ctrump/ast/types.h File Reference

C99言語の型の定義. More...

#include "ctrump/common/symbol.h"
#include "ctrump/common/mempool.h"
#include "ctrump/ast/location.h"
#include "ctrump/ast/source-string.h"
#include "ctrump/common/dll.h"
#include "ctrump/ast/builtin-types.def"

Include dependency graph for types.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ctrump_gccext_attribute
 GCC attribute. More...
struct  ctrump_record_type_field
 union, struct のフィールド More...
struct  ctrump_record_type
 struct, union型 More...
struct  ctrump_enum_type_field
 enum のフィールド More...
struct  ctrump_enum_type
 enum 型 More...
struct  ctrump_function_type
 関数型 More...
struct  ctrump_typedef_name
 typedef された型 More...
struct  ctrump_qualified_type
 修飾された型 More...
struct  ctrump_builtin_type
 組み込み型 More...
struct  ctrump_array_type
 配列型 More...
struct  ctrump_array_type_chain
 配列型検索用リスト More...
struct  ctrump_qualified_type_chain
 修飾型検索用リスト More...
struct  ctrump_func_type_node
 関数型検索木のノード More...
struct  ctrump_texpr
 CTRUMP 型情報. More...
struct  ctrump_type_env
 型全体を管理するオブジェクト More...
struct  ctrump_get_functype_iterator
 関数の型を探索するイテレータ More...

Defines

#define CTRUMP_ALIGN_UNSPECIFIED   (-1)
#define CTRUMP_QUAL_ATTR_PACKED   (1<<0)
#define CTRUMP_QUAL_ATTR_MAY_ALIAS   (1<<1)
#define CTRUMP_TYPE_ATTR_PACKED   (1<<2)
#define CTRUMP_BITFIELD_UNSPECIFIED   (-1)
#define CTRUMP_QUAL_CONST   (1<<0)
#define CTRUMP_QUAL_RESTRICT   (1<<1)
#define CTRUMP_QUAL_VOLATILE   (1<<2)
#define CTRUMP_QUAL_STATIC   (1<<3)
#define DEFINE_BUILTIN_TYPE(str_name, code, sym)   CTRUMP_EXTDEF extern struct ctrump_texpr ctrump_builtin_##str_name;

Enumerations

enum  ctrump_builtin_type_code {
  CTRUMP_BOOL, CTRUMP_CHAR, CTRUMP_SCHAR, CTRUMP_UCHAR,
  CTRUMP_SSHORT, CTRUMP_USHORT, CTRUMP_SINT, CTRUMP_UINT,
  CTRUMP_SLONG, CTRUMP_ULONG, CTRUMP_SLONGLONG, CTRUMP_ULONGLONG,
  CTRUMP_FLOAT, CTRUMP_DOUBLE, CTRUMP_LONG_DOUBLE, CTRUMP_VOID,
  CTRUMP_VEC_SCHAR, CTRUMP_VEC_UCHAR, CTRUMP_VEC_SSHORT, CTRUMP_VEC_USHORT,
  CTRUMP_VEC_SINT, CTRUMP_VEC_UINT, CTRUMP_VEC_SLONG, CTRUMP_VEC_ULONG,
  CTRUMP_VEC_SLONGLONG, CTRUMP_VEC_ULONGLONG, CTRUMP_VEC_FLOAT, CTRUMP_VEC_DOUBLE
}
enum  ctrump_texpr_code {
  CTRUMP_TYPE_BUILTIN, CTRUMP_TYPE_UNION, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_ENUM,
  CTRUMP_TYPE_FUNC, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_INCOMPLETE_ARRAY,
  CTRUMP_TYPE_VARLEN_ARRAY, CTRUMP_TYPE_TYPEDEF_NAME, CTRUMP_TYPE_QUALIFIED
}

Functions

CTRUMP_EXTDEF int ctrump_type_is_float (const struct ctrump_texpr *type)
CTRUMP_EXTDEF int ctrump_type_is_scalar (const struct ctrump_texpr *type)
CTRUMP_EXTDEF struct ctrump_texprctrump_get_typedef_name (struct ctrump_type_env *env, struct ctrump_texpr *orig_type, const struct ctrump_symbol *name)
 get typedefed type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_qualified_attr_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr, int qual_flags, const struct ctrump_gccext_attribute *attr)
 get qualified(const, restrict, volatile) and gcc attributed type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_qualified_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr, int qual_flags)
 get qualified type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_unqualified_type (struct ctrump_texpr *texpr)
 get unqualified type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_pointer_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr)
 get pointer type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_array_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr, int size)
 get array type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_incomplete_array_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr)
 get incomplete array type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_varlen_array_type (struct ctrump_type_env *env, struct ctrump_texpr *texpr)
 get varlen array type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_incomplete_struct_type (struct ctrump_type_env *env, enum ctrump_texpr_code code, const struct ctrump_symbol *name)
 get incomplete struct type
CTRUMP_EXTDEF void ctrump_complete_struct_type (struct ctrump_record_type *record_type, int nfield, struct ctrump_record_type_field *fields, struct ctrump_gccext_attribute *attr)
 convert incomplete type to complete type
CTRUMP_EXTDEF struct ctrump_texprctrump_get_incomplete_enum_type (struct ctrump_type_env *env, const struct ctrump_symbol *name)
CTRUMP_EXTDEF void ctrump_complete_enum_type (struct ctrump_enum_type *enum_type, int nfield, struct ctrump_enum_type_field *fields)
CTRUMP_EXTDEF void ctrump_get_functype_begin (struct ctrump_get_functype_iterator *iter, struct ctrump_type_env *env, struct ctrump_texpr *ret_type, int num_args)
 get function type initialiezr You can get function type with calling functions, `get_functype_begin', `get_functype_next', `get_functype_end' as follows:
CTRUMP_EXTDEF void ctrump_get_functype_next (struct ctrump_type_env *env, struct ctrump_get_functype_iterator *iter, struct ctrump_texpr *arg)
 get function type
CTRUMP_EXTDEF void ctrump_get_functype_cancel (struct ctrump_get_functype_iterator *iter)
 cancel get function type This function releases some resource.
CTRUMP_EXTDEF struct ctrump_texprctrump_get_functype_end (struct ctrump_type_env *env, struct ctrump_get_functype_iterator *iter, int has_unspec_arg)
 get function type
CTRUMP_EXTDEF void ctrump_type_env_init (struct ctrump_type_env *env, int is_char_signed)
 init type environment
CTRUMP_EXTDEF void ctrump_type_env_destroy (struct ctrump_type_env *env)
 release env resource
CTRUMP_EXTDEF struct ctrump_texprctrump_alloc_texpr (struct ctrump_type_env *env, enum ctrump_texpr_code code)
 allocate new texpr
CTRUMP_EXTDEF int ctrump_texpr_is_pointer (struct ctrump_texpr *type)
 return 1 if texpr is pointer type
CTRUMP_EXTDEF struct ctrump_texprctrump_texpr_apply_unary_pointer_conversion (struct ctrump_type_env *env, struct ctrump_texpr *type)
 return pointer type
CTRUMP_EXTDEF struct ctrump_texprctrump_retrieve_pointer_type (struct ctrump_texpr *type)
 return type of pointed by `type'
CTRUMP_EXTDEF struct ctrump_texprctrump_retrieve_address_type (struct ctrump_texpr *type)
 return type of pointed or arrayed by `type'
CTRUMP_EXTDEF struct ctrump_texprctrump_retrieve_typedef_name (struct ctrump_texpr *texpr)
 typedef された型の指す型を取得
CTRUMP_EXTDEF struct
ctrump_gccext_attribute 
ctrump_merge_attr (const struct ctrump_gccext_attribute *decl_attr, const struct ctrump_gccext_attribute *var_attr)
 変数に付けられたGCC attributeと宣言に付けられたGCC attributeをマージ
CTRUMP_EXTDEF int ctrump_is_scalar_type (const struct ctrump_texpr *texpr)
 型がスカラ型かどうか

Variables

CTRUMP_EXTDEF const int ctrump_builtin_type_is_float_table []
 型が浮動少数かどうかを示すテーブル (texpr_code -> int)
CTRUMP_EXTDEF const int ctrump_builtin_type_is_scalar_table []
 型がスカラ型かどうかを示すテーブル (texpr_code -> int)


Detailed Description

C99言語の型の定義.

CTRUMPでの型定義

CTRUMP では 型は以下のように扱う

struct ctrump_texprがCTRUMPでの型を表現する struct ctrump_texpr { int id; enum ctrump_texpr_code code;

struct ctrump_texpr *pointer_type; // この型を指すポインタ型 struct ctrump_texpr *incomplete_array_type; // この型の配列型の不完全配列型 struct ctrump_array_type_chain *array_types; // この型の配列型のリスト struct ctrump_func_type_node *func_types; // この型を戻り値とする関数型のリスト struct ctrump_qualified_type_chain *qualified_types; // この型を修飾した型のリスト

union { struct ctrump_builtin_type builtin; struct ctrump_texpr *pointer_to; struct ctrump_texpr *incomplete_array_of; struct ctrump_texpr *varlen_array_of; struct ctrump_array_type array; struct ctrump_record_type struct_, union_; struct ctrump_function_type func; struct ctrump_typedef_name typedef_name; struct ctrump_qualified_type qualified; struct ctrump_enum_type enum_; }u; };

配列型、修飾された型、関数型は、宣言された位置、使用された位置に関係無く、 同じ型であれば、同じポインタ値を持つ (ポインタ値の比較によって型の同値を識別できる)

CTRUMPの型は、以下10種類のうちのいずれかである。

1. 組み込みの型 (以下の型、整数型はsigned,unsigned両方含む)

ctrump_texprのcodeがCTRUMP_TYPE_BUILTINになり、 u.builtinのcodeにどの型かを示す値が入る

2. 任意の型へのポインタ型

ctrump_texprのcodeが CTRUMP_TYPE_POINTER になり u.poniter_to にポイントする先の型を示す値が入る

3. 任意の型の配列型

ctrump_texprのcodeが CTRUMP_TYPE_ARRAY になり、 u.array に型とサイズが入る

4. 不完全配列型(int a[]など)

ctrump_texprのcodeが CTRUMP_TYPE_INCOMPLETE_ARRAY になり、 u.incomplete_array_of に型が入る

5. 可変長配列型

(未実装)

6. 構造体型、共用体型

ctrump_texprのcodeが CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_UNION になり、 u.struct_, u.union_ に型の内容を示す値が入る

struct ctrump_record_type { const struct ctrump_symbol *name; この型の名前(無い場合はNULL) int is_completed; 完全である場合1 int nfield; フィールドの数 struct ctrump_record_type_field *fields; フィールド struct ctrump_gccext_attribute attr; GCC attribute };

フィールドは、 struct ctrump_record_type_field{ const struct ctrump_symbol *name; フィールド名(無い場合はNULL) struct ctrump_texpr *type; 型 int bitfield_width; ビットフィールドの幅、指定されない場合、 CTRUMP_BITFIELD_UNSPECIFIED struct ctrump_gccext_attribute attr; GCC attribute };

で示される

7. ENUM型

ctrump_texpr のcode が CTRUMP_TYPE_ENUM になり u.enum_ に型の内容を示す値が入る

struct ctrump_enum_type { const struct ctrump_symbol *name; 名前 int is_completed; 完全の場合1 int nfield; フィールドの数

struct ctrump_enum_type_field *fields; フィールド };

struct ctrump_enum_type_field { const struct ctrump_symbol *name; 名前 long long value; 値 };

8. 関数型

ctrump_texpr の code が CTRUMP_TYPE_FUNC になり、 u.func に型の内容を示す値が入る

9. typedef された型

ctrump_texpr の code が CTRUMP_TYPE_TYPEDEF_NAME になり、 u.typedef_name に型の内容を示す値が入る (CTRUMPでは、typedef で型付けされた名前で変数が宣言された場合、 その変数の型は、CTRUMP_TYPE_TYPEDEF_NAME の型になる。元の型ではない)

10. 修飾された型 ctrump_texpr の code が CTRUMP_TYPE_QUALIFIED になり、 u.qualified に型の内容を示す値あ入る

CTRUMPでは、C99修飾子(const, volatile, restrict)と GCC attributeをあわせて修飾子としている。

配列型、関数型、修飾型について

各型の配列型、関数型、修飾型の使いかたは以下のとおり

配列型

ctrump_get_array_type()で配列型を取得する

修飾型

ctrump_get_qualified_attr_type()で修飾型を取得する

関数型

ctrump_get_functype_begin(), ctrump_get_functype_next(), ctrump_get_functype_end() を組み合わせて関数型を取得する

使用例は以下のとおり

---------------------------------------- struct ctrump_texpr *args[N]; struct ctrump_texpr *ret_type; struct ctrump_texpr *func_type; struct ctrump_get_functype_iterator iter; int has_unspec_arg;

ctrump_get_functype_begin(&iter, env, ret_type, N);

for (i=0; i<N; i++) { ctrump_get_functype_next(env, iter, args[i]); }

func_type = ctrump_get_functype_end(env, iter, has_unspec_arg); ----------------------------------------

Definition in file types.h.


Define Documentation

#define CTRUMP_ALIGN_UNSPECIFIED   (-1)

#define CTRUMP_BITFIELD_UNSPECIFIED   (-1)

Definition at line 301 of file types.h.

Referenced by ctrump_env_handle_record_decls().

#define CTRUMP_QUAL_ATTR_MAY_ALIAS   (1<<1)

Definition at line 292 of file types.h.

#define CTRUMP_QUAL_ATTR_PACKED   (1<<0)

Definition at line 291 of file types.h.

#define CTRUMP_QUAL_CONST   (1<<0)

Definition at line 367 of file types.h.

Referenced by print_qual_flags().

#define CTRUMP_QUAL_RESTRICT   (1<<1)

Definition at line 368 of file types.h.

Referenced by print_qual_flags().

#define CTRUMP_QUAL_STATIC   (1<<3)

Definition at line 374 of file types.h.

#define CTRUMP_QUAL_VOLATILE   (1<<2)

Definition at line 369 of file types.h.

Referenced by print_qual_flags().

#define CTRUMP_TYPE_ATTR_PACKED   (1<<2)

Definition at line 293 of file types.h.

#define DEFINE_BUILTIN_TYPE ( str_name,
code,
sym   )     CTRUMP_EXTDEF extern struct ctrump_texpr ctrump_builtin_##str_name;

Definition at line 465 of file types.h.


Enumeration Type Documentation

Enumerator:
CTRUMP_BOOL 
CTRUMP_CHAR 
CTRUMP_SCHAR 
CTRUMP_UCHAR 
CTRUMP_SSHORT 
CTRUMP_USHORT 
CTRUMP_SINT 
CTRUMP_UINT 
CTRUMP_SLONG 
CTRUMP_ULONG 
CTRUMP_SLONGLONG 
CTRUMP_ULONGLONG 
CTRUMP_FLOAT 
CTRUMP_DOUBLE 
CTRUMP_LONG_DOUBLE 
CTRUMP_VOID 
CTRUMP_VEC_SCHAR 
CTRUMP_VEC_UCHAR 
CTRUMP_VEC_SSHORT 
CTRUMP_VEC_USHORT 
CTRUMP_VEC_SINT 
CTRUMP_VEC_UINT 
CTRUMP_VEC_SLONG 
CTRUMP_VEC_ULONG 
CTRUMP_VEC_SLONGLONG 
CTRUMP_VEC_ULONGLONG 
CTRUMP_VEC_FLOAT 
CTRUMP_VEC_DOUBLE 

Definition at line 228 of file types.h.

Enumerator:
CTRUMP_TYPE_BUILTIN 
CTRUMP_TYPE_UNION 
CTRUMP_TYPE_STRUCT 
CTRUMP_TYPE_ENUM 
CTRUMP_TYPE_FUNC 
CTRUMP_TYPE_POINTER 
CTRUMP_TYPE_ARRAY 
CTRUMP_TYPE_INCOMPLETE_ARRAY 
CTRUMP_TYPE_VARLEN_ARRAY 
CTRUMP_TYPE_TYPEDEF_NAME 
CTRUMP_TYPE_QUALIFIED 

Definition at line 274 of file types.h.


Function Documentation

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_alloc_texpr ( struct ctrump_type_env env,
enum ctrump_texpr_code  code 
) [read]

allocate new texpr

Definition at line 78 of file types.c.

References alloc_texpr(), and ctrump_texpr::code.

CTRUMP_EXTDEF void ctrump_complete_enum_type ( struct ctrump_enum_type enum_type,
int  nfield,
struct ctrump_enum_type_field fields 
)

CTRUMP_EXTDEF void ctrump_complete_struct_type ( struct ctrump_record_type record_type,
int  nfield,
struct ctrump_record_type_field fields,
struct ctrump_gccext_attribute attr 
)

convert incomplete type to complete type

Parameters:
record_type target type
nfield 

Definition at line 399 of file types.c.

References ctrump_record_type::attr, ctrump_record_type::fields, ctrump_record_type::is_completed, and ctrump_record_type::nfield.

Referenced by ctrump_env_handle_record_decls().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_array_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr,
int  size 
) [read]

CTRUMP_EXTDEF void ctrump_get_functype_begin ( struct ctrump_get_functype_iterator iter,
struct ctrump_type_env env,
struct ctrump_texpr ret_type,
int  num_args 
)

get function type initialiezr You can get function type with calling functions, `get_functype_begin', `get_functype_next', `get_functype_end' as follows:

---------------------------------------- struct ctrump_texpr *args[N]; struct ctrump_texpr *ret_type; struct ctrump_texpr *func_type; struct ctrump_get_functype_iterator iter; int has_unspec_arg;

ctrump_get_functype_begin(&iter, env, ret_type, N);

for (i=0; i<N; i++) { ctrump_get_functype_next(env, iter, args[i]); }

func_type = ctrump_get_functype_end(env, iter, has_unspec_arg); ----------------------------------------

`func_type' has type of function.

Parameters:
typeget iter iterator
env type environment
ret_type return type of function
num_args number of args

Definition at line 283 of file types.c.

References ctrump_func_type_node::arg_type, ctrump_get_functype_iterator::args, ctrump_func_type_node::brother, ctrump_func_type_node::child, ctrump_mempool_alloc, ctrump_get_functype_iterator::cur, ctrump_get_functype_iterator::cur_arg, ctrump_func_type_node::func_type, ctrump_texpr::func_types, ctrump_get_functype_iterator::ret, and ctrump_type_env::type_allocator.

Referenced by build_func_type(), and ctrump_env_handle_decl_node().

CTRUMP_EXTDEF void ctrump_get_functype_cancel ( struct ctrump_get_functype_iterator iter  ) 

cancel get function type This function releases some resource.

Parameters:
iter iterator

Definition at line 379 of file types.c.

References ctrump_get_functype_iterator::args.

Referenced by build_func_type().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_functype_end ( struct ctrump_type_env env,
struct ctrump_get_functype_iterator iter,
int  has_unspec_arg 
) [read]

CTRUMP_EXTDEF void ctrump_get_functype_next ( struct ctrump_type_env env,
struct ctrump_get_functype_iterator iter,
struct ctrump_texpr arg 
)

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_incomplete_array_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr 
) [read]

get incomplete array type

Parameters:
env type environment
texpr type

Definition at line 217 of file types.c.

References alloc_texpr(), ctrump_texpr::code, CTRUMP_TYPE_INCOMPLETE_ARRAY, ctrump_texpr::incomplete_array_of, ctrump_texpr::incomplete_array_type, and ctrump_texpr::u.

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_incomplete_enum_type ( struct ctrump_type_env env,
const struct ctrump_symbol name 
) [read]

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_incomplete_struct_type ( struct ctrump_type_env env,
enum ctrump_texpr_code  code,
const struct ctrump_symbol name 
) [read]

get incomplete struct type

Parameters:
env type environment
code CTRUMP_TYPE_UNION or CTRUMP_TYPE_STRUCT,

Definition at line 386 of file types.c.

References alloc_texpr(), ctrump_texpr::code, and ctrump_texpr::u.

Referenced by build_incomplete_field_type(), and build_struct().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_pointer_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr 
) [read]

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_qualified_attr_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr,
int  qual_flags,
const struct ctrump_gccext_attribute attr 
) [read]

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_qualified_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr,
int  qual_flags 
) [read]

get qualified type

Parameters:
env type environment
texpr target type
qual_flags combination of qualifier flags

Definition at line 172 of file types.c.

References ctrump_gccext_attribute::aligned, ctrump_qualified_type::attr, ctrump_texpr::code, CTRUMP_ALIGN_UNSPECIFIED, ctrump_get_qualified_attr_type(), CTRUMP_TYPE_QUALIFIED, ctrump_gccext_attribute::flags, ctrump_texpr::qualified, and ctrump_texpr::u.

Referenced by ctrump_env_handle_decl_node().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_typedef_name ( struct ctrump_type_env env,
struct ctrump_texpr orig_type,
const struct ctrump_symbol name 
) [read]

get typedefed type

Parameters:
env type env
orig_type original type
name name of type

Definition at line 87 of file types.c.

References alloc_texpr(), ctrump_texpr::code, CTRUMP_TYPE_TYPEDEF_NAME, ctrump_typedef_name::def_name, ctrump_typedef_name::defined_to, ctrump_texpr::typedef_name, and ctrump_texpr::u.

Referenced by build_typedef_name().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_unqualified_type ( struct ctrump_texpr texpr  )  [read]

get unqualified type

Parameters:
texpr type

Definition at line 188 of file types.c.

References ctrump_texpr::code, CTRUMP_TYPE_QUALIFIED, ctrump_texpr::qualified, ctrump_texpr::u, and ctrump_qualified_type::unqualified_type.

Referenced by recog_array_access(), and struct_field_offset().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_get_varlen_array_type ( struct ctrump_type_env env,
struct ctrump_texpr texpr 
) [read]

get varlen array type

Parameters:
texpr type

Definition at line 236 of file types.c.

References alloc_texpr(), ctrump_texpr::code, CTRUMP_TYPE_VARLEN_ARRAY, ctrump_texpr::u, and ctrump_texpr::varlen_array_of.

CTRUMP_EXTDEF int ctrump_is_scalar_type ( const struct ctrump_texpr texpr  ) 

CTRUMP_EXTDEF struct ctrump_gccext_attribute ctrump_merge_attr ( const struct ctrump_gccext_attribute decl_attr,
const struct ctrump_gccext_attribute var_attr 
) [read]

変数に付けられたGCC attributeと宣言に付けられたGCC attributeをマージ

Definition at line 563 of file types.c.

References ctrump_gccext_attribute::aligned, CTRUMP_ALIGN_UNSPECIFIED, and ctrump_gccext_attribute::flags.

Referenced by print_texpr_abstract_declarator(), and print_texpr_spec().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_retrieve_address_type ( struct ctrump_texpr type  )  [read]

return type of pointed or arrayed by `type'

Parameters:
type pointer or array type
Returns:
pointed type or NULL if type is not pointer

Definition at line 536 of file types.c.

References ctrump_texpr::array, ctrump_array_type::array_of, ctrump_texpr::code, CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_TYPEDEF_NAME, ctrump_typedef_name::defined_to, ctrump_texpr::pointer_to, ctrump_texpr::qualified, ctrump_texpr::typedef_name, ctrump_texpr::u, and ctrump_qualified_type::unqualified_type.

Referenced by retrieve_address_type().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_retrieve_pointer_type ( struct ctrump_texpr type  )  [read]

return type of pointed by `type'

Parameters:
type pointer type
Returns:
pointed type or NULL if type is not pointer

Definition at line 514 of file types.c.

References ctrump_texpr::code, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_TYPEDEF_NAME, ctrump_typedef_name::defined_to, ctrump_texpr::pointer_to, ctrump_texpr::qualified, ctrump_texpr::typedef_name, ctrump_texpr::u, and ctrump_qualified_type::unqualified_type.

Referenced by append_record_member_ref(), and retrieve_pointer_type().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_retrieve_typedef_name ( struct ctrump_texpr texpr  )  [read]

typedef された型の指す型を取得

Definition at line 687 of file types.c.

References ctrump_texpr::code, CTRUMP_TYPE_TYPEDEF_NAME, ctrump_typedef_name::defined_to, ctrump_texpr::typedef_name, and ctrump_texpr::u.

Referenced by struct_field_offset().

CTRUMP_EXTDEF struct ctrump_texpr* ctrump_texpr_apply_unary_pointer_conversion ( struct ctrump_type_env env,
struct ctrump_texpr type 
) [read]

CTRUMP_EXTDEF int ctrump_texpr_is_pointer ( struct ctrump_texpr type  ) 

CTRUMP_EXTDEF void ctrump_type_env_destroy ( struct ctrump_type_env env  ) 

release env resource

Parameters:
env type environment

Definition at line 454 of file types.c.

References ctrump_mempool_destroy(), and ctrump_type_env::type_allocator.

Referenced by typeenv_dealloc().

CTRUMP_EXTDEF void ctrump_type_env_init ( struct ctrump_type_env env,
int  is_char_signed 
)

init type environment

Parameters:
env type environment
is_char_signed 1 if char is signed

Definition at line 433 of file types.c.

References ctrump_type_env::builtin_char_type, ctrump_mempool_init(), ctrump_type_env::id, and ctrump_type_env::type_allocator.

Referenced by ctrump_indent(), ctrump_prog_file2pprint_format(), and typeenv_Init().

CTRUMP_EXTDEF int ctrump_type_is_float ( const struct ctrump_texpr type  ) 

CTRUMP_EXTDEF int ctrump_type_is_scalar ( const struct ctrump_texpr type  ) 


Variable Documentation

CTRUMP_EXTDEF const int ctrump_builtin_type_is_float_table[]

型が浮動少数かどうかを示すテーブル (texpr_code -> int)

Definition at line 579 of file types.c.

Referenced by ctrump_type_is_float().

CTRUMP_EXTDEF const int ctrump_builtin_type_is_scalar_table[]

型がスカラ型かどうかを示すテーブル (texpr_code -> int)

Definition at line 611 of file types.c.

Referenced by ctrump_type_is_scalar().


Generated on Tue Mar 31 20:19:24 2009 for ctrump by  doxygen 1.5.6