convert_array (compile_c_instance *context, struct type *type)
{
gcc_type element_type;
- struct type *range = TYPE_INDEX_TYPE (type);
+ struct type *range = type->index_type ();
element_type = context->convert_type (TYPE_TARGET_TYPE (type));
}
context->insert_type (type, result);
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
+ for (i = 0; i < type->num_fields (); ++i)
{
gcc_type field_type;
unsigned long bitsize = TYPE_FIELD_BITSIZE (type, i);
- field_type = context->convert_type (TYPE_FIELD_TYPE (type, i));
+ field_type = context->convert_type (type->field (i).type ());
if (bitsize == 0)
- bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, i));
+ bitsize = 8 * TYPE_LENGTH (type->field (i).type ());
context->plugin ().build_add_field (result,
TYPE_FIELD_NAME (type, i),
field_type,
TYPE_LENGTH (type));
result = context->plugin ().build_enum_type (int_type);
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
+ for (i = 0; i < type->num_fields (); ++i)
{
context->plugin ().build_add_enum_constant
(result, TYPE_FIELD_NAME (type, i), TYPE_FIELD_ENUMVAL (type, i));
types. Those are impossible in C, though. */
return_type = context->convert_type (target_type);
- array.n_elements = TYPE_NFIELDS (type);
- array.elements = XNEWVEC (gcc_type, TYPE_NFIELDS (type));
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
- array.elements[i] = context->convert_type (TYPE_FIELD_TYPE (type, i));
+ array.n_elements = type->num_fields ();
+ array.elements = XNEWVEC (gcc_type, type->num_fields ());
+ for (i = 0; i < type->num_fields (); ++i)
+ array.elements[i] = context->convert_type (type->field (i).type ());
result = context->plugin ().build_function_type (return_type,
&array, is_varargs);