summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/iSwitch.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-20 17:45:12 +0000
committerChris Lattner <sabre@nondot.org>2003-11-20 17:45:12 +0000
commit0e03ab67c3911b85847736b48f9fee2adae7058a (patch)
tree40a097fbaeb94436688a8f71e9d0682dc89c8263 /llvm/lib/VMCore/iSwitch.cpp
parent1183b6f5b0b250d3798df777f66bedc66b7d107c (diff)
downloadbcm5719-llvm-0e03ab67c3911b85847736b48f9fee2adae7058a.tar.gz
bcm5719-llvm-0e03ab67c3911b85847736b48f9fee2adae7058a.zip
* Finegrainify namespacification
* Add new constructors to allow insertion of terminator instructions at the end of basic blocks. * Move a ReturnInst method out-of-line, so that the vtable and type info don't need to be emitted to every translation unit that uses the class. llvm-svn: 10107
Diffstat (limited to 'llvm/lib/VMCore/iSwitch.cpp')
-rw-r--r--llvm/lib/VMCore/iSwitch.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/iSwitch.cpp b/llvm/lib/VMCore/iSwitch.cpp
index 4386b7b837c..c4cffc22d7d 100644
--- a/llvm/lib/VMCore/iSwitch.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud