Remove CHECK_TYPEDEF, use check_typedef instead
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 6 Jul 2015 20:05:06 +0000 (16:05 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 14 Jul 2015 20:42:16 +0000 (16:42 -0400)
I think that the CHECK_TYPEDEF macro is not necessary, and even a bit
annoying.  It makes unclear the fact that the "type" variables gets
overwritten.  It has actually bitten me a few times.  I think the
following, explicit form, is better.

  type = check_typedef (type);

This patches changes all instances of CHECK_TYPEDEF for an equivalent
call to check_typedef.  The bulk of the change was done with this sed:

  sed -i 's/CHECK_TYPEDEF (\([^)]*\));/\1 = check_typedef (\1);/' <file>.c

The ChangeLog was generated using David Malcom's generate_changelog.py.
I manually fixed those places where it gets the wrong function name,
hopefully all of them.

The patch was built-tested, and I ran a few smoke tests.

gdb/ChangeLog:
* gdbtypes.h (CHECK_TYPEDEF): Remove.
* aarch64-tdep.c (aarch64_return_in_memory): Replace CHECK_TYPEDEF
        with check_typedef.
* ada-lang.c (decode_constrained_packed_array_type): Likewise.
(ada_array_length): Likewise.
(find_parallel_type_by_descriptive_type): Likewise.
(ada_check_typedef): Likewise.
* arm-tdep.c (arm_return_in_memory): Likewise.
* ax-gdb.c (gen_trace_static_fields): Likewise.
(gen_struct_ref_recursive): Likewise.
* c-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
(variable: block COLONCOLON name): Likewise.
(qualified_name: TYPENAME COLONCOLON name): Likewise.
* c-lang.c (classify_type): Likewise.
* c-typeprint.c (c_print_type): Likewise.
(c_print_typedef): Likewise.
(c_type_print_base): Likewise.
* c-valprint.c (c_val_print): Likewise.
* compile/compile-c-types.c (convert_type): Likewise.
* compile/compile-object-load.c (get_out_value_type): Likewise.
* completer.c (add_struct_fields): Likewise.
(expression_completer): Likewise.
* cp-namespace.c (cp_find_type_baseclass_by_name): Likewise.
(cp_lookup_nested_symbol_1): Likewise.
(cp_lookup_nested_symbol): Likewise.
* cp-valprint.c (cp_print_value_fields): Likewise.
(cp_print_static_field): Likewise.
* d-valprint.c (d_val_print): Likewise.
* eval.c (evaluate_subexp_standard): Likewise.
(evaluate_subexp_for_sizeof): Likewise.
* f-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
* f-typeprint.c (f_type_print_base): Likewise.
* f-valprint.c (f_val_print): Likewise.
* gdbtypes.c (get_discrete_bounds): Likewise.
(create_array_type_with_stride): Likewise.
(type_name_no_tag_or_error): Likewise.
(lookup_struct_elt_type): Likewise.
(get_unsigned_type_max): Likewise.
(internal_type_vptr_fieldno): Likewise.
(set_type_vptr_fieldno): Likewise.
(internal_type_vptr_basetype): Likewise.
(set_type_vptr_basetype): Likewise.
        (get_vptr_fieldno): Likewise.
(is_integral_type): Likewise.
(is_scalar_type): Likewise.
        (is_scalar_type_recursive): Likewise.
(distance_to_ancestor): Likewise.
(is_unique_ancestor_worker): Likewise.
(check_types_equal): Likewise.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* gnu-v3-abi.c (gnuv3_dynamic_class): Likewise.
(gnuv3_get_vtable): Likewise.
(gnuv3_pass_by_reference): Likewise.
* go-exp.y (exp : SIZEOF_KEYWORD '(' type ')' %prec UNARY): Likewise.
* go-lang.c (gccgo_string_p): Likewise.
(go_classify_struct_type): Likewise.
* go-typeprint.c (go_print_type): Likewise.
* go-valprint.c (go_val_print): Likewise.
* guile/scm-math.c (vlscm_binop): Likewise.
* guile/scm-value.c (gdbscm_value_dynamic_type): Likewise.
(gdbscm_value_to_bytevector): Likewise.
(gdbscm_value_to_bool): Likewise.
(gdbscm_value_to_integer): Likewise.
(gdbscm_value_to_real): Likewise.
* infcall.c (call_function_by_hand_dummy): Likewise.
* infcmd.c (get_return_value): Likewise.
* jv-lang.c (is_object_type): Likewise.
* jv-typeprint.c (java_type_print_base): Likewise.
* jv-valprint.c (java_print_value_fields): Likewise.
(java_val_print): Likewise.
* linespec.c (find_methods): Likewise.
(collect_one_symbol): Likewise.
* m2-typeprint.c (m2_print_type): Likewise.
(m2_print_typedef): Likewise.
(m2_get_discrete_bounds): Likewise.
* m2-valprint.c (m2_print_long_set): Likewise.
(m2_print_unbounded_array): Likewise.
(m2_print_array_contents): Likewise.
(m2_val_print): Likewise.
* opencl-lang.c (opencl_print_type): Likewise.
* p-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
* p-typeprint.c (pascal_print_type): Likewise.
(pascal_print_typedef): Likewise.
(pascal_type_print_base): Likewise.
* p-valprint.c (pascal_val_print): Likewise.
(pascal_object_print_value_fields): Likewise.
(pascal_object_print_static_field): Likewise.
* python/py-type.c (typy_fields_items): Likewise.
(typy_get_composite): Likewise.
* python/py-value.c (valpy_get_dynamic_type): Likewise.
(valpy_binop): Likewise.
(valpy_long): Likewise.
(valpy_float): Likewise.
* stack.c (return_command): Likewise.
* symtab.c (check_field): Likewise.
(lookup_symbol_aux): Likewise.
* tic6x-tdep.c (tic6x_return_value): Likewise.
* typeprint.c (print_type_scalar): Likewise.
* valarith.c (value_vector_widen): Likewise.
* valops.c (value_cast): Likewise.
(value_assign): Likewise.
(do_search_struct_field): Likewise.
(search_struct_method): Likewise.
(find_method_list): Likewise.
* valprint.c (val_print_scalar_type_p): Likewise.
(valprint_check_validity): Likewise.
(generic_val_print): Likewise.
* value.c (unpack_double): Likewise.
(value_primitive_field): Likewise.
(unpack_bits_as_long): Likewise.

51 files changed:
gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/ada-lang.c
gdb/arm-tdep.c
gdb/ax-gdb.c
gdb/c-exp.y
gdb/c-lang.c
gdb/c-typeprint.c
gdb/c-valprint.c
gdb/compile/compile-c-types.c
gdb/compile/compile-object-load.c
gdb/completer.c
gdb/cp-namespace.c
gdb/cp-valprint.c
gdb/d-valprint.c
gdb/eval.c
gdb/f-exp.y
gdb/f-typeprint.c
gdb/f-valprint.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/gnu-v2-abi.c
gdb/gnu-v3-abi.c
gdb/go-exp.y
gdb/go-lang.c
gdb/go-typeprint.c
gdb/go-valprint.c
gdb/guile/scm-math.c
gdb/guile/scm-value.c
gdb/infcall.c
gdb/infcmd.c
gdb/jv-lang.c
gdb/jv-typeprint.c
gdb/jv-valprint.c
gdb/linespec.c
gdb/m2-typeprint.c
gdb/m2-valprint.c
gdb/opencl-lang.c
gdb/p-exp.y
gdb/p-typeprint.c
gdb/p-valprint.c
gdb/python/py-type.c
gdb/python/py-value.c
gdb/stack.c
gdb/symtab.c
gdb/tic6x-tdep.c
gdb/typeprint.c
gdb/valarith.c
gdb/valops.c
gdb/valprint.c
gdb/value.c

index 2ace643d46f526579ae647a31b2a8b79bca43ffa..cd9139f38c770f0b6274996a7800889ebcd9e127 100644 (file)
@@ -1,3 +1,56 @@
+2015-07-14  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * gdbtypes.h (CHECK_TYPEDEF): Remove.
+       * aarch64-tdep.c (aarch64_return_in_memory): Replace CHECK_TYPEDEF
+       with check_typedef.
+       * ada-lang.c (decode_constrained_packed_array_type): Likewise.
+       (ada_array_length): Likewise.
+       (find_parallel_type_by_descriptive_type): Likewise.
+       (ada_check_typedef): Likewise.
+       * arm-tdep.c (arm_return_in_memory): Likewise.
+       * ax-gdb.c (gen_trace_static_fields): Likewise.
+       (gen_struct_ref_recursive): Likewise.
+       * c-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
+       (variable: block COLONCOLON name): Likewise.
+       (qualified_name: TYPENAME COLONCOLON name): Likewise.
+       * c-lang.c (classify_type): Likewise.
+       * c-typeprint.c (c_print_type): Likewise.
+       (c_print_typedef): Likewise.
+       (c_type_print_base): Likewise.
+       * c-valprint.c (c_val_print): Likewise.
+       * compile/compile-c-types.c (convert_type): Likewise.
+       * compile/compile-object-load.c (get_out_value_type): Likewise.
+       * completer.c (add_struct_fields): Likewise.
+       (expression_completer): Likewise.
+       * cp-namespace.c (cp_find_type_baseclass_by_name): Likewise.
+       (cp_lookup_nested_symbol_1): Likewise.
+       (cp_lookup_nested_symbol): Likewise.
+       * cp-valprint.c (cp_print_value_fields): Likewise.
+       (cp_print_static_field): Likewise.
+       * d-valprint.c (d_val_print): Likewise.
+       * eval.c (evaluate_subexp_standard): Likewise.
+       (evaluate_subexp_for_sizeof): Likewise.
+       * f-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
+       * f-typeprint.c (f_type_print_base): Likewise.
+       * f-valprint.c (f_val_print): Likewise.
+       * gdbtypes.c (get_discrete_bounds): Likewise.
+       (create_array_type_with_stride): Likewise.
+       (type_name_no_tag_or_error): Likewise.
+       (lookup_struct_elt_type): Likewise.
+       (get_unsigned_type_max): Likewise.
+       (internal_type_vptr_fieldno): Likewise.
+       (set_type_vptr_fieldno): Likewise.
+       (internal_type_vptr_basetype): Likewise.
+       (set_type_vptr_basetype): Likewise.
+       (get_vptr_fieldno): Likewise.
+       (is_integral_type): Likewise.
+       (is_scalar_type): Likewise.
+       (is_scalar_type_recursive): Likewise.
+       (distance_to_ancestor): Likewise.
+       (is_unique_ancestor_worker): Likewise.
+       (check_types_equal): Likewise.
+       * gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
+
 2015-07-14  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * dwarf2read.c (find_slot_in_mapped_hash): Extend language support to
index b6135329a21a619a156f025f7ad6dc66305dbd04..2cecad0f857e03cfbce63e8ceee6d2b21dbdf7eb 100644 (file)
@@ -2104,7 +2104,7 @@ aarch64_return_in_memory (struct gdbarch *gdbarch, struct type *type)
   int nRc;
   enum type_code code;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* In the AArch64 ABI, "integer" like aggregate types are returned
      in registers.  For an aggregate type to be integer like, its size
index 782447a6fd3368ecacb860989271fc5456dd207a..06c72ee9c298ecc01f1df3f8b6a390c7a330a65f 100644 (file)
@@ -2238,7 +2238,7 @@ decode_constrained_packed_array_type (struct type *type)
       lim_warning (_("could not find bounds information on packed array"));
       return NULL;
     }
-  CHECK_TYPEDEF (shadow_type);
+  shadow_type = check_typedef (shadow_type);
 
   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
     {
@@ -3056,7 +3056,7 @@ ada_array_length (struct value *arr, int n)
       high = value_as_long (desc_one_bound (desc_bounds (arr), n, 1));
     }
 
-  CHECK_TYPEDEF (arr_type);
+  arr_type = check_typedef (arr_type);
   index_type = TYPE_INDEX_TYPE (arr_type);
   if (index_type != NULL)
     {
@@ -7841,7 +7841,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name)
        result = tmp;
       else
        {
-         CHECK_TYPEDEF (result);
+         result = check_typedef (result);
          if (HAVE_GNAT_AUX_INFO (result))
            result = TYPE_DESCRIPTIVE_TYPE (result);
          else
@@ -8943,7 +8943,7 @@ ada_check_typedef (struct type *type)
       && is_thick_pntr (ada_typedef_target_type (type)))
     return type;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
       || !TYPE_STUB (type)
       || TYPE_TAG_NAME (type) == NULL)
index 527bd01875d337e8786f3d8f21cdef3a5d79fce9..a458c9a1d5dfaaabf80cfb68dafc6d38da9f2524 100644 (file)
@@ -9008,7 +9008,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
   int nRc;
   enum type_code code;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* In the ARM ABI, "integer" like aggregate types are returned in
      registers.  For an aggregate type to be integer like, its size
index 38dacac84650b7628fa4121e9ea989028035a339..b035486a2f1246826904223eecdb597fce83e547 100644 (file)
@@ -322,7 +322,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch,
   int i, nbases = TYPE_N_BASECLASSES (type);
   struct axs_value value;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
     {
@@ -1438,7 +1438,7 @@ gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
   int i, rslt;
   int nbases = TYPE_N_BASECLASSES (type);
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
     {
index f458545e839e387773391f643696cd8962b3c249..3ea544d8efa3092863b719d20b579cfe1716ad31 100644 (file)
@@ -793,7 +793,7 @@ exp :       SIZEOF '(' type ')'     %prec UNARY
                                              (parse_language (pstate),
                                               parse_gdbarch (pstate),
                                               "int"));
-                         CHECK_TYPEDEF (type);
+                         type = check_typedef (type);
 
                            /* $5.3.3/2 of the C++ Standard (n3290 draft)
                               says of sizeof:  "When applied to a reference
@@ -985,7 +985,7 @@ variable:   block COLONCOLON name
 qualified_name:        TYPENAME COLONCOLON name
                        {
                          struct type *type = $1.type;
-                         CHECK_TYPEDEF (type);
+                         type = check_typedef (type);
                          if (!type_aggregate_p (type))
                            error (_("`%s' is not defined as an aggregate type."),
                                   TYPE_SAFE_NAME (type));
@@ -1001,7 +1001,7 @@ qualified_name:   TYPENAME COLONCOLON name
                          struct stoken tmp_token;
                          char *buf;
 
-                         CHECK_TYPEDEF (type);
+                         type = check_typedef (type);
                          if (!type_aggregate_p (type))
                            error (_("`%s' is not defined as an aggregate type."),
                                   TYPE_SAFE_NAME (type));
index 4b44b950ee695e1eb0ced44aaf981c7b13c7d65e..cbc7a9e7b9979701bb353dbbdb95d85e58ae5923 100644 (file)
@@ -124,7 +124,7 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
          /* Perhaps check_typedef did not update the target type.  In
             this case, force the lookup again and hope it works out.
             It never will for C, but it might for C++.  */
-         CHECK_TYPEDEF (elttype);
+         elttype = check_typedef (elttype);
        }
     }
 
index 421b72014865e17521b142f907aeb12a88546a79..708ace0f3b7335e2e5a29fa80867f628aa43db94 100644 (file)
@@ -89,7 +89,7 @@ c_print_type (struct type *type,
   const char *local_name;
 
   if (show > 0)
-    CHECK_TYPEDEF (type);
+    type = check_typedef (type);
 
   local_name = find_typedef_in_hash (flags, type);
   if (local_name != NULL)
@@ -144,7 +144,7 @@ c_print_typedef (struct type *type,
                 struct symbol *new_symbol,
                 struct ui_file *stream)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   fprintf_filtered (stream, "typedef ");
   type_print (type, "", stream, 0);
   if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
@@ -876,7 +876,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
       return;
     }
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index d76a206e25f5e108e858e9b83464e0743e95a3ac..2009e953a95eaad9914a36495c508c6bb9cbc514 100644 (file)
@@ -488,7 +488,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
 {
   struct type *unresolved_type = type;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
index 1ad3dd9b77aeb8ec4a5f7deb99d46ff5054b26ca..77fbd686db0cee14150864578f123814968927e9 100644 (file)
@@ -383,7 +383,7 @@ convert_type (struct compile_c_instance *context, struct type *type)
 
   /* We don't ever have to deal with typedefs in this code, because
      those are only needed as symbols by the C compiler.  */
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   inst.type = type;
   found = htab_find (context->type_map, &inst);
index 82987482c7b39ab764d778ff631abf3693a44cc2..162227ab01772fc6e832b9f09a15cd32c97dc60b 100644 (file)
@@ -474,14 +474,14 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
     error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
 
   gdb_type = SYMBOL_TYPE (gdb_val_sym);
-  CHECK_TYPEDEF (gdb_type);
+  gdb_type = check_typedef (gdb_type);
 
   gdb_ptr_type_sym = block_lookup_symbol (block, COMPILE_I_EXPR_PTR_TYPE,
                                          VAR_DOMAIN);
   if (gdb_ptr_type_sym == NULL)
     error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
   gdb_ptr_type = SYMBOL_TYPE (gdb_ptr_type_sym);
-  CHECK_TYPEDEF (gdb_ptr_type);
+  gdb_ptr_type = check_typedef (gdb_ptr_type);
   if (TYPE_CODE (gdb_ptr_type) != TYPE_CODE_PTR)
     error (_("Type of \"%s\" is not a pointer"), COMPILE_I_EXPR_PTR_TYPE);
   gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_ptr_type);
index fd52a0400b1eefce77bd509467fb6efdc66b8362..d1ebf67f08c5b3001ef349efbfc1f44edc957acb 100644 (file)
@@ -344,7 +344,7 @@ add_struct_fields (struct type *type, VEC (char_ptr) **output,
   int computed_type_name = 0;
   const char *type_name = NULL;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   for (i = 0; i < TYPE_NFIELDS (type); ++i)
     {
       if (i < TYPE_N_BASECLASSES (type))
@@ -415,7 +415,7 @@ expression_completer (struct cmd_list_element *ignore,
     {
       for (;;)
        {
-         CHECK_TYPEDEF (type);
+         type = check_typedef (type);
          if (TYPE_CODE (type) != TYPE_CODE_PTR
              && TYPE_CODE (type) != TYPE_CODE_REF)
            break;
index ab7d0cb43b88063a0086498ac59513cd0e2ac82e..41f8d35fce001960860d880b927f27dc209af698 100644 (file)
@@ -882,7 +882,7 @@ cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
 {
   int i;
 
-  CHECK_TYPEDEF (parent_type);
+  parent_type = check_typedef (parent_type);
   for (i = 0; i < TYPE_N_BASECLASSES (parent_type); ++i)
     {
       struct type *type = check_typedef (TYPE_BASECLASS (parent_type, i));
@@ -1002,7 +1002,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
     }
 
   /* If this is a class with baseclasses, search them next.  */
-  CHECK_TYPEDEF (container_type);
+  container_type = check_typedef (container_type);
   if (TYPE_N_BASECLASSES (container_type) > 0)
     {
       sym = find_symbol_in_baseclass (container_type, nested_name, block,
@@ -1029,7 +1029,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
      original type.  */
   struct type *saved_parent_type = parent_type;
 
-  CHECK_TYPEDEF (parent_type);
+  parent_type = check_typedef (parent_type);
 
   if (symbol_lookup_debug)
     {
index feb3a66721877064b9212fc2e8a5f14727735943..0c32f04286abc8134cba77a3a1124dbaf63873df 100644 (file)
@@ -165,7 +165,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
   int fields_seen = 0;
   static int last_set_recurse = -1;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   
   if (recurse == 0)
     {
@@ -669,7 +669,7 @@ cp_print_static_field (struct type *type,
       addr = value_address (val);
       obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
                    sizeof (CORE_ADDR));
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
       cp_print_value_fields (type, value_enclosing_type (val),
                             value_contents_for_printing (val),
                             value_embedded_offset (val), addr,
index 89efb053761149782907f99124d99508f4e590d1..5f4df329de9351b72d91adcf82285585d9df2af4 100644 (file)
@@ -80,7 +80,7 @@ d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 {
   int ret;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
       case TYPE_CODE_STRUCT:
index 6bbd495990cbdb1d5d0028f64f93d14dc8b5d109..5699aea25cc650d48bc0f04cb91243ebc8b79fb1 100644 (file)
@@ -1226,7 +1226,7 @@ evaluate_subexp_standard (struct type *expect_type,
 
            block_for_pc (funaddr);
 
-           CHECK_TYPEDEF (val_type);
+           val_type = check_typedef (val_type);
          
            if ((val_type == NULL) 
                || (TYPE_CODE(val_type) == TYPE_CODE_ERROR))
@@ -3089,7 +3089,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
   /* $5.3.3/2 of the C++ Standard (n3290 draft) says of sizeof:
      "When applied to a reference or a reference type, the result is
      the size of the referenced type."  */
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   if (exp->language_defn->la_language == language_cplus
       && TYPE_CODE (type) == TYPE_CODE_REF)
     type = check_typedef (TYPE_TARGET_TYPE (type));
index 144e17f318cffa83ddee154eea10a08b441c2daf..94494f0891c25a7d70797624cc6abefb33f0acb7 100644 (file)
@@ -487,7 +487,7 @@ exp :       SIZEOF '(' type ')'     %prec UNARY
                          write_exp_elt_type (pstate,
                                              parse_f_type (pstate)
                                              ->builtin_integer);
-                         CHECK_TYPEDEF ($3);
+                         $3 = check_typedef ($3);
                          write_exp_elt_longcst (pstate,
                                                 (LONGEST) TYPE_LENGTH ($3));
                          write_exp_elt_opcode (pstate, OP_LONG); }
index 4957e1f9b9dedfa514ee6c1ce44a5d3995fe3948..590ed73d32fa0e85d37fd7b0c1b4f1d6ef86d1d9 100644 (file)
@@ -273,7 +273,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
     }
 
   if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
-    CHECK_TYPEDEF (type);
+    type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index 8d74f03574c2147a5a98da9fa931cdd881f84cfa..2e5519b18ef6a32e99f339e2b49aebd7b354d539 100644 (file)
@@ -264,7 +264,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
   CORE_ADDR addr;
   int index;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_STRING:
index ca86fbd3c21a7ff2d038f8b7880ac0489b1ed159..e44fd4fa2914ecacb18cf69d54c46ccca9760604 100644 (file)
@@ -898,7 +898,7 @@ has_static_range (const struct range_bounds *bounds)
 int
 get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_RANGE:
@@ -1074,7 +1074,7 @@ create_array_type_with_stride (struct type *result_type,
 
       if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
        low_bound = high_bound = 0;
-      CHECK_TYPEDEF (element_type);
+      element_type = check_typedef (element_type);
       /* Be careful when setting the array length.  Ada arrays can be
         empty arrays with the high_bound being smaller than the low_bound.
         In such cases, the array length should be zero.  */
@@ -1383,7 +1383,7 @@ type_name_no_tag_or_error (struct type *type)
   const char *name;
   struct objfile *objfile;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   name = type_name_no_tag (type);
   if (name != NULL)
@@ -1562,7 +1562,7 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
 
   for (;;)
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
       if (TYPE_CODE (type) != TYPE_CODE_PTR
          && TYPE_CODE (type) != TYPE_CODE_REF)
        break;
@@ -1639,7 +1639,7 @@ get_unsigned_type_max (struct type *type, ULONGEST *max)
 {
   unsigned int n;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && TYPE_UNSIGNED (type));
   gdb_assert (TYPE_LENGTH (type) <= sizeof (ULONGEST));
 
@@ -1656,7 +1656,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
 {
   unsigned int n;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && !TYPE_UNSIGNED (type));
   gdb_assert (TYPE_LENGTH (type) <= sizeof (LONGEST));
 
@@ -1675,7 +1675,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
 int
 internal_type_vptr_fieldno (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
   if (!HAVE_CPLUS_STRUCT (type))
@@ -1688,7 +1688,7 @@ internal_type_vptr_fieldno (struct type *type)
 void
 set_type_vptr_fieldno (struct type *type, int fieldno)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
   if (!HAVE_CPLUS_STRUCT (type))
@@ -1702,7 +1702,7 @@ set_type_vptr_fieldno (struct type *type, int fieldno)
 struct type *
 internal_type_vptr_basetype (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
   gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_CPLUS_STUFF);
@@ -1714,7 +1714,7 @@ internal_type_vptr_basetype (struct type *type)
 void
 set_type_vptr_basetype (struct type *type, struct type *basetype)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
   if (!HAVE_CPLUS_STRUCT (type))
@@ -1737,7 +1737,7 @@ set_type_vptr_basetype (struct type *type, struct type *basetype)
 int
 get_vptr_fieldno (struct type *type, struct type **basetypep)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   if (TYPE_VPTR_FIELDNO (type) < 0)
     {
@@ -2679,7 +2679,7 @@ can_dereference (struct type *t)
 {
   /* FIXME: Should we return true for references as well as
      pointers?  */
-  CHECK_TYPEDEF (t);
+  t = check_typedef (t);
   return
     (t != NULL
      && TYPE_CODE (t) == TYPE_CODE_PTR
@@ -2689,7 +2689,7 @@ can_dereference (struct type *t)
 int
 is_integral_type (struct type *t)
 {
-  CHECK_TYPEDEF (t);
+  t = check_typedef (t);
   return
     ((t != NULL)
      && ((TYPE_CODE (t) == TYPE_CODE_INT)
@@ -2705,7 +2705,7 @@ is_integral_type (struct type *t)
 static int
 is_scalar_type (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
@@ -2727,7 +2727,7 @@ is_scalar_type (struct type *type)
 int
 is_scalar_type_recursive (struct type *t)
 {
-  CHECK_TYPEDEF (t);
+  t = check_typedef (t);
 
   if (is_scalar_type (t))
     return 1;
@@ -2809,8 +2809,8 @@ distance_to_ancestor (struct type *base, struct type *dclass, int is_public)
   int i;
   int d;
 
-  CHECK_TYPEDEF (base);
-  CHECK_TYPEDEF (dclass);
+  base = check_typedef (base);
+  dclass = check_typedef (dclass);
 
   if (class_types_same_p (base, dclass))
     return 0;
@@ -2859,8 +2859,8 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
 {
   int i, count = 0;
 
-  CHECK_TYPEDEF (base);
-  CHECK_TYPEDEF (dclass);
+  base = check_typedef (base);
+  dclass = check_typedef (dclass);
 
   for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
     {
@@ -3179,8 +3179,8 @@ static int
 check_types_equal (struct type *type1, struct type *type2,
                   VEC (type_equality_entry_d) **worklist)
 {
-  CHECK_TYPEDEF (type1);
-  CHECK_TYPEDEF (type2);
+  type1 = check_typedef (type1);
+  type2 = check_typedef (type2);
 
   if (type1 == type2)
     return 1;
index fd3bc0ed5be698d8eed323a4e98ecf954e425ff4..c166e4876cabfbe520d7a6f1687236f5d6e10616 100644 (file)
@@ -1814,11 +1814,6 @@ extern void add_dyn_prop
 
 extern struct type *check_typedef (struct type *);
 
-#define CHECK_TYPEDEF(TYPE)                    \
-  do {                                         \
-    (TYPE) = check_typedef (TYPE);             \
-  } while (0)
-
 extern void check_stub_method_group (struct type *, int);
 
 extern char *gdb_mangle_name (struct type *, int, int);
index 68b734c1b18fc0a1e0b633a2222c29186819e5d2..c508b552666efd64fe36faad386e6c440a7775c3 100644 (file)
@@ -204,7 +204,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
 
   /* Get declared type.  */
   known_type = value_type (v);
-  CHECK_TYPEDEF (known_type);
+  known_type = check_typedef (known_type);
   /* RTTI works only or class objects.  */
   if (TYPE_CODE (known_type) != TYPE_CODE_STRUCT)
     return NULL;
@@ -225,7 +225,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
   /* Make sure our basetype and known type match, otherwise, cast
      so we can get at the vtable properly.  */
   btype = known_type_vptr_basetype;
-  CHECK_TYPEDEF (btype);
+  btype = check_typedef (btype);
   if (btype != known_type )
     {
       v = value_cast (btype, v);
index 5c040114d862120ebd435c199e1c6d8f8ac25a10..e233fe6b28de4e5aa02cef2f059f16648f7aa76f 100644 (file)
@@ -202,7 +202,7 @@ gnuv3_dynamic_class (struct type *type)
 {
   int fieldnum, fieldelem;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
 
@@ -253,7 +253,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch,
   struct value *vtable_pointer;
   CORE_ADDR vtable_address;
 
-  CHECK_TYPEDEF (container_type);
+  container_type = check_typedef (container_type);
   gdb_assert (TYPE_CODE (container_type) == TYPE_CODE_STRUCT);
 
   /* If this type does not have a virtual table, don't read the first
@@ -1293,7 +1293,7 @@ gnuv3_pass_by_reference (struct type *type)
 {
   int fieldnum, fieldelem;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* We're only interested in things that can have methods.  */
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT
index bada4cff54dab62fe5b9fc51d830c35b012e60c2..a719d2f1680b9cae0ef6e6b67cdef26b8aadabaf 100644 (file)
@@ -508,7 +508,7 @@ exp :       SIZEOF_KEYWORD '(' type ')'  %prec UNARY
                          write_exp_elt_type
                            (pstate,
                             parse_type (pstate)->builtin_unsigned_int);
-                         CHECK_TYPEDEF ($3);
+                         $3 = check_typedef ($3);
                          write_exp_elt_longcst (pstate,
                                                 (LONGEST) TYPE_LENGTH ($3));
                          write_exp_elt_opcode (pstate, OP_LONG);
index b48467d838c5fb12a797ce126b076ecc8847d89c..2835dd9e3a2a2b66fa8d1150dd65543a2da75b5c 100644 (file)
@@ -77,8 +77,8 @@ gccgo_string_p (struct type *type)
       struct type *type0 = TYPE_FIELD_TYPE (type, 0);
       struct type *type1 = TYPE_FIELD_TYPE (type, 1);
 
-      CHECK_TYPEDEF (type0);
-      CHECK_TYPEDEF (type1);
+      type0 = check_typedef (type0);
+      type1 = check_typedef (type1);
 
       if (TYPE_CODE (type0) == TYPE_CODE_PTR
          && strcmp (TYPE_FIELD_NAME (type, 0), "__data") == 0
@@ -87,7 +87,7 @@ gccgo_string_p (struct type *type)
        {
          struct type *target_type = TYPE_TARGET_TYPE (type0);
 
-         CHECK_TYPEDEF (target_type);
+         target_type = check_typedef (target_type);
 
          if (TYPE_CODE (target_type) == TYPE_CODE_INT
              && TYPE_LENGTH (target_type) == 1
@@ -119,7 +119,7 @@ sixg_string_p (struct type *type)
 enum go_type
 go_classify_struct_type (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* Recognize strings as they're useful to be able to print without
      pretty-printers.  */
index c35a552a733ebd69b4316e51a9e304fb158f2a81..6e7625ed7e570352e399dc08df12c26372662309 100644 (file)
@@ -48,7 +48,7 @@ go_print_type (struct type *type, const char *varstring,
 {
   /* Borrowed from c-typeprint.c.  */
   if (show > 0)
-    CHECK_TYPEDEF (type);
+    type = check_typedef (type);
 
   /* Print the type of "abc" as "string", not char[4].  */
   if (TYPE_CODE (type) == TYPE_CODE_ARRAY
index 5779a1cbf130ff6271f2a8c7f33ad990f1888d10..a40d6f2da1305346228e5a3e9d263c1b302f220a 100644 (file)
@@ -91,7 +91,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
              const struct value *val,
              const struct value_print_options *options)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index 4b6bb5d85c428780261983bbb9294f39c67b353d..5fbe0eb07dd0018a8c0f95a70c939a4b3c50a04a 100644 (file)
@@ -186,9 +186,9 @@ vlscm_binop (enum valscm_binary_opcode opcode, SCM x, SCM y,
            struct type *ltype = value_type (arg1);
            struct type *rtype = value_type (arg2);
 
-           CHECK_TYPEDEF (ltype);
+           ltype = check_typedef (ltype);
            ltype = STRIP_REFERENCE (ltype);
-           CHECK_TYPEDEF (rtype);
+           rtype = check_typedef (rtype);
            rtype = STRIP_REFERENCE (rtype);
 
            if (TYPE_CODE (ltype) == TYPE_CODE_PTR
@@ -206,9 +206,9 @@ vlscm_binop (enum valscm_binary_opcode opcode, SCM x, SCM y,
            struct type *ltype = value_type (arg1);
            struct type *rtype = value_type (arg2);
 
-           CHECK_TYPEDEF (ltype);
+           ltype = check_typedef (ltype);
            ltype = STRIP_REFERENCE (ltype);
-           CHECK_TYPEDEF (rtype);
+           rtype = check_typedef (rtype);
            rtype = STRIP_REFERENCE (rtype);
 
            if (TYPE_CODE (ltype) == TYPE_CODE_PTR
index 3789c38e54a27a7d2107af573bc23e67645077f6..d26ab0d745937a03cd7c2b87f9579c79b72dec6e 100644 (file)
@@ -581,7 +581,7 @@ gdbscm_value_dynamic_type (SCM self)
        = make_cleanup_value_free_to_mark (value_mark ());
 
       type = value_type (value);
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
 
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
@@ -906,7 +906,7 @@ gdbscm_value_to_bytevector (SCM self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
       length = TYPE_LENGTH (type);
       contents = value_contents (value);
     }
@@ -950,7 +950,7 @@ gdbscm_value_to_bool (SCM self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
@@ -993,7 +993,7 @@ gdbscm_value_to_integer (SCM self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
@@ -1039,7 +1039,7 @@ gdbscm_value_to_real (SCM self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
index e3bd72a71b6f21d21c68356700e9f79b1053394b..139c361aa403fb59b16886d13e2b03fa0228f1f4 100644 (file)
@@ -757,7 +757,7 @@ call_function_by_hand_dummy (struct value *function,
   if (!values_type)
     values_type = builtin_type (gdbarch)->builtin_int;
 
-  CHECK_TYPEDEF (values_type);
+  values_type = check_typedef (values_type);
 
   /* Are we returning a value using a structure return (passing a
      hidden argument pointing to storage) or a normal value return?
index 03282a71da06f6280a1850522ed052fcf8faf859..4948d279875bc5cc1df4255010ae5d6ffcc7cff2 100644 (file)
@@ -1530,7 +1530,7 @@ get_return_value (struct value *function, struct type *value_type,
 
   gdbarch = get_regcache_arch (stop_regs);
 
-  CHECK_TYPEDEF (value_type);
+  value_type = check_typedef (value_type);
   gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
 
   /* FIXME: 2003-09-27: When returning from a nested inferior function
index 0d635c7896b420648cf8d4829fd9dce4cefc9d65..fee816c4e57717b4c18360d935394c74d59ca7db 100644 (file)
@@ -610,7 +610,7 @@ get_java_object_header_size (struct gdbarch *gdbarch)
 int
 is_object_type (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
     {
       struct type *ttype = check_typedef (TYPE_TARGET_TYPE (type));
index 0bf6d10b31e66022d8eaa83cefc9ce33a7e38eff..3ea81c3b171abaed046891fd049976ee30e71921 100644 (file)
@@ -110,7 +110,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
       return;
     }
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index 1ad599bfa8041b777408085dfd5364bf189a7e36..9fc8f50ed8ff1e279997df402106bfc7bab418e3 100644 (file)
@@ -273,7 +273,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
 {
   int i, len, n_baseclasses;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   fprintf_filtered (stream, "{");
   len = TYPE_NFIELDS (type);
@@ -462,7 +462,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
   struct type *target_type;
   CORE_ADDR addr;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_PTR:
index 65155d98dda47b02d8413d171f3772edfb870f63..81f526d6f6b1428ad405c9796d2d8bdb57e9cf2a 100644 (file)
@@ -1129,7 +1129,7 @@ find_methods (struct type *t, const char *name,
     {
       int method_counter;
 
-      CHECK_TYPEDEF (t);
+      t = check_typedef (t);
 
       /* Loop over each method name.  At this level, all overloads of a name
          are counted as a single name.  There is an inner loop which loops over
@@ -2717,7 +2717,7 @@ collect_one_symbol (struct symbol *sym, void *d)
     return 1; /* Continue iterating.  */
 
   t = SYMBOL_TYPE (sym);
-  CHECK_TYPEDEF (t);
+  t = check_typedef (t);
   if (TYPE_CODE (t) != TYPE_CODE_STRUCT
       && TYPE_CODE (t) != TYPE_CODE_UNION
       && TYPE_CODE (t) != TYPE_CODE_NAMESPACE)
index be198722bf9862bd538951c9fcd53a8fc69de82c..a1a33e53802dad1c160f4eecf1e8938de0dc5625 100644 (file)
@@ -74,7 +74,7 @@ m2_print_type (struct type *type, const char *varstring,
               int show, int level,
               const struct type_print_options *flags)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   QUIT;
 
@@ -160,7 +160,7 @@ void
 m2_print_typedef (struct type *type, struct symbol *new_symbol,
                  struct ui_file *stream)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   fprintf_filtered (stream, "TYPE ");
   if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
       || strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
@@ -373,7 +373,7 @@ m2_is_long_set (struct type *type)
 static int
 m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_CHAR:
index 7afcce3056f7308f41829b9989481e5f10676b2e..f59293331f586de21a28b20003a7c9abd410304e 100644 (file)
@@ -81,7 +81,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
   struct type *target;
   int bitval;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   fprintf_filtered (stream, "{");
   len = TYPE_NFIELDS (type);
@@ -167,7 +167,7 @@ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
   LONGEST len;
   struct value *val;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   content_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
 
   addr = unpack_pointer (TYPE_FIELD_TYPE (type, 0),
@@ -268,7 +268,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
                         const struct value_print_options *options,
                         int len)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   if (TYPE_LENGTH (type) > 0)
     {
@@ -319,7 +319,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
   struct type *elttype;
   CORE_ADDR addr;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
@@ -406,7 +406,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
     case TYPE_CODE_SET:
       elttype = TYPE_INDEX_TYPE (type);
-      CHECK_TYPEDEF (elttype);
+      elttype = check_typedef (elttype);
       if (TYPE_STUB (elttype))
        {
          fprintf_filtered (stream, _("<incomplete type>"));
index dd1e944aacdbf08cd340e0fea23702b787b36517..6583d158d56e7bc6217ebbd5a01c99b692d9cd32 100644 (file)
@@ -1007,7 +1007,7 @@ opencl_print_type (struct type *type, const char *varstring,
      be printed using their TYPE_NAME.  */
   if (show > 0)
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
       if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
          && TYPE_NAME (type) != NULL)
        show = 0;
index 9e2dc829d7ff332ee6603a24f60b5cc6757174e1..5d5c22b6be9e7d33348d41aae280954305c33851 100644 (file)
@@ -596,7 +596,7 @@ exp :       SIZEOF '(' type ')'     %prec UNARY
                          write_exp_elt_type (pstate,
                                            parse_type (pstate)->builtin_int);
                          current_type = parse_type (pstate)->builtin_int;
-                         CHECK_TYPEDEF ($3);
+                         $3 = check_typedef ($3);
                          write_exp_elt_longcst (pstate,
                                                 (LONGEST) TYPE_LENGTH ($3));
                          write_exp_elt_opcode (pstate, OP_LONG); }
index b5bf4d456ec32675f2efd5d30131d82025cb6028..40ece584b58f7bbbd3b0d18c1428405e8d3fc52a 100644 (file)
@@ -55,7 +55,7 @@ pascal_print_type (struct type *type, const char *varstring,
   code = TYPE_CODE (type);
 
   if (show > 0)
-    CHECK_TYPEDEF (type);
+    type = check_typedef (type);
 
   if ((code == TYPE_CODE_FUNC
        || code == TYPE_CODE_METHOD))
@@ -96,7 +96,7 @@ void
 pascal_print_typedef (struct type *type, struct symbol *new_symbol,
                      struct ui_file *stream)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   fprintf_filtered (stream, "type ");
   fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
   type_print (type, "", stream, 0);
@@ -479,7 +479,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
       return;
     }
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index a66ff4425032d23d659a7b0736eb2214c6966423..f736a79e323e36c1eeb97ed3d7fe3b13b120c665 100644 (file)
@@ -74,7 +74,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
   CORE_ADDR addr;
   int want_space = 0;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
@@ -336,7 +336,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
 
     case TYPE_CODE_SET:
       elttype = TYPE_INDEX_TYPE (type);
-      CHECK_TYPEDEF (elttype);
+      elttype = check_typedef (elttype);
       if (TYPE_STUB (elttype))
        {
          fprintf_filtered (stream, "<incomplete type>");
@@ -537,7 +537,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
   int i, len, n_baseclasses;
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   fprintf_filtered (stream, "{");
   len = TYPE_NFIELDS (type);
@@ -872,7 +872,7 @@ pascal_object_print_static_field (struct value *val,
       obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
                    sizeof (CORE_ADDR));
 
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
       pascal_object_print_value_fields (type,
                                        value_contents_for_printing (val),
                                        value_embedded_offset (val),
index 648d8c8e1787519a8736249b3bf639c4f7b4be5b..e202c83732dc9038ca167aebdc0e1793ea004c8f 100644 (file)
@@ -346,7 +346,7 @@ typy_fields_items (PyObject *self, enum gdbpy_iter_kind kind)
 
   TRY
     {
-      CHECK_TYPEDEF (checked_type);
+      checked_type = check_typedef (checked_type);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
@@ -477,7 +477,7 @@ typy_get_composite (struct type *type)
     {
       TRY
        {
-         CHECK_TYPEDEF (type);
+         type = check_typedef (type);
        }
       CATCH (except, RETURN_MASK_ALL)
        {
index 97eb66ae7d63bf0045d3b4a1b5b5266bc39eb810..ec26bc8c005c8e6e874d6ffcf27f32a4691c8fe6 100644 (file)
@@ -356,7 +356,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
       struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
 
       type = value_type (val);
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
 
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
@@ -1059,9 +1059,9 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
            struct type *ltype = value_type (arg1);
            struct type *rtype = value_type (arg2);
 
-           CHECK_TYPEDEF (ltype);
+           ltype = check_typedef (ltype);
            ltype = STRIP_REFERENCE (ltype);
-           CHECK_TYPEDEF (rtype);
+           rtype = check_typedef (rtype);
            rtype = STRIP_REFERENCE (rtype);
 
            handled = 1;
@@ -1083,9 +1083,9 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
            struct type *ltype = value_type (arg1);
            struct type *rtype = value_type (arg2);
 
-           CHECK_TYPEDEF (ltype);
+           ltype = check_typedef (ltype);
            ltype = STRIP_REFERENCE (ltype);
-           CHECK_TYPEDEF (rtype);
+           rtype = check_typedef (rtype);
            rtype = STRIP_REFERENCE (rtype);
 
            handled = 1;
@@ -1474,7 +1474,7 @@ valpy_long (PyObject *self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
 
       if (!is_integral_type (type)
          && TYPE_CODE (type) != TYPE_CODE_PTR)
@@ -1501,7 +1501,7 @@ valpy_float (PyObject *self)
 
   TRY
     {
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
 
       if (TYPE_CODE (type) != TYPE_CODE_FLT)
        error (_("Cannot convert value to float."));
index 39803d9e1e178e796c37f163386a0a6b2d223f08..48788253256b3999efdb6967b5f95ef473153151 100644 (file)
@@ -2415,7 +2415,7 @@ return_command (char *retval_exp, int from_tty)
          return_type = value_type (return_value);
        }
       do_cleanups (old_chain);
-      CHECK_TYPEDEF (return_type);
+      return_type = check_typedef (return_type);
       return_value = value_cast (return_type, return_value);
 
       /* Make sure the value is fully evaluated.  It may live in the
index 2b6af6ccd198a48c4ca41998caa16ac405840088..decc5a958ffada845924cb2dbdd285c2caeee4f2 100644 (file)
@@ -2030,7 +2030,7 @@ check_field (struct type *type, const char *name,
   int i;
 
   /* The type may be a stub.  */
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
     {
@@ -2133,7 +2133,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
 
          /* I'm not really sure that type of this can ever
             be typedefed; just be safe.  */
-         CHECK_TYPEDEF (t);
+         t = check_typedef (t);
          if (TYPE_CODE (t) == TYPE_CODE_PTR
              || TYPE_CODE (t) == TYPE_CODE_REF)
            t = TYPE_TARGET_TYPE (t);
index 2603f91c630576f5ef08b60a05a73eef19e68182..3fc56423fff05e467d7d495d6129af40403eae19 100644 (file)
@@ -807,7 +807,7 @@ tic6x_return_value (struct gdbarch *gdbarch, struct value *function,
     {
       if (type != NULL)
        {
-         CHECK_TYPEDEF (type);
+         type = check_typedef (type);
          if (language_pass_by_reference (type))
            return RETURN_VALUE_STRUCT_CONVENTION;
        }
index 5a97acecbea9f04bf936bda196779e63e2ed2282..9e44225f4242f807e521dd40bf42a3649f714de8 100644 (file)
@@ -524,7 +524,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
   unsigned int i;
   unsigned len;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   switch (TYPE_CODE (type))
     {
index df1e8c3a17c621a21d2c624e57b70aa425db17e3..0162c10681aeadade85f3ec68f8115c9547be5b4 100644 (file)
@@ -1391,7 +1391,7 @@ value_vector_widen (struct value *scalar_value, struct type *vector_type)
   LONGEST low_bound, high_bound;
   int i;
 
-  CHECK_TYPEDEF (vector_type);
+  vector_type = check_typedef (vector_type);
 
   gdb_assert (TYPE_CODE (vector_type) == TYPE_CODE_ARRAY
              && TYPE_VECTOR (vector_type));
index 403e088070a660f9167154742e62973862c5012a..d68e9f3e59727fc250773b4c5513a58cf2c24af9 100644 (file)
@@ -381,7 +381,7 @@ value_cast (struct type *type, struct value *arg2)
     /* We deref the value and then do the cast.  */
     return value_cast (type, coerce_ref (arg2)); 
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   code1 = TYPE_CODE (type);
   arg2 = coerce_ref (arg2);
   type2 = check_typedef (value_type (arg2));
@@ -1012,7 +1012,7 @@ value_assign (struct value *toval, struct value *fromval)
        fromval = coerce_array (fromval);
     }
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* Since modifying a register can trash the frame chain, and
      modifying memory can trash the frame cache, we save the old frame
@@ -1802,7 +1802,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset,
   int i;
   int nbases;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   nbases = TYPE_N_BASECLASSES (type);
 
   if (!looking_for_baseclass)
@@ -1983,7 +1983,7 @@ search_struct_method (const char *name, struct value **arg1p,
   int name_matched = 0;
   char dem_opname[64];
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
     {
       const char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
@@ -2285,7 +2285,7 @@ find_method_list (struct value **argp, const char *method,
   VEC (xmethod_worker_ptr) *worker_vec = NULL, *new_vec = NULL;
 
   gdb_assert (fn_list != NULL && xm_worker_vec != NULL);
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* First check in object itself.
      This function is called recursively to search through base classes.
index 294c6a86e1445a65ff12c81e685d3949614037a8..52a386afba3693c7b8974aede2ed51be133713be 100644 (file)
@@ -274,11 +274,11 @@ show_symbol_print (struct ui_file *file, int from_tty,
 int
 val_print_scalar_type_p (struct type *type)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   while (TYPE_CODE (type) == TYPE_CODE_REF)
     {
       type = TYPE_TARGET_TYPE (type);
-      CHECK_TYPEDEF (type);
+      type = check_typedef (type);
     }
   switch (TYPE_CODE (type))
     {
@@ -301,7 +301,7 @@ valprint_check_validity (struct ui_file *stream,
                         int embedded_offset,
                         const struct value *val)
 {
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   if (TYPE_CODE (type) != TYPE_CODE_UNION
       && TYPE_CODE (type) != TYPE_CODE_STRUCT
@@ -386,7 +386,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
   LONGEST val;
   CORE_ADDR addr;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
index a01f3902741a3f361b381126041497db51ff8db4..4399493229ebc6064c18aa16cf69d692300f8d85 100644 (file)
@@ -2852,7 +2852,7 @@ unpack_double (struct type *type, const gdb_byte *valaddr, int *invp)
   int nosign;
 
   *invp = 0;                   /* Assume valid.  */
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   code = TYPE_CODE (type);
   len = TYPE_LENGTH (type);
   nosign = TYPE_UNSIGNED (type);
@@ -2993,7 +2993,7 @@ value_primitive_field (struct value *arg1, int offset,
   struct value *v;
   struct type *type;
 
-  CHECK_TYPEDEF (arg_type);
+  arg_type = check_typedef (arg_type);
   type = TYPE_FIELD_TYPE (arg_type, fieldno);
 
   /* Call check_typedef on our type to make sure that, if TYPE
@@ -3195,7 +3195,7 @@ unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr,
 
   /* Read the minimum number of bytes required; there may not be
      enough bytes to read an entire ULONGEST.  */
-  CHECK_TYPEDEF (field_type);
+  field_type = check_typedef (field_type);
   if (bitsize)
     bytes_read = ((bitpos % 8) + bitsize + 7) / 8;
   else
This page took 0.087042 seconds and 4 git commands to generate.