This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- From: Jeff Law <law at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Andrew MacLeod <amacleod at redhat dot com>
- Date: Tue, 05 Nov 2013 15:12:08 -0700
- Subject: Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)
- Authentication-results: sourceware.org; auth=none
- References: <5271CBF9 dot 2070005 at redhat dot com> <1383236801-13234-1-git-send-email-dmalcolm at redhat dot com> <527960A8 dot 7030107 at redhat dot com> <1383688624 dot 5282 dot 111 dot camel at surprise>
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