This is the mail archive of the gcc@gcc.gnu.org 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: writing a new pass: association with an option string


Andrea Callia D'Iddio wrote on 12/04/06 03:48:
Dear all,
I wrote a new pass for gcc. Actually the pass is always executed, but
I'd like to execute it only if I specify an option from shell (ex. gcc
--mypass pippo.c). How can I do?

Create a new flag in common.opt and read its value in the gate function of your pass. I *believe* this is documented somewher in the internals manual, but I'm not sure.

You can check how other passes do it. See, for instance, flag_tree_vectorize in common.opt and in the vectorizer's gating predicate.


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