[LLVMdev] problem with multiple LLVM passes

Susan Horwitz horwitz at cs.wisc.edu
Thu Sep 10 10:23:10 PDT 2009


I'm trying to write two LLVM passes, one of which uses the results of the
other.  The first is LiveVars and the second is RemoveUseless.  In the
RemoveUseless class I have:
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<LiveVars>();
   }

This compiles fine, but when I try to run it I get an error:
       Pass class not registered!

The error goes away if I take out that "addRequired".

The code for the LiveVars pass includes
 	RegisterPass<LiveVars> X("liveVars", "Live vars analysis", true,
 	true);

and I can run the LiveVars pass like this:
 	opt -load Debug/lib/dataflowAnalysis.so -f -analyze -liveVars ...

I've tried running the RemoveUseless pass with various combinations of flags 
(just -removeUseless, both -liveVars and -removeUseles, with and without 
-analyze), but I always get the same error.


Any help will be much appreciated!



More information about the llvm-dev mailing list