From 814f1bb8e31ea9d582f56a18b6470592f5e9f0cf Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Fri, 7 Jan 2011 20:26:51 +0000 Subject: [PATCH] Remove the "ugly" method BranchInst::setUnconditionalDest(). llvm-svn: 123026 --- llvm/include/llvm/Instructions.h | 13 ------------- llvm/unittests/VMCore/InstructionsTest.cpp | 17 ----------------- 2 files changed, 30 deletions(-) diff --git a/llvm/include/llvm/Instructions.h b/llvm/include/llvm/Instructions.h index eab167db148a..626dd0ee4540 100644 --- a/llvm/include/llvm/Instructions.h +++ b/llvm/include/llvm/Instructions.h @@ -2100,19 +2100,6 @@ public: 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 { diff --git a/llvm/unittests/VMCore/InstructionsTest.cpp b/llvm/unittests/VMCore/InstructionsTest.cpp index c9fe2a13166f..1d1127d863b8 100644 --- a/llvm/unittests/VMCore/InstructionsTest.cpp +++ b/llvm/unittests/VMCore/InstructionsTest.cpp @@ -99,23 +99,6 @@ TEST(InstructionsTest, BranchInst) { 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;