summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index fdc0b1bb97b..eb686aa4bec 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -105,8 +105,8 @@ void DIBuilder::finalize() {
// Now that all temp nodes have been replaced or deleted, resolve remaining
// cycles.
for (const auto &N : UnresolvedNodes)
- if (N)
- cast<UniquableMDNode>(N)->resolveCycles();
+ if (N && !N->isResolved())
+ N->resolveCycles();
UnresolvedNodes.clear();
// Can't handle unresolved nodes anymore.
OpenPOWER on IntegriCloud