summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-10-09 01:13:17 +0000
committerReid Kleckner <rnk@google.com>2015-10-09 01:13:17 +0000
commitae44e871cdd5c51a17198733e9b795d2eabaef14 (patch)
tree06987cd62dd9dcf85520edcf012ec34ddeea4800 /llvm/lib/CodeGen
parent37bb6810f24a68643aea0268b85e7c1b9f1a3f02 (diff)
downloadbcm5719-llvm-ae44e871cdd5c51a17198733e9b795d2eabaef14.tar.gz
bcm5719-llvm-ae44e871cdd5c51a17198733e9b795d2eabaef14.zip
Revert "Revert "Revert r248959, "[WinEH] Emit int3 after noreturn calls on Win64"""
This reverts commit r249794. Apparently my checkouts are full of unexpected surprises today. llvm-svn: 249796
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp6
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index f97edb4ef09..13b097cfc60 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -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.
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 9371944d242..9e315194c98 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2260,7 +2260,11 @@ void SelectionDAGBuilder::visitIndirectBr(const IndirectBrInst &I) {
getValue(I.getAddress())));
}
-void SelectionDAGBuilder::visitUnreachable(const UnreachableInst &I) {}
+void SelectionDAGBuilder::visitUnreachable(const UnreachableInst &I) {
+ if (DAG.getTarget().Options.TrapUnreachable)
+ DAG.setRoot(
+ DAG.getNode(ISD::TRAP, getCurSDLoc(), MVT::Other, DAG.getRoot()));
+}
void SelectionDAGBuilder::visitFSub(const User &I) {
// -0.0 - X --> fneg
OpenPOWER on IntegriCloud