This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [plugins] [patch] Initial implementation of GCC plugin support
Diego Novillo wrote:
On Tue, Feb 24, 2009 at 13:38, Taras Glek <tglek@mozilla.com> wrote:
Just wanted to make a comment on the register_pass and position_pass stuff.
The code is based on the code I wrote. Since writing it, I realized that it
was a mistake to put it in the plugin part of GCC as that code needed a fair
bit of fixing over time(and will probably need more). The pass insertion
stuff should be done in the plugins themselves.
Hmm? What do you mean? The plugin should request where it wants to
be inserted. It shouldn't be its responsibility to actually insert
itself there.
I think it will depend on the plugin as to how it wants to be inserted,
some plugins don't care about registering passes, others just want to be
notified when any passes run and others yet will want to register
multiple passes, reorganize existing passes, etc. So it makes sense to
let the plugin mess around as much as it needs with passes.
My thoughts on solving this are:
a) the pass manager should provide all of the pass
enumeration/positioning/registration stuff. It does not make sense to
duplicate parts of what the pass manager does in plugin.c. If the stuff
does not seem to belong in passes.c, then it shouldn't be part of gcc.
b) If we are going to have an incomplete or hacky api, it might as well
live in the plugin.
As I said, I originally took the approach that's now(much improved) in
Le-Chun's patch, but now I consider that to be a design mistake.
Taras