From 0955bbf0c04ddb4caa7d64f93638bb5dddb4143d Mon Sep 17 00:00:00 2001 From: Michael Chastain Date: Wed, 20 Aug 2003 23:00:06 +0000 Subject: [PATCH] 2003-08-20 Michael Chastain * gdbtypes.h (struct main_type): Rearrange to save space. --- gdb/ChangeLog | 4 ++++ gdb/gdbtypes.h | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2fa84aba801..f33d2320268 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2003-08-20 Michael Chastain + + * gdbtypes.h (struct main_type): Rearrange to save space. + 2003-08-20 Michael Snyder * trad-frame.c: Comment typo fix. diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index e7d755a1746..554778af40b 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -272,11 +272,26 @@ enum type_code #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \ & TYPE_FLAG_ADDRESS_CLASS_ALL) +/* 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; + + /* These fields appear at this location because they pack nicely here. */ + /* 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 : 4; + int lower_bound_type : 4; /* Name of this type, or NULL if none. @@ -298,17 +313,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 @@ -340,6 +344,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. @@ -421,15 +434,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 -- 2.30.2