diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:46:38 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:46:38 -0400 |
commit | 7813437494ac39f3aef392d06ed5416e84fe386b (patch) | |
tree | 15290bf5b2bd9d23c59103a6a42b99adc0111d6d /gdb/p-typeprint.c | |
parent | 67607e24d0413828acdfa9bc38f6fbac40b860b9 (diff) | |
download | fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.zip fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.gz fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.bz2 |
gdb: remove TYPE_CODE macro
Remove TYPE_CODE, changing all the call sites to use type::code
directly. This is quite a big diff, but this was mostly done using sed
and coccinelle. A few call sites were done by hand.
gdb/ChangeLog:
* gdbtypes.h (TYPE_CODE): Remove. Change all call sites to use
type::code instead.
Diffstat (limited to 'gdb/p-typeprint.c')
-rw-r--r-- | gdb/p-typeprint.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index 3b8d3be..4d6eb26 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -53,7 +53,7 @@ pascal_print_type (struct type *type, const char *varstring, enum type_code code; int demangled_args; - code = TYPE_CODE (type); + code = type->code (); if (show > 0) type = check_typedef (type); @@ -216,7 +216,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream, QUIT; - switch (TYPE_CODE (type)) + switch (type->code ()) { case TYPE_CODE_PTR: fprintf_filtered (stream, "^"); @@ -229,7 +229,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream, if (passed_a_ptr) fprintf_filtered (stream, "("); if (TYPE_TARGET_TYPE (type) != NULL - && TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID) + && TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) { fprintf_filtered (stream, "function "); } @@ -258,7 +258,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream, fprintf_filtered (stream, "("); if (TYPE_TARGET_TYPE (type) != NULL - && TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID) + && TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) { fprintf_filtered (stream, "function "); } @@ -347,7 +347,7 @@ pascal_type_print_func_varspec_suffix (struct type *type, struct ui_file *strea const struct type_print_options *flags) { if (TYPE_TARGET_TYPE (type) == NULL - || TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID) + || TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_VOID) { fprintf_filtered (stream, " : "); pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), @@ -382,7 +382,7 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream, QUIT; - switch (TYPE_CODE (type)) + switch (type->code ()) { case TYPE_CODE_ARRAY: if (passed_a_ptr) @@ -476,8 +476,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, } /* void pointer */ - if ((TYPE_CODE (type) == TYPE_CODE_PTR) - && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)) + if ((type->code () == TYPE_CODE_PTR) + && (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_VOID)) { fputs_filtered (TYPE_NAME (type) ? TYPE_NAME (type) : "pointer", stream); @@ -495,7 +495,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, type = check_typedef (type); - switch (TYPE_CODE (type)) + switch (type->code ()) { case TYPE_CODE_TYPEDEF: case TYPE_CODE_PTR: @@ -707,8 +707,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, "destructor "); } else if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0 - && TYPE_CODE (TYPE_TARGET_TYPE ( - TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID) + && TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID) { fprintf_filtered (stream, "function "); } @@ -723,8 +722,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, stream); if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) != 0 - && TYPE_CODE (TYPE_TARGET_TYPE ( - TYPE_FN_FIELD_TYPE (f, j))) != TYPE_CODE_VOID) + && TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE(f, j))->code () != TYPE_CODE_VOID) { fputs_filtered (" : ", stream); type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), @@ -830,7 +828,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, an error (). */ fprintf_styled (stream, metadata_style.style (), "<invalid unnamed pascal type code %d>", - TYPE_CODE (type)); + type->code ()); } break; } |