[LLVMdev] Error when using getAnalysis

Jeff Yeong-Peng Hao jeffhao at umich.edu
Tue Dec 2 11:35:24 PST 2008


Sure.  I've attached the code for the test pass I wrote, as well as the
code and bitcode for the testcase I'm running.  All the functionality has
been stripped out of the pass, and the pass compiles without a problem, but
the error appears when the pass is run.

Jeff

On Tue, 2 Dec 2008 11:06:44 -0800, Devang Patel <dpatel at apple.com> wrote:
> On Dec 2, 2008, at 10:40 AM, Jeff Yeong-Peng Hao wrote:
> 
>>
>> Hi,
>>
>> I had a question about this as well.  The documentation about  
>> writing a
>> pass shows an example like what John wrote, calling a function pass  
>> within
>> a module pass on a per function basis.  However, if I code it that  
>> way, I
>> still get the same error:
>>
>> opt: /x/jeffhao/llvm/llvm/include/llvm/PassAnalysisSupport.h:232:
>> AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*,
>> llvm::Function&) [with AnalysisType = llvm::LoopInfo]: Assertion
>> `ResultPass && "getAnalysis*() called on an analysis that was not "
>> "'required' by pass!"' failed.
>>
>> If I remove the addRequired from getAnalysisUsage, I get this error:
>>
>> opt: /x/jeffhao/llvm/llvm-2.4/lib/VMCore/PassManager.cpp:1440: virtual
>> llvm::Pass* llvm::MPPassManager::getOnTheFlyPass(llvm::Pass*, const
>> llvm::PassInfo*, llvm::Function&): Assertion `FPP && "Unable to find  
>> on the
>> fly pass"' failed.
>>
>> What else needs to be added to make the code run?
> 
> Is it possible for you to provide a reproducible test case to help us  
> understand what is going on ?
> Thanks,
> -
> Devang
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ModuleLoop.cpp
Type: text/x-c++src
Size: 1002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081202/86d01285/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ModuleLoop.h
Type: text/x-chdr
Size: 346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081202/86d01285/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.c
Type: text/x-csrc
Size: 239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081202/86d01285/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.bc
Type: application/octet-stream
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081202/86d01285/attachment.obj>


More information about the llvm-dev mailing list