aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-15 23:52:53 +0000
committerChris Lattner <sabre@nondot.org>2004-10-15 23:52:53 +0000
commit795948a5d1f47c121a027a7916b323caa433f2cb (patch)
treec05b371f39fed491211bdaeb6a8078508fdb7d64 /lib/VMCore/Instructions.cpp
parentf319e832e742959a01ab5cd0e34de0722b318b6b (diff)
Move the implementation of the instructions clone methods to this file so
that the vtables for these classes are only instantiated in this translation unit, not in every xlation unit they are used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 74907dd7c4..38e9255a9b 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -802,3 +802,33 @@ 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);
}
+
+
+// Define these methods here so vtables don't get emitted into every translation
+// unit that uses these classes.
+
+GetElementPtrInst *GetElementPtrInst::clone() const {
+ return new GetElementPtrInst(*this);
+}
+
+BinaryOperator *BinaryOperator::clone() const {
+ return create(getOpcode(), Operands[0], Operands[1]);
+}
+
+MallocInst *MallocInst::clone() const { return new MallocInst(*this); }
+AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); }
+FreeInst *FreeInst::clone() const { return new FreeInst(Operands[0]); }
+LoadInst *LoadInst::clone() const { return new LoadInst(*this); }
+StoreInst *StoreInst::clone() const { return new StoreInst(*this); }
+CastInst *CastInst::clone() const { return new CastInst(*this); }
+CallInst *CallInst::clone() const { return new CallInst(*this); }
+ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); }
+SelectInst *SelectInst::clone() const { return new SelectInst(*this); }
+VANextInst *VANextInst::clone() const { return new VANextInst(*this); }
+VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); }
+PHINode *PHINode::clone() const { return new PHINode(*this); }
+ReturnInst *ReturnInst::clone() const { return new ReturnInst(*this); }
+BranchInst *BranchInst::clone() const { return new BranchInst(*this); }
+SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); }
+InvokeInst *InvokeInst::clone() const { return new InvokeInst(*this); }
+UnwindInst *UnwindInst::clone() const { return new UnwindInst(); }