mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-17 00:27:31 +00:00
Add NamedMDNode destructor.
llvm-svn: 77959
This commit is contained in:
parent
14781bacfe
commit
b770039c5b
@ -200,6 +200,15 @@ public:
|
||||
return new NamedMDNode(N, MDs, NumMDs, M);
|
||||
}
|
||||
|
||||
/// eraseFromParent - Drop all references and remove the node from parent
|
||||
/// module.
|
||||
void eraseFromParent();
|
||||
|
||||
/// dropAllReferences - Remove all uses and clear node vector.
|
||||
void dropAllReferences();
|
||||
|
||||
~NamedMDNode();
|
||||
|
||||
typedef SmallVectorImpl<WeakMetadataVH>::const_iterator const_elem_iterator;
|
||||
|
||||
/// getParent - Get the module that holds this named metadata collection.
|
||||
|
@ -83,3 +83,20 @@ NamedMDNode::NamedMDNode(const Twine &N, MetadataBase*const* MDs,
|
||||
if (ParentModule)
|
||||
ParentModule->getNamedMDList().push_back(this);
|
||||
}
|
||||
|
||||
/// eraseFromParent - Drop all references and remove the node from parent
|
||||
/// module.
|
||||
void NamedMDNode::eraseFromParent() {
|
||||
dropAllReferences();
|
||||
getParent()->getNamedMDList().erase(this);
|
||||
}
|
||||
|
||||
/// dropAllReferences - Remove all uses and clear node vector.
|
||||
void NamedMDNode::dropAllReferences() {
|
||||
// FIXME: Update metadata use list.
|
||||
Node.clear();
|
||||
}
|
||||
|
||||
NamedMDNode::~NamedMDNode() {
|
||||
dropAllReferences();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user