]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
add make_unqualified_type
authorTom Tromey <tromey@redhat.com>
Wed, 14 May 2014 19:52:04 +0000 (13:52 -0600)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 12 Dec 2014 21:24:37 +0000 (22:24 +0100)
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.

gdb/ChangeLog
gdb/gdbtypes.c
gdb/gdbtypes.h

index 56ebab0f9bb87784594016e00241f1165ef8287e..0fc1035f3ba9392bb647665bdde0913a3cf13422 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 611a0e7d4a5e79688b067b1f30707093b6811ca2..7d842e97d1e166488aab702e17763c1502f58031 100644 (file)
@@ -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.
index a56f543be2f35ae3b2a87de92252b38d7fc109ea..b4d4f3a086ef214fad4c0b1d0ae48f6f0bd3d64d 100644 (file)
@@ -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 *);