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.

Reply via email to