[llvm-commits] [vmkit] r48946 - in /vmkit/trunk/lib: JnJVM/VMCore/LowerArrayLength.cpp N3/VMCore/LowerArrayLength.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Mar 29 10:03:07 PDT 2008
Author: geoffray
Date: Sat Mar 29 12:03:05 2008
New Revision: 48946
URL: http://llvm.org/viewvc/llvm-project?rev=48946&view=rev
Log:
Bugfix in case the last instruction of a basic block is removed
Modified:
vmkit/trunk/lib/JnJVM/VMCore/LowerArrayLength.cpp
vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/LowerArrayLength.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LowerArrayLength.cpp?rev=48946&r1=48945&r2=48946&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/LowerArrayLength.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/LowerArrayLength.cpp Sat Mar 29 12:03:05 2008
@@ -38,10 +38,9 @@
bool Changed = false;
for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; BI++) {
BasicBlock *Cur = BI;
-
- for (BasicBlock::iterator II = Cur->begin(), IE = Cur->end(); II != IE;
- II++) {
+ for (BasicBlock::iterator II = Cur->begin(), IE = Cur->end(); II != IE;) {
Instruction *I = II;
+ II++;
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (CI->getOperand(0) == jnjvm::JavaJIT::arrayLengthLLVM) {
Changed = true;
Modified: vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp?rev=48946&r1=48945&r2=48946&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp Sat Mar 29 12:03:05 2008
@@ -39,9 +39,9 @@
for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; BI++) {
BasicBlock *Cur = BI;
- for (BasicBlock::iterator II = Cur->begin(), IE = Cur->end(); II != IE;
- II++) {
+ for (BasicBlock::iterator II = Cur->begin(), IE = Cur->end(); II != IE; ) {
Instruction *I = II;
+ II++;
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (CI->getOperand(0) == n3::CLIJit::arrayLengthLLVM) {
Changed = true;
More information about the llvm-commits
mailing list