46 return htab_hash_pointer (inst->
type);
78 slot = htab_find_slot (context->
type_map, &inst, INSERT);
84 error (
_(
"Unexpected type id from GCC, check you use recent enough GCC."));
101 return C_CTX (context)->c_ops->build_pointer_type (
C_CTX (context),
110 gcc_type element_type;
116 return C_CTX (context)->c_ops->error (
C_CTX (context),
117 _(
"array type with non-constant" 118 " lower bound is not supported"));
120 return C_CTX (context)->c_ops->error (
C_CTX (context),
121 _(
"cannot convert array type with " 122 "non-zero lower bound to C"));
130 return C_CTX (context)->c_ops->error (
C_CTX (context),
131 _(
"variably-sized vector type" 132 " is not supported"));
136 result =
C_CTX (context)->c_ops->build_vla_array_type (
C_CTX (context),
138 upper_bound.c_str ());
143 LONGEST low_bound, high_bound, count;
150 count = high_bound + 1;
154 return C_CTX (context)->c_ops->build_vector_type (
C_CTX (context),
157 return C_CTX (context)->c_ops->build_array_type (
C_CTX (context),
158 element_type, count);
173 result =
C_CTX (context)->c_ops->build_record_type (
C_CTX (context));
177 result =
C_CTX (context)->c_ops->build_union_type (
C_CTX (context));
189 C_CTX (context)->c_ops->build_add_field (
C_CTX (context), result,
196 C_CTX (context)->c_ops->finish_record_or_union (
C_CTX (context), result,
206 gcc_type int_type, result;
208 struct gcc_c_context *ctx =
C_CTX (context);
210 int_type = ctx->c_ops->int_type_v0 (ctx,
214 result = ctx->c_ops->build_enum_type (ctx, int_type);
217 ctx->c_ops->build_add_enum_constant (ctx,
223 ctx->c_ops->finish_enum_type (ctx, result);
234 gcc_type result, return_type;
235 struct gcc_type_array array;
245 if (target_type == NULL)
251 warning (
_(
"function has unknown return type; assuming int"));
263 result =
C_CTX (context)->c_ops->build_function_type (
C_CTX (context),
266 xfree (array.elements);
276 return C_CTX (context)->c_ops->int_type_v0 (
C_CTX (context),
286 return C_CTX (context)->c_ops->float_type_v0 (
C_CTX (context),
295 return C_CTX (context)->c_ops->void_type (
C_CTX (context));
303 return C_CTX (context)->c_ops->bool_type (
C_CTX (context));
312 gcc_type unqual_converted;
313 gcc_qualifiers_flags quals = 0;
318 quals |= GCC_QUALIFIER_CONST;
320 quals |= GCC_QUALIFIER_VOLATILE;
322 quals |= GCC_QUALIFIER_RESTRICT;
324 return C_CTX (context)->c_ops->build_qualified_type (
C_CTX (context),
336 return C_CTX (context)->c_ops->build_complex_type (
C_CTX (context), base);
393 struct type *fallback;
398 warning (
_(
"variable has unknown type; assuming int"));
403 return C_CTX (context)->c_ops->error (
C_CTX (context),
404 _(
"cannot convert gdb type " 453 result->
base.
fe = &fe->base;
468 return &result->
base;
std::string c_get_range_decl_name(const struct dynamic_prop *prop)
#define TYPE_HIGH_BOUND_KIND(range_type)
static gcc_type convert_array(struct compile_c_instance *context, struct type *type)
#define TYPE_RANGE_DATA(thistype)
#define TYPE_OBJFILE_OWNED(t)
#define TYPE_FIELD_NAME(thistype, n)
const char * gcc_target_options
#define TYPE_LOW_BOUND(range_type)
struct type * make_unqualified_type(struct type *type)
struct compile_instance base
void warning(const char *fmt,...)
static gcc_type convert_struct_or_union(struct compile_c_instance *context, struct type *type)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
const struct objfile_type * objfile_type(struct objfile *objfile)
static gcc_type convert_enum(struct compile_c_instance *context, struct type *type)
static gcc_type convert_qualified(struct compile_c_instance *context, struct type *type)
static void insert_type(struct compile_c_instance *context, struct type *type, gcc_type gcc_type)
#define TYPE_PROTOTYPED(t)
#define TYPE_FIELD_ENUMVAL(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
gcc_c_symbol_address_function gcc_symbol_address
#define TYPE_INSTANCE_FLAGS(thistype)
struct type * check_typedef(struct type *type)
static gcc_type convert_void(struct compile_c_instance *context, struct type *type)
static int eq_type_map_instance(const void *a, const void *b)
static gcc_type convert_func(struct compile_c_instance *context, struct type *type)
static gcc_type convert_complex(struct compile_c_instance *context, struct type *type)
static gcc_type convert_int(struct compile_c_instance *context, struct type *type)
static void delete_instance(struct compile_instance *c)
gcc_c_oracle_function gcc_convert_symbol
#define TYPE_FIELD_BITSIZE(thistype, n)
#define TYPE_FIELD_BITPOS(thistype, n)
struct type * builtin_int
void(* destroy)(struct compile_instance *)
static gcc_type convert_pointer(struct compile_c_instance *context, struct type *type)
static gcc_type convert_bool(struct compile_c_instance *context, struct type *type)
#define TYPE_TARGET_TYPE(thistype)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
struct gcc_base_context * fe
static hashval_t hash_type_map_instance(const void *p)
#define TYPE_LOW_BOUND_KIND(range_type)
#define TYPE_NFIELDS(thistype)
static gcc_type convert_type_basic(struct compile_c_instance *context, struct type *type)
struct compile_instance * new_compile_instance(struct gcc_c_context *fe)
#define TYPE_LENGTH(thistype)
gcc_type convert_type(struct compile_c_instance *context, struct type *type)
PTR xcalloc(size_t number, size_t size)
int get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
void error(const char *fmt,...)
static gcc_type convert_float(struct compile_c_instance *context, struct type *type)
struct type * builtin_int