forked from OSchip/llvm-project
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
This commit is contained in:
parent
d3f3a89425
commit
48a995f7e9
|
@ -189,7 +189,7 @@ private:
|
||||||
void getAllMetadataImpl(SmallVectorImpl<std::pair<unsigned,MDNode*> > &)const;
|
void getAllMetadataImpl(SmallVectorImpl<std::pair<unsigned,MDNode*> > &)const;
|
||||||
void getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
|
void getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
|
||||||
MDNode*> > &) const;
|
MDNode*> > &) const;
|
||||||
void removeAllMetadata();
|
void clearMetadataHashEntries();
|
||||||
public:
|
public:
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Predicates and helper methods.
|
// Predicates and helper methods.
|
||||||
|
|
|
@ -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.
|
// Out of line virtual method, so the vtable, etc has a home.
|
||||||
Instruction::~Instruction() {
|
Instruction::~Instruction() {
|
||||||
assert(Parent == 0 && "Instruction still linked in the program!");
|
assert(Parent == 0 && "Instruction still linked in the program!");
|
||||||
if (hasMetadata())
|
if (hasMetadataHashEntry())
|
||||||
removeAllMetadata();
|
clearMetadataHashEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -563,13 +563,11 @@ getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// removeAllMetadata - Remove all metadata from this instruction.
|
/// clearMetadataHashEntries - Clear all hashtable-based metadata from
|
||||||
void Instruction::removeAllMetadata() {
|
/// this instruction.
|
||||||
assert(hasMetadata() && "Caller should check");
|
void Instruction::clearMetadataHashEntries() {
|
||||||
DbgLoc = DebugLoc();
|
assert(hasMetadataHashEntry() && "Caller should check");
|
||||||
if (hasMetadataHashEntry()) {
|
getContext().pImpl->MetadataStore.erase(this);
|
||||||
getContext().pImpl->MetadataStore.erase(this);
|
setHasMetadataHashEntry(false);
|
||||||
setHasMetadataHashEntry(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue