summaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2015-07-06 16:05:06 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2015-07-14 16:42:16 -0400
commitf168693bc9d109c387e442119354bd57ecec8267 (patch)
tree246349860c64a7b75651e5b6b3b7242e897cee8b /gdb/valops.c
parent452802827f0870df0c8ece81a7e098d94cee4536 (diff)
Remove CHECK_TYPEDEF, use check_typedef instead
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.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 403e088070..d68e9f3e59 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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.