From patchwork Fri Jun 20 15:57:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1600 Received: (qmail 9038 invoked by alias); 20 Jun 2014 15:58:16 -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 8969 invoked by uid 89); 20 Jun 2014 15:58:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD 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; Fri, 20 Jun 2014 15:58:10 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5KFw8Ec022667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 20 Jun 2014 11:58:09 -0400 Received: from barimba.redhat.com (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5KFw53I015561; Fri, 20 Jun 2014 11:58:07 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 04/14] add make_unqualified_type Date: Fri, 20 Jun 2014 09:57:44 -0600 Message-Id: <1403279874-23781-5-git-send-email-tromey@redhat.com> In-Reply-To: <1403279874-23781-1-git-send-email-tromey@redhat.com> References: <1403279874-23781-1-git-send-email-tromey@redhat.com> 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-06-20 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/gdbtypes.c b/gdb/gdbtypes.c index d0c002f..453342a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -706,6 +706,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 bb6352d..3303c13 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1627,6 +1627,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 *);