diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-21 22:03:07 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-02-06 16:03:46 -0500 |
commit | ba44b1a3e0bd6ec2e94e6d6c288786114b8a633c (patch) | |
tree | 20520b6490fca5bfd178d09894485f3868bc552f /gdb/symtab.h | |
parent | 81e32b6a84c54031d31de6ebcf74a91b29d1498a (diff) | |
download | gdb-ba44b1a3e0bd6ec2e94e6d6c288786114b8a633c.zip gdb-ba44b1a3e0bd6ec2e94e6d6c288786114b8a633c.tar.gz gdb-ba44b1a3e0bd6ec2e94e6d6c288786114b8a633c.tar.bz2 |
gdb: remove SYMBOL_ACLASS_INDEX macro, add getter/setter
Add a getter and a setter for a symbol's aclass index. Remove the
corresponding macro and adjust all callers.
Change-Id: Ie8c8d732624cfadb714aba5ddafa3d29409b3d39
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index a765d1a..aa380aa 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1112,7 +1112,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack symbol () /* Class-initialization of bitfields is only allowed in C++20. */ : domain (UNDEF_DOMAIN), - aclass_index (0), + m_aclass_index (0), is_objfile_owned (1), is_argument (0), is_inlined (0), @@ -1136,6 +1136,16 @@ struct symbol : public general_symbol_info, public allocate_on_obstack symbol (const symbol &) = default; symbol &operator= (const symbol &) = default; + unsigned int aclass_index () const + { + return m_aclass_index; + } + + void set_aclass_index (unsigned int aclass_index) + { + m_aclass_index = aclass_index; + } + /* Data type of value */ struct type *type = nullptr; @@ -1162,7 +1172,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack table. The actual enum address_class value is stored there, alongside any per-class ops vectors. */ - unsigned int aclass_index : SYMBOL_ACLASS_BITS; + unsigned int m_aclass_index : SYMBOL_ACLASS_BITS; /* If non-zero then symbol is objfile-owned, use owner.symtab. Otherwise symbol is arch-owned, use owner.arch. */ @@ -1241,8 +1251,7 @@ extern const struct symbol_impl *symbol_impls; "private". */ #define SYMBOL_DOMAIN(symbol) (symbol)->domain -#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index]) -#define SYMBOL_ACLASS_INDEX(symbol) (symbol)->aclass_index +#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index ()]) #define SYMBOL_CLASS(symbol) (SYMBOL_IMPL (symbol).aclass) #define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned) #define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument |