+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct type) <is_stub, set_is_stub>: New methods.
+ (TYPE_STUB): Use type::is_stub, change all write call sites to
+ use type::set_is_stub.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_NOSIGN): Remove, replace all uses with
Consider the case of an array, for instance, where the size
of the array is computed from the number of elements in
our array multiplied by the size of its element. */
- TYPE_STUB (fixed_record_type) = 0;
+ fixed_record_type->set_is_stub (false);
}
}
return fixed_record_type;
{
/* ICC<14 does not output the required DW_AT_declaration on
incomplete types, but gives them a size of zero. */
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
}
else
TYPE_STUB_SUPPORTED (type) = 1;
if (die_is_declaration (die, cu))
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
else if (attr == NULL && die->child == NULL
&& producer_is_realview (cu->producer))
/* RealView does not output the required DW_AT_declaration
on incomplete types. */
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
/* We need to add the type field to the die immediately so we don't
infinitely recurse when dealing with pointers to the structure
Types. When another package uses such a type, an incomplete DIE
may be generated by the compiler. */
if (die_is_declaration (die, cu))
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
/* If this type has an underlying type that is not a stub, then we
may use its attributes. We always use the "unsigned" attribute
such a type, we treat it as a stub, and try to resolve it later on,
when needed. */
if (cu->language == language_ada)
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
return set_die_type (die, type, cu);
}
mtype = alloc_type_copy (type);
mtype->set_code (TYPE_CODE_METHOD);
TYPE_LENGTH (mtype) = 1;
- TYPE_STUB (mtype) = 1;
+ mtype->set_is_stub (true);
TYPE_TARGET_TYPE (mtype) = type;
/* TYPE_SELF_TYPE (mtype) = unknown yet */
return mtype;
We want a method (TYPE_CODE_METHOD). */
smash_to_method_type (mtype, type, TYPE_TARGET_TYPE (mtype),
argtypes, argcount, p[-2] == '.');
- TYPE_STUB (mtype) = 0;
+ mtype->set_is_stub (false);
TYPE_FN_FIELD_STUB (f, signature_id) = 0;
xfree (demangled_name);
if someone referenced a type that wasn't defined in a source file
via (struct sir_not_appearing_in_this_film *)). */
-#define TYPE_STUB(t) (TYPE_MAIN_TYPE (t)->flag_stub)
+#define TYPE_STUB(t) ((t)->is_stub ())
/* * The target type of this type is a stub type, and this type needs
to be updated if it gets un-stubbed in check_typedef. Used for
unsigned int m_flag_unsigned : 1;
unsigned int m_flag_nosign : 1;
- unsigned int flag_stub : 1;
+ unsigned int m_flag_stub : 1;
unsigned int flag_target_stub : 1;
unsigned int flag_prototyped : 1;
unsigned int flag_varargs : 1;
this->main_type->m_flag_nosign = has_no_signedness;
}
+ bool is_stub () const
+ {
+ return this->main_type->m_flag_stub;
+ }
+
+ void set_is_stub (bool is_stub)
+ {
+ this->main_type->m_flag_stub = is_stub;
+ }
+
/* * Return the dynamic property of the requested KIND from this type's
list of dynamic properties. */
dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
do not create a symbol for it either. */
if (t->num_fields () == 0)
{
- TYPE_STUB (t) = 1;
+ t->set_is_stub (true);
break;
}
{
*pname = "<undefined>";
*tpp = init_type (mdebugread_objfile, type_code, 0, NULL);
- TYPE_STUB (*tpp) = 1;
+ (*tpp)->set_is_stub (true);
return result;
}
type->set_code (code);
type->set_name (type_name);
INIT_CPLUS_SPECIFIC (type);
- TYPE_STUB (type) = 1;
+ type->set_is_stub (true);
add_undefined_type (type, typenums);
return type;
INIT_CPLUS_SPECIFIC (type);
type->set_code (type_code);
- TYPE_STUB (type) = 0;
+ type->set_is_stub (false);
/* First comes the total size in bytes. */
TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
set_length_in_type_chain (type);
type->set_code (TYPE_CODE_ENUM);
- TYPE_STUB (type) = 0;
+ type->set_is_stub (false);
if (unsigned_enum)
type->set_is_unsigned (true);
type->set_num_fields (nsyms);