diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-20 22:25:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-20 22:25:04 +0000 |
commit | 48a995f7e9f231b9596a470171ee66da54cbce0f (patch) | |
tree | 75b50514faeb3cdf61b04935074ac0af18b0db55 /llvm/lib | |
parent | d3f3a894250a6fed00a010e7dfaa454a4b0f3ce3 (diff) | |
download | bcm5719-llvm-48a995f7e9f231b9596a470171ee66da54cbce0f.tar.gz bcm5719-llvm-48a995f7e9f231b9596a470171ee66da54cbce0f.zip |
Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.
llvm-svn: 108948
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Instruction.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp index 9792adaaa12..05bed4c6431 100644 --- a/llvm/lib/VMCore/Instruction.cpp +++ b/llvm/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/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 22e758763d6..023799ceb82 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/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); } |