From c882973bf7c1dfc6c99de868d171f7f2647c9350 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 10 Sep 2002 23:54:58 +0000 Subject: [PATCH] Add convenience ctor to BranchInst llvm-svn: 3676 --- lib/VMCore/iBranch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/VMCore/iBranch.cpp b/lib/VMCore/iBranch.cpp index 1561c3b7095..3ad36d13ee2 100644 --- a/lib/VMCore/iBranch.cpp +++ b/lib/VMCore/iBranch.cpp @@ -26,6 +26,13 @@ BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond, "May only branch on boolean predicates!!!!"); } +BranchInst::BranchInst(BasicBlock *True, Instruction *InsertBefore) + : TerminatorInst(Instruction::Br, InsertBefore) { + assert(True != 0 && "True branch destination may not be null!!!"); + Operands.reserve(1); + Operands.push_back(Use(True, this)); +} + BranchInst::BranchInst(const BranchInst &BI) : TerminatorInst(Instruction::Br) { Operands.reserve(BI.Operands.size()); Operands.push_back(Use(BI.Operands[0], this));