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/typeprint.c | |
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/typeprint.c')
-rw-r--r-- | gdb/typeprint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/typeprint.c b/gdb/typeprint.c index ed39141..947109f 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -544,7 +544,7 @@ whatis_exp (const char *exp, int show) get_user_print_options (&opts); if (val != NULL && opts.objectprint) { - if (((type->code () == TYPE_CODE_PTR) || TYPE_IS_REFERENCE (type)) + if (type->is_pointer_or_reference () && (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_STRUCT)) real_type = value_rtti_indirect_type (val, &full, &top, &using_enc); else if (type->code () == TYPE_CODE_STRUCT) |