mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
While replacing an MDNode elment, properly update MDNode's operand list.
MDNode's operand list does not include all elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81045 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -62,9 +62,10 @@ bool LLVMContext::RemoveDeadMetadata() {
|
||||
return Changed;
|
||||
|
||||
while (!DeadMDNodes.empty()) {
|
||||
const MDNode *N = cast<MDNode>(DeadMDNodes.back()); DeadMDNodes.pop_back();
|
||||
if (N->use_empty())
|
||||
delete N;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user