+/* This structure is space-critical.
+ Its layout has been tweaked to reduce the space used. */
+
+struct main_type
+{
+ /* Code for kind of type */
+
+ ENUM_BITFIELD(type_code) code : 8;
+
+ /* Flags about this type. These fields appear at this location
+ because they packs nicely here. See the TYPE_* macros for
+ documentation about these fields. */
+
+ unsigned int flag_unsigned : 1;
+ unsigned int flag_nosign : 1;
+ unsigned int flag_stub : 1;
+ unsigned int flag_target_stub : 1;
+ unsigned int flag_static : 1;
+ unsigned int flag_prototyped : 1;
+ unsigned int flag_incomplete : 1;
+ unsigned int flag_varargs : 1;
+ unsigned int flag_vector : 1;
+ unsigned int flag_stub_supported : 1;
+ unsigned int flag_nottext : 1;
+ unsigned int flag_fixed_instance : 1;
+
+ /* Number of fields described for this type. This field appears at
+ this location because it packs nicely here. */
+
+ 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
+ get_vptr_fieldno should be called to find it if possible.
+ get_vptr_fieldno will update this field if possible.
+ Otherwise the value is left at -1.
+
+ Unused if this type does not have virtual functions.
+
+ This field appears at this location because it packs nicely here. */
+
+ short vptr_fieldno;
+
+ /* Name of this type, or NULL if none.
+
+ This is used for printing only, except by poorly designed C++ code.
+ For looking up a name, look for a symbol in the VAR_DOMAIN. */
+
+ char *name;
+
+ /* Tag name for this type, or NULL if none. This means that the
+ name of the type consists of a keyword followed by the tag name.
+ Which keyword is determined by the type code ("struct" for
+ TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages
+ with this feature.
+
+ This is used for printing only, except by poorly designed C++ code.
+ For looking up a name, look for a symbol in the STRUCT_DOMAIN.
+ One more legitimate use is that if TYPE_FLAG_STUB is set, this is
+ the name to use to look for definitions in other files. */
+
+ char *tag_name;
+
+ /* Every type is now associated with a particular objfile, and the
+ type is allocated on the objfile_obstack for that objfile. One problem
+ however, is that there are times when gdb allocates new types while
+ it is not in the process of reading symbols from a particular objfile.
+ Fortunately, these happen when the type being created is a derived
+ type of an existing type, such as in lookup_pointer_type(). So
+ we can just allocate the new type using the same objfile as the
+ existing type, but to do this we need a backpointer to the objfile
+ from the existing type. Yes this is somewhat ugly, but without
+ major overhaul of the internal type system, it can't be avoided
+ for now. */
+
+ struct objfile *objfile;
+
+ /* For a pointer type, describes the type of object pointed to.
+ For an array type, describes the type of the elements.
+ For a function or method type, describes the type of the return value.
+ For a range type, describes the type of the full range.
+ For a complex type, describes the type of each coordinate.
+ Unused otherwise. */
+
+ struct type *target_type;
+
+ /* 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.
+ For range types, there are two "fields",
+ the minimum and maximum values (both inclusive).
+ For enum types, each possible value is described by one "field".
+ For a function or method type, a "field" for each parameter.
+ For C++ classes, there is one field for each base class (if it is
+ a derived class) plus one field for each class data member. Member
+ functions are recorded elsewhere.
+
+ Using a pointer to a separate array of fields
+ allows all types to have the same size, which is useful
+ because we can allocate the space for a type before
+ we know what to put in it. */
+
+ struct field
+ {
+ union field_location
+ {
+ /* Position of this field, counting in bits from start of
+ containing structure.
+ For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB.
+ For gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB.
+ For a range bound or enum value, this is the value itself. */