diff options
author | Matthias Braun <matze@braunis.de> | 2018-06-28 17:00:45 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2018-06-28 17:00:45 +0000 |
commit | fd4b3c46449f001c2f02d158613e8b7302ed0d75 (patch) | |
tree | 87d9927c72cd1acf18a81bc9e1435d21d7dccf35 /llvm/lib/Target/X86/X86TargetMachine.cpp | |
parent | cccc6591b96db6fe22981e686b171d796d98a9a8 (diff) |
SelectionDAGBuilder, mach-o: Skip trap after noreturn call (for Mach-O)
Add NoTrapAfterNoreturn target option which skips emission of traps
behind noreturn calls even if TrapUnreachable is enabled.
Enable the feature on Mach-O to save code size; Comments suggest it is
not possible to enable it for the other users of TrapUnreachable.
rdar://41530228
DifferentialRevision: https://reviews.llvm.org/D48674
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 8402434cd47..9b45e3bddc8 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -229,8 +229,10 @@ X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT, // 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() || - TT.isOSBinFormatMachO()) + TT.isOSBinFormatMachO()) { this->Options.TrapUnreachable = true; + this->Options.NoTrapAfterNoreturn = TT.isOSBinFormatMachO(); + } initAsmInfo(); } |