mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
Delete attached metadata when an instruction is deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82647 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48e1935284
commit
ffa363c94b
@ -11,6 +11,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "LLVMContextImpl.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/Function.h"
|
||||
@ -49,6 +50,10 @@ 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() {
|
||||
if (hasMetadata()) {
|
||||
LLVMContext &Context = getContext();
|
||||
Context.pImpl->TheMetadata.ValueIsDeleted(this);
|
||||
}
|
||||
assert(Parent == 0 && "Instruction still linked in the program!");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user