diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-04-17 09:10:43 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-04-17 09:10:43 +0000 |
| commit | a762fa6c988001f61c1cc9ca2bf90eee19f08c33 (patch) | |
| tree | 3574e298284af1faa3c23195ccd11b26b66c8411 /llvm/lib/CodeGen/WinEHPrepare.cpp | |
| parent | 634b6029834ffd661ecedaf53e727a689959f0e2 (diff) | |
| download | bcm5719-llvm-a762fa6c988001f61c1cc9ca2bf90eee19f08c33.tar.gz bcm5719-llvm-a762fa6c988001f61c1cc9ca2bf90eee19f08c33.zip | |
Revert r235154-r235156, they cause asserts when building win64 code (http://crbug.com/477988)
llvm-svn: 235170
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/WinEHPrepare.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index e573f3e7f41..35b944ea309 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -306,6 +306,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) { SmallVector<LandingPadInst *, 4> LPads; SmallVector<ResumeInst *, 4> Resumes; @@ -329,6 +334,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; |

