From patchwork Sat Nov 1 21:46:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 3543 Received: (qmail 26380 invoked by alias); 1 Nov 2014 21:46:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26307 invoked by uid 89); 1 Nov 2014 21:46:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 01 Nov 2014 21:46:24 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA1LkM5d021206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sat, 1 Nov 2014 17:46:23 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA1LkLpC022268 for ; Sat, 1 Nov 2014 17:46:22 -0400 Subject: [PATCH v3 04/14] add make_unqualified_type From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Sat, 01 Nov 2014 22:46:21 +0100 Message-ID: <20141101214621.13230.28444.stgit@host1.jankratochvil.net> In-Reply-To: <20141101214552.13230.45564.stgit@host1.jankratochvil.net> References: <20141101214552.13230.45564.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes From: Tom Tromey 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. 2014-10-07 Tom Tromey * gdbtypes.h (make_unqualified_type): Declare. * gdbtypes.c (make_unqualified_type): New function. --- gdb/ChangeLog | 5 +++++ gdb/gdbtypes.c | 13 +++++++++++++ gdb/gdbtypes.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9993a2b..15513ae 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-10-07 Tom Tromey + * gdbtypes.h (make_unqualified_type): Declare. + * gdbtypes.c (make_unqualified_type): New function. + +2014-10-07 Tom Tromey + * 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 ee33d77..017cd28 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 bd1a0ab..879c650 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1641,6 +1641,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 *);