On 10/31/13 10:26, David Malcolm wrote:
The following series of patches convert it to a C++ hierarchy, using the
existing structs, eliminating the union. The "gimple" typedef changes
from being a
(union gimple_statement_d *)
to being a:
(struct gimple_statement_base *)
There are no virtual functions in the new code: the sizes of the various
structs are unchanged.
Seems like a reasonable place to start (no virtuals). As I mentioned in
my earlier reply today, virtuals may be one way to cut down on the
downcasting. They have obvious downsides, but I think we now have some
code samples to think about so we can sensibly evaluate downcasting vs
adding virtual functions and how each affects the code we write.
Again, as noted in the earlier patch series, the names of the structs
are rather verbose. I would prefer to also rename them all to eliminate
the "_statement" component:
"gimple_statement_base" -> "gimple_base"
"gimple_statement_phi" -> "gimple_phi"
"gimple_statement_omp" -> "gimple_omp"
etc, but I didn't do this to mimimize the patch size. But if the core
maintainers are up for that, I can redo the patch series with that
change also, or do that as a followup.
If we do that, I think it'd be a followup -- it's a fair amount of churn
with marginal benefit though, IMHO.
Jeff