summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-09-22 19:50:05 +0000
committerHans Wennborg <hans@hanshq.net>2016-09-22 19:50:05 +0000
commitc4b1d20ba2952e1699ec5c44dd532fa8e9bf042c (patch)
treeeca5d64e9c70e9dd6885eefe355720a4a09ad88b /llvm/lib/CodeGen/AsmPrinter/WinException.cpp
parent0201a9e94e3e95baf0e2d818e79c3f63b8fef558 (diff)
downloadbcm5719-llvm-c4b1d20ba2952e1699ec5c44dd532fa8e9bf042c.tar.gz
bcm5719-llvm-c4b1d20ba2952e1699ec5c44dd532fa8e9bf042c.zip
Win64: Don't emit unwind info for "leaf" functions (PR30337)
According to MSDN (see the PR), functions which don't touch any callee-saved registers (including %rsp) don't need any unwind info. This patch makes LLVM not emit unwind info for such functions, to save binary size. Differential Revision: https://reviews.llvm.org/D24748 llvm-svn: 282185
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 8faf53fbfb3..72f8a217c88 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -90,7 +90,7 @@ void WinException::beginFunction(const MachineFunction *MF) {
// If we're not using CFI, we don't want the CFI or the personality, but we
// might want EH tables if we had EH pads.
- if (!Asm->MAI->usesWindowsCFI()) {
+ if (!Asm->MAI->usesWindowsCFI() || (!MF->hasWinCFI() && !Per)) {
shouldEmitLSDA = hasEHFunclets;
shouldEmitPersonality = false;
return;
OpenPOWER on IntegriCloud