mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Remove MDNode from ValueMap when MDNode is destroyed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -92,8 +92,17 @@ void MDNode::dropAllReferences() {
|
||||
Node.clear();
|
||||
}
|
||||
|
||||
static std::vector<Value*> getValType(MDNode *N) {
|
||||
std::vector<Value*> Elements;
|
||||
Elements.reserve(N->getNumElements());
|
||||
for (unsigned i = 0, e = N->getNumElements(); i != e; ++i)
|
||||
Elements.push_back(N->getElement(i));
|
||||
return Elements;
|
||||
}
|
||||
|
||||
MDNode::~MDNode() {
|
||||
dropAllReferences();
|
||||
getType()->getContext().pImpl->MDNodes.remove(this);
|
||||
}
|
||||
//===----------------------------------------------------------------------===//
|
||||
//NamedMDNode implementation
|
||||
|
||||
Reference in New Issue
Block a user