summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h51
1 files changed, 30 insertions, 21 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index caeab83688f..a7e541cde6b 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -273,11 +273,31 @@ enum type_code
#define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
& TYPE_FLAG_ADDRESS_CLASS_ALL)
+/* Array bound type. */
+enum array_bound_type
+{
+ BOUND_SIMPLE = 0,
+ BOUND_BY_VALUE_IN_REG,
+ BOUND_BY_REF_IN_REG,
+ BOUND_BY_VALUE_ON_STACK,
+ BOUND_BY_REF_ON_STACK,
+ BOUND_CANNOT_BE_DETERMINED
+};
+
+/* This structure is space-critical.
+ Its layout has been tweaked to reduce the space used. */
+
struct main_type
{
/* Code for kind of type */
- enum type_code code;
+ ENUM_BITFIELD(type_code) code : 8;
+
+ /* Array bounds. These fields appear at this location because
+ they pack nicely here. */
+
+ ENUM_BITFIELD(array_bound_type) upper_bound_type : 4;
+ ENUM_BITFIELD(array_bound_type) lower_bound_type : 4;
/* Name of this type, or NULL if none.
@@ -299,17 +319,6 @@ struct main_type
char *tag_name;
- /* FIXME, these should probably be restricted to a Fortran-specific
- field in some fashion. */
-#define BOUND_CANNOT_BE_DETERMINED 5
-#define BOUND_BY_REF_ON_STACK 4
-#define BOUND_BY_VALUE_ON_STACK 3
-#define BOUND_BY_REF_IN_REG 2
-#define BOUND_BY_VALUE_IN_REG 1
-#define BOUND_SIMPLE 0
- int upper_bound_type;
- int lower_bound_type;
-
/* Every type is now associated with a particular objfile, and the
type is allocated on the type_obstack for that objfile. One problem
however, is that there are times when gdb allocates new types while
@@ -341,6 +350,15 @@ struct main_type
short nfields;
+ /* Field number of the virtual function table pointer in
+ VPTR_BASETYPE. If -1, we were unable to find the virtual
+ function table pointer in initial symbol reading, and
+ fill_in_vptr_fieldno should be called to find it if possible.
+
+ Unused if this type does not have virtual functions. */
+
+ short vptr_fieldno;
+
/* For structure and union types, a description of each field.
For set and pascal array types, there is one "field",
whose type is the domain type of the set or array.
@@ -422,15 +440,6 @@ struct main_type
struct type *vptr_basetype;
- /* Field number of the virtual function table pointer in
- VPTR_BASETYPE. If -1, we were unable to find the virtual
- function table pointer in initial symbol reading, and
- fill_in_vptr_fieldno should be called to find it if possible.
-
- Unused if this type does not have virtual functions. */
-
- int vptr_fieldno;
-
/* Slot to point to additional language-specific fields of this type. */
union type_specific