diff options
author | Tom Tromey <tom@tromey.com> | 2021-09-11 13:58:04 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-09-23 15:11:00 -0600 |
commit | 809f3be12c0621cbf071c585da5638f6841c38b1 (patch) | |
tree | c0a9beeebaf38da9fb3a3e7447f4cb18a624479f /gdb/gdbtypes.h | |
parent | 0086a91ceef5207463a10c875ed85c40eb066722 (diff) | |
download | fsf-binutils-gdb-809f3be12c0621cbf071c585da5638f6841c38b1.zip fsf-binutils-gdb-809f3be12c0621cbf071c585da5638f6841c38b1.tar.gz fsf-binutils-gdb-809f3be12c0621cbf071c585da5638f6841c38b1.tar.bz2 |
Change pointer_type to a method of struct type
I noticed that pointer_type is declared in language.h and defined in
language.c. However, it really has to do with types, so it should
have been in gdbtypes.h all along.
This patch changes it to be a method on struct type. And, I went
through uses of TYPE_IS_REFERENCE and updated many spots to use the
new method as well. (I didn't update ones that were in arch-specific
code, as I couldn't readily test that.)
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index bfb7f29..2a64112 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1355,6 +1355,12 @@ struct type return main_type->type_specific.int_stuff.bit_offset; } + /* Return true if this is a pointer or reference type. */ + bool is_pointer_or_reference () const + { + return this->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (this); + } + /* * Type that is a pointer to this type. NULL if no such pointer-to type is known yet. The debugger may add the address of such a type |