aboutsummaryrefslogtreecommitdiff
path: root/gdb/go-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:46:38 -0400
commit7813437494ac39f3aef392d06ed5416e84fe386b (patch)
tree15290bf5b2bd9d23c59103a6a42b99adc0111d6d /gdb/go-lang.c
parent67607e24d0413828acdfa9bc38f6fbac40b860b9 (diff)
downloadfsf-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/go-lang.c')
-rw-r--r--gdb/go-lang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/go-lang.c b/gdb/go-lang.c
index 03dc986..373c12d 100644
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -81,16 +81,16 @@ gccgo_string_p (struct type *type)
type0 = check_typedef (type0);
type1 = check_typedef (type1);
- if (TYPE_CODE (type0) == TYPE_CODE_PTR
+ if (type0->code () == TYPE_CODE_PTR
&& strcmp (TYPE_FIELD_NAME (type, 0), "__data") == 0
- && TYPE_CODE (type1) == TYPE_CODE_INT
+ && type1->code () == TYPE_CODE_INT
&& strcmp (TYPE_FIELD_NAME (type, 1), "__length") == 0)
{
struct type *target_type = TYPE_TARGET_TYPE (type0);
target_type = check_typedef (target_type);
- if (TYPE_CODE (target_type) == TYPE_CODE_INT
+ if (target_type->code () == TYPE_CODE_INT
&& TYPE_LENGTH (target_type) == 1
&& strcmp (TYPE_NAME (target_type), "uint8") == 0)
return 1;
@@ -137,7 +137,7 @@ static bool
go_is_string_type_p (struct type *type)
{
type = check_typedef (type);
- return (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ return (type->code () == TYPE_CODE_STRUCT
&& go_classify_struct_type (type) == GO_TYPE_STRING);
}