Yiannis Tsiouris
2012-Oct-18 11:50 UTC
[LLVMdev] Bug in LowerIntrinsics::PerformDefaultLowering ?
Hi, I noticed that in line 288-289 of lib/CodeGen/GCStrategy.cpp there is a loop:> for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { > for (BasicBlock::iterator II = BB->begin(), E = BB->end(); > II != E;) {E is used both for F.end() and for BB->end(). Is this intended? -Y. -- Yiannis Tsiouris Ph.D. student, Software Engineering Laboratory, National Technical University of Athens WWW: http://www.softlab.ntua.gr/~gtsiour
David Tweed
2012-Oct-18 12:45 UTC
[LLVMdev] Bug in LowerIntrinsics::PerformDefaultLowering ?
|I noticed that in line 288-289 of lib/CodeGen/GCStrategy.cpp there is a |loop: |> for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { |> for (BasicBlock::iterator II = BB->begin(), E = BB->end(); |> II != E;) { |E is used both for F.end() and for BB->end(). Is this intended? Note that it's also being declared in the for header, so the inner E is shadowing the outer E (ie, they're separate variables). So it's not wrong per se, although I always compile with -Wshadow because problems when this happens are _really_ nasty to track down. Cheers, Dave
Yiannis Tsiouris
2012-Oct-18 13:36 UTC
[LLVMdev] Bug in LowerIntrinsics::PerformDefaultLowering ?
On 10/18/2012 03:45 PM, David Tweed wrote:> |I noticed that in line 288-289 of lib/CodeGen/GCStrategy.cpp there is a > |loop: > > |> for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { > |> for (BasicBlock::iterator II = BB->begin(), E = BB->end(); > |> II != E;) { > > |E is used both for F.end() and for BB->end(). Is this intended? > > Note that it's also being declared in the for header, so the inner E is shadowing the outer E (ie, they're separate variables). So it's not wrong per se, although I always compile with -Wshadow because problems when this happens are _really_ nasty to track down. >Oops, sorry for that! You're absolutely right! :-$ -- Yiannis Tsiouris Ph.D. student, Software Engineering Laboratory, National Technical University of Athens WWW: http://www.softlab.ntua.gr/~gtsiour
Possibly Parallel Threads
- [LLVMdev] Bug in LowerIntrinsics::PerformDefaultLowering ?
- [LLVMdev] GCMetadataPrinter::finishAssembly not executed?
- [LLVMdev] Publication - ErLLVM: An LLVM backend for Erlang
- [LLVMdev] GCMetadataPrinter::finishAssembly not executed?
- [LLVMdev] Publication - ErLLVM: An LLVM backend for Erlang