From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17677 invoked by alias); 5 Nov 2013 22:12:18 -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 17667 invoked by uid 89); 5 Nov 2013 22:12:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 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; Tue, 05 Nov 2013 22:12:16 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA5MC99E011660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 5 Nov 2013 17:12:09 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-132.phx2.redhat.com [10.3.113.132]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA5MC89T007616; Tue, 5 Nov 2013 17:12:08 -0500 Message-ID: <52796D38.2010602@redhat.com> Date: Tue, 05 Nov 2013 22:17:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: David Malcolm CC: gcc-patches@gcc.gnu.org, Andrew MacLeod 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> <527960A8.7030107@redhat.com> <1383688624.5282.111.camel@surprise> In-Reply-To: <1383688624.5282.111.camel@surprise> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00486.txt.bz2 On 11/05/13 14:57, David Malcolm wrote: > > Thanks for looking through this. > > Both you and Andrew objected to my use of the is-a.h stuff. Is this due > to the use of C++ templates in that code? If I were to rewrite things > in a more C idiom, would that be acceptable? I can't speak for Andrew, but my experience with this kind of object type casting in a large C++ project is that it's a red flag for a design problem. You could certainly argue that the design problem already exists. You could further argue that what you're doing is marking those warts visible in the code rather than in the data structures. Whether or not that's a good thing I haven't pondered much. For me personally it's less about the syntax. Others may have other opinions. I strongly suggest they chime in with them ;-) > > Maybe. If the above idea is still too far, we could keep the > GIMPLE_CHECK checking, and cast by hand. I suspect the results would be > more ugly (though it's clear that beauty is in the eye of the beholder > here :)) > > BTW, how do you feel about static_cast<> vs C-style casts? Dislike them both :-) jeff