diff options
author | Tom Tromey <tom@tromey.com> | 2023-04-22 12:41:43 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-05-01 09:20:37 -0600 |
commit | c819a3380fc1b110b88bc6ab5ef9323dbe7d4753 (patch) | |
tree | 05450117dff9b07e36d3ddb7bddf2fd88651c543 /gdb/gdbtypes.h | |
parent | 077a1f08485e88f3b234af1dbb8b907b16045e6a (diff) | |
download | gdb-c819a3380fc1b110b88bc6ab5ef9323dbe7d4753.zip gdb-c819a3380fc1b110b88bc6ab5ef9323dbe7d4753.tar.gz gdb-c819a3380fc1b110b88bc6ab5ef9323dbe7d4753.tar.bz2 |
Replace field_is_static with a method
This changes field_is_static to be a method on struct field, and
updates all the callers. Most of this patch was written by script.
Regression tested on x86-64 Fedora 36.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index b5cccb7..9254ec9 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -559,6 +559,18 @@ struct field m_name = name; } + /* Return true if this field is static; false if not. */ + bool is_static () const + { + /* "static" fields are the fields whose location is not relative + to the address of the enclosing struct. It would be nice to + have a dedicated flag that would be set for static fields when + the type is being created. But in practice, checking the field + loc_kind should give us an accurate answer. */ + return (m_loc_kind == FIELD_LOC_KIND_PHYSNAME + || m_loc_kind == FIELD_LOC_KIND_PHYSADDR); + } + /* Location getters / setters. */ field_loc_kind loc_kind () const @@ -2686,8 +2698,6 @@ extern struct rank rank_one_type (struct type *, struct type *, extern void recursive_dump_type (struct type *, int); -extern int field_is_static (struct field *); - /* printcmd.c */ extern void print_scalar_formatted (const gdb_byte *, struct type *, |