summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2018-04-13 22:25:20 +0000
committerTim Northover <tnorthover@apple.com>2018-04-13 22:25:20 +0000
commit83610b8b82775007c6ef2ac61c10510ab3728eaa (patch)
tree94a066ad0f4e22a32dbd99b7c4fc97c2fc4fdb7d /llvm/lib/Target/X86/X86TargetMachine.cpp
parent69b897731dbfcfdc778485bcf6a336cb9af2c1b3 (diff)
MachO: trap unreachable instructions
Debugability is more important than saving 4 bytes to let us to fall through to nonense.
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 87dadd9966c..2fbf6c3b4ae 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/lib/Target/X86/X86TargetMachine.cpp
@@ -224,7 +224,8 @@ X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT,
// The check here for 64-bit windows is a bit icky, but as we're unlikely
// to ever want to mix 32 and 64-bit windows code in a single module
// this should be fine.
- if ((TT.isOSWindows() && TT.getArch() == Triple::x86_64) || TT.isPS4())
+ if ((TT.isOSWindows() && TT.getArch() == Triple::x86_64) || TT.isPS4() ||
+ TT.isOSBinFormatMachO())
this->Options.TrapUnreachable = true;
initAsmInfo();