r243310 - [AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin.
Akira Hatanaka
ahatanaka at apple.com
Mon Jul 27 12:29:04 PDT 2015
Author: ahatanak
Date: Mon Jul 27 14:29:04 2015
New Revision: 243310
URL: http://llvm.org/viewvc/llvm-project?rev=243310&view=rev
Log:
[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin.
After r243308, the front-end is responsible for checking the target OS and
passing reserve-x18 if the target is Darwin.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/aarch64-fixed-x18.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=243310&r1=243309&r2=243310&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jul 27 14:29:04 2015
@@ -1927,7 +1927,9 @@ getAArch64MicroArchFeaturesFromMcpu(cons
return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
}
-static void getAArch64TargetFeatures(const Driver &D, const ArgList &Args,
+static void getAArch64TargetFeatures(const Driver &D,
+ const llvm::Triple &Triple,
+ const ArgList &Args,
std::vector<const char *> &Features) {
Arg *A;
bool success = true;
@@ -1968,7 +1970,7 @@ static void getAArch64TargetFeatures(con
Features.push_back("-crc");
}
- if (Args.hasArg(options::OPT_ffixed_x18))
+ if (Args.hasArg(options::OPT_ffixed_x18) || Triple.isOSDarwin())
Features.push_back("+reserve-x18");
}
@@ -2003,7 +2005,7 @@ static void getTargetFeatures(const Driv
break;
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_be:
- getAArch64TargetFeatures(D, Args, Features);
+ getAArch64TargetFeatures(D, Triple, Args, Features);
break;
case llvm::Triple::x86:
case llvm::Triple::x86_64:
Modified: cfe/trunk/test/Driver/aarch64-fixed-x18.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/aarch64-fixed-x18.c?rev=243310&r1=243309&r2=243310&view=diff
==============================================================================
--- cfe/trunk/test/Driver/aarch64-fixed-x18.c (original)
+++ cfe/trunk/test/Driver/aarch64-fixed-x18.c Mon Jul 27 14:29:04 2015
@@ -1,4 +1,9 @@
// RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s
+// RUN: %clang -target aarch64-none-gnu -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-NO-FIXED-X18 < %t %s
+// RUN: %clang -target -arm64-apple-ios -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s
// CHECK-FIXED-X18: "-target-feature" "+reserve-x18"
+// CHECK-NO-FIXED-X18-NOT: "-target-feature" "+reserve-x18"
More information about the cfe-commits
mailing list