From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25323 invoked by alias); 6 Jun 2016 19:22:59 -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 25285 invoked by uid 89); 6 Jun 2016 19:22:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:type_is, Hx-spam-relays-external:sk:broadba, H*RU:sk:broadba, qualifiers X-HELO: mail-lf0-f66.google.com Received: from mail-lf0-f66.google.com (HELO mail-lf0-f66.google.com) (209.85.215.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 06 Jun 2016 19:22:48 +0000 Received: by mail-lf0-f66.google.com with SMTP id k192so5861245lfb.1 for ; Mon, 06 Jun 2016 12:22:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jmYE482VfIOdgMwuvaGwBpNKINA7nq5p0TzbYonQCRI=; b=IG8lIhGNUzrfW5zd8HC+ADWkUWHOQjxh/FJb9ubAhH/CulZwBap46BYTICLCrQeTv0 iHa8ruj8JN8Ja6PG5bXZIvvhDHfIO2rwJwfmdJyPYLL3tAzVeMohmCU6fheDkVGQqBDp m1RNuBtQZ6yhxW/l7TQ6BueL9n+0M0V/zMBdtJWkZCxTfqlytcqLCO8qmh2jiUFlknhC YTgDpb/GQxQNYu7sQzWCvht7LKXHc1eKpuR74Zp6hXGxEIrXUAkRhrjGwactaifaCAKs zUNUdnkdo3USk+/QQgDrJnx7XK/4jSGp/hX1Si0Kw/4+mOzEVrnLGvt+d+857WwOUCEZ Q40w== X-Gm-Message-State: ALyK8tJgpQpIjR24rJuvIVSdNMOv0jwuaw4MrZQ+8HUUluUhxg8VrT199Mn3aS3Jq4y9Bg== X-Received: by 10.46.5.67 with SMTP id 64mr4878773ljf.12.1465240965614; Mon, 06 Jun 2016 12:22:45 -0700 (PDT) Received: from localhost.localdomain (broadband-90-154-70-138.nationalcablenetworks.ru. [90.154.70.138]) by smtp.gmail.com with ESMTPSA id jv7sm1970253lbc.4.2016.06.06.12.22.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 12:22:44 -0700 (PDT) From: Artemiy Volkov To: gdb-patches@sourceware.org Cc: palves@redhat.com, keiths@redhat.com, Artemiy Volkov Subject: [PATCH v5 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Date: Mon, 06 Jun 2016 19:23:00 -0000 Message-Id: <20160606192225.12384-2-artemiyv@acm.org> In-Reply-To: <20160606192225.12384-1-artemiyv@acm.org> References: <1458593958-25656-1-git-send-email-artemiyv@acm.org> <20160606192225.12384-1-artemiyv@acm.org> X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00108.txt.bz2 This patch introduces preliminal definitions regarding C++11 rvalue references to the gdb type system. In addition to an enum type_code entry, a field in struct type and an accessor macro for that which are created similarly to the lvalue references counterparts, we also introduce a TYPE_REFERENCE convenience macro used to check for both kinds of references simultaneously as they are equivalent in many contexts. gdb/Changelog: 2016-06-06 Artemiy Volkov PR gdb/14441 * gdbtypes.h (enum type_code) : New constant. (TYPE_IS_REFERENCE): New macro. (struct type): Add rvalue_reference_type field. (TYPE_RVALUE_REFERENCE_TYPE): New macro. --- gdb/gdbtypes.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index c651c88..bdb8354 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -160,6 +160,8 @@ enum type_code TYPE_CODE_REF, /**< C++ Reference types */ + TYPE_CODE_RVALUE_REF, /**< C++ rvalue reference types */ + TYPE_CODE_CHAR, /**< *real* character type */ /* * Boolean type. 0 is false, 1 is true, and other values are @@ -362,6 +364,11 @@ enum type_instance_flag_value #define TYPE_ATOMIC(t) \ (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_ATOMIC) +/* * True if this type represents either an lvalue or lvalue reference type. */ + +#define TYPE_IS_REFERENCE(t) \ + (TYPE_CODE (t) == TYPE_CODE_REF || TYPE_CODE (t) == TYPE_CODE_RVALUE_REF) + /* * Instruction-space delimited type. This is for Harvard architectures which have separate instruction and data address spaces (and perhaps others). @@ -767,6 +774,10 @@ struct type struct type *reference_type; + /* * A C++ rvalue reference type added in C++11. */ + + struct type *rvalue_reference_type; + /* * Variant chain. This points to a type that differs from this one only in qualifiers and length. Currently, the possible qualifiers are const, volatile, code-space, data-space, and @@ -1229,6 +1240,7 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_TARGET_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->target_type #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type +#define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type #define TYPE_CHAIN(thistype) (thistype)->chain /* * Note that if thistype is a TYPEDEF type, you have to call check_typedef. But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, -- 2.8.3