[LLVMdev] [Fwd: Error while running my pass with opt]

Eugene Toder eltoder at gmail.com
Sat May 8 15:50:23 PDT 2010


Try setting breakpoint in your getAnalysisUsage() and see if it's
actually called. Maybe there's a subtle difference in signature.
Failing that, try breaking on assertion failure and examining it more closely.

On Sat, May 8, 2010 at 7:03 PM, ambika <ambika at cse.iitb.ac.in> wrote:
> But this is already present in my pass.
> And I am not able to understand the cause for the error:
>
> opt: /home/ambika/llvm_3/llvm-2.6/include/llvm/PassAnalysisSupport.h:203:
> AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const
> [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass &&
> "getAnalysis*() called on an analysis that was not " "'required' by
> pass!"' failed.
>
> What can possibly cause this. Any ideas will also help.
>
> Tobias Grosser wrote:
>> Hi,
>>
>> you need something like this in your pass:
>>
>> void YourPass::getAnalysisUsage(AnalysisUsage &AU) const {
>>   AU.addRequired<DominatorTree>();
>> }
>>
>> because you need to specify which analysis you are using.
>>
>> Tobi
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list