summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/iSwitch.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-26 21:41:09 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-26 21:41:09 +0000
commit9f0fdf748243844ae04aa3561b591edb2d9283e4 (patch)
tree8c3f95b238481a3fa6ca9d7c08cefdc4d464b60f /llvm/lib/VMCore/iSwitch.cpp
parent9e84b503f0364b9b76fb40b89ddcdbad635a8847 (diff)
downloadbcm5719-llvm-9f0fdf748243844ae04aa3561b591edb2d9283e4.tar.gz
bcm5719-llvm-9f0fdf748243844ae04aa3561b591edb2d9283e4.zip
Refactor common initialization code in private init() functions.
This is a first step in supplying append to basic block constructors for all instruction types. llvm-svn: 13793
Diffstat (limited to 'llvm/lib/VMCore/iSwitch.cpp')
-rw-r--r--llvm/lib/VMCore/iSwitch.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/VMCore/iSwitch.cpp b/llvm/lib/VMCore/iSwitch.cpp
index c4cffc22d7d..d4dccde5b58 100644
--- a/llvm/lib/VMCore/iSwitch.cpp
+++ b/llvm/lib/VMCore/iSwitch.cpp
@@ -15,20 +15,22 @@
#include "llvm/BasicBlock.h"
using namespace llvm;
-SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
+void SwitchInst::init(Value *Value, BasicBlock *Default)
+{
+ assert(Value && Default);
+ Operands.push_back(Use(Value, this));
+ Operands.push_back(Use(Default, this));
+}
+
+SwitchInst::SwitchInst(Value *V, BasicBlock *D,
Instruction *InsertBefore)
: TerminatorInst(Instruction::Switch, InsertBefore) {
- assert(V && DefaultDest);
- Operands.push_back(Use(V, this));
- Operands.push_back(Use(DefaultDest, this));
+ init(V, D);
}
-SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
- BasicBlock *InsertAtEnd)
+SwitchInst::SwitchInst(Value *V, BasicBlock *D, BasicBlock *InsertAtEnd)
: TerminatorInst(Instruction::Switch, InsertAtEnd) {
- assert(V && DefaultDest);
- Operands.push_back(Use(V, this));
- Operands.push_back(Use(DefaultDest, this));
+ init(V, D);
}
SwitchInst::SwitchInst(const SwitchInst &SI)
OpenPOWER on IntegriCloud