From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] gdb: remove TYPE_DYN_PROP_KIND
Date: Sat, 1 Aug 2020 19:59:34 -0400 [thread overview]
Message-ID: <20200801235935.1110640-3-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20200801235935.1110640-1-simon.marchi@polymtl.ca>
Replace uses with calling the dynamic_prop::kind method directly.
gdb/ChangeLog:
* gdbtypes.h (TYPE_DYN_PROP_KIND): Remove, replace uses with
dynamic_prop::kind.
Change-Id: I78a3e2890f0b3e3950e9a19ad657b976cbb9610b
---
gdb/f-typeprint.c | 6 +++---
gdb/gdbtypes.c | 8 ++++----
gdb/gdbtypes.h | 2 --
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 65ec93af9f41..c3a01673d2bc 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -196,11 +196,11 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
else if (type_not_allocated (type))
print_rank_only = true;
else if ((TYPE_ASSOCIATED_PROP (type)
- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
+ && PROP_CONST != TYPE_ASSOCIATED_PROP (type)->kind ())
|| (TYPE_ALLOCATED_PROP (type)
- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
+ && PROP_CONST != TYPE_ALLOCATED_PROP (type)->kind ())
|| (TYPE_DATA_LOCATION (type)
- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
+ && PROP_CONST != TYPE_DATA_LOCATION (type)->kind ()))
{
/* This case exist when we ptype a typename which has the dynamic
properties but cannot be resolved as there is no object. */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index e87648813ec5..4b1f40ab77dc 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4133,8 +4133,8 @@ type_not_allocated (const struct type *type)
{
struct dynamic_prop *prop = TYPE_ALLOCATED_PROP (type);
- return (prop && TYPE_DYN_PROP_KIND (prop) == PROP_CONST
- && !TYPE_DYN_PROP_ADDR (prop));
+ return (prop != nullptr && prop->kind () == PROP_CONST
+ && !TYPE_DYN_PROP_ADDR (prop));
}
/* Associated status of type TYPE. Return zero if type TYPE is associated.
@@ -4145,8 +4145,8 @@ type_not_associated (const struct type *type)
{
struct dynamic_prop *prop = TYPE_ASSOCIATED_PROP (type);
- return (prop && TYPE_DYN_PROP_KIND (prop) == PROP_CONST
- && !TYPE_DYN_PROP_ADDR (prop));
+ return (prop != nullptr && prop->kind () == PROP_CONST
+ && !TYPE_DYN_PROP_ADDR (prop));
}
/* rank_one_type helper for when PARM's type code is TYPE_CODE_PTR. */
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 9ea23718ffb5..de54a5ed73b6 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1638,8 +1638,6 @@ extern bool set_type_align (struct type *, ULONGEST);
/* Attribute accessors for dynamic properties. */
#define TYPE_DYN_PROP_ADDR(dynprop) \
(dynprop->const_val ())
-#define TYPE_DYN_PROP_KIND(dynprop) \
- (dynprop->kind ())
/* C++ */
--
2.28.0
next prev parent reply other threads:[~2020-08-01 23:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-01 23:59 [PATCH 0/3] Remove last dynamic prop macros Simon Marchi
2020-08-01 23:59 ` [PATCH 1/3] gdb: remove TYPE_DYN_PROP_BATON Simon Marchi
2020-08-01 23:59 ` Simon Marchi [this message]
2020-08-01 23:59 ` [PATCH 3/3] gdb: remove TYPE_DYN_PROP_ADDR Simon Marchi
2020-08-05 9:20 ` Tom de Vries
2020-08-05 10:33 ` [committed][gdb] Fix prop->const_val uses in gdbtypes.c Tom de Vries
2020-08-05 12:46 ` Simon Marchi
2020-08-05 12:56 ` Tom de Vries
2020-08-04 18:06 ` [PATCH 0/3] Remove last dynamic prop macros Tom Tromey
2020-08-04 18:48 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200801235935.1110640-3-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox