From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7627 invoked by alias); 4 Nov 2013 22:48:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7595 invoked by uid 89); 4 Nov 2013 22:48:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Nov 2013 22:48:19 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA4MmBid013552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Nov 2013 17:48:11 -0500 Received: from [10.10.53.219] (vpn-53-219.rdu2.redhat.com [10.10.53.219]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rA4MmAwa025658; Mon, 4 Nov 2013 17:48:11 -0500 Message-ID: <5278242A.5050609@redhat.com> Date: Mon, 04 Nov 2013 22:49:00 -0000 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jakub Jelinek CC: David Malcolm , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3) References: <5271CBF9.2070005@redhat.com> <1383236801-13234-1-git-send-email-dmalcolm@redhat.com> <52741EE2.3030100@redhat.com> <20131101214148.GF27813@tucnak.zalov.cz> <52742162.2010009@redhat.com> <20131101215709.GG27813@tucnak.zalov.cz> <1383346704.5282.44.camel@surprise> <52779EF5.8000401@redhat.com> <1383601413.5282.62.camel@surprise> <20131104222543.GA27813@tucnak.zalov.cz> In-Reply-To: <20131104222543.GA27813@tucnak.zalov.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00304.txt.bz2 On 11/04/2013 05:25 PM, Jakub Jelinek wrote: > On Mon, Nov 04, 2013 at 04:43:33PM -0500, David Malcolm wrote: >> I tried converting gimple_call_set_lhs to accept a gimple_call, rather >> than a gimple, and excitingly, it was easiest to also convert >> cgraph_edge's call_stmt to also be a gimple_call, rather than just a >> gimple. >> >> Am attaching a patch (on top of the patch series being discussed) which >> adds this compile-time typesafety; bootstrap is in-progress. IMHO very >> little use of is-a.h was needed (5 instances of as_a, and 3 of dyn_cast; >> no use of is_a). > But that was just for gimple_call_set_lhs, which indeed usually is done just > for newly created calls, not for inspecting preexisting IL. If you do it > for say gimple_call_arg, gimple_call_fndecl and/or even gimple_call_lhs, I'm > afraid suddenly it would be hundreds of ugly dyn_casts/as_a and similar mess > everywhere. And, calls are still far less common gimple statements than > gimple assign. > > Indeed, we need to look at a much larger swath of code before even thinking of committing anything. Andrew