From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12755 invoked by alias); 16 May 2014 15:56:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12734 invoked by uid 89); 16 May 2014 15:56:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_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 ESMTP; Fri, 16 May 2014 15:56:54 +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 s4GFQfrI019075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 16 May 2014 11:26:41 -0400 Received: from barimba.redhat.com (ovpn-113-182.phx2.redhat.com [10.3.113.182]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4GFQcV6006849; Fri, 16 May 2014 11:26:41 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 04/14] add make_unqualified_type Date: Fri, 16 May 2014 15:56:00 -0000 Message-Id: <1400253995-12333-5-git-send-email-tromey@redhat.com> In-Reply-To: <1400253995-12333-1-git-send-email-tromey@redhat.com> References: <1400253995-12333-1-git-send-email-tromey@redhat.com> X-SW-Source: 2014-05/txt/msg00302.txt.bz2 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-05-16 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 8e6631a..8e59d15 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 86b1d62..4f44e27 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1621,6 +1621,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 *); -- 1.9.0