r268589 - Do not add uwtable attribute by default for MachO targets.
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Wed May 4 18:41:08 PDT 2016
Author: ahatanak
Date: Wed May 4 20:41:07 2016
New Revision: 268589
URL: http://llvm.org/viewvc/llvm-project?rev=268589&view=rev
Log:
Do not add uwtable attribute by default for MachO targets.
r217178 changed clang to add function attribute uwtable by default on
Win64, which caused the __eh_frame section to be emitted by default.
This commit restores the previous behavior for MachO targets.
rdar://problem/25282627
Added:
cfe/trunk/test/Driver/win-macho-unwind.c
Modified:
cfe/trunk/lib/Driver/MSVCToolChain.cpp
Modified: cfe/trunk/lib/Driver/MSVCToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/MSVCToolChain.cpp?rev=268589&r1=268588&r2=268589&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/MSVCToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/MSVCToolChain.cpp Wed May 4 20:41:07 2016
@@ -71,6 +71,11 @@ bool MSVCToolChain::IsUnwindTablesDefaul
// Emit unwind tables by default on Win64. All non-x86_32 Windows platforms
// such as ARM and PPC actually require unwind tables, but LLVM doesn't know
// how to generate them yet.
+
+ // Don't emit unwind tables by default for MachO targets.
+ if (getTriple().isOSBinFormatMachO())
+ return false;
+
return getArch() == llvm::Triple::x86_64;
}
Added: cfe/trunk/test/Driver/win-macho-unwind.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/win-macho-unwind.c?rev=268589&view=auto
==============================================================================
--- cfe/trunk/test/Driver/win-macho-unwind.c (added)
+++ cfe/trunk/test/Driver/win-macho-unwind.c Wed May 4 20:41:07 2016
@@ -0,0 +1,4 @@
+// RUN: %clang -target x86_64-pc-win32-macho -### -S %s -o %t.s 2>&1 | FileCheck %s
+
+// Do not add function attribute "uwtable" for macho targets.
+// CHECK-NOT: -munwind-tables
More information about the cfe-commits
mailing list