aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/iSwitch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/iSwitch.cpp')
-rw-r--r--lib/VMCore/iSwitch.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/VMCore/iSwitch.cpp b/lib/VMCore/iSwitch.cpp
index 4386b7b..c4cffc2 100644
--- a/lib/VMCore/iSwitch.cpp
+++ b/lib/VMCore/iSwitch.cpp
@@ -13,8 +13,7 @@
#include "llvm/iTerminators.h"
#include "llvm/BasicBlock.h"
-
-namespace llvm {
+using namespace llvm;
SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
Instruction *InsertBefore)
@@ -24,6 +23,14 @@ SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
Operands.push_back(Use(DefaultDest, this));
}
+SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
+ BasicBlock *InsertAtEnd)
+ : TerminatorInst(Instruction::Switch, InsertAtEnd) {
+ assert(V && DefaultDest);
+ Operands.push_back(Use(V, this));
+ Operands.push_back(Use(DefaultDest, this));
+}
+
SwitchInst::SwitchInst(const SwitchInst &SI)
: TerminatorInst(Instruction::Switch) {
Operands.reserve(SI.Operands.size());
@@ -50,5 +57,3 @@ void SwitchInst::removeCase(unsigned idx) {
assert(idx*2 < Operands.size() && "Successor index out of range!!!");
Operands.erase(Operands.begin()+idx*2, Operands.begin()+(idx+1)*2);
}
-
-} // End llvm namespace