On 11/01/2013 05:57 PM, Jakub Jelinek wrote:
On Fri, Nov 01, 2013 at 05:47:14PM -0400, Andrew MacLeod wrote:
On 11/01/2013 05:41 PM, Jakub Jelinek wrote:
On Fri, Nov 01, 2013 at 05:36:34PM -0400, Andrew MacLeod wrote:
static inline void
! gimple_call_set_lhs (gimple gs, tree lhs)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
The checking you are removing here.
What checking? There ought to be no checking at all in this
example... gimple_build_call_vec returns a gimple_call, and
gimple_call_set_lhs() doesn't have to check anything because it
only accepts gimple_call's.. so there is no checking other than the
usual "does my parameter match" that the compiler has to do...
and want to replace it by checking of the types at compile time.
The problem is that it uglifies the source too much, and, when you
actually don't have a gimple_call but supposedly a base class of it,
But when you convert all the source base for gimple calls, then you have
context pretty much everywhere.. you wont be doing it from a base
class... at least pretty infrequently.
I expect you'd do as_a which is not only further uglification, but has
runtime cost also for --enable-checking=release.
Im not a fan of as_a<> or is_a<> at all. I really dislike them. They
should be kept to the barest minimum, or even non existent if
possible..... If you need it, you probably need restructured source.
ie, functions which work with switches on gimple_code() need to be
restructured... And the end result should look cleaner.
Of course, thats what makes it a big project too :-)
Andrew