[LLVMdev] how can I have LoopInfo in a module pass?

Wenbin Zhang zhangwen at cse.ohio-state.edu
Thu Mar 3 13:09:10 PST 2011


Hi all,
I tried to have a LoopInfo object in a function pass, add addRequired<LoopInfo> in getAnalysisUsage, and then use getAnalysis<LoopInfo> in runOnFunction(). It worked OK.
Now I want to have a module pass to traverse the functions, and similarly I want to have to loop information of the functions. When I did the above in runOnModule, and run the pass, the following error popped out:

AnalysisType& llvm::Pass::getAnalysis() const [with AnalysisType = llvm::DominatorTree]: Assertion `Resolver && "Pass has not been inserted into a PassManager object!"' failed.

Can anyone tell me the correct way to handle this in a module pass? Thanks a lot!

Best,
--Wenbin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110303/03ca1631/attachment.html>


More information about the llvm-dev mailing list