+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct type) <has_no_signedness,
+ set_has_no_signedness>: New methods.
+ (TYPE_NOSIGN): Use type::has_no_signedness, change all write
+ call sites to use type::set_has_no_signedness.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_UNSIGNED): Remove, replace all uses with
}
if (name != NULL && strcmp (name, "char") == 0)
- TYPE_NOSIGN (type) = 1;
+ type->set_has_no_signedness (true);
return set_tid_type (of, tid, type);
}
}
if (name && strcmp (name, "char") == 0)
- TYPE_NOSIGN (type) = 1;
+ type->set_has_no_signedness (true);
maybe_set_alignment (cu, die, type);
builtin_type->builtin_char
= arch_integer_type (gdbarch, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
- TYPE_NOSIGN (builtin_type->builtin_char) = 1;
+ builtin_type->builtin_char->set_has_no_signedness (true);
builtin_type->builtin_signed_char
= arch_integer_type (gdbarch, TARGET_CHAR_BIT,
0, "signed char");
objfile_type->builtin_char
= init_integer_type (objfile, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
- TYPE_NOSIGN (objfile_type->builtin_char) = 1;
+ objfile_type->builtin_char->set_has_no_signedness (true);
objfile_type->builtin_signed_char
= init_integer_type (objfile, TARGET_CHAR_BIT,
0, "signed char");
"unsigned char" are distinct types; so we need an extra flag to
indicate the absence of a sign! */
-#define TYPE_NOSIGN(t) (TYPE_MAIN_TYPE (t)->flag_nosign)
+#define TYPE_NOSIGN(t) ((t)->has_no_signedness ())
/* * A compiler may supply dwarf instrumentation
that indicates the desired endian interpretation of the variable
documentation about these fields. */
unsigned int m_flag_unsigned : 1;
- unsigned int flag_nosign : 1;
+ unsigned int m_flag_nosign : 1;
unsigned int flag_stub : 1;
unsigned int flag_target_stub : 1;
unsigned int flag_prototyped : 1;
this->main_type->m_flag_unsigned = is_unsigned;
}
+ bool has_no_signedness () const
+ {
+ return this->main_type->m_flag_nosign;
+ }
+
+ void set_has_no_signedness (bool has_no_signedness)
+ {
+ this->main_type->m_flag_nosign = has_no_signedness;
+ }
+
/* * 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;
case btChar:
tp = init_integer_type (objfile, 8, 0, "char");
- TYPE_NOSIGN (tp) = 1;
+ tp->set_has_no_signedness (true);
break;
case btUChar:
break;
case 2:
rettype = init_integer_type (objfile, 8, 0, "char");
- TYPE_NOSIGN (rettype) = 1;
+ rettype->set_has_no_signedness (true);
break;
case 3:
rettype = init_integer_type (objfile, 16, 0, "short");
{
struct type *type = init_integer_type (objfile, TARGET_CHAR_BIT,
0, NULL);
- TYPE_NOSIGN (type) = 1;
+ type->set_has_no_signedness (true);
return type;
}
/* We used to do this only for subrange of self or subrange of int. */