aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2023-11-17 17:44:19 +0000
committerGitHub <noreply@github.com>2023-11-17 17:44:19 +0000
commit0fd5dc94380d5fe666dc6c603b4bb782cef743e7 (patch)
treec3fe0e5316db110542489dae088604bdd7422b39 /llvm/lib/IR/LLVMContextImpl.cpp
parent6b56dd6a9362a7060565d3ba9ba67702773ad22d (diff)
downloadllvm-0fd5dc94380d5fe666dc6c603b4bb782cef743e7.zip
llvm-0fd5dc94380d5fe666dc6c603b4bb782cef743e7.tar.gz
llvm-0fd5dc94380d5fe666dc6c603b4bb782cef743e7.tar.bz2
Revert "[DebugInfo] Make DIArgList inherit from Metadata and always unique" (#72682)
Reverts llvm/llvm-project#72147 Reverted due to buildbot failure: https://lab.llvm.org/buildbot/#/builders/5/builds/38410
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.cpp')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp
index 993deaf..406850b 100644
--- a/llvm/lib/IR/LLVMContextImpl.cpp
+++ b/llvm/lib/IR/LLVMContextImpl.cpp
@@ -68,8 +68,15 @@ LLVMContextImpl::~LLVMContextImpl() {
// Drop references for MDNodes. Do this before Values get deleted to avoid
// unnecessary RAUW when nodes are still unresolved.
- for (auto *I : DistinctMDNodes)
+ for (auto *I : DistinctMDNodes) {
+ // We may have DIArgList that were uniqued, and as it has a custom
+ // implementation of dropAllReferences, it needs to be explicitly invoked.
+ if (auto *AL = dyn_cast<DIArgList>(I)) {
+ AL->dropAllReferences();
+ continue;
+ }
I->dropAllReferences();
+ }
#define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) \
for (auto *I : CLASS##s) \
I->dropAllReferences();
@@ -80,10 +87,6 @@ LLVMContextImpl::~LLVMContextImpl() {
Pair.second->dropUsers();
for (auto &Pair : MetadataAsValues)
Pair.second->dropUse();
- // Do not untrack ValueAsMetadata references for DIArgLists, as they have
- // already been more efficiently untracked above.
- for (DIArgList *AL : DIArgLists)
- AL->dropAllReferences(/* Untrack */ false);
// Destroy MDNodes.
for (MDNode *I : DistinctMDNodes)