+2021-04-01 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct type) <is_flag_enum,
+ set_is_flag_enum>: New methods.
+ (TYPE_FLAG_ENUM): Use type::is_flag_enum, change all
+ write call sites to use type::set_is_flag_enum.
+
2021-04-01 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_DECLARED_CLASS): Remove, replace all uses
type->set_is_unsigned (true);
if (flag_enum)
- TYPE_FLAG_ENUM (type) = 1;
+ type->set_is_flag_enum (true);
}
/* Given a DW_AT_enumeration_type die, set its type. We do not
#define TYPE_NOTTEXT(t) (((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_NOTTEXT)
-/* * True if this type is a "flag" enum. A flag enum is one where all
- the values are pairwise disjoint when "and"ed together. This
- affects how enum values are printed. */
-
-#define TYPE_FLAG_ENUM(t) (TYPE_MAIN_TYPE (t)->flag_flag_enum)
+#define TYPE_FLAG_ENUM(t) ((t)->is_flag_enum ())
/* * Constant type. If this is set, the corresponding type has a
const modifier. */
/* * True if this is an enum type with disjoint values. This
affects how the enum is printed. */
- unsigned int flag_flag_enum : 1;
+ unsigned int m_flag_flag_enum : 1;
/* * A discriminant telling us which field of the type_specific
union is being used for this type, if any. */
this->main_type->m_flag_declared_class = is_declared_class;
}
+ /* True if this type is a "flag" enum. A flag enum is one where all
+ the values are pairwise disjoint when "and"ed together. This
+ affects how enum values are printed. */
+
+ bool is_flag_enum () const
+ {
+ return this->main_type->m_flag_flag_enum;
+ }
+
+ void set_is_flag_enum (bool is_flag_enum)
+ {
+ this->main_type->m_flag_flag_enum = is_flag_enum;
+ }
+
/* * Assuming that THIS is a TYPE_CODE_FIXED_POINT, return a reference
to this type's fixed_point_info. */