mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Derive metadata hierarchy from Value instead of User.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -45,32 +45,6 @@ GetElementPtrConstantExpr::GetElementPtrConstantExpr
|
||||
OperandList[i+1] = IdxList[i];
|
||||
}
|
||||
|
||||
bool LLVMContext::RemoveDeadMetadata() {
|
||||
std::vector<WeakVH> DeadMDNodes;
|
||||
bool Changed = false;
|
||||
while (1) {
|
||||
|
||||
for (FoldingSet<MDNode>::iterator
|
||||
I = pImpl->MDNodeSet.begin(),
|
||||
E = pImpl->MDNodeSet.end(); I != E; ++I) {
|
||||
MDNode *N = &(*I);
|
||||
if (N->use_empty())
|
||||
DeadMDNodes.push_back(WeakVH(N));
|
||||
}
|
||||
|
||||
if (DeadMDNodes.empty())
|
||||
return Changed;
|
||||
|
||||
while (!DeadMDNodes.empty()) {
|
||||
Value *V = DeadMDNodes.back(); DeadMDNodes.pop_back();
|
||||
if (const MDNode *N = dyn_cast_or_null<MDNode>(V))
|
||||
if (N->use_empty())
|
||||
delete N;
|
||||
}
|
||||
}
|
||||
return Changed;
|
||||
}
|
||||
|
||||
MetadataContext &LLVMContext::getMetadata() {
|
||||
return pImpl->TheMetadata;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user