[LLVMdev] problem with runOnLoop

Alex alexandruionutdiaconescu at gmail.com
Tue Dec 18 01:34:31 PST 2012


John Criswell <criswell <at> illinois.edu> writes:

> 
> 
>     On 12/12/11 9:59 AM, neda 8664 wrote:
>     
>       
>       hi all,
>       I want access to all basic blocks of function in a loop, so I used
>       the following code:bool parallel::runOnLoop(Loop *L, LPPassManager
>           &LPM)
>           {
>               for (Function::iterator bi= func->begin(); bi !=
>           func->end(); bi++){
>                  //
>                }
>           }
> 
>     
>     Are you modifying anything within this code (especially changes that
>     add/remove basic blocks or change their Terminator instructions)? 
>     Depending on what you're doing, you may be invalidating the basic
>     block iterator bi.
>     -- John T.
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

Hello, I am getting same opt Stack dump error frequently as well. Also trying to
access basic blocks in runOnBasicBlock(BasicBlock &BB). This is at the 4th line
with errs():
Instruction* current = BB.getTerminator();
errs() << "\n last: "<<*current<<"\n";
Instruction* prev = current->getPrevNode();
errs()<<*prev<<"\n";
What can be the cause?







More information about the llvm-dev mailing list