aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-exp.y
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/p-exp.y
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/p-exp.y')
-rw-r--r--gdb/p-exp.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 213033d..e332fe9 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -257,7 +257,7 @@ exp : field_exp FIELDNAME
search_field = 0;
if (current_type)
{
- while (TYPE_CODE (current_type)
+ while (current_type->code ()
== TYPE_CODE_PTR)
current_type =
TYPE_TARGET_TYPE (current_type);
@@ -275,7 +275,7 @@ exp : field_exp name
search_field = 0;
if (current_type)
{
- while (TYPE_CODE (current_type)
+ while (current_type->code ()
== TYPE_CODE_PTR)
current_type =
TYPE_TARGET_TYPE (current_type);
@@ -357,9 +357,9 @@ exp : type '(' exp ')' %prec UNARY
{ if (current_type)
{
/* Allow automatic dereference of classes. */
- if ((TYPE_CODE (current_type) == TYPE_CODE_PTR)
- && (TYPE_CODE (TYPE_TARGET_TYPE (current_type)) == TYPE_CODE_STRUCT)
- && (TYPE_CODE ($1) == TYPE_CODE_STRUCT))
+ if ((current_type->code () == TYPE_CODE_PTR)
+ && (TYPE_TARGET_TYPE (current_type)->code () == TYPE_CODE_STRUCT)
+ && (($1)->code () == TYPE_CODE_STRUCT))
write_exp_elt_opcode (pstate, UNOP_IND);
}
write_exp_elt_opcode (pstate, UNOP_CAST);
@@ -601,7 +601,7 @@ exp : THIS
this_type = NULL;
if (this_type)
{
- if (TYPE_CODE (this_type) == TYPE_CODE_PTR)
+ if (this_type->code () == TYPE_CODE_PTR)
{
this_type = TYPE_TARGET_TYPE (this_type);
write_exp_elt_opcode (pstate, UNOP_IND);
@@ -666,8 +666,8 @@ qualified_name: typebase COLONCOLON name
{
struct type *type = $1;
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_UNION)
+ if (type->code () != TYPE_CODE_STRUCT
+ && type->code () != TYPE_CODE_UNION)
error (_("`%s' is not defined as an aggregate type."),
TYPE_NAME (type));