[llvm-commits] [llvm] r123026 - in /llvm/trunk: include/llvm/Instructions.h unittests/VMCore/InstructionsTest.cpp

Jay Foad jay.foad at gmail.com
Fri Jan 7 12:26:51 PST 2011


Author: foad
Date: Fri Jan  7 14:26:51 2011
New Revision: 123026

URL: http://llvm.org/viewvc/llvm-project?rev=123026&view=rev
Log:
Remove the "ugly" method BranchInst::setUnconditionalDest().

Modified:
    llvm/trunk/include/llvm/Instructions.h
    llvm/trunk/unittests/VMCore/InstructionsTest.cpp

Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=123026&r1=123025&r2=123026&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Fri Jan  7 14:26:51 2011
@@ -2100,19 +2100,6 @@
     Op<-3>() = V;
   }
 
-  // setUnconditionalDest - Change the current branch to an unconditional branch
-  // targeting the specified block.
-  // FIXME: Eliminate this ugly method.
-  void setUnconditionalDest(BasicBlock *Dest) {
-    Op<-1>() = (Value*)Dest;
-    if (isConditional()) {  // Convert this to an uncond branch.
-      Op<-2>() = 0;
-      Op<-3>() = 0;
-      NumOperands = 1;
-      OperandList = op_begin();
-    }
-  }
-
   unsigned getNumSuccessors() const { return 1+isConditional(); }
 
   BasicBlock *getSuccessor(unsigned i) const {

Modified: llvm/trunk/unittests/VMCore/InstructionsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/InstructionsTest.cpp?rev=123026&r1=123025&r2=123026&view=diff
==============================================================================
--- llvm/trunk/unittests/VMCore/InstructionsTest.cpp (original)
+++ llvm/trunk/unittests/VMCore/InstructionsTest.cpp Fri Jan  7 14:26:51 2011
@@ -99,23 +99,6 @@
 
   EXPECT_EQ(b, b1->op_end());
 
-  // shrink it
-  b1->setUnconditionalDest(bb1);
-
-  // check num operands
-  EXPECT_EQ(b1->getNumOperands(), 1U);
-
-  User::const_op_iterator c(b1->op_begin());
-  EXPECT_NE(c, b1->op_end());
-
-  // check THEN
-  EXPECT_EQ(*c, bb1);
-  EXPECT_EQ(b1->getOperand(0), bb1);
-  EXPECT_EQ(b1->getSuccessor(0), bb1);
-  ++c;
-
-  EXPECT_EQ(c, b1->op_end());
-
   // clean up
   delete b0;
   delete b1;





More information about the llvm-commits mailing list