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]

Passes are now C++ classes (was Re: [PATCH 03/11] Handwritten part of conversion of passes to C++ classes)

On Mon, 2013-07-29 at 15:41 -0600, Jeff Law wrote:
> On 07/26/2013 09:04 AM, David Malcolm wrote:
> > This patch is the hand-written part of the conversion of passes from
> > C structs to C++ classes.  It does not work without the subsequent
> > autogenerated part, which is huge.
> [ ... ]
> With the changes from pipeline -> pass_manager this is fine.  As is the 
> follow-up autogenerated patch.

I've committed this and the other patches that needed to go with it to
trunk, with the name fix, having successfully bootstrapped and tested
them on x86_64-unknown-linux-gnu - so opt_pass is now a C++ class
hierarchy, allowing for pass instances to hold pass-specific data
(albeit not GTY refs yet), and the future possibility of multiple pass
managers and pass pipelines (e.g. for embedding GCC for

Specifically, I fixed the names and rebased against master and tested
repeatedly (for the later GC patches, which are still being reviewed).
I refreshed the "03/11" patch (which became r201505) to resolve a
trivial conflict in cgraphunit.c, and then bootstrapped and tested the
series of 5 patches against r201494 on x86_64-unknown-linux-gnu (RHEL
6.4 in fact).

It successfully built all 3 stages, and gave the same testing results as
an unpatched build of r201494.

Given that, I've committed the following to trunk:
  * r201505: this patch (aka 03/11; handwritten part of conversion,
approved above by Jeff)
  * r201506: the zero-initialization of pass_manager (aka 3.1/11;
approved by rth in )
  * r201508: the big autogenerated patch (aka 04/11; approved above by
  * r201509: adding -fno-rtti when building plugins in the testsuite
(aka 05/11; approved by Jeff in )
  * r201511: aka 06/11; using pass->clone and fixing pass switch
numbering (approved by rth in )

Note that r201505 and r201506 don't compile by themselves; they need
r201508 to update all of the passes to the new internal API, and r201509
and r201511 are then needed otherwise you'll see regressions in the

Given all of the above testing I'm reasonably confident that this works.
However this is such a large change [1] that there's a non-zero chance
of at least one glitch - let me know if you see any breakages.  One
glitch that I ran into when applying the patches to svn was that I saw
some end-of-file whitespace changes in some of the gcc/testsuite files:
I'm not sure how those crept in, but I used "svn revert" by hand on them
before committing to ensure that only the files I was expecting to
change were changed.

Some of followup patches in the series are now approved, some aren't, so
I'm next going to bootstrap/test/commit the approved ones as


[1] 127 files changed, 10227 insertions(+), 4465 deletions(-)

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