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: How to add a new pass?


DJ Delorie wrote:
> Ian Lance Taylor <iant@google.com> writes:
>> I don't think anybody has ever done this.  At the moment only plugins
>> add new passes.  But I agree that backends clearly need to be able to do
>> this, and some passes need to move into the appropriate backends.  I
>> would encourage you to fix this.
> 
> I've done this, to move md_reorg sooner.  The pass gets a "highest" dump
> file number, but it runs at the right time.

Thanks for the information.

The dump pass number is very confusing, it is no more possible to
see when the pass actually runs resp. the actual pass ordering.

The reason is that a backend cannot hook in before
register_dump_files() is called in passes.c:init_optimization_passes().

A target hook there would be reasonable and yield a place to add/[re]move
passes instead of abusing a hook that's not designed for it.

> 
> I just call register_pass() with a suitable struct.
> 

Which hook did you use to add/move the pass?



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