+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (TYPE_STUB): Remove, replace all
+ uses with type::is_stub.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (struct type) <is_stub, set_is_stub>: New methods.
{
struct type *target_type = TYPE_TARGET_TYPE (p_bounds_type);
- if (TYPE_STUB (target_type))
+ if (target_type->is_stub ())
p_bounds = value_cast (lookup_pointer_type
(ada_check_typedef (target_type)),
p_bounds);
/* If two symbols have the same name and one of them is a stub type,
the get rid of the stub. */
- if (TYPE_STUB (SYMBOL_TYPE ((*syms)[i].symbol))
+ if (SYMBOL_TYPE ((*syms)[i].symbol)->is_stub ()
&& (*syms)[i].symbol->linkage_name () != NULL)
{
for (j = 0; j < syms->size (); j++)
{
if (j != i
- && !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol))
+ && !SYMBOL_TYPE ((*syms)[j].symbol)->is_stub ()
&& (*syms)[j].symbol->linkage_name () != NULL
&& strcmp ((*syms)[i].symbol->linkage_name (),
(*syms)[j].symbol->linkage_name ()) == 0)
type = check_typedef (type);
if (type == NULL || type->code () != TYPE_CODE_ENUM
- || !TYPE_STUB (type)
+ || !type->is_stub ()
|| type->name () == NULL)
return type;
else
flds = 0;
- if (fld0 > fld1 && TYPE_STUB (type))
+ if (fld0 > fld1 && type->is_stub ())
return -1;
for (i = fld0; i <= fld1; i += 1)
if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
&& TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
{
- if (TYPE_STUB (type))
+ if (type->is_stub ())
fprintfi_filtered (level + 4, stream,
_("%p[<incomplete type>%p]\n"),
metadata_style.style ().ptr (), nullptr);
fprintf_filtered (stream, "{\n");
if (type->num_fields () == 0)
{
- if (TYPE_STUB (type))
+ if (type->is_stub ())
fprintfi_filtered (level + 4, stream,
_("%p[<incomplete type>%p]\n"),
metadata_style.style ().ptr (), nullptr);
can tell us the reality. However, we defer to a local size
attribute if one exists, because this lets the compiler override
the underlying type if needed. */
- if (TYPE_TARGET_TYPE (type) != NULL && !TYPE_STUB (TYPE_TARGET_TYPE (type)))
+ if (TYPE_TARGET_TYPE (type) != NULL && !TYPE_TARGET_TYPE (type)->is_stub ())
{
struct type *underlying_type = TYPE_TARGET_TYPE (type);
underlying_type = check_typedef (underlying_type);
result_type = alloc_type_copy (index_type);
result_type->set_code (TYPE_CODE_RANGE);
TYPE_TARGET_TYPE (result_type) = index_type;
- if (TYPE_STUB (index_type))
+ if (index_type->is_stub ())
TYPE_TARGET_STUB (result_type) = 1;
else
TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
result_type->set_fields
((struct field *) TYPE_ZALLOC (result_type, sizeof (struct field)));
- if (!TYPE_STUB (domain_type))
+ if (!domain_type->is_stub ())
{
LONGEST low_bound, high_bound, bit_length;
}
/* Otherwise, rely on the stub flag being set for opaque/stubbed
types. */
- else if (TYPE_STUB (type) && !currently_reading_symtab)
+ else if (type->is_stub () && !currently_reading_symtab)
{
const char *name = type->name ();
/* FIXME: shouldn't we look in STRUCT_DOMAIN and/or VAR_DOMAIN
{
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
- if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type))
+ if (target_type->is_stub () || TYPE_TARGET_STUB (target_type))
{
/* Nothing we can do. */
}
{
puts_filtered (" TYPE_ENDIANITY_NOT_DEFAULT");
}
- if (TYPE_STUB (type))
+ if (type->is_stub ())
{
puts_filtered (" TYPE_STUB");
}
#define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default)
-/* * This appears in a type's flags word if it is a stub type (e.g.,
- 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) ((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
arrays and ranges, in which TYPE_LENGTH of the array/range gets set
this->main_type->m_flag_nosign = has_no_signedness;
}
+ /* This appears in a type's flags word if it is a stub type (e.g.,
+ if someone referenced a type that wasn't defined in a source file
+ via (struct sir_not_appearing_in_this_film *)). */
+
bool is_stub () const
{
return this->main_type->m_flag_stub;
&& ((thistype)->num_fields () == 0) \
&& (!HAVE_CPLUS_STRUCT (thistype) \
|| TYPE_NFN_FIELDS (thistype) == 0) \
- && (TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
+ && ((thistype)->is_stub () || !TYPE_STUB_SUPPORTED (thistype)))
/* * A helper macro that returns the name of a type or "unnamed type"
if the type has no name. */
case TYPE_CODE_SET:
elttype = type->index_type ();
elttype = check_typedef (elttype);
- if (TYPE_STUB (elttype))
+ if (elttype->is_stub ())
{
fprintf_styled (stream, metadata_style.style (),
_("<incomplete type>"));
fprintf_filtered (stream, "\n");
if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
- if (TYPE_STUB (type))
+ if (type->is_stub ())
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
else
fprintfi_filtered (level + 4, stream, "<no data fields>\n");
case TYPE_CODE_SET:
elttype = type->index_type ();
elttype = check_typedef (elttype);
- if (TYPE_STUB (elttype))
+ if (elttype->is_stub ())
{
fprintf_styled (stream, metadata_style.style (), "<incomplete type>");
break;
try
{
/* Try not to let stub types leak out to Python. */
- if (TYPE_STUB (type))
+ if (type->is_stub ())
type = check_typedef (type);
}
catch (...)
== TYPE_CODE_METHOD);
/* If this is just a stub, then we don't have the real name here. */
- if (TYPE_STUB (new_sublist->fn_field.type))
+ if (new_sublist->fn_field.type->is_stub ())
{
if (!TYPE_SELF_TYPE (new_sublist->fn_field.type))
set_type_self_type (new_sublist->fn_field.type, type);
scribbling on existing structure type objects when new definitions
appear. */
if (! (type->code () == TYPE_CODE_UNDEF
- || TYPE_STUB (type)))
+ || type->is_stub ()))
{
complain_about_struct_wipeout (type);
as well as in check_typedef to deal with the (legitimate in
C though not C++) case of several types with the same name
in different source files. */
- if (TYPE_STUB (*type))
+ if ((*type)->is_stub ())
{
struct pending *ppt;
int i;
only a stub and we can't find and substitute its complete type, then
print appropriate string and return. */
- if (TYPE_STUB (real_type))
+ if (real_type->is_stub ())
{
fprintf_styled (stream, metadata_style.style (), _("<incomplete type>"));
return;