<p dir="ltr">Do we accept the inverse option here? (If not, why not?) If so, this will add it in places it isn't supposed to go. </p>
<p dir="ltr">-eric</p>
<br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 23, 2015, 8:07 AM Akira Hatanaka <<a href="mailto:ahatanak@gmail.com">ahatanak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ahatanak created this revision.<br>
ahatanak added reviewers: echristo, dexonsmith.<br>
ahatanak added a subscriber: cfe-commits.<br>
Herald added subscribers: rengolin, aemerson.<br>
<br>
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.<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11462&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=G2fTkbJH1d8afpylpg8M6fyzITlfHiBrN7Rbj3T5c1o&s=3l4pe_SYDa_ftpUHRwXab7Ezgk04WFPXeVvSIupESGk&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11462</a><br>
<br>
Files:<br>
lib/Driver/Tools.cpp<br>
test/Driver/aarch64-fixed-x18.c<br>
<br>
Index: test/Driver/aarch64-fixed-x18.c<br>
===================================================================<br>
--- test/Driver/aarch64-fixed-x18.c<br>
+++ test/Driver/aarch64-fixed-x18.c<br>
@@ -1,4 +1,4 @@<br>
// RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t<br>
// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s<br>
<br>
-// CHECK-FIXED-X18: "-backend-option" "-aarch64-reserve-x18"<br>
+// CHECK-FIXED-X18: "-target-feature" "+reserve-x18"<br>
Index: lib/Driver/Tools.cpp<br>
===================================================================<br>
--- lib/Driver/Tools.cpp<br>
+++ lib/Driver/Tools.cpp<br>
@@ -919,11 +919,6 @@<br>
else<br>
CmdArgs.push_back("-aarch64-global-merge=true");<br>
}<br>
-<br>
- if (Args.hasArg(options::OPT_ffixed_x18)) {<br>
- CmdArgs.push_back("-backend-option");<br>
- CmdArgs.push_back("-aarch64-reserve-x18");<br>
- }<br>
}<br>
<br>
// Get CPU and ABI names. They are not independent<br>
@@ -1971,6 +1966,9 @@<br>
else<br>
Features.push_back("-crc");<br>
}<br>
+<br>
+ if (Args.hasArg(options::OPT_ffixed_x18))<br>
+ Features.push_back("+reserve-x18");<br>
}<br>
<br>
static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,<br>
<br>
<br>
</blockquote></div>