From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40029 invoked by alias); 23 Feb 2016 07:04: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 40015 invoked by uid 89); 23 Feb 2016 07:04:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.220.67, H*RU:209.85.220.67, 7676, H*r:gmail.com X-HELO: mail-pa0-f67.google.com Received: from mail-pa0-f67.google.com (HELO mail-pa0-f67.google.com) (209.85.220.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 23 Feb 2016 07:04:15 +0000 Received: by mail-pa0-f67.google.com with SMTP id y7so7722013paa.0 for ; Mon, 22 Feb 2016 23:04:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=5JMH22Gi2Ju19GkVG0LW7vT3del6kkV+3R8SwjxXRBc=; b=QuUQl+u+NSTFZt9N0zOdhglwvGzXcS+nhzjRAhvTTP11DPFT1RKDg6azaz3TYI7+jI N/QoDT0aPJBOVG4o+SKEubkpIOWHopbCtQI9jgvWskJWhdp4eFrOIB8CwTdGGgTxCt67 1QCqcRXVyQQxoHhYev7sf8dkZB61HXN+OJIceABAOsTxrRF3tKX+1eMT2Agv6+qOiaTJ BzORiPD6DsOfSqXfH51LzzbLkvkKsr1WHiuFWLCAt+azzdxnzH4QTWmsNOPPUAfrZscb 794c91wZRvXM8LrbnpPvuDwElk1FbTqqkGD7QV6kqQqXokgsWEntqWBarNfJ6eI32W9X neoQ== X-Gm-Message-State: AG10YOQbOTxRiauvnKtpE6VOIn6vxHBSqX+cae3TIbwDWyHrugOJ2+sTPxhd/I4cNlgsMg== X-Received: by 10.66.192.195 with SMTP id hi3mr43934222pac.149.1456211054211; Mon, 22 Feb 2016 23:04:14 -0800 (PST) Received: from gmail.com (c-73-15-67-137.hsd1.ca.comcast.net. [73.15.67.137]) by smtp.gmail.com with ESMTPSA id u84sm41385015pfa.57.2016.02.22.23.04.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 23:04:13 -0800 (PST) Date: Tue, 23 Feb 2016 07:04:00 -0000 From: Artemiy Volkov To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 01/11] [PR gdb/14441] gdb: gdbtypes: add definitions for rvalue reference type Message-ID: <20160223070313.GA1564@gmail.com> References: <1450661481-31178-1-git-send-email-artemiyv@acm.org> <1453229609-20159-1-git-send-email-artemiyv@acm.org> <1453229609-20159-2-git-send-email-artemiyv@acm.org> <56C763C2.8090207@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C763C2.8090207@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00678.txt.bz2 On Fri, Feb 19, 2016 at 10:49:38AM -0800, Keith Seitz wrote: [snip] > > /* * Instruction-space delimited type. This is for Harvard architectures > > which have separate instruction and data address spaces (and perhaps > > others). > > @@ -767,6 +775,10 @@ struct type > > > > struct type *reference_type; > > > > + /* * A C++ rvalue reference type added in C++0x. */ > > + > > + struct type *rvalue_reference_type; > > + > > Why is this new field necessary? AFAICT, it is used exactly the same way > as the reference_type field above it, and whether a reference type is an > rvalue type is encoded into the type code. Do you suggest keeping only the lvalue version of the reference type and then adjust its type code from TYPE_CODE_REF to TYPE_CODE_RVALUE_REF on lookup_rvalue_reference_type()? It seems somewhat hacky to me. E.g. how would we be able to create a struct type for a complex type involving a T&&, such as a typedef of it? > > > /* * 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 +1241,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, > > If struct type.rvalue_reference_type is superfluous, this is unneeded. > > Keith >