#include "ctrump/ast/env.h"
#include "ctrump/common/varray.h"
#include <stdlib.h>
Go to the source code of this file.
Functions | |
static struct ctrump_texpr * | handle_type_spec (struct ctrump_typespec *spec) |
static void | ctrump_env_handle_decl (const struct ctrump_symbol **ret_name, struct ctrump_texpr **ret_type, struct ctrump_type_env *type_env, const struct ctrump_declarator *decl, struct ctrump_decl_specifier *declspec) |
ctrump_declarator を処理する | |
static void | ctrump_env_handle_decl_node (const struct ctrump_symbol **ret_name, struct ctrump_texpr **ret_type, struct ctrump_type_env *type_env, const struct ctrump_declarator_node *cur_node, struct ctrump_decl_specifier *declspec) |
ctrump_declarator_node を処理する | |
void | ctrump_env_handle_record_decls (struct ctrump_record_type *record_type, struct ctrump_type_env *type_env, struct ctrump_struct_decl *decls, int num_decl, int num_field, struct ctrump_gccext_attribute *attr, struct ctrump_location *loc, struct ctrump_mempool *tree_pool) |
フィールドの宣言列(decls)からrecord_typeをつくる incomplete struct のrecord_type をわたすと complete struct になる |
Definition in file env.c.
static void ctrump_env_handle_decl | ( | const struct ctrump_symbol ** | ret_name, | |
struct ctrump_texpr ** | ret_type, | |||
struct ctrump_type_env * | type_env, | |||
const struct ctrump_declarator * | decl, | |||
struct ctrump_decl_specifier * | declspec | |||
) | [static] |
ctrump_declarator を処理する
Definition at line 182 of file env.c.
References ctrump_declarator::attr, ctrump_env_handle_decl_node(), ctrump_get_qualified_attr_type(), and ctrump_declarator::nodes.
Referenced by ctrump_env_handle_decl_node(), and ctrump_env_handle_record_decls().
static void ctrump_env_handle_decl_node | ( | const struct ctrump_symbol ** | ret_name, | |
struct ctrump_texpr ** | ret_type, | |||
struct ctrump_type_env * | type_env, | |||
const struct ctrump_declarator_node * | cur_node, | |||
struct ctrump_decl_specifier * | declspec | |||
) | [static] |
ctrump_declarator_node を処理する
Definition at line 96 of file env.c.
References ctrump_declarator_param_typelist::args, ctrump_declarator_node::array, ctrump_declarator_pointer::attr, ctrump_declarator_node::code, ctrump_ast_fold_const_sint(), CTRUMP_DECLARATOR_ARRAY, CTRUMP_DECLARATOR_EMPTY, CTRUMP_DECLARATOR_IDENTIFIER, CTRUMP_DECLARATOR_INCOMPLETE_ARRAY, CTRUMP_DECLARATOR_PARAM_IDENTIFIER_LIST, CTRUMP_DECLARATOR_PARAM_TYPELIST, CTRUMP_DECLARATOR_PAREN, CTRUMP_DECLARATOR_POINTER, CTRUMP_DECLARATOR_VARLEN_ARRAY, ctrump_env_handle_decl(), ctrump_get_array_type(), ctrump_get_functype_begin(), ctrump_get_functype_end(), ctrump_get_functype_next(), ctrump_get_pointer_type(), ctrump_get_qualified_attr_type(), ctrump_get_qualified_type(), ctrump_declarator_paren::decl, ctrump_declarator_param_typelist::decl, ctrump_declarator_param::decl, ctrump_declarator_array::decl, ctrump_declarator_pointer::decl, ctrump_declarator_param::decl_spec, handle_type_spec(), ctrump_declarator_param_typelist::has_unspecified_arg, ctrump_declarator_identifier::identifier, ctrump_declarator_node::identifier, ctrump_declarator_param_typelist::num_args, ctrump_declarator_node::param_typelist, ctrump_declarator_node::paren, ctrump_declarator_node::pointer, ctrump_declarator_pointer::qual_flags, ctrump_decl_specifier::qual_flags, ctrump_declarator_array::size, ctrump_decl_specifier::type_spec, and ctrump_declarator_node::u.
Referenced by ctrump_env_handle_decl().
void ctrump_env_handle_record_decls | ( | struct ctrump_record_type * | record_type, | |
struct ctrump_type_env * | type_env, | |||
struct ctrump_struct_decl * | decls, | |||
int | num_decl, | |||
int | num_field, | |||
struct ctrump_gccext_attribute * | attr, | |||
struct ctrump_location * | loc, | |||
struct ctrump_mempool * | tree_pool | |||
) |
フィールドの宣言列(decls)からrecord_typeをつくる incomplete struct のrecord_type をわたすと complete struct になる
record_type | 構造体型(incomplete struct) | |
type_env | 型環境 | |
decls | フィールド宣言列 | |
num_decl | 宣言(declarator)の数 | |
num_field | フィールド(declaration)の数 | |
attr | この構造体のGCC attribute | |
loc | 宣言位置 | |
tree_pool | メモリプール |
Definition at line 194 of file env.c.
References ctrump_gccext_attribute::aligned, ctrump_record_type_field::attr, ctrump_record_type_field::bitfield_width, ctrump_struct_decl::code, CTRUMP_ALIGN_UNSPECIFIED, CTRUMP_BITFIELD_UNSPECIFIED, ctrump_complete_struct_type(), ctrump_env_handle_decl(), ctrump_mempool_alloc, CTRUMP_STRUCT_DECL_FIELDS, ctrump_struct_decl::decl, ctrump_struct_decl_decl::decls, ctrump_gccext_attribute::flags, ctrump_record_type_field::name, ctrump_struct_decl_decl::num_decls, ctrump_struct_decl_decl::spec, ctrump_record_type_field::type, and ctrump_struct_decl::u.
Referenced by build_struct().
static struct ctrump_texpr* handle_type_spec | ( | struct ctrump_typespec * | spec | ) | [static, read] |
Definition at line 44 of file env.c.
References ctrump_typespec::anon_struct_definition, ctrump_typespec::builtin, ctrump_typespec::code, CTRUMP_TYPESPEC_ANON_STRUCT_DEFINITION, CTRUMP_TYPESPEC_ANON_UNION_DEFINITION, CTRUMP_TYPESPEC_BUILTIN, CTRUMP_TYPESPEC_STRUCT_DEFINITION, CTRUMP_TYPESPEC_STRUCT_NAME, CTRUMP_TYPESPEC_TYPEDEF_NAME, CTRUMP_TYPESPEC_UNION_DEFINITION, CTRUMP_TYPESPEC_UNION_NAME, CTRUMP_TYPESPEC_UNTYPED_SIGNED_INT, ctrump_named_record_definition::def, ctrump_anon_record_definition::def, ctrump_record_definition::record_type, ctrump_typespec::struct_definition, ctrump_typespec::struct_name, ctrump_typespec_record_name::texpr, ctrump_typespec_typedef_name::texpr, ctrump_typespec_builtin::texpr, ctrump_typespec::typedef_name, and ctrump_typespec::u.
Referenced by ctrump_env_handle_decl_node().