20 if (!
found || !base_type) {
88 if (!
found || !callable) {
129 type->identifier.is_const = is_const;
165 type->identifier.is_const = is_const;
167 if (!
type->identifier.name) {
179 if (!base_type->
name) {
191 tpair->
btype = base_type;
222 type->identifier.is_const = is_const;
231 tpair->
btype = base_type;
250 type->identifier.is_const =
false;
294 tpair->
btype = base_type;
330 tpair->
btype = base_type;
377 type->identifier.is_const =
false;
422 tpair->
btype = base_type;
458 tpair->
btype = base_type;
505 type->identifier.is_const =
false;
550 tpair->
btype = base_type;
586 tpair->
btype = base_type;
633 type->identifier.is_const =
false;
720 type->identifier.is_const =
false;
724 tpair->
btype = base_type;
752 type->identifier.is_const =
false;
761 tpair->
btype = base_type;
785 type->callable = callable;
811 if (!
found || !callable) {
822 type->callable = callable;
861 type->pointer.is_const = is_const;
884 tpair->type->pointer.type = subpair->type;
885 tpair->btype = subpair->btype;
892 tpair->type->array.type = subpair->type;
893 tpair->btype = subpair->btype;
899 state->anon.structs++;
905 state->anon.unions++;
RZ_API void rz_type_base_type_free(RzBaseType *type)
Frees the RzBaseType instance and all of its members.
RZ_API RZ_OWN RzBaseType * rz_type_base_type_new(RzBaseTypeKind kind)
Allocates a new instance of RzBaseType given the kind.
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define rz_return_val_if_fail(expr, val)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
@ RZ_BASE_TYPE_KIND_TYPEDEF
@ RZ_BASE_TYPE_KIND_ATOMIC
@ RZ_BASE_TYPE_KIND_UNION
@ RZ_BASE_TYPE_KIND_STRUCT
@ RZ_TYPE_IDENTIFIER_KIND_STRUCT
@ RZ_TYPE_IDENTIFIER_KIND_UNSPECIFIED
@ RZ_TYPE_IDENTIFIER_KIND_ENUM
@ RZ_TYPE_IDENTIFIER_KIND_UNION
@ RZ_TYPE_KIND_IDENTIFIER
RZ_API void * rz_vector_reserve(RzVector *vec, size_t capacity)
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
void(* RzPVectorFree)(void *e)
static void ** rz_pvector_push(RzPVector *vec, void *x)
#define rz_pvector_foreach(vec, it)
RzBaseTypeStruct struct_data
RzBaseTypeUnion union_data
RzPVector * args
optional for the time being
RZ_API void rz_type_callable_arg_free(RzCallableArg *arg)
Frees the RzCallableArg.
RZ_API void rz_type_free(RZ_NULLABLE RzType *type)
Frees the RzType.
void parser_debug(CParserState *state, const char *fmt,...)
void parser_error(CParserState *state, const char *fmt,...)
RZ_OWN ParserTypePair * c_parser_new_union_naked_type(CParserState *state, RZ_NONNULL const char *name)
Creates new union naked type (without base type) based on the name.
bool c_parser_pointer_set_subtype(CParserState *state, RZ_BORROW ParserTypePair *tpair, RZ_OWN ParserTypePair *subpair)
RzBaseType * c_parser_base_type_find(CParserState *state, RZ_NONNULL const char *name)
bool c_parser_base_type_exists(CParserState *state, RZ_NONNULL const char *name)
bool c_parser_forward_definition_remove(CParserState *state, RZ_NONNULL const char *name)
bool c_parser_base_type_is_forward_definition(CParserState *state, RZ_NONNULL const char *name)
RZ_OWN ParserTypePair * c_parser_new_unspecified_naked_type(CParserState *state, RZ_NONNULL const char *name, bool is_const)
Creates new unspecified naked type (without base type) based on the name.
bool c_parser_array_set_subtype(CParserState *state, RZ_BORROW ParserTypePair *tpair, RZ_OWN ParserTypePair *subpair)
RZ_OWN ParserTypePair * c_parser_new_enum_type(CParserState *state, RZ_NONNULL const char *name, size_t cases_count)
Creates new enumeration type based on the name.
bool c_parser_base_type_store(CParserState *state, RZ_NONNULL const char *name, ParserTypePair *tpair)
RZ_OWN ParserTypePair * c_parser_new_structure_type(CParserState *state, RZ_NONNULL const char *name, size_t members_count)
Creates new structure "type + base type" pair based on the name.
RZ_OWN ParserTypePair * c_parser_get_structure_type(CParserState *state, RZ_NONNULL const char *name)
Returns the structure type if matching in the types hashtable.
RZ_OWN ParserTypePair * c_parser_new_primitive_type(CParserState *state, RZ_NONNULL const char *name, bool is_const)
Creates new primitive type based on the name.
RZ_OWN RzType * c_parser_new_callable(CParserState *state, RZ_NONNULL const char *name)
Creates new callable based on the name.
RZ_OWN ParserTypePair * c_parser_new_typedef(CParserState *state, RZ_NONNULL const char *name, RZ_NONNULL const char *base)
Creates new type alias based on the name.
bool c_parser_forward_definition_store(CParserState *state, RZ_NONNULL const char *name)
RZ_OWN ParserTypePair * c_parser_type_wrap_to_array(CParserState *state, ParserTypePair *tpair, size_t size)
RZ_OWN char * c_parser_new_anonymous_callable_name(CParserState *state)
RZ_OWN ParserTypePair * c_parser_new_enum_naked_type(CParserState *state, RZ_NONNULL const char *name)
Creates new enum naked type (without base type) based on the name.
RZ_OWN ParserTypePair * c_parser_new_structure_naked_type(CParserState *state, RZ_NONNULL const char *name)
Creates new structure naked type (without base type) based on the name.
RZ_OWN char * c_parser_new_anonymous_enum_name(CParserState *state)
RZ_OWN ParserTypePair * c_parser_new_typedef_forward_definition(CParserState *state, RZ_NONNULL const char *name)
Creates new type alias forward definition.
RZ_OWN ParserTypePair * c_parser_get_typedef(CParserState *state, RZ_NONNULL const char *name)
Returns the type if matching in the types hashtable.
RZ_OWN ParserTypePair * c_parser_new_enum_forward_definition(CParserState *state, RZ_NONNULL const char *name)
Creates new enum forward definition.
RZ_OWN char * c_parser_new_anonymous_structure_name(CParserState *state)
bool c_parser_new_callable_argument(CParserState *state, RZ_NONNULL RzCallable *callable, RZ_NONNULL const char *name, RZ_OWN RZ_NONNULL RzType *type)
Adds a new argument to the callable.
RZ_OWN ParserTypePair * c_parser_new_typedef_naked_type(CParserState *state, RZ_NONNULL const char *name)
Creates new type alias naked type (without base type) based on the name.
RZ_OWN ParserTypePair * c_parser_get_enum_type(CParserState *state, RZ_NONNULL const char *name)
Returns the enum type if matching in the types hashtable.
RZ_OWN char * c_parser_new_anonymous_union_name(CParserState *state)
bool c_parser_callable_type_exists(CParserState *state, RZ_NONNULL const char *name)
RzCallable * c_parser_callable_type_find(CParserState *state, RZ_NONNULL const char *name)
RZ_OWN ParserTypePair * c_parser_get_union_type(CParserState *state, RZ_NONNULL const char *name)
Returns the union type if matching in the types hashtable.
RZ_OWN ParserTypePair * c_parser_get_primitive_type(CParserState *state, RZ_NONNULL const char *name, bool is_const)
Returns the primitive type if matching in the types hashtable.
RZ_OWN ParserTypePair * c_parser_new_union_type(CParserState *state, RZ_NONNULL const char *name, size_t members_count)
Creates new union "type + base type" pair based on the name.
RZ_OWN ParserTypePair * c_parser_new_union_forward_definition(CParserState *state, RZ_NONNULL const char *name)
Creates new union forward definition.
RZ_OWN ParserTypePair * c_parser_type_wrap_to_pointer(CParserState *state, ParserTypePair *tpair, bool is_const)
RZ_OWN RzType * c_parser_new_naked_callable(CParserState *state)
Creates new naked callable without storing it.
RZ_OWN ParserTypePair * c_parser_new_structure_forward_definition(CParserState *state, RZ_NONNULL const char *name)
Creates new structure forward definition.
bool c_parser_callable_type_store(CParserState *state, RZ_NONNULL const char *name, RZ_NONNULL RzType *type)