summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-23 18:34:01 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-23 18:34:01 +0000
commit909ea7e6b87844e1b95fa66d8fb8ed2eeaf495e9 (patch)
treeab06b5219018b590dccd5e5b7c882aa1ab599804 /llvm/lib/CodeGen/WinEHPrepare.cpp
parent7c5cb066d091eed948d0ef10bb15b9def37b81ab (diff)
downloadbcm5719-llvm-909ea7e6b87844e1b95fa66d8fb8ed2eeaf495e9.tar.gz
bcm5719-llvm-909ea7e6b87844e1b95fa66d8fb8ed2eeaf495e9.zip
Revert "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
We still have some "uses remain after removal" issues in -O0 builds. This reverts commit r235557. llvm-svn: 235617
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index e11da29fedc..57671f09378 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -323,6 +323,11 @@ FunctionPass *llvm::createWinEHPass(const TargetMachine *TM) {
return new WinEHPrepare(TM);
}
+// FIXME: Remove this once the backend can handle the prepared IR.
+static cl::opt<bool>
+ SEHPrepare("sehprepare", cl::Hidden,
+ cl::desc("Prepare functions with SEH personalities"));
+
bool WinEHPrepare::runOnFunction(Function &Fn) {
// No need to prepare outlined handlers.
if (Fn.hasFnAttribute("wineh-parent"))
@@ -350,6 +355,16 @@ bool WinEHPrepare::runOnFunction(Function &Fn) {
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ if (isAsynchronousEHPersonality(Personality) && !SEHPrepare) {
+ // Replace all resume instructions with unreachable.
+ // FIXME: Remove this once the backend can handle the prepared IR.
+ for (ResumeInst *Resume : Resumes) {
+ IRBuilder<>(Resume).CreateUnreachable();
+ Resume->eraseFromParent();
+ }
+ return true;
+ }
+
// If there were any landing pads, prepareExceptionHandlers will make changes.
prepareExceptionHandlers(Fn, LPads);
return true;
OpenPOWER on IntegriCloud