Move parent assertion check before metadata deletion.

llvm-svn: 82692
This commit is contained in:
Devang Patel 2009-09-24 16:19:11 +00:00
parent f95a450ef9
commit 4e6f2e46e8
1 changed files with 1 additions and 1 deletions

View File

@ -50,11 +50,11 @@ Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
// Out of line virtual method, so the vtable, etc has a home.
Instruction::~Instruction() {
assert(Parent == 0 && "Instruction still linked in the program!");
if (hasMetadata()) {
LLVMContext &Context = getContext();
Context.pImpl->TheMetadata.ValueIsDeleted(this);
}
assert(Parent == 0 && "Instruction still linked in the program!");
}