[LLVMdev] loadable passes with dependencies?

Tobias Grosser tobias at grosser.es
Tue Nov 8 11:28:34 PST 2011


On 11/08/2011 07:33 PM, ret val wrote:
> Sorry to keep dragging this out on you. Im now getting: Assertion
> failed: (ResultPass&&  "getAnalysis*() called on an analysis that was
> not " "'required' by pass!"), function getAnalysisID
>
> But I already have:
> void getAnalysisUsage(AnalysisUsage&AU) const {
> 		AU.addRequired<DominatorTree>();
> }
>
> And changed the bottom of my pass too:
>
> char Hello::ID = 0;
> namespace llvm { void initializeHelloPass(llvm::PassRegistry&); }
> INITIALIZE_PASS_BEGIN(Hello, "hello", "Hello World Pass", false, true)
> INITIALIZE_PASS_DEPENDENCY(DominatorTree)
> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true)
>
> class StaticInitializer {
> public:
> 	StaticInitializer() {
> 		PassRegistry&Registry = *PassRegistry::getPassRegistry();
> 		initializeHelloPass(Registry);
> 	}
> };
>
> static StaticInitializer InitializeEverything;

Looks good to me. Are you sure you call getAnalysis only for the 
DominatorTree? What is the output of "grep getAnalysis YourPass.cpp"?

Cheers
Tobi



More information about the llvm-dev mailing list