This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/6] Conversion of gimple types to C++ inheritance (v3)

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

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]