#include "Python.h"
#include "structmember.h"
#include "ctrump/ctrump.h"
#include "ctrump/ast/builtin-types.def"
#include "astobj.h"
#include "build-ast.h"
#include "constants.h"

Go to the source code of this file.
Data Structures | |
| struct | abiObject |
| python abi オブジェクト More... | |
| struct | symbolObject |
| struct | recordFieldObject |
| struct | texprObject |
| struct | bitmapObject |
| python bitmap オブジェクト More... | |
| struct | CompilationErrorObject |
| python CompilationError オブジェクト More... | |
| struct | TypeEnvObject |
| python typeEnv オブジェクト More... | |
| struct | EnvObject |
| struct | ParserOptionObject |
| struct | BuilderObject |
| python Builder オブジェクト More... | |
| struct | ctrump_abi_register_node |
Defines | |
| #define | PyIndex_Check(obj) PyInt_Check(obj) |
| #define | PyNumber_AsSsize_t(obj, exc) PyInt_AsLong(obj) |
| #define | DEFINE_BUILTIN_TYPE(str_name, code, sym) texprObject *str_name; |
| #define | DEFINE_BUILTIN_TYPE(str_name, c, sym) |
| #define | DEFINE_BUILTIN_TYPE(str_name, c, sym) {#str_name, T_OBJECT, offsetof(TypeEnvObject, str_name), READONLY}, |
| #define | NELEM(a) (sizeof(a)/sizeof(a[0])) |
| #define | EnvObject_Check(v) ((v)->ob_type == &EnvObject_Type) |
| #define | TranslationUnitObject_Check(v) ((v)->ob_type == &translation_unit_Type) |
| #define | CompilationErrorObject_Check(v) ((v)->ob_type == &CompilationErrorObject_Type) |
Typedefs | |
| typedef int | Py_ssize_t |
| typedef inquiry | lenfunc |
| typedef intargfunc | ssizeargfunc |
Enumerations | |
| enum | { ERROR_BUILD_CFG, ERROR_CFRONT_PARSE } |
Functions | |
| static PyObject * | symbol_obj (struct EnvObject *env, const struct ctrump_symbol *tobj) |
| static PyObject * | texpr_obj (struct EnvObject *env, struct ctrump_texpr *tobj) |
| static void * | alloc_table (int num_entry) |
| static void | expand_table_size (int *current_size, PyObject ***table, int assert_size) |
| static void | expand_table_size_memtbl (int *current_size, PyObject ***id2tree_table, PyObject ****memobj_table, int assert_size) |
| static PyObject * | symbol_str (symbolObject *obj) |
| static PyObject * | record_field_getattr (recordFieldObject *self, char *name) |
| static PyObject * | record_field_obj (struct EnvObject *env, struct ctrump_record_type_field *tree) |
| static PyObject * | texpr_getattr (texprObject *self, char *name) |
| static PyObject * | texpr_str (texprObject *self) |
| static PyObject * | bitmap_str (bitmapObject *self) |
| static PyObject * | bitmap_item (bitmapObject *self, Py_ssize_t i) |
| static Py_ssize_t | bitmap_length (bitmapObject *self) |
| static PyObject * | bitmap_subscript (bitmapObject *self, PyObject *item) |
| static PyObject * | bitmap_pop (bitmapObject *self) |
| static PyObject * | error_get_error_token (CompilationErrorObject *self, PyObject *args) |
| static PyObject * | error_get_lineno (CompilationErrorObject *self) |
| static PyObject * | error_get_reason (CompilationErrorObject *self) |
| static PyObject * | error_get_path (CompilationErrorObject *self) |
| static PyObject * | error_get_message (CompilationErrorObject *self) |
| static CompilationErrorObject * | build_cfg_error_New (struct ctrump_build_cfg_error *e) |
| static CompilationErrorObject * | cfront_parse_error_New (struct ctrump_loginfo *loginfo) |
| static int | typeenv_Init (TypeEnvObject *self, struct EnvObject *env, PyObject *args, PyObject *kwds) |
| static void | typeenv_dealloc (TypeEnvObject *o) |
| static int | env_Init (EnvObject *self, PyObject *args, PyObject *kwds) |
| static PyObject * | member_obj (PyObject **mem_tbl, int index) |
| static int | parserOption_Init (ParserOptionObject *self, PyObject *args, PyObject *kwds) |
| static PyObject * | fill_table_symbol (EnvObject *env, const struct ctrump_symbol *sym) |
| static PyObject * | fill_table_texpr (EnvObject *env, const struct ctrump_texpr *sym) |
| static PyObject * | cfront_parse (EnvObject *self, PyObject *args) |
| static PyObject * | pprint0 (PyObject *args, int print_ssa) |
| static PyObject * | pprint (EnvObject *self, PyObject *args) |
| static PyObject * | pprint_ssa (EnvObject *self, PyObject *args) |
| static PyObject * | pprint_stmt (PyObject *self, PyObject *args) |
| static PyObject * | pprint_expr0 (PyObject *args, int print_ssa) |
| static PyObject * | pprint_expr (PyObject *self, PyObject *args) |
| static PyObject * | pprint_ssa_expr (PyObject *self, PyObject *args) |
| static struct ctrump_loop_subscript * | subscript_typecheck (PyObject *o) |
| static struct ctrump_loop_index * | index_typecheck (PyObject *o) |
| static PyObject * | loop_subscript_hash (PyObject *self, PyObject *args) |
| static PyObject * | loop_subscript_equal (PyObject *self, PyObject *args) |
| static PyObject * | loop_index_equal (PyObject *self, PyObject *args) |
| static texprObject * | texpr_arg (PyObject *args) |
| static PyObject * | is_pointer_type (PyObject *self, PyObject *args) |
| static PyObject * | type_apply_unary_pointer_conversion (PyObject *self, PyObject *args) |
| static PyObject * | fold_const (PyObject *self, PyObject *args) |
| static PyObject * | calc_type_size (PyObject *self, PyObject *args) |
| static PyObject * | struct_field_offset (PyObject *self, PyObject *args) |
| static PyObject * | retrieve_pointer_type (PyObject *self, PyObject *args) |
| static PyObject * | retrieve_address_type (PyObject *self, PyObject *args) |
| static void | EnvObject_dealloc (EnvObject *o) |
| static PyObject * | expr_prec (PyObject *self, PyObject *args) |
| static PyObject * | get_stmt_loc (PyObject *self, PyObject *args) |
| static void | BuilderObject_dealloc (BuilderObject *self) |
| static int | builder_Init (BuilderObject *self, PyObject *args) |
| static PyObject * | build_symbol (BuilderObject *self, PyObject *args) |
| static PyObject * | build_struct (BuilderObject *self, PyObject *args) |
| static PyObject * | build_incomplete_field_type (BuilderObject *self, PyObject *args) |
| static PyObject * | build_typedef_name (BuilderObject *self, PyObject *args) |
| static PyObject * | build_func_type (BuilderObject *self, PyObject *args) |
| static PyObject * | build_array_type (BuilderObject *self, PyObject *args) |
| static PyObject * | build_pointer_type (BuilderObject *self, PyObject *args) |
| static PyObject * | build_qualified_type (BuilderObject *self, PyObject *args) |
| PyDoc_STRVAR (module_doc,"Python interface for ctrump.") | |
| static void | register_abis (PyObject *dict) |
| CTRUMP_EXTDEF PyMODINIT_FUNC | init_ctrump (void) |
Variables | |
| static PyTypeObject | abiObject_Type |
| static PyTypeObject | symbolObject_Type |
| static PyTypeObject | recordFieldObject_Type |
| static PyTypeObject | texprObject_Type |
| static PyObject * | indexerr = NULL |
| static PyMethodDef | bitmap_methods [] |
| static PySequenceMethods | bitmap_as_sequence |
| static PyTypeObject | bitmapObject_Type |
| static struct PyMethodDef | compile_error_methods [] |
| static PyTypeObject | CompilationErrorObject_Type |
| static PyMethodDef | typeenv_methods [] |
| static PyMemberDef | typeenv_members [] |
| static PyTypeObject | TypeEnvObject_Type |
| static PyTypeObject | EnvObject_Type |
| static PyMemberDef | parserOption_members [] |
| static PyTypeObject | ParserOption_Type |
| static PyMethodDef | env_methods [] |
| static PyMemberDef | env_members [] |
| static PyMethodDef | builder_methods [] |
| static PyTypeObject | BuilderObject_Type |
| static struct PyMethodDef | ctrump_methods [] |
| static PyMemberDef | abi_members [] |
| static struct ctrump_abi_register_node | abis [] |
Definition in file ctrumpmodule.c.
| #define CompilationErrorObject_Check | ( | v | ) | ((v)->ob_type == &CompilationErrorObject_Type) |
Definition at line 1964 of file ctrumpmodule.c.
| #define DEFINE_BUILTIN_TYPE | ( | str_name, | |||
| c, | |||||
| sym | ) | {#str_name, T_OBJECT, offsetof(TypeEnvObject, str_name), READONLY}, |
Definition at line 689 of file ctrumpmodule.c.
| #define DEFINE_BUILTIN_TYPE | ( | str_name, | |||
| c, | |||||
| sym | ) |
Value:
type_obj = PyObject_New(texprObject, &texprObject_Type); \ type_obj->tree = &ctrump_builtin_##str_name; \ type_obj->env = env; \ self->id2texpr_obj_table[type_obj->tree->id] = (PyObject*)type_obj; \ self->str_name = type_obj;
Definition at line 689 of file ctrumpmodule.c.
| #define DEFINE_BUILTIN_TYPE | ( | str_name, | |||
| code, | |||||
| sym | ) | texprObject *str_name; |
Definition at line 689 of file ctrumpmodule.c.
| #define EnvObject_Check | ( | v | ) | ((v)->ob_type == &EnvObject_Type) |
Definition at line 1600 of file ctrumpmodule.c.
| #define NELEM | ( | a | ) | (sizeof(a)/sizeof(a[0])) |
Definition at line 1492 of file ctrumpmodule.c.
| #define PyIndex_Check | ( | obj | ) | PyInt_Check(obj) |
| #define PyNumber_AsSsize_t | ( | obj, | |||
| exc | ) | PyInt_AsLong(obj) |
| #define TranslationUnitObject_Check | ( | v | ) | ((v)->ob_type == &translation_unit_Type) |
Definition at line 1963 of file ctrumpmodule.c.
| typedef inquiry lenfunc |
Definition at line 41 of file ctrumpmodule.c.
| typedef int Py_ssize_t |
Definition at line 40 of file ctrumpmodule.c.
| typedef intargfunc ssizeargfunc |
Definition at line 42 of file ctrumpmodule.c.
| anonymous enum |
| static void* alloc_table | ( | int | num_entry | ) | [static] |
| static PyObject* bitmap_item | ( | bitmapObject * | self, | |
| Py_ssize_t | i | |||
| ) | [static] |
Definition at line 398 of file ctrumpmodule.c.
References ctrump_bitmap_p().
Referenced by bitmap_subscript().
| static Py_ssize_t bitmap_length | ( | bitmapObject * | self | ) | [static] |
Definition at line 416 of file ctrumpmodule.c.
| static PyObject* bitmap_pop | ( | bitmapObject * | self | ) | [static] |
| static PyObject* bitmap_str | ( | bitmapObject * | self | ) | [static] |
| static PyObject* bitmap_subscript | ( | bitmapObject * | self, | |
| PyObject * | item | |||
| ) | [static] |
Definition at line 422 of file ctrumpmodule.c.
References bitmap_item(), PyIndex_Check, and PyNumber_AsSsize_t.
| static PyObject* build_array_type | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1837 of file ctrumpmodule.c.
References ctrump_get_array_type(), and texpr_obj().
| static CompilationErrorObject* build_cfg_error_New | ( | struct ctrump_build_cfg_error * | e | ) | [static] |
Definition at line 656 of file ctrumpmodule.c.
References CompilationErrorObject::build_cfg, ERROR_BUILD_CFG, CompilationErrorObject::error_code, and CompilationErrorObject::u.
Referenced by cfront_parse().
| static PyObject* build_func_type | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1789 of file ctrumpmodule.c.
References ctrump_get_functype_begin(), ctrump_get_functype_cancel(), ctrump_get_functype_end(), ctrump_get_functype_next(), texpr_obj(), and texprObject::tree.
| static PyObject* build_incomplete_field_type | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1723 of file ctrumpmodule.c.
References ctrump_struct_decl::code, ctrump_get_incomplete_struct_type(), CTRUMP_TYPE_ENUM, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_UNION, LOCATION_GENERATED, symbolObject_Type, texpr_obj(), TypeEnvObject::type_env, and EnvObject::type_env.
| static PyObject* build_pointer_type | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1860 of file ctrumpmodule.c.
References ctrump_get_pointer_type(), ctrump_texpr::pointer_type, and texpr_obj().
| static PyObject* build_qualified_type | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1882 of file ctrumpmodule.c.
References ctrump_gccext_attribute::aligned, CTRUMP_ALIGN_UNSPECIFIED, ctrump_get_qualified_attr_type(), ctrump_gccext_attribute::flags, and texpr_obj().
| static PyObject* build_struct | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1660 of file ctrumpmodule.c.
References ctrump_gccext_attribute::aligned, ctrump_env_handle_record_decls(), ctrump_get_incomplete_struct_type(), ctrump_mempool_alloc, CTRUMP_TYPE_ENUM, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_UNION, ctrump_struct_decl::decl, ctrump_gccext_attribute::flags, LOCATION_GENERATED, symbolObject_Type, texpr_obj(), EnvObject::tree_pool, TypeEnvObject::type_env, EnvObject::type_env, and ctrump_texpr::u.
| static PyObject* build_symbol | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* build_typedef_name | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1761 of file ctrumpmodule.c.
References ctrump_get_typedef_name(), symbolObject_Type, texpr_obj(), TypeEnvObject::type_env, and EnvObject::type_env.
| static int builder_Init | ( | BuilderObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1623 of file ctrumpmodule.c.
| static void BuilderObject_dealloc | ( | BuilderObject * | self | ) | [static] |
Definition at line 1616 of file ctrumpmodule.c.
| static PyObject* calc_type_size | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* cfront_parse | ( | EnvObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 974 of file ctrumpmodule.c.
References build_cfg_error_New(), cfront_parse_error_New(), ctrump_analyze(), ctrump_mempool_alloc, ctrump_parse(), ctrump_ppc32_abi, expand_table_size_memtbl(), and ParserOptionObject::tree.
| static CompilationErrorObject* cfront_parse_error_New | ( | struct ctrump_loginfo * | loginfo | ) | [static] |
Definition at line 667 of file ctrumpmodule.c.
References CompilationErrorObject::cfront, ERROR_CFRONT_PARSE, CompilationErrorObject::error_code, and CompilationErrorObject::u.
Referenced by cfront_parse().
| static int env_Init | ( | EnvObject * | self, | |
| PyObject * | args, | |||
| PyObject * | kwds | |||
| ) | [static] |
Definition at line 796 of file ctrumpmodule.c.
References alloc_table(), ctrump_get_current_symbol_num(), ctrump_mempool_init(), and typeenv_Init().
| static void EnvObject_dealloc | ( | EnvObject * | o | ) | [static] |
Definition at line 1478 of file ctrumpmodule.c.
References ctrump_mempool_destroy(), EnvObject::id2symbol_table, EnvObject::id2tree_obj_table, EnvObject::member_obj_table, EnvObject::pyobj_pool, EnvObject::tree_pool, and EnvObject::type_env.
| static PyObject* error_get_error_token | ( | CompilationErrorObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 510 of file ctrumpmodule.c.
References ctrump_generate_pprint_format(), ctrump_print_stmt_format(), ERROR_BUILD_CFG, ERROR_CFRONT_PARSE, and ctrump_stmt::u.
| static PyObject* error_get_lineno | ( | CompilationErrorObject * | self | ) | [static] |
Definition at line 536 of file ctrumpmodule.c.
References ctrump_get_stmt_loc(), ERROR_BUILD_CFG, ERROR_CFRONT_PARSE, and ctrump_location::lineno.
| static PyObject* error_get_message | ( | CompilationErrorObject * | self | ) | [static] |
Definition at line 583 of file ctrumpmodule.c.
References ctrump_get_loginfo_message(), ERROR_BUILD_CFG, and ERROR_CFRONT_PARSE.
| static PyObject* error_get_path | ( | CompilationErrorObject * | self | ) | [static] |
Definition at line 567 of file ctrumpmodule.c.
References ctrump_get_stmt_loc(), ERROR_BUILD_CFG, ERROR_CFRONT_PARSE, and ctrump_location::path.
| static PyObject* error_get_reason | ( | CompilationErrorObject * | self | ) | [static] |
| static void expand_table_size | ( | int * | current_size, | |
| PyObject *** | table, | |||
| int | assert_size | |||
| ) | [static] |
| static void expand_table_size_memtbl | ( | int * | current_size, | |
| PyObject *** | id2tree_table, | |||
| PyObject **** | memobj_table, | |||
| int | assert_size | |||
| ) | [static] |
| static PyObject* expr_prec | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1495 of file ctrumpmodule.c.
References CTRUMP_EXPR_EMPTY, and ctrump_expr_prec_table.
| static PyObject* fill_table_symbol | ( | EnvObject * | env, | |
| const struct ctrump_symbol * | sym | |||
| ) | [static] |
Definition at line 960 of file ctrumpmodule.c.
| static PyObject* fill_table_texpr | ( | EnvObject * | env, | |
| const struct ctrump_texpr * | sym | |||
| ) | [static] |
Definition at line 966 of file ctrumpmodule.c.
| static PyObject* fold_const | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* get_stmt_loc | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1510 of file ctrumpmodule.c.
References ctrump_get_stmt_loc(), ctrump_location::lineno, and ctrump_location::path.
| static struct ctrump_loop_index* index_typecheck | ( | PyObject * | o | ) | [static, read] |
| CTRUMP_EXTDEF PyMODINIT_FUNC init_ctrump | ( | void | ) |
Definition at line 2081 of file ctrumpmodule.c.
References ctrump_init_all(), register_abis(), and symbolObject_Type.
| static PyObject* is_pointer_type | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1281 of file ctrumpmodule.c.
References ctrump_texpr_is_pointer(), texpr_arg(), and texprObject::tree.
| static PyObject* loop_index_equal | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1240 of file ctrumpmodule.c.
References ctrump_loop_index_equal(), and index_typecheck().
| static PyObject* loop_subscript_equal | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1216 of file ctrumpmodule.c.
References ctrump_loop_subscript_equal(), s1, s2, and subscript_typecheck().
| static PyObject* loop_subscript_hash | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1199 of file ctrumpmodule.c.
References ctrump_loop_subscript_hash(), and subscript_typecheck().
| static PyObject* member_obj | ( | PyObject ** | mem_tbl, | |
| int | index | |||
| ) | [static] |
Definition at line 881 of file ctrumpmodule.c.
| static int parserOption_Init | ( | ParserOptionObject * | self, | |
| PyObject * | args, | |||
| PyObject * | kwds | |||
| ) | [static] |
| static PyObject* pprint | ( | EnvObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* pprint0 | ( | PyObject * | args, | |
| int | print_ssa | |||
| ) | [static] |
Definition at line 1066 of file ctrumpmodule.c.
References ctrump_generate_pprint_format(), and ctrump_print_translation_unit_format().
Referenced by pprint(), and pprint_ssa().
| static PyObject* pprint_expr | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* pprint_expr0 | ( | PyObject * | args, | |
| int | print_ssa | |||
| ) | [static] |
Definition at line 1134 of file ctrumpmodule.c.
References ctrump_generate_pprint_format(), and ctrump_print_expr_format().
Referenced by pprint_expr(), and pprint_ssa_expr().
| static PyObject* pprint_ssa | ( | EnvObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* pprint_ssa_expr | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
| static PyObject* pprint_stmt | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1109 of file ctrumpmodule.c.
References ctrump_generate_pprint_format(), and ctrump_print_stmt_format().
| PyDoc_STRVAR | ( | module_doc | , | |
| "Python interface for ctrump." | ||||
| ) |
| static PyObject* record_field_getattr | ( | recordFieldObject * | self, | |
| char * | name | |||
| ) | [static] |
Definition at line 166 of file ctrumpmodule.c.
References ctrump_record_type_field::name, symbol_obj(), texpr_obj(), and ctrump_record_type_field::type.
| static PyObject * record_field_obj | ( | struct EnvObject * | env, | |
| struct ctrump_record_type_field * | tree | |||
| ) | [static] |
Definition at line 888 of file ctrumpmodule.c.
References recordFieldObject::env, and recordFieldObject::tree.
Referenced by texpr_getattr().
| static void register_abis | ( | PyObject * | dict | ) | [static] |
Definition at line 2064 of file ctrumpmodule.c.
References ctrump_abi_register_node::abi, abiObject::abi, and ctrump_abi_register_node::name.
Referenced by init_ctrump().
| static PyObject* retrieve_address_type | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1457 of file ctrumpmodule.c.
References ctrump_retrieve_address_type(), texprObject::env, texpr_arg(), texpr_obj(), and texprObject::tree.
| static PyObject* retrieve_pointer_type | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1437 of file ctrumpmodule.c.
References ctrump_retrieve_pointer_type(), texprObject::env, texpr_arg(), texpr_obj(), and texprObject::tree.
| static PyObject* struct_field_offset | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1384 of file ctrumpmodule.c.
References abiObject_Type, ctrump_texpr::code, ctrump_get_unqualified_type(), ctrump_retrieve_typedef_name(), ctrump_struct_field_offset(), CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_UNION, symbolObject_Type, and ctrump_texpr::u.
| static struct ctrump_loop_subscript* subscript_typecheck | ( | PyObject * | o | ) | [static, read] |
Definition at line 1171 of file ctrumpmodule.c.
Referenced by loop_subscript_equal(), and loop_subscript_hash().
| static PyObject * symbol_obj | ( | struct EnvObject * | env, | |
| const struct ctrump_symbol * | tobj | |||
| ) | [static] |
Definition at line 852 of file ctrumpmodule.c.
References expand_table_size(), ctrump_symbol::id, EnvObject::id2symbol_table, EnvObject::id2symbol_table_size, symbolObject_Type, and symbolObject::tree.
Referenced by build_symbol(), record_field_getattr(), and texpr_getattr().
| static PyObject* symbol_str | ( | symbolObject * | obj | ) | [static] |
Definition at line 128 of file ctrumpmodule.c.
References ctrump_symbol::symlen, ctrump_symbol::symstr, and symbolObject::tree.
| static texprObject* texpr_arg | ( | PyObject * | args | ) | [static] |
Definition at line 1267 of file ctrumpmodule.c.
Referenced by is_pointer_type(), retrieve_address_type(), retrieve_pointer_type(), and type_apply_unary_pointer_conversion().
| static PyObject* texpr_getattr | ( | texprObject * | self, | |
| char * | name | |||
| ) | [static] |
Definition at line 227 of file ctrumpmodule.c.
References ctrump_gccext_attribute::aligned, ctrump_texpr::array, ctrump_array_type::array_of, ctrump_qualified_type::attr, ctrump_texpr::code, CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_BUILTIN, CTRUMP_TYPE_ENUM, CTRUMP_TYPE_FUNC, CTRUMP_TYPE_INCOMPLETE_ARRAY, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_TYPEDEF_NAME, CTRUMP_TYPE_UNION, CTRUMP_TYPE_VARLEN_ARRAY, ctrump_typedef_name::def_name, ctrump_typedef_name::defined_to, f(), ctrump_gccext_attribute::flags, ctrump_texpr::pointer_to, ctrump_qualified_type::qual_flags, ctrump_texpr::qualified, record_field_obj(), ctrump_array_type::size, symbol_obj(), texpr_obj(), ctrump_texpr::typedef_name, ctrump_texpr::u, and ctrump_qualified_type::unqualified_type.
| static PyObject * texpr_obj | ( | struct EnvObject * | env, | |
| struct ctrump_texpr * | tobj | |||
| ) | [static] |
Definition at line 822 of file ctrumpmodule.c.
References texprObject::env, expand_table_size(), ctrump_texpr::id, TypeEnvObject::id2texpr_obj_table, TypeEnvObject::id2texpr_obj_table_size, texprObject::tree, and EnvObject::type_env.
Referenced by build_array_type(), build_func_type(), build_incomplete_field_type(), build_pointer_type(), build_qualified_type(), build_struct(), build_typedef_name(), record_field_getattr(), retrieve_address_type(), retrieve_pointer_type(), texpr_getattr(), and type_apply_unary_pointer_conversion().
| static PyObject* texpr_str | ( | texprObject * | self | ) | [static] |
| static PyObject* type_apply_unary_pointer_conversion | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 1297 of file ctrumpmodule.c.
References ctrump_texpr_apply_unary_pointer_conversion(), texprObject::env, ctrump_texpr::pointer_type, texpr_arg(), texpr_obj(), texprObject::tree, TypeEnvObject::type_env, and EnvObject::type_env.
| static void typeenv_dealloc | ( | TypeEnvObject * | o | ) | [static] |
Definition at line 727 of file ctrumpmodule.c.
References ctrump_type_env_destroy(), TypeEnvObject::id2texpr_obj_table, and TypeEnvObject::type_env.
| static int typeenv_Init | ( | TypeEnvObject * | self, | |
| struct EnvObject * | env, | |||
| PyObject * | args, | |||
| PyObject * | kwds | |||
| ) | [static] |
Definition at line 701 of file ctrumpmodule.c.
References alloc_table(), and ctrump_type_env_init().
Referenced by env_Init().
PyMemberDef abi_members[] [static] |
Initial value:
{
{"sizeof_pointer", T_INT, offsetof(abiObject, abi.sizeof_pointer), READONLY},
{"sizeof_long", T_INT, offsetof(abiObject, abi.sizeof_long), READONLY},
{"sizeof_int", T_INT, offsetof(abiObject, abi.sizeof_int), READONLY},
{"sizeof_short", T_INT, offsetof(abiObject, abi.sizeof_short), READONLY},
{"sizeof_bool", T_INT, offsetof(abiObject, abi.sizeof_bool), READONLY},
{"sizeof_longlong", T_INT, offsetof(abiObject, abi.sizeof_longlong), READONLY},
{"sizeof_float", T_INT, offsetof(abiObject, abi.sizeof_float), READONLY},
{"sizeof_double", T_INT, offsetof(abiObject, abi.sizeof_double), READONLY},
{"sizeof_long_double", T_INT, offsetof(abiObject, abi.sizeof_long_double), READONLY},
{"sizeof_enum", T_INT, offsetof(abiObject, abi.sizeof_enum), READONLY},
{"sizeof_vector", T_INT, offsetof(abiObject, abi.sizeof_vector), READONLY},
{"alignof_pointer", T_INT, offsetof(abiObject,abi.alignof_pointer), READONLY},
{"alignof_long", T_INT, offsetof(abiObject,abi.alignof_long), READONLY},
{"alignof_int", T_INT, offsetof(abiObject,abi.alignof_int), READONLY},
{"alignof_short", T_INT, offsetof(abiObject,abi.alignof_short), READONLY},
{"alignof_bool", T_INT, offsetof(abiObject,abi.alignof_bool), READONLY},
{"alignof_longlong", T_INT, offsetof(abiObject,abi.alignof_longlong), READONLY},
{"alignof_float", T_INT, offsetof(abiObject,abi.alignof_float), READONLY},
{"alignof_double", T_INT, offsetof(abiObject,abi.alignof_double), READONLY},
{"alignof_long_double", T_INT, offsetof(abiObject,abi.alignof_long_double), READONLY},
{"alignof_enum", T_INT, offsetof(abiObject,abi.alignof_enum), READONLY},
{"alignof_vector", T_INT, offsetof(abiObject,abi.alignof_vector), READONLY},
{"is_char_signed", T_INT, offsetof(abiObject, abi.is_char_signed), READONLY},
{0},
}
Definition at line 1990 of file ctrumpmodule.c.
static PyTypeObject abiObject_Type [static] |
Definition at line 55 of file ctrumpmodule.c.
Referenced by calc_type_size(), and struct_field_offset().
struct ctrump_abi_register_node abis[] [static] |
Initial value:
{
{"spu_abi", &ctrump_spu_abi},
{"ppc32_abi", &ctrump_ppc32_abi},
{"ppc64_abi", &ctrump_ppc64_abi}
}
Definition at line 2057 of file ctrumpmodule.c.
PySequenceMethods bitmap_as_sequence [static] |
Initial value:
{
(lenfunc)bitmap_length,
(binaryfunc)NULL,
NULL,
(ssizeargfunc)bitmap_item,
}
Definition at line 449 of file ctrumpmodule.c.
PyMethodDef bitmap_methods[] [static] |
Initial value:
{
{"__getitem__", (PyCFunction)bitmap_subscript, METH_O|METH_COEXIST},
{"popcount", (PyCFunction)bitmap_pop, METH_NOARGS},
{NULL, (PyCFunction)NULL, 0, NULL},
}
Definition at line 443 of file ctrumpmodule.c.
PyTypeObject bitmapObject_Type [static] |
Definition at line 456 of file ctrumpmodule.c.
PyMethodDef builder_methods[] [static] |
Initial value:
{
{"symbol", (PyCFunction)build_symbol, METH_VARARGS, NULL},
{"decls_to_struct_texpr", (PyCFunction)build_struct, METH_VARARGS, NULL},
{"incomplete_struct", (PyCFunction)build_incomplete_field_type,METH_VARARGS, NULL},
{"array_type", (PyCFunction)build_array_type, METH_VARARGS, NULL},
{"typedef_name", (PyCFunction)build_typedef_name, METH_VARARGS, NULL},
{"func_type", (PyCFunction)build_func_type, METH_VARARGS, NULL},
{"pointer_type", (PyCFunction)build_pointer_type, METH_VARARGS, NULL},
{"qualified_type", (PyCFunction)build_qualified_type, METH_VARARGS, NULL},
BUILDER_METHOD_TABLE
{NULL, NULL, 0, NULL}
}
Definition at line 1906 of file ctrumpmodule.c.
PyTypeObject BuilderObject_Type [static] |
Definition at line 1919 of file ctrumpmodule.c.
PyTypeObject CompilationErrorObject_Type [static] |
Definition at line 611 of file ctrumpmodule.c.
struct PyMethodDef compile_error_methods[] [static] |
Initial value:
{
{"get_error_token", (PyCFunction)error_get_error_token, METH_VARARGS, NULL},
{"lineno", (PyCFunction)error_get_lineno, METH_NOARGS, NULL},
{"path", (PyCFunction)error_get_path, METH_NOARGS, NULL},
{"reason", (PyCFunction)error_get_reason, METH_NOARGS, NULL},
{"message", (PyCFunction)error_get_message, METH_NOARGS, NULL},
{NULL, (PyCFunction)NULL, 0, NULL}
}
Definition at line 602 of file ctrumpmodule.c.
struct PyMethodDef ctrump_methods[] [static] |
Initial value:
{
{"pprint", (PyCFunction)pprint, METH_VARARGS},
{"pprint_ssa", (PyCFunction)pprint_ssa, METH_VARARGS},
{"pprint_expr", (PyCFunction)pprint_expr, METH_VARARGS},
{"pprint_ssa_expr", (PyCFunction)pprint_ssa_expr, METH_VARARGS},
{"pprint_stmt", (PyCFunction)pprint_stmt, METH_VARARGS},
{"fold_const", (PyCFunction)fold_const, METH_VARARGS},
{"expr_prec", (PyCFunction)expr_prec, METH_VARARGS},
{"is_pointer_type", (PyCFunction)is_pointer_type, METH_VARARGS},
{"type_apply_unary_pointer_conversion", (PyCFunction)type_apply_unary_pointer_conversion, METH_VARARGS},
{"calc_type_size", (PyCFunction)calc_type_size, METH_VARARGS},
{"get_stmt_loc", (PyCFunction)get_stmt_loc, METH_VARARGS},
{"retrieve_pointer_type", (PyCFunction)retrieve_pointer_type, METH_VARARGS},
{"retrieve_address_type", (PyCFunction)retrieve_address_type, METH_VARARGS},
{"struct_field_offset", (PyCFunction)struct_field_offset, METH_VARARGS},
{"loop_index_equal", (PyCFunction)loop_index_equal, METH_VARARGS},
{"loop_subscript_equal", (PyCFunction)loop_subscript_equal, METH_VARARGS},
{"loop_subscript_hash", (PyCFunction)loop_subscript_hash, METH_VARARGS},
{NULL, (PyCFunction)NULL, 0, NULL}
}
Definition at line 1966 of file ctrumpmodule.c.
PyMemberDef env_members[] [static] |
Initial value:
{
{"type_env", T_OBJECT, offsetof(EnvObject, type_env), READONLY},
{0},
}
Definition at line 1552 of file ctrumpmodule.c.
PyMethodDef env_methods[] [static] |
Initial value:
{
{"parse", (PyCFunction)cfront_parse, METH_VARARGS},
{"cfront_parse", (PyCFunction)cfront_parse, METH_VARARGS},
{NULL, (PyCFunction)NULL, 0, NULL}
}
Definition at line 1546 of file ctrumpmodule.c.
static PyTypeObject EnvObject_Type [static] |
Definition at line 793 of file ctrumpmodule.c.
PyObject* indexerr = NULL [static] |
Definition at line 395 of file ctrumpmodule.c.
PyMemberDef parserOption_members[] [static] |
Initial value:
{
{"is_vector_keyword", T_INT, offsetof(ParserOptionObject, tree.is_vector_keyword), 0, "whether `vector' is keyword or not"},
{0},
}
Definition at line 904 of file ctrumpmodule.c.
PyTypeObject ParserOption_Type [static] |
Definition at line 916 of file ctrumpmodule.c.
PyTypeObject recordFieldObject_Type [static] |
Definition at line 183 of file ctrumpmodule.c.
PyTypeObject symbolObject_Type [static] |
Initial value:
{
PyObject_HEAD_INIT (NULL) 0,
"ctrump.symbol",
sizeof (symbolObject),
0,
0,
0,
(getattrfunc) 0,
0,
0,
0,
0,
0,
0,
0,
0,
(reprfunc)symbol_str,
}
Definition at line 135 of file ctrumpmodule.c.
Referenced by build_incomplete_field_type(), build_struct(), build_typedef_name(), init_ctrump(), struct_field_offset(), and symbol_obj().
static PyTypeObject texprObject_Type [static] |
Definition at line 312 of file ctrumpmodule.c.
PyMemberDef typeenv_members[] [static] |
Definition at line 734 of file ctrumpmodule.c.
PyMethodDef typeenv_methods[] [static] |
Initial value:
{
{NULL, (PyCFunction)NULL, 0, NULL},
}
Definition at line 696 of file ctrumpmodule.c.
PyTypeObject TypeEnvObject_Type [static] |
Definition at line 743 of file ctrumpmodule.c.
1.5.6