summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index c4eaef88673..12733acf3b8 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -1072,7 +1072,8 @@ void WinEHPrepare::fixupNoReturnCleanupPads(Function &F) {
if (!CleanupPad)
continue;
// Skip over any cleanups have unwind targets, they do not need this.
- if (getCleanupRetUnwindDest(CleanupPad) != nullptr)
+ if (any_of(CleanupPad->users(),
+ [](const User *U) { return isa<CleanupReturnInst>(U); }))
continue;
// Walk the blocks within the cleanup which end in 'unreachable'.
// We will replace the unreachable instruction with a cleanupret;
OpenPOWER on IntegriCloud