r191900 - ARM: *-*-darwin-eabi triples should use AAPCS.

Tim Northover tnorthover at apple.com
Thu Oct 3 07:23:28 PDT 2013


Author: tnorthover
Date: Thu Oct  3 09:23:28 2013
New Revision: 191900

URL: http://llvm.org/viewvc/llvm-project?rev=191900&view=rev
Log:
ARM: *-*-darwin-eabi triples should use AAPCS.

Added:
    cfe/trunk/test/Driver/darwin-eabi.c
Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=191900&r1=191899&r2=191900&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Oct  3 09:23:28 2013
@@ -765,7 +765,8 @@ void Clang::AddARMTargetArgs(const ArgLi
   } else if (Triple.isOSDarwin()) {
     // The backend is hardwired to assume AAPCS for M-class processors, ensure
     // the frontend matches that.
-    if (StringRef(CPUName).startswith("cortex-m")) {
+    if (Triple.getEnvironment() == llvm::Triple::EABI ||
+        StringRef(CPUName).startswith("cortex-m")) {
       ABIName = "aapcs";
     } else {
       ABIName = "apcs-gnu";

Added: cfe/trunk/test/Driver/darwin-eabi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-eabi.c?rev=191900&view=auto
==============================================================================
--- cfe/trunk/test/Driver/darwin-eabi.c (added)
+++ cfe/trunk/test/Driver/darwin-eabi.c Thu Oct  3 09:23:28 2013
@@ -0,0 +1,7 @@
+// RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
+// RUN: %clang -arch armv7 -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+// RUN: %clang -arch armv7s -### -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
+
+// CHECK-AAPCS: "-target-abi" "aapcs"
+// CHECK-APCS: "-target-abi" "apcs-gnu"





More information about the cfe-commits mailing list