]> granicus.if.org Git - clang/commitdiff
[Driver] Disable frame pointer elimination by default if target is
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 26 Feb 2016 05:07:00 +0000 (05:07 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 26 Feb 2016 05:07:00 +0000 (05:07 +0000)
x86_64-pc-win32-macho.

rdar://problem/24470634

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261976 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/frame-pointer.c

index 0cb49afb72e2e083a24eab13af8b551e925ed488..d81b0ae200c0fbdda3a7f698f20cbdc70ddd8928 100644 (file)
@@ -2955,6 +2955,8 @@ static bool shouldUseFramePointerForTarget(const ArgList &Args,
     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
index 1d63f2c42920ac621cf7f154fe6eb05f39336152..cec168636c13410cfaec3000196a2e59cf074067 100644 (file)
@@ -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