[PATCH] D11462: [AArch64] Pass subtarget feature "+reserve-x18"

Akira Hatanaka ahatanak at gmail.com
Thu Jul 23 08:07:30 PDT 2015


ahatanak created this revision.
ahatanak added reviewers: echristo, dexonsmith.
ahatanak added a subscriber: cfe-commits.
Herald added subscribers: rengolin, aemerson.

This patch changes clang driver to pass subtarget feature "+reserve-x18" instead of passing backend option "-aarch64-reserve-x18". This is needed since backend options do not make it to the backend when doing LTO.

http://reviews.llvm.org/D11462

Files:
  lib/Driver/Tools.cpp
  test/Driver/aarch64-fixed-x18.c

Index: test/Driver/aarch64-fixed-x18.c
===================================================================
--- test/Driver/aarch64-fixed-x18.c
+++ test/Driver/aarch64-fixed-x18.c
@@ -1,4 +1,4 @@
 // RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t
 // RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s
 
-// CHECK-FIXED-X18: "-backend-option" "-aarch64-reserve-x18"
+// CHECK-FIXED-X18: "-target-feature" "+reserve-x18"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -919,11 +919,6 @@
     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 @@
     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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11462.30487.patch
Type: text/x-patch
Size: 1119 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150723/f48e1dc1/attachment.bin>


More information about the cfe-commits mailing list