[LLVMdev] writing an alias analysis pass?

Tobias Güntner fatbull at web.de
Fri May 2 05:59:47 PDT 2014


Am 29.04.2014 19:18, schrieb Matthew O'Connor:
> I want to be able to load my pass from an external library & not have it
> compiled into opt.

INITIALIZE_AG_PASS defines initialization functions, but it does not 
actually call them. Try this instead:

static RegisterPass<EverythingMustAlias> X("must-aa", "Everything must 
alias", false, true);
static RegisterAnalysisGroup<AliasAnalysis> Y(X);

I suppose INITIALIZE_AG_PASS is only required if the pass is directly 
linked into LLVM so it won't be initialized too early (before the rest 
of LLVM has been initialized). This isn't an issue for plugins, so 
static initialization works just fine there. But that's just my guess. ;)

Regards,
Tobias



More information about the llvm-dev mailing list