[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass

David Blaikie dblaikie at gmail.com
Tue Nov 29 22:13:18 PST 2011


On Tue, Nov 29, 2011 at 6:59 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> The following code is causing an "UNREACHABLE executed!" and a stack dump,
> any ideas?

The stack might be handy.

> namespace {
>   struct myPass : public CallGraphSCCPass {
>   static char ID;
>   myPass() : CallGraphSCCPass(ID) {}
>   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
>            AU.setPreservesAll();
>            AU.addRequired<LoopInfo>();
>   }
>   virtual bool runOnSCC(CallGraphSCC &SCC) {
>        for (CallGraphSCC::iterator CGNodeItr = SCC.begin(),
> CFNodeItrE=SCC.end();CGNodeItr!=CGNodeItrE;++CGNodeItr)  }
>                   const CallGraphNode *CGNode = *CGNodeItr;
>                   Function *F = CGNode->getFunction();
>                   if (!F->isDeclaration())
>                                LoopInfo &LI = getAnalysis<LoopInfo>(*F);
>         }
>        return false;
>    }
>   };
>    char myPass::ID = 0;
>    static RegisterPass<myPass> X("myPass", "This is my pass", false, false);
> }
>
> _______________________________________________
> 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