From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17070 invoked by alias); 1 Feb 2015 05:48:22 -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 17059 invoked by uid 89); 1 Feb 2015 05:48:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 01 Feb 2015 05:48:15 +0000 Received: by mail-pa0-f48.google.com with SMTP id ey11so68977201pad.7 for ; Sat, 31 Jan 2015 21:48:14 -0800 (PST) X-Received: by 10.70.140.200 with SMTP id ri8mr20029878pdb.165.1422769694220; Sat, 31 Jan 2015 21:48:14 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id dg5sm6457774pbb.67.2015.01.31.21.48.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jan 2015 21:48:13 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org Cc: gaius@glam.ac.uk Subject: Re: [PATCH 0/5] Remove struct main_type.vptr_{fieldno,basetype} References: Date: Sun, 01 Feb 2015 05:48:00 -0000 In-Reply-To: (Doug Evans's message of "Sun, 25 Jan 2015 11:31:10 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00000.txt.bz2 Doug Evans writes: > Hi. > > Anytime you can reduce the size of struct main_type that's A Good Thing. > Alas in this case my motivation, besides more general cleanup (will it > never end?), is that I may wish to add something to struct main_type. > Now I can, if I need to. > > There are two fields in struct main_type that really shouldn't be there: > vptr_fieldno, and vptr_basetype. Every type has to pay the price > in memory usage for their presence. The proper place for them is > in the type_specific field (in this case cplus_stuff) which exists > for this purpose. > > Things are a bit complicated because vptr_basetype is overloaded > to record the type of "this" for TYPE_CODE_{METHODPTR,MEMBERPTR,METHOD}, > and is accessed through the macro TYPE_DOMAIN_TYPE. > > There is also the wrinkle, discussed earlier, that m2-typeprint.c > uses TYPE_DOMAIN_TYPE. I've replaced that with TYPE_TARGET_TYPE > and left a FIXME there (pre-discussed with Gaius). This is done in 4/5. > > The series has been tested on amd64-linux with dwarf and stabs. > It needs more testing, eg., on other file formats (e.g., xcoff). > And it could use another set of eyes. > > One thing I did was rename TYPE_DOMAIN_TYPE to TYPE_SELF_TYPE. > My mind is far too used to associating the word "domain" with > VAR_DOMAIN, STRUCT_DOMAIN, etc. A better name would be nice. > I went with "self" because TYPE_THIS_TYPE was a bit confusing. > Another alternative is TYPE_TYPE_OF_THIS, but TYPE_SELF_TYPE > "works for me". Internally, some of the debug info readers > still use "domain", which is fine by me, and I've left those alone. > > 1/5 - Finish TYPE_SPECIFIC_FIELD handling in copy_type_recursive > 2/5 - Tighten up handling of types passed in gnu-v3-abi.c > ["info vtbl my_int" will currently call INIT_CPLUS_SPECIFIC on that int!] > 3/5 - Rename TYPE_DOMAIN_TYPE to TYPE_SELF_TYPE > 4/5 - Create TYPE_SPECIFIC_SELF_TYPE and have TYPE_CODE_{METHODPTR, > MEMBERPTR,METHOD} use it. > 5/5 - Finally, move vptr_fieldno,vptr_basetype into cplus_struct_type. Hi. I've done additional regression testing on aix and mingw. Committed.