diff options
author | Chris Lattner <sabre@nondot.org> | 2006-06-21 16:53:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-06-21 16:53:47 +0000 |
commit | 1c12a881fbdef271e25d5ab9f472e29d7ef46d9d (patch) | |
tree | c2432dd13a5625c487ce5f772f2e0e99318845ce /llvm/lib/VMCore/Instruction.cpp | |
parent | 7aa4590f674615c86da4a095cf7e4650983fdc5b (diff) | |
download | bcm5719-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.cpp | 6 |
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); } |