diff options
author | Tom Tromey <tromey@redhat.com> | 2014-05-14 13:52:04 -0600 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-12-12 22:24:37 +0100 |
commit | f1660027106d583c639c9f37096519944d5c20e9 (patch) | |
tree | 3050e98a16c8e123e8e18174b98b7f64444e1659 | |
parent | 4ff709eb44e13fee683f01184a490e4fcc5c2862 (diff) | |
download | gdb-f1660027106d583c639c9f37096519944d5c20e9.zip gdb-f1660027106d583c639c9f37096519944d5c20e9.tar.gz gdb-f1660027106d583c639c9f37096519944d5c20e9.tar.bz2 |
add make_unqualified_type
There's seemingly no function to get the unqualified variant of a
type, so this patch adds one. This new function will be used in the
final patch.
gdb/ChangeLog
2014-12-12 Tom Tromey <tromey@redhat.com>
* gdbtypes.h (make_unqualified_type): Declare.
* gdbtypes.c (make_unqualified_type): New function.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 13 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 56ebab0..0fc1035 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-12-12 Tom Tromey <tromey@redhat.com> + * gdbtypes.h (make_unqualified_type): Declare. + * gdbtypes.c (make_unqualified_type): New function. + +2014-12-12 Tom Tromey <tromey@redhat.com> + * ui-file.h (ui_file_write_for_put): Declare. * ui-file.c (ui_file_write_for_put): New function. * mi/mi-out.c (do_write): Remove. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 611a0e7..7d842e9 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -703,6 +703,19 @@ make_restrict_type (struct type *type) NULL); } +/* Make a type without const, volatile, or restrict. */ + +struct type * +make_unqualified_type (struct type *type) +{ + return make_qualified_type (type, + (TYPE_INSTANCE_FLAGS (type) + & ~(TYPE_INSTANCE_FLAG_CONST + | TYPE_INSTANCE_FLAG_VOLATILE + | TYPE_INSTANCE_FLAG_RESTRICT)), + NULL); +} + /* Replace the contents of ntype with the type *type. This changes the contents, rather than the pointer for TYPE_MAIN_TYPE (ntype); thus the changes are propogated to all types in the TYPE_CHAIN. diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index a56f543..b4d4f3a 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1632,6 +1632,8 @@ extern struct type *make_cv_type (int, int, struct type *, struct type **); extern struct type *make_restrict_type (struct type *); +extern struct type *make_unqualified_type (struct type *); + extern void replace_type (struct type *, struct type *); extern int address_space_name_to_int (struct gdbarch *, char *); |