From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75129 invoked by alias); 21 Mar 2016 21:02:17 -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 75107 invoked by uid 89); 21 Mar 2016 21:02:16 -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=harvard, Harvard, 3626, represents X-HELO: mail-lb0-f196.google.com Received: from mail-lb0-f196.google.com (HELO mail-lb0-f196.google.com) (209.85.217.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 21 Mar 2016 21:02:15 +0000 Received: by mail-lb0-f196.google.com with SMTP id sx8so7292616lbb.3 for ; Mon, 21 Mar 2016 14:02:15 -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=JU4MIHHZYQbQua2fnmefG3Qy/NHDLsR09XhvfcgvbbQ=; b=R3TVU5SHhcodX9q7KYGVAFbusLzioaVgy9ySG1h+2aKrE6uCnAEAhLGKIDqYa6ohFV 7dUaN9VizNVXqUmgcpZ4c9YpYVOW/3iOaduK95Sboq9HqabriuGEVKAoNUObk05Wcwq4 ry1rU1DisLodzKmxtQNrlwwTazXinUjcsab40kbX/86ki878rAq919iCvuBqAHMTXdum bsWuUNM3b9uogQrn7QzX4h44HWEXlOACtuLnEU81e+tY1WDHoNm8ZPUqnh+CHjSWqqiD C9Vq7b1mv8L2eNrAknuRdTbr4yRS2auHlsbGoZpm6KvlbdW81sBh6T/TSg9lXcX7qAzW I+XA== X-Gm-Message-State: AD7BkJJkA+j/J4dpKZ2qjZMinAj6HbAJFGXhDu73xxE6CQ4P0Tvea8aPCNmz53GPhkyzLw== X-Received: by 10.112.137.129 with SMTP id qi1mr11550726lbb.31.1458594132373; Mon, 21 Mar 2016 14:02:12 -0700 (PDT) Received: from arch.smware.local (broadband-90-154-70-182.nationalcablenetworks.ru. [90.154.70.182]) by smtp.gmail.com with ESMTPSA id 40sm4730939lfp.41.2016.03.21.14.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 14:02:11 -0700 (PDT) From: Artemiy Volkov To: gdb-patches@sourceware.org Cc: keiths@redhat.com, palves@redhat.com, Artemiy Volkov Subject: [PATCH v4 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Date: Mon, 21 Mar 2016 21:02:00 -0000 Message-Id: <1458593958-25656-2-git-send-email-artemiyv@acm.org> In-Reply-To: <1458593958-25656-1-git-send-email-artemiyv@acm.org> References: <1457147955-21871-1-git-send-email-artemiyv@acm.org> <1458593958-25656-1-git-send-email-artemiyv@acm.org> X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00436.txt.bz2 This patch introduces preliminal definitions regarding C++0x 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_IS_REFERENCE convenience macro used to check for both kinds of references simultaneously as they are equivalent in many contexts. gdb/Changelog: 2016-03-21 Artemiy Volkov * 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 1518a7a..6842052 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++0x. */ + + 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.7.3