summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-21 16:53:47 +0000
committerChris Lattner <sabre@nondot.org>2006-06-21 16:53:47 +0000
commit1c12a881fbdef271e25d5ab9f472e29d7ef46d9d (patch)
treec2432dd13a5625c487ce5f772f2e0e99318845ce /llvm/lib/VMCore/Instruction.cpp
parent7aa4590f674615c86da4a095cf7e4650983fdc5b (diff)
downloadbcm5719-llvm-1c12a881fbdef271e25d5ab9f472e29d7ef46d9d.tar.gz
bcm5719-llvm-1c12a881fbdef271e25d5ab9f472e29d7ef46d9d.zip
Add some out-of-line virtual dtors so that the class has a "home", preventing
vtables for (e.g.) Instruction from being emitted into every .o file. llvm-svn: 28898
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index fe4ba507c17..ab4aaac7450 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/lib/VMCore/Instruction.cpp
@@ -43,6 +43,12 @@ Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
InsertAtEnd->getInstList().push_back(this);
}
+// Out of line virtual method, so the vtable, etc has a home.
+Instruction::~Instruction() {
+ assert(Parent == 0 && "Instruction still linked in the program!");
+}
+
+
void Instruction::setOpcode(unsigned opc) {
setValueType(Value::InstructionVal + opc);
}
OpenPOWER on IntegriCloud