[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 18:47:00 PDT 2002


Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.46 -> 1.47

---
Log message:

Fix the last of the silly bugs I just introduced.  :(



---
Diffs of the changes:

Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.46 llvm/lib/Transforms/Scalar/ADCE.cpp:1.47
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.46	Tue Sep 10 17:38:47 2002
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Tue Sep 10 18:46:10 2002
@@ -240,7 +240,7 @@
     //
     if (!AliveBlocks.count(&Func->front())) {
       BasicBlock *NewEntry = new BasicBlock();
-      new BranchInst(&Func->front(), NewEntry->end());
+      NewEntry->getInstList().push_back(new BranchInst(&Func->front()));
       Func->getBasicBlockList().push_front(NewEntry);
       AliveBlocks.insert(NewEntry);    // This block is always alive!
     }
@@ -353,8 +353,8 @@
         // Delete the old terminator instruction...
         BB->getInstList().pop_back();
         const Type *RetTy = Func->getReturnType();
-        new ReturnInst(RetTy != Type::VoidTy ? Constant::getNullValue(RetTy) :0,
-                       BB->end());
+        BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ?
+                                           Constant::getNullValue(RetTy) : 0));
       }
 
       BB->dropAllReferences();





More information about the llvm-commits mailing list