From: Fred Fish Date: Wed, 12 Dec 2001 02:11:52 +0000 (+0000) Subject: Approved by Jim Blandy: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74a9bb82c55f8d399894d5b3525572c17c3a0312;p=binutils-gdb.git Approved by Jim Blandy: 2001-12-11 Fred Fish * c-typeprint.c (c_type_print_base): Use type flags access macros to test bits. * ch-typeprint.c (chill_type_print_base): Ditto. * ch-valprint.c (chill_val_print): Ditto. * d10v-tdep.c (d10v_pointer_to_address): Ditto. * dwarf2read.c (dwarf2_add_member_fn): Ditto. * dwarfread.c (read_structure_scope): Ditto. * gdbtypes.c (create_range_type): Dittol (create_set_type): Ditto. (check_typedef): Ditto. * jv-typeprint.c (java_type_print_base): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto * p-valprint.c (pascal_val_print): Ditto. * stabsread.c (read_cfront_member_functions): Ditto. (read_member_functions): Ditto. (cleanup_undefined_types): Ditto. * valprint.c (val_print): Ditto. * valops.c (hand_function_call): Remove is_prototyped variable and just use type flag test macro directly. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ee86924cfb9..9a39c5c2f58 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,26 @@ +2001-12-11 Fred Fish + + * c-typeprint.c (c_type_print_base): Use type flags access macros + to test bits. + * ch-typeprint.c (chill_type_print_base): Ditto. + * ch-valprint.c (chill_val_print): Ditto. + * d10v-tdep.c (d10v_pointer_to_address): Ditto. + * dwarf2read.c (dwarf2_add_member_fn): Ditto. + * dwarfread.c (read_structure_scope): Ditto. + * gdbtypes.c (create_range_type): Dittol + (create_set_type): Ditto. + (check_typedef): Ditto. + * jv-typeprint.c (java_type_print_base): Ditto. + * p-typeprint.c (pascal_type_print_base): Ditto + * p-valprint.c (pascal_val_print): Ditto. + * stabsread.c (read_cfront_member_functions): Ditto. + (read_member_functions): Ditto. + (cleanup_undefined_types): Ditto. + * valprint.c (val_print): Ditto. + + * valops.c (hand_function_call): Remove is_prototyped + variable and just use type flag test macro directly. + 2001-12-11 Fred Fish * gdbtypes.c (print_bound_type): New function. diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index c8300295686..aa7f5a50772 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -751,7 +751,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, "{\n"); if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0)) { - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) + if (TYPE_STUB (type)) fprintfi_filtered (level + 4, stream, "\n"); else fprintfi_filtered (level + 4, stream, "\n"); diff --git a/gdb/ch-typeprint.c b/gdb/ch-typeprint.c index 339dd0b32d3..011bd125d2a 100644 --- a/gdb/ch-typeprint.c +++ b/gdb/ch-typeprint.c @@ -207,7 +207,7 @@ chill_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, "(\n"); if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0)) { - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) + if (TYPE_STUB (type)) { fprintfi_filtered (level + 4, stream, "\n"); } diff --git a/gdb/ch-valprint.c b/gdb/ch-valprint.c index 77109b5713b..44b1c534311 100644 --- a/gdb/ch-valprint.c +++ b/gdb/ch-valprint.c @@ -335,7 +335,7 @@ chill_val_print (struct type *type, char *valaddr, int embedded_offset, case TYPE_CODE_SET: elttype = TYPE_INDEX_TYPE (type); CHECK_TYPEDEF (elttype); - if (TYPE_FLAGS (elttype) & TYPE_FLAG_STUB) + if (TYPE_STUB (elttype)) { fprintf_filtered (stream, ""); gdb_flush (stream); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 3002444fe23..fa55d464ef5 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -430,8 +430,8 @@ d10v_pointer_to_address (struct type *type, void *buf) /* Is it a code address? */ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC - || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || - (TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_CODE_SPACE) != 0) + || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD + || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) return d10v_make_iaddr (addr); else return d10v_make_daddr (addr); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index aab1d46676b..7c78eb5ad81 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2134,7 +2134,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, arg_types[iparams] = TYPE_FIELD_TYPE (die->type, iparams); /* Set last entry in argument type vector. */ - if (TYPE_FLAGS (die->type) & TYPE_FLAG_VARARGS) + if (TYPE_VARARGS (die->type)) arg_types[nparams] = NULL; else arg_types[nparams] = dwarf2_fundamental_type (objfile, FT_VOID); diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 6eb0a0b06ed..3fdfd1ce375 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -1147,7 +1147,7 @@ read_structure_scope (struct dieinfo *dip, char *thisdie, char *enddie, struct symbol *sym; type = struct_type (dip, thisdie, enddie, objfile); - if (!(TYPE_FLAGS (type) & TYPE_FLAG_STUB)) + if (!TYPE_STUB (type)) { sym = new_symbol (dip, objfile); if (sym != NULL) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index a46f9ce51a6..4a4ff1edf1e 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -569,7 +569,7 @@ create_range_type (struct type *result_type, struct type *index_type, } TYPE_CODE (result_type) = TYPE_CODE_RANGE; TYPE_TARGET_TYPE (result_type) = index_type; - if (TYPE_FLAGS (index_type) & TYPE_FLAG_STUB) + if (TYPE_STUB (index_type)) TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB; else TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type)); @@ -732,7 +732,7 @@ create_set_type (struct type *result_type, struct type *domain_type) TYPE_ALLOC (result_type, 1 * sizeof (struct field)); memset (TYPE_FIELDS (result_type), 0, sizeof (struct field)); - if (!(TYPE_FLAGS (domain_type) & TYPE_FLAG_STUB)) + if (!TYPE_STUB (domain_type)) { if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0) low_bound = high_bound = 0; @@ -1245,7 +1245,7 @@ check_typedef (struct type *type) make_cv_type (is_const, is_volatile, newtype, &type); } /* Otherwise, rely on the stub flag being set for opaque/stubbed types */ - else if ((TYPE_FLAGS (type) & TYPE_FLAG_STUB) && !currently_reading_symtab) + else if (TYPE_STUB (type) && !currently_reading_symtab) { char *name = type_name_no_tag (type); /* FIXME: shouldn't we separately check the TYPE_NAME and the @@ -1263,12 +1263,12 @@ check_typedef (struct type *type) make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type); } - if (TYPE_FLAGS (type) & TYPE_FLAG_TARGET_STUB) + if (TYPE_TARGET_STUB (type)) { struct type *range_type; struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type)); - if (TYPE_FLAGS (target_type) & (TYPE_FLAG_STUB | TYPE_FLAG_TARGET_STUB)) + if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type)) { } else if (TYPE_CODE (type) == TYPE_CODE_ARRAY diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index c0d9ec92903..893082cc187 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -152,7 +152,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, "{\n"); if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0)) { - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) + if (TYPE_STUB (type)) fprintfi_filtered (level + 4, stream, "\n"); else fprintfi_filtered (level + 4, stream, "\n"); diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index 0facebfa9d1..3a72e40f24d 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -588,7 +588,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, "\n"); if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0)) { - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) + if (TYPE_STUB (type)) fprintfi_filtered (level + 4, stream, "\n"); else fprintfi_filtered (level + 4, stream, "\n"); diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 29503a093e0..3cad5f84f70 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -445,7 +445,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset, case TYPE_CODE_SET: elttype = TYPE_INDEX_TYPE (type); CHECK_TYPEDEF (elttype); - if (TYPE_FLAGS (elttype) & TYPE_FLAG_STUB) + if (TYPE_STUB (elttype)) { fprintf_filtered (stream, ""); gdb_flush (stream); diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 7b682427fb4..620634a8d61 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -869,7 +869,7 @@ read_cfront_member_functions (struct field_info *fip, char **pp, TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD; /* If this is just a stub, then we don't have the real name here. */ - if (TYPE_FLAGS (new_sublist->fn_field.type) & TYPE_FLAG_STUB) + if (TYPE_STUB (new_sublist->fn_field.type)) { if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type)) TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type; @@ -3100,7 +3100,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type, /* If this is just a stub, then we don't have the real name here. */ - if (TYPE_FLAGS (new_sublist->fn_field.type) & TYPE_FLAG_STUB) + if (TYPE_STUB (new_sublist->fn_field.type)) { if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type)) TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type; @@ -4941,7 +4941,7 @@ cleanup_undefined_types (void) as well as in check_typedef to deal with the (legitimate in C though not C++) case of several types with the same name in different source files. */ - if (TYPE_FLAGS (*type) & TYPE_FLAG_STUB) + if (TYPE_STUB (*type)) { struct pending *ppt; int i; diff --git a/gdb/valops.c b/gdb/valops.c index 980a98af54d..4e14b095e17 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1458,10 +1458,8 @@ hand_function_call (value_ptr function, int nargs, value_ptr *args) else { - int is_prototyped = TYPE_FLAGS (ftype) & TYPE_FLAG_PROTOTYPED; param_type = TYPE_FIELD_TYPE (ftype, i); - - args[i] = value_arg_coerce (args[i], param_type, is_prototyped); + args[i] = value_arg_coerce (args[i], param_type, TYPE_PROTOTYPED (ftype)); } /*elz: this code is to handle the case in which the function to be called diff --git a/gdb/valprint.c b/gdb/valprint.c index 21f681d43d7..ad6a992b737 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -142,7 +142,7 @@ val_print (struct type *type, char *valaddr, int embedded_offset, only a stub and we can't find and substitute its complete type, then print appropriate string and return. */ - if (TYPE_FLAGS (real_type) & TYPE_FLAG_STUB) + if (TYPE_STUB (real_type)) { fprintf_filtered (stream, ""); gdb_flush (stream);