r261976 - [Driver] Disable frame pointer elimination by default if target is

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 21:07:00 PST 2016


Author: ahatanak
Date: Thu Feb 25 23:07:00 2016
New Revision: 261976

URL: http://llvm.org/viewvc/llvm-project?rev=261976&view=rev
Log:
[Driver] Disable frame pointer elimination by default if target is
x86_64-pc-win32-macho.

rdar://problem/24470634

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/frame-pointer.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=261976&r1=261975&r2=261976&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Feb 25 23:07:00 2016
@@ -2955,6 +2955,8 @@ static bool shouldUseFramePointerForTarg
     switch (Triple.getArch()) {
     case llvm::Triple::x86:
       return !areOptimizationsEnabled(Args);
+    case llvm::Triple::x86_64:
+      return Triple.isOSBinFormatMachO();
     case llvm::Triple::arm:
     case llvm::Triple::thumb:
       // Windows on ARM builds with FPO disabled to aid fast stack walking

Modified: cfe/trunk/test/Driver/frame-pointer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/frame-pointer.c?rev=261976&r1=261975&r2=261976&view=diff
==============================================================================
--- cfe/trunk/test/Driver/frame-pointer.c (original)
+++ cfe/trunk/test/Driver/frame-pointer.c Thu Feb 25 23:07:00 2016
@@ -10,6 +10,7 @@
 // RUN: %clang -target x86_64-pc-linux -### -S -O2 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK2-64 %s
 // RUN: %clang -target x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
 // RUN: %clang -target x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
+// RUN: %clang -target x86_64-pc-win32-macho -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK-MACHO-64 %s
 
 // Trust the above to get the optimizations right, and just test other targets
 // that want this by default.
@@ -36,3 +37,4 @@
 // CHECK2-64-NOT: -mdisable-fp-elim
 // CHECK3-64-NOT: -mdisable-fp-elim
 // CHECKs-64-NOT: -mdisable-fp-elim
+// CHECK-MACHO-64: -mdisable-fp-elim




More information about the cfe-commits mailing list