2003-08-21 Michael Chastain <mec@shout.net>
authorMichael Chastain <mec@google.com>
Fri, 22 Aug 2003 05:05:56 +0000 (05:05 +0000)
committerMichael Chastain <mec@google.com>
Fri, 22 Aug 2003 05:05:56 +0000 (05:05 +0000)
* gdbtypes.h: Change array bound type from an int to enum.

gdb/ChangeLog
gdb/gdbtypes.h

index 727e0d7..d410a3b 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-21  Michael Chastain  <mec@shout.net>
+
+       * gdbtypes.h: Change array bound type from an int to enum.
+
 2003-08-21  Andrew Cagney  <cagney@redhat.com>
 
        * config/sparc/tm-sp64.h: Delete #if !GDB_MULTI_ARCH and #if 0 code.
index 554778a..c7036f5 100644 (file)
@@ -272,6 +272,17 @@ 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.  */
 
@@ -281,17 +292,11 @@ struct main_type
 
   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;
+  /* 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.