44 return htab_hash_pointer (inst->
type);
76 slot = htab_find_slot (context->
type_map, &inst, INSERT);
81 if (add != NULL && add->
gcc_type != gcc_type)
82 error (
_(
"Unexpected type id from GCC, check you use recent enough GCC."));
99 return C_CTX (context)->c_ops->build_pointer_type (
C_CTX (context),
114 return C_CTX (context)->c_ops->error (
C_CTX (context),
115 _(
"array type with non-constant"
116 " lower bound is not supported"));
118 return C_CTX (context)->c_ops->error (
C_CTX (context),
119 _(
"cannot convert array type with "
120 "non-zero lower bound to C"));
129 return C_CTX (context)->c_ops->error (
C_CTX (context),
130 _(
"variably-sized vector type"
131 " is not supported"));
134 result =
C_CTX (context)->c_ops->build_vla_array_type (
C_CTX (context),
142 LONGEST low_bound, high_bound, count;
149 count = high_bound + 1;
153 return C_CTX (context)->c_ops->build_vector_type (
C_CTX (context),
156 return C_CTX (context)->c_ops->build_array_type (
C_CTX (context),
157 element_type, count);
172 result =
C_CTX (context)->c_ops->build_record_type (
C_CTX (context));
176 result =
C_CTX (context)->c_ops->build_union_type (
C_CTX (context));
188 C_CTX (context)->c_ops->build_add_field (
C_CTX (context), result,
195 C_CTX (context)->c_ops->finish_record_or_union (
C_CTX (context), result,
205 gcc_type int_type, result;
207 struct gcc_c_context *ctx =
C_CTX (context);
209 int_type = ctx->c_ops->int_type (ctx,
213 result = ctx->c_ops->build_enum_type (ctx, int_type);
216 ctx->c_ops->build_add_enum_constant (ctx,
222 ctx->c_ops->finish_enum_type (ctx, result);
233 gcc_type result, return_type;
234 struct gcc_type_array array;
242 array.elements = XNEWVEC (gcc_type,
TYPE_NFIELDS (type));
246 result =
C_CTX (context)->c_ops->build_function_type (
C_CTX (context),
249 xfree (array.elements);
259 return C_CTX (context)->c_ops->int_type (
C_CTX (context),
269 return C_CTX (context)->c_ops->float_type (
C_CTX (context),
278 return C_CTX (context)->c_ops->void_type (
C_CTX (context));
286 return C_CTX (context)->c_ops->bool_type (
C_CTX (context));
295 gcc_type unqual_converted;
301 quals |= GCC_QUALIFIER_CONST;
303 quals |= GCC_QUALIFIER_VOLATILE;
305 quals |= GCC_QUALIFIER_RESTRICT;
307 return C_CTX (context)->c_ops->build_qualified_type (
C_CTX (context),
319 return C_CTX (context)->c_ops->build_complex_type (
C_CTX (context), base);
371 return C_CTX (context)->c_ops->error (
C_CTX (context),
372 _(
"cannot convert gdb type "
389 found = htab_find (context->
type_map, &inst);
421 result->
base.
fe = &fe->base;
436 return &result->
base;
#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_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
static gcc_type convert_struct_or_union(struct compile_c_instance *context, struct type *type)
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)
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)
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)
#define CHECK_TYPEDEF(TYPE)
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,...)
char * c_get_range_decl_name(const struct dynamic_prop *prop)
static gcc_type convert_float(struct compile_c_instance *context, struct type *type)