aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-21 10:24:35 -0600
committerTom Tromey <tromey@adacore.com>2023-11-21 14:52:05 -0700
commitc3842cbe44249a70bcf4bb1a123f4335c4e98bf1 (patch)
tree8baaa41d4eae36af74574bb3605d200c1552d2f5
parent61461a5b41fb660ef11a7a9ffe457ea52b5c2a6a (diff)
downloadgdb-c3842cbe44249a70bcf4bb1a123f4335c4e98bf1.zip
gdb-c3842cbe44249a70bcf4bb1a123f4335c4e98bf1.tar.gz
gdb-c3842cbe44249a70bcf4bb1a123f4335c4e98bf1.tar.bz2
Add field::is_public
This adds a field::is_public convenience method, and updates one spot to use it. Acked-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-by: Keith Seitz <keiths@redhat.com>
-rw-r--r--gdb/gdbtypes.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index a815834..6a11f58 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -686,6 +686,10 @@ struct field
enum accessibility accessibility () const
{ return m_accessibility; }
+ /* True if this field is 'public'. */
+ bool is_public () const
+ { return m_accessibility == accessibility::PUBLIC; }
+
/* True if this field is 'private'. */
bool is_private () const
{ return m_accessibility == accessibility::PRIVATE; }
@@ -1964,7 +1968,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define TYPE_BASECLASS_NAME(thistype,index) (thistype->field (index).name ())
#define TYPE_BASECLASS_BITPOS(thistype,index) (thistype->field (index).loc_bitpos ())
#define BASETYPE_VIA_PUBLIC(thistype, index) \
- ((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index)))
+ ((thistype)->field (index).is_public ())
#define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic
#define BASETYPE_VIA_VIRTUAL(thistype, index) \