]> granicus.if.org Git - clang/commitdiff
[AArch64] Pass subtarget feature "+reserve-x18" instead of passing backend
authorAkira Hatanaka <ahatanaka@apple.com>
Sat, 25 Jul 2015 00:18:00 +0000 (00:18 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Sat, 25 Jul 2015 00:18:00 +0000 (00:18 +0000)
option "-aarch64-reserve-x18".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

Differential Revision: http://reviews.llvm.org/D11462

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

lib/Driver/Tools.cpp

index 46a309fb830a3952d20d4eb3ad05c10365c7e492..f99c81866c44338332a71db9b4ea781d31567dbf 100644 (file)
@@ -919,11 +919,6 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
     else
       CmdArgs.push_back("-aarch64-global-merge=true");
   }
-
-  if (Args.hasArg(options::OPT_ffixed_x18)) {
-    CmdArgs.push_back("-backend-option");
-    CmdArgs.push_back("-aarch64-reserve-x18");
-  }
 }
 
 // Get CPU and ABI names. They are not independent
@@ -1971,6 +1966,9 @@ static void getAArch64TargetFeatures(const Driver &D, const ArgList &Args,
     else
       Features.push_back("-crc");
   }
+
+  if (Args.hasArg(options::OPT_ffixed_x18))
+    Features.push_back("+reserve-x18");
 }
 
 static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,