Hi,<br><br>I'm trying to use the function getAnalysis. This is the code I'm using :<br><br> void getAnalysisUsage(AnalysisUsage &AU) const {<br>      AU.addRequired<LoopInfo>();<br>      AU.setPreservesAll();<br>
    }<br><br> virtual bool runOnModule(Module &M) {<br>     LoopInfo &LI = getAnalysis<LoopInfo>();<br><br><br>   }<br><br><br><br>I get following error when I try to run my pass :<br><br>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.<br>
opt[0x83cfa9d]<br>/lib/tls/libc.so.6(abort+0xe9)[0x15d289]<br>/lib/tls/libc.so.6(__assert_fail+0x101)[0x154da1]<br>opt(_ZNK4llvm4Pass13getAnalysisIDINS_8LoopInfoEEERT_PKNS_8PassInfoE+0x54)[0x81294a0]<br><br>Could someone please help me out with this?<br>
<br>Thanks!<br>Nitisha<br> <br>