gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 13 Jul 2020 02:58:52 +0000 (22:58 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 13 Jul 2020 02:58:52 +0000 (22:58 -0400)
Remove the macros, use the getters of `struct dynamic_prop` instead.

gdb/ChangeLog:

* gdbtypes.h (TYPE_LOW_BOUND_UNDEFINED,
TYPE_HIGH_BOUND_UNDEFINED): Remove.  Update all callers
to get the bound property's kind and check against
PROP_UNDEFINED.

Change-Id: I6a7641ac1aa3fa7fca0c21f00556f185f2e2d68c

gdb/ChangeLog
gdb/ada-tasks.c
gdb/eval.c
gdb/gdbtypes.c
gdb/gdbtypes.h

index e6acbb2fd834ed3ea73bc67d257b20ed39e587d7..3233cb5fa8fe6b0c96a09905b1f7b16fc92d6164 100644 (file)
@@ -1,3 +1,10 @@
+2020-07-12  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.h (TYPE_LOW_BOUND_UNDEFINED,
+       TYPE_HIGH_BOUND_UNDEFINED): Remove.  Update all callers
+       to get the bound property's kind and check against
+       PROP_UNDEFINED.
+
 2020-07-12  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND): Remove.  Update
index 7870a7847ad6ef9b68cb5dd18fe489cca992f837..27b458767a79c3731a2156f04bc4364056fb0816 100644 (file)
@@ -896,8 +896,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
              && eltype->code () == TYPE_CODE_PTR)
            idxtype = check_typedef (type->index_type ());
          if (idxtype != NULL
-             && !TYPE_LOW_BOUND_UNDEFINED (idxtype)
-             && !TYPE_HIGH_BOUND_UNDEFINED (idxtype))
+             && idxtype->bounds ()->low.kind () != PROP_UNDEFINED
+             && idxtype->bounds ()->high.kind () != PROP_UNDEFINED)
            {
              data->known_tasks_element = eltype;
              data->known_tasks_length =
index 2191e190927e6626c2b9b2ae2b70efece4f3ba75..dacd46da44fa303a32b830a901c0b6611788d441 100644 (file)
@@ -3212,7 +3212,8 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
          type = value_type (val);
          if (type->code () == TYPE_CODE_ARRAY
               && is_dynamic_type (type->index_type ())
-              && TYPE_HIGH_BOUND_UNDEFINED (type->index_type ()))
+              && (type->index_type ()->bounds ()->high.kind ()
+                 == PROP_UNDEFINED))
            return allocate_optimized_out_value (size_type);
        }
       else
index 507d2f6dacbe7d65e21732090a9da6d71250fffd..227f696b73636827a4d4037cd4fd232f7e84860e 100644 (file)
@@ -5117,10 +5117,11 @@ recursive_dump_type (struct type *type, int spaces)
     {
       printfi_filtered (spaces, "low %s%s  high %s%s\n",
                        plongest (type->bounds ()->low.const_val ()),
-                       TYPE_LOW_BOUND_UNDEFINED (type) ? " (undefined)" : "",
+                       (type->bounds ()->low.kind () == PROP_UNDEFINED
+                        ? " (undefined)" : ""),
                        plongest (type->bounds ()->high.const_val ()),
-                       TYPE_HIGH_BOUND_UNDEFINED (type) 
-                       ? " (undefined)" : "");
+                       (type->bounds ()->high.kind () == PROP_UNDEFINED
+                        ? " (undefined)" : ""));
     }
 
   switch (TYPE_SPECIFIC_FIELD (type))
index 044af479727fbe0b3654d01b264dfe21a34b0990..2d277ac688d0db136e82f445a02161e09fc27d39 100644 (file)
@@ -1594,10 +1594,6 @@ extern unsigned type_align (struct type *);
    space in struct type.  */
 extern bool set_type_align (struct type *, ULONGEST);
 
-#define TYPE_LOW_BOUND_UNDEFINED(range_type) \
-  (TYPE_LOW_BOUND_KIND(range_type) == PROP_UNDEFINED)
-#define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
-  (TYPE_HIGH_BOUND_KIND(range_type) == PROP_UNDEFINED)
 #define TYPE_HIGH_BOUND_KIND(range_type) \
   ((range_type)->bounds ()->high.kind ())
 #define TYPE_LOW_BOUND_KIND(range_type) \
@@ -1637,9 +1633,9 @@ extern bool set_type_align (struct type *, ULONGEST);
    index type.  */
 
 #define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
-   TYPE_HIGH_BOUND_UNDEFINED((arraytype)->index_type ())
+   ((arraytype)->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED)
 #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
-   TYPE_LOW_BOUND_UNDEFINED((arraytype)->index_type ())
+   ((arraytype)->index_type ()->bounds ()->low.kind () == PROP_UNDEFINED)
 
 #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
    ((arraytype)->index_type ()->bounds ()->high.const_val ())
This page took 0.037728 seconds and 4 git commands to generate.