diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 78a1b74fd84..7a10467e062 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -99,12 +99,26 @@ public: // BranchInst(BB* T, BB *F, Value *C, Inst *I) - 'br C, T, F', insert before I // BranchInst(BB* B, BB *I) - 'br B' insert at end // BranchInst(BB* T, BB *F, Value *C, BB *I) - 'br C, T, F', insert at end - BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = 0); - BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *cond, - Instruction *InsertBefore = 0); - BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd); - BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *cond, - BasicBlock *InsertAtEnd); + BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = 0) + : TerminatorInst(Instruction::Br, InsertBefore) { + init(IfTrue); + } + BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, + Instruction *InsertBefore = 0) + : TerminatorInst(Instruction::Br, InsertBefore) { + init(IfTrue, IfFalse, Cond); + } + + BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd) + : TerminatorInst(Instruction::Br, InsertAtEnd) { + init(IfTrue); + } + + BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, + BasicBlock *InsertAtEnd) + : TerminatorInst(Instruction::Br, InsertAtEnd) { + init(IfTrue, IfFalse, Cond); + } virtual Instruction *clone() const { return new BranchInst(*this); } @@ -168,8 +182,14 @@ class SwitchInst : public TerminatorInst { void init(Value *Value, BasicBlock *Default); public: - SwitchInst(Value *Value, BasicBlock *Default, Instruction *InsertBefore = 0); - SwitchInst(Value *Value, BasicBlock *Default, BasicBlock *InsertAtEnd); + SwitchInst(Value *Value, BasicBlock *Default, Instruction *InsertBefore = 0) + : TerminatorInst(Instruction::Switch, InsertBefore) { + init(Value, Default); + } + SwitchInst(Value *Value, BasicBlock *Default, BasicBlock *InsertAtEnd) + : TerminatorInst(Instruction::Switch, InsertAtEnd) { + init(Value, Default); + } virtual Instruction *clone() const { return new SwitchInst(*this); } diff --git a/lib/VMCore/iBranch.cpp b/lib/VMCore/iBranch.cpp index a5ba36fd177..e0bdcf7d18a 100644 --- a/lib/VMCore/iBranch.cpp +++ b/lib/VMCore/iBranch.cpp @@ -47,28 +47,6 @@ void BranchInst::init(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond) Operands.push_back(Use(Cond, this)); } -BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond, - Instruction *InsertBefore) - : TerminatorInst(Instruction::Br, InsertBefore) { - init(True, False, Cond); -} - -BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond, - BasicBlock *InsertAtEnd) - : TerminatorInst(Instruction::Br, InsertAtEnd) { - init(True, False, Cond); -} - -BranchInst::BranchInst(BasicBlock *True, Instruction *InsertBefore) - : TerminatorInst(Instruction::Br, InsertBefore) { - init(True); -} - -BranchInst::BranchInst(BasicBlock *True, BasicBlock *InsertAtEnd) - : TerminatorInst(Instruction::Br, InsertAtEnd) { - init(True); -} - BranchInst::BranchInst(const BranchInst &BI) : TerminatorInst(Instruction::Br) { Operands.reserve(BI.Operands.size()); Operands.push_back(Use(BI.Operands[0], this)); diff --git a/lib/VMCore/iSwitch.cpp b/lib/VMCore/iSwitch.cpp index d4dccde5b58..b78cfbbdc3d 100644 --- a/lib/VMCore/iSwitch.cpp +++ b/lib/VMCore/iSwitch.cpp @@ -22,17 +22,6 @@ void SwitchInst::init(Value *Value, BasicBlock *Default) Operands.push_back(Use(Default, this)); } -SwitchInst::SwitchInst(Value *V, BasicBlock *D, - Instruction *InsertBefore) - : TerminatorInst(Instruction::Switch, InsertBefore) { - init(V, D); -} - -SwitchInst::SwitchInst(Value *V, BasicBlock *D, BasicBlock *InsertAtEnd) - : TerminatorInst(Instruction::Switch, InsertAtEnd) { - init(V, D); -} - SwitchInst::SwitchInst(const SwitchInst &SI) : TerminatorInst(Instruction::Switch) { Operands.reserve(SI.Operands.size());