Revert r248959, "[WinEH] Emit int3 after noreturn calls on Win64"
[oota-llvm.git] / lib / CodeGen / SelectionDAG / FastISel.cpp
index f97edb4ef0904a2939cba7754ca924df68087e98..13b097cfc6065e5329a458225dce007ee182eda6 100644 (file)
@@ -1569,8 +1569,10 @@ bool FastISel::selectOperator(const User *I, unsigned Opcode) {
   }
 
   case Instruction::Unreachable:
-    // Nothing to emit.
-    return true;
+    if (TM.Options.TrapUnreachable)
+      return fastEmit_(MVT::Other, MVT::Other, ISD::TRAP) != 0;
+    else
+      return true;
 
   case Instruction::Alloca:
     // FunctionLowering has the static-sized case covered.