diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Instruction.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Metadata.cpp | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp index 9792adaaa1..05bed4c643 100644 --- a/lib/VMCore/Instruction.cpp +++ b/lib/VMCore/Instruction.cpp @@ -49,8 +49,8 @@ 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()) - removeAllMetadata(); + if (hasMetadataHashEntry()) + clearMetadataHashEntries(); } diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 22e758763d..023799ceb8 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -563,13 +563,11 @@ getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned, } -/// removeAllMetadata - Remove all metadata from this instruction. -void Instruction::removeAllMetadata() { - assert(hasMetadata() && "Caller should check"); - DbgLoc = DebugLoc(); - if (hasMetadataHashEntry()) { - getContext().pImpl->MetadataStore.erase(this); - setHasMetadataHashEntry(false); - } +/// clearMetadataHashEntries - Clear all hashtable-based metadata from +/// this instruction. +void Instruction::clearMetadataHashEntries() { + assert(hasMetadataHashEntry() && "Caller should check"); + getContext().pImpl->MetadataStore.erase(this); + setHasMetadataHashEntry(false); } |