[SEH] Reimplement x64 SEH using WinEHPrepare
[oota-llvm.git] / lib / CodeGen / WinEHPrepare.cpp
index 35b944ea309cb4b6169a1aba4a7cd1d8e0b1bd8f..e573f3e7f41c20c9d478d937246386f2a86e3ac1 100644 (file)
@@ -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;