diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-04-17 01:01:27 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-04-17 01:01:27 +0000 |
| commit | d4523e3c5189dfefe4d59a1d226eefa624edeae1 (patch) | |
| tree | d8cf75f6bde24a7014ec5264aa8769bbfffc0999 /llvm/lib/CodeGen/WinEHPrepare.cpp | |
| parent | de50d36ab39b9d591bae6562f76a6e0c3169e84b (diff) | |
| download | bcm5719-llvm-d4523e3c5189dfefe4d59a1d226eefa624edeae1.tar.gz bcm5719-llvm-d4523e3c5189dfefe4d59a1d226eefa624edeae1.zip | |
[SEH] Reimplement x64 SEH using WinEHPrepare
This now emits simple, unoptimized xdata tables for __C_specific_handler
based on the handlers listed in @llvm.eh.actions calls produced by
WinEHPrepare.
This adds support for running __finally blocks when exceptions are
thrown, and removes the old landingpad fan-in codepath.
I ran some manual execution tests on small basic test cases with and
without optimization, as well as on Chrome base_unittests, which uses a
small amount of SEH. I'm sure there are bugs, and we may need to
revert.
llvm-svn: 235154
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/WinEHPrepare.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index 35b944ea309..e573f3e7f41 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -306,11 +306,6 @@ 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) { SmallVector<LandingPadInst *, 4> LPads; SmallVector<ResumeInst *, 4> Resumes; @@ -334,16 +329,6 @@ 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; |

