aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-04-16 12:33:56 -0600
committerTom Tromey <tom@tromey.com>2022-04-20 09:28:12 -0600
commit496feb16f855347dbd30fa171a8dc1d97654ae8e (patch)
tree2ce2c71ec938c4aa5ebfb65f2c17043fbe7c193f /gdb/symtab.h
parenta827b8ec32f9e0ed10b2bf647ce983db813a3d3c (diff)
downloadbinutils-496feb16f855347dbd30fa171a8dc1d97654ae8e.zip
binutils-496feb16f855347dbd30fa171a8dc1d97654ae8e.tar.gz
binutils-496feb16f855347dbd30fa171a8dc1d97654ae8e.tar.bz2
Add accessors for symbol's artificial field
For a series I'm experimenting with, it was handy to hide a symbol's "artificial" field behind accessors. This patch is the result.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4a33c7a..41c8654 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1203,7 +1203,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
m_is_inlined (0),
maybe_copied (0),
subclass (SYMBOL_NONE),
- artificial (false)
+ m_artificial (false)
{
/* We can't use an initializer list for members of a base class, and
general_symbol_info needs to stay a POD type. */
@@ -1369,6 +1369,18 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
m_value.chain = sym;
}
+ /* Return true if this symbol was marked as artificial. */
+ bool is_artificial () const
+ {
+ return m_artificial;
+ }
+
+ /* Set the 'artificial' flag on this symbol. */
+ void set_is_artificial (bool artificial)
+ {
+ m_artificial = artificial;
+ }
+
/* Data type of value */
struct type *m_type = nullptr;
@@ -1423,7 +1435,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
/* Whether this symbol is artificial. */
- bool artificial : 1;
+ bool m_artificial : 1;
/* Line number of this symbol's definition, except for inlined
functions. For an inlined function (class LOC_BLOCK and