diff options
| author | Eli Friedman <efriedma@codeaurora.org> | 2018-11-07 21:31:14 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@codeaurora.org> | 2018-11-07 21:31:14 +0000 |
| commit | d00fb2e0a8809981759545c145bd0875d4087c8e (patch) | |
| tree | 0b43d70e587d29722ce73ed6a1d3c9c554e9e10c /llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | |
| parent | 7f1959ebb3739274ef01f397bfc5d4b746585f34 (diff) | |
| download | bcm5719-llvm-d00fb2e0a8809981759545c145bd0875d4087c8e.tar.gz bcm5719-llvm-d00fb2e0a8809981759545c145bd0875d4087c8e.zip | |
[AArch64] [Windows] Trap after noreturn calls.
Like the comment says, this isn't the most efficient fix in terms of
codesize, but it works.
Differential Revision: https://reviews.llvm.org/D54129
llvm-svn: 346358
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64TargetMachine.cpp')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp index fe2eea65ffe..5168c0c67da 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -263,6 +263,16 @@ AArch64TargetMachine::AArch64TargetMachine(const Target &T, const Triple &TT, this->Options.NoTrapAfterNoreturn = true; } + if (TT.isOSWindows()) { + // Unwinding can get confused if the last instruction in an + // exception-handling region (function, funclet, try block, etc.) + // is a call. + // + // FIXME: We could elide the trap if the next instruction would be in + // the same region anyway. + this->Options.TrapUnreachable = true; + } + // Enable GlobalISel at or below EnableGlobalISelAt0. if (getOptLevel() <= EnableGlobalISelAtO) setGlobalISel(true); |

