[llvm-dev] Guidelines for pass initialization?

Philip Reames via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 21 10:15:29 PDT 2015


Does anyone know what the guidelines are supposed to be for properly 
initializing a pass?  Looking around, we seem to have three styles of 
pass registration in use.

INITIALIZE_PASS(...)

INITIALIZE_PASS_BEGIN(...)
INITIALIZE_PASS_DEPENDENCY(...)
...
INITIALIZE_PASS_END(...)

static RegisterPass<FooPass> X(...);
(This is the one encouraged in the docs, but seemingly the least widely 
used in tree?)

As far as I can tell, these often appear to work interchangeably. (At 
least for passes with only "well known" dependencies.)  Can anyone 
expose a set of guidelines as to when one should use each?

Philip


More information about the llvm-dev mailing list