Revert r242736.
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 20 Jul 2015 23:53:02 +0000 (23:53 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 20 Jul 2015 23:53:02 +0000 (23:53 +0000)
r242737 caused builds to fail with the following error message, so I'm
reverting the clang side change too:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

llvm-svn: 242741

clang/lib/Driver/Tools.cpp
clang/test/Driver/arm-fixed-r9.c

index 8e5e980..3ae0558 100644 (file)
@@ -719,12 +719,6 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
       Features.push_back("+long-calls");
   }
 
-  // llvm does not support reserving registers in general. There is support
-  // for reserving r9 on ARM though (defined as a platform-specific register
-  // in ARM EABI).
-  if (Args.hasArg(options::OPT_ffixed_r9))
-    Features.push_back("+reserve-r9");
-
   // The kext linker doesn't know how to deal with movw/movt.
   if (KernelOrKext)
     Features.push_back("+no-movt");
@@ -834,6 +828,13 @@ void Clang::AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs,
                     options::OPT_mno_implicit_float, true))
     CmdArgs.push_back("-no-implicit-float");
 
+  // llvm does not support reserving registers in general. There is support
+  // for reserving r9 on ARM though (defined as a platform-specific register
+  // in ARM EABI).
+  if (Args.hasArg(options::OPT_ffixed_r9)) {
+    CmdArgs.push_back("-backend-option");
+    CmdArgs.push_back("-arm-reserve-r9");
+  }
 }
 
 /// getAArch64TargetCPU - Get the (LLVM) name of the AArch64 cpu we are
index 74ac336..2cec8b4 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang -target arm-none-gnueabi -ffixed-r9 -### %s 2> %t
 // RUN: FileCheck --check-prefix=CHECK-FIXED-R9 < %t %s
 
-// CHECK-FIXED-R9: "-target-feature" "+reserve-r9"
+// CHECK-FIXED-R9: "-backend-option" "-arm-reserve-r9"