[LLVMdev] Error when using getAnalysis
nitisha warkari
nitisha.warkari at gmail.com
Sat Nov 29 20:53:23 PST 2008
Hi,
I'm trying to use the function getAnalysis. This is the code I'm using :
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfo>();
AU.setPreservesAll();
}
virtual bool runOnModule(Module &M) {
LoopInfo &LI = getAnalysis<LoopInfo>();
}
I get following error when I try to run my pass :
opt:
/net/hc295/nwarkari/llvm/llvm-2.3/include/llvm/PassAnalysisSupport.h:193:
AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with
AnalysisType = llvm::LoopInfo]: Assertion `ResultPass && "getAnalysis*()
called on an analysis that was not " "'required' by pass!"' failed.
opt[0x83cfa9d]
/lib/tls/libc.so.6(abort+0xe9)[0x15d289]
/lib/tls/libc.so.6(__assert_fail+0x101)[0x154da1]
opt(_ZNK4llvm4Pass13getAnalysisIDINS_8LoopInfoEEERT_PKNS_8PassInfoE+0x54)[0x81294a0]
Could someone please help me out with this?
Thanks!
Nitisha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081129/b85a1cc8/attachment.html>
More information about the llvm-dev
mailing list