summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-02-21 16:23:44 +0000
committerdim <dim@FreeBSD.org>2016-02-21 16:23:44 +0000
commit5082f936dc42b118ee4ffb925af6e5979070b01f (patch)
treec3ed2eba6ed6d6a807aca69342c053354fb156ea /contrib/llvm/lib/CodeGen/WinEHPrepare.cpp
parent2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c (diff)
downloadFreeBSD-src-5082f936dc42b118ee4ffb925af6e5979070b01f.zip
FreeBSD-src-5082f936dc42b118ee4ffb925af6e5979070b01f.tar.gz
Update llvm and clang to release_38 branch r261369.
Diffstat (limited to 'contrib/llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--contrib/llvm/lib/CodeGen/WinEHPrepare.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp b/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp
index 886c5f6..14ec911 100644
--- a/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/contrib/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -257,10 +257,14 @@ static void calculateCXXStateNumbers(WinEHFuncInfo &FuncInfo,
if (auto *InnerCatchSwitch = dyn_cast<CatchSwitchInst>(UserI))
if (InnerCatchSwitch->getUnwindDest() == CatchSwitch->getUnwindDest())
calculateCXXStateNumbers(FuncInfo, UserI, CatchLow);
- if (auto *InnerCleanupPad = dyn_cast<CleanupPadInst>(UserI))
- if (getCleanupRetUnwindDest(InnerCleanupPad) ==
- CatchSwitch->getUnwindDest())
+ if (auto *InnerCleanupPad = dyn_cast<CleanupPadInst>(UserI)) {
+ BasicBlock *UnwindDest = getCleanupRetUnwindDest(InnerCleanupPad);
+ // If a nested cleanup pad reports a null unwind destination and the
+ // enclosing catch pad doesn't it must be post-dominated by an
+ // unreachable instruction.
+ if (!UnwindDest || UnwindDest == CatchSwitch->getUnwindDest())
calculateCXXStateNumbers(FuncInfo, UserI, CatchLow);
+ }
}
}
int CatchHigh = FuncInfo.getLastStateNumber();
@@ -360,10 +364,14 @@ static void calculateSEHStateNumbers(WinEHFuncInfo &FuncInfo,
if (auto *InnerCatchSwitch = dyn_cast<CatchSwitchInst>(UserI))
if (InnerCatchSwitch->getUnwindDest() == CatchSwitch->getUnwindDest())
calculateSEHStateNumbers(FuncInfo, UserI, ParentState);
- if (auto *InnerCleanupPad = dyn_cast<CleanupPadInst>(UserI))
- if (getCleanupRetUnwindDest(InnerCleanupPad) ==
- CatchSwitch->getUnwindDest())
+ if (auto *InnerCleanupPad = dyn_cast<CleanupPadInst>(UserI)) {
+ BasicBlock *UnwindDest = getCleanupRetUnwindDest(InnerCleanupPad);
+ // If a nested cleanup pad reports a null unwind destination and the
+ // enclosing catch pad doesn't it must be post-dominated by an
+ // unreachable instruction.
+ if (!UnwindDest || UnwindDest == CatchSwitch->getUnwindDest())
calculateSEHStateNumbers(FuncInfo, UserI, ParentState);
+ }
}
} else {
auto *CleanupPad = cast<CleanupPadInst>(FirstNonPHI);
OpenPOWER on IntegriCloud