diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:08:01 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-09-14 11:08:01 -0400 |
commit | 7f9f399b34b7e2278eb1e8d6b7653e2b38070c55 (patch) | |
tree | 57d5f65b7f0d6877964243ce07f9779bda95a7b0 /gdb | |
parent | 27e69b7aedcfee8af8fc6ee4f2e99aca2d41daca (diff) | |
download | gdb-7f9f399b34b7e2278eb1e8d6b7653e2b38070c55.zip gdb-7f9f399b34b7e2278eb1e8d6b7653e2b38070c55.tar.gz gdb-7f9f399b34b7e2278eb1e8d6b7653e2b38070c55.tar.bz2 |
gdb: remove TYPE_PROTOTYPED
gdb/ChangeLog:
* gdbtypes.h (TYPE_PROTOTYPED): Remove, replace all
uses with type::is_prototyped.
Change-Id: Ic96b19c24ce5afcd7e1302a75c39909767e4d885
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/c-typeprint.c | 2 | ||||
-rw-r--r-- | gdb/compile/compile-c-types.c | 2 | ||||
-rw-r--r-- | gdb/f-typeprint.c | 2 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 2 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 12 | ||||
-rw-r--r-- | gdb/infcall.c | 2 | ||||
-rw-r--r-- | gdb/rx-tdep.c | 2 |
8 files changed, 16 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 05cb60a..193d0c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-09-14 Simon Marchi <simon.marchi@efficios.com> + * gdbtypes.h (TYPE_PROTOTYPED): Remove, replace all + uses with type::is_prototyped. + +2020-09-14 Simon Marchi <simon.marchi@efficios.com> + * gdbtypes.h (struct type) <is_prototyped, set_is_prototyped>: New methods. (TYPE_PROTOTYPED): Use type::is_prototyped, change all write diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index ef16f2b..37bb16e 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -604,7 +604,7 @@ c_type_print_args (struct type *type, struct ui_file *stream, } } else if (!printed_any - && (TYPE_PROTOTYPED (type) || language == language_cplus)) + && (type->is_prototyped () || language == language_cplus)) fprintf_filtered (stream, "void"); fprintf_filtered (stream, ")"); diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c index 3527442..08c8c6b 100644 --- a/gdb/compile/compile-c-types.c +++ b/gdb/compile/compile-c-types.c @@ -153,7 +153,7 @@ convert_func (compile_c_instance *context, struct type *type) int i; gcc_type result, return_type; struct gcc_type_array array; - int is_varargs = TYPE_VARARGS (type) || !TYPE_PROTOTYPED (type); + int is_varargs = TYPE_VARARGS (type) || !type->is_prototyped (); struct type *target_type = TYPE_TARGET_TYPE (type); diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index c3a0167..577ed3b 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -262,7 +262,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, if (passed_a_ptr) fprintf_filtered (stream, ") "); fprintf_filtered (stream, "("); - if (nfields == 0 && TYPE_PROTOTYPED (type)) + if (nfields == 0 && type->is_prototyped ()) f_print_type (builtin_f_type (get_type_arch (type))->builtin_void, "", stream, -1, 0, 0); else diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 0753630..ae3d927 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5084,7 +5084,7 @@ recursive_dump_type (struct type *type, int spaces) { puts_filtered (" TYPE_TARGET_STUB"); } - if (TYPE_PROTOTYPED (type)) + if (type->is_prototyped ()) { puts_filtered (" TYPE_PROTOTYPED"); } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index b41e91f..abb6746 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -216,13 +216,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); #define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default) -/* * This is a function type which appears to have a prototype. We - need this for function calls in order to tell us if it's necessary - to coerce the args, or to just do the standard conversions. This - is used with a short field. */ - -#define TYPE_PROTOTYPED(t) ((t)->is_prototyped ()) - /* * FIXME drow/2002-06-03: Only used for methods, but applies as well to functions. */ @@ -1100,6 +1093,11 @@ struct type this->main_type->m_flag_target_stub = target_is_stub; } + /* This is a function type which appears to have a prototype. We + need this for function calls in order to tell us if it's necessary + to coerce the args, or to just do the standard conversions. This + is used with a short field. */ + bool is_prototyped () const { return this->main_type->m_flag_prototyped; diff --git a/gdb/infcall.c b/gdb/infcall.c index cdb3013..a158cb5 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1043,7 +1043,7 @@ call_function_by_hand_dummy (struct value *function, prototyped = 1; } else if (i < ftype->num_fields ()) - prototyped = TYPE_PROTOTYPED (ftype); + prototyped = ftype->is_prototyped (); else prototyped = 0; diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 1148eea..0447794 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -795,7 +795,7 @@ rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { int p_arg_size = 4; - if (TYPE_PROTOTYPED (func_type) + if (func_type->is_prototyped () && i < func_type->num_fields ()) { struct type *p_arg_type = |