From 7813437494ac39f3aef392d06ed5416e84fe386b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 May 2020 13:46:38 -0400 Subject: 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. --- gdb/lm32-tdep.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/lm32-tdep.c') diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index f2c3fea..6b5bb15 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -258,7 +258,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, ULONGEST val; /* Promote small integer types to int. */ - switch (TYPE_CODE (arg_type)) + switch (arg_type->code ()) { case TYPE_CODE_INT: case TYPE_CODE_BOOL: @@ -309,15 +309,15 @@ lm32_extract_return_value (struct type *type, struct regcache *regcache, ULONGEST l; CORE_ADDR return_buffer; - if (TYPE_CODE (type) != TYPE_CODE_STRUCT - && TYPE_CODE (type) != TYPE_CODE_UNION - && TYPE_CODE (type) != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4) + if (type->code () != TYPE_CODE_STRUCT + && type->code () != TYPE_CODE_UNION + && type->code () != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4) { /* Return value is returned in a single register. */ regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l); store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, l); } - else if ((TYPE_CODE (type) == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8)) + else if ((type->code () == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8)) { /* 64-bit values are returned in a register pair. */ regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l); @@ -368,7 +368,7 @@ lm32_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - enum type_code code = TYPE_CODE (valtype); + enum type_code code = valtype->code (); if (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION -- cgit v1.1