r209434 - MachO: perform ARM ABI detection even for non-Darwin triples.

Tim Northover tnorthover at apple.com
Thu May 22 05:54:30 PDT 2014


Author: tnorthover
Date: Thu May 22 07:54:30 2014
New Revision: 209434

URL: http://llvm.org/viewvc/llvm-project?rev=209434&view=rev
Log:
MachO: perform ARM ABI detection even for non-Darwin triples.

When "-arch armv7m" is specified, we want "aapcs", for example.

rdar://problem/16581138

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/macho-embedded.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=209434&r1=209433&r2=209434&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu May 22 07:54:30 2014
@@ -771,7 +771,7 @@ void Clang::AddARMTargetArgs(const ArgLi
   const char *ABIName = nullptr;
   if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
     ABIName = A->getValue();
-  } else if (Triple.isOSDarwin()) {
+  } else if (Triple.isOSBinFormatMachO()) {
     // The backend is hardwired to assume AAPCS for M-class processors, ensure
     // the frontend matches that.
     if (Triple.getEnvironment() == llvm::Triple::EABI ||

Modified: cfe/trunk/test/Driver/macho-embedded.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/macho-embedded.c?rev=209434&r1=209433&r2=209434&view=diff
==============================================================================
--- cfe/trunk/test/Driver/macho-embedded.c (original)
+++ cfe/trunk/test/Driver/macho-embedded.c Thu May 22 07:54:30 2014
@@ -1,4 +1,5 @@
 // RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
+// RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7m -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
 // RUN: %clang -arch armv7s -target thumbv7-apple-ios -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
 // RUN: %clang -arch armv7s -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
 // RUN: %clang -arch armv6m -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACHO-EMBEDDED





More information about the cfe-commits mailing list