<div dir="ltr"><div>Totally reasonable. I look forward to removing it again in the very near future. :)<br></div><div class="gmail_extra"><br>- Lang.<br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 2:18 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br>
Date: Fri Aug 1 16:18:01 2014<br>
New Revision: 214560<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=214560&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=214560&view=rev</a><br>
Log:<br>
Add a non-const subtarget returning function to the target machine<br>
so that we can use it to get the old-style JIT out of the subtarget.<br>
<br>
This code should be removed when the old-style JIT is removed<br>
(imminently).<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/Target/TargetMachine.h<br>
llvm/trunk/lib/Target/ARM/ARMTargetMachine.h<br>
llvm/trunk/lib/Target/Mips/MipsTargetMachine.h<br>
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h<br>
llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h<br>
llvm/trunk/lib/Target/X86/X86TargetMachine.h<br>
<br>
Modified: llvm/trunk/include/llvm/Target/TargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)<br>
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -100,6 +100,7 @@ public:<br>
virtual const TargetSubtargetInfo *getSubtargetImpl() const {<br>
return nullptr;<br>
}<br>
+ virtual TargetSubtargetInfo *getSubtargetImpl() { return nullptr; }<br>
<br>
mutable TargetOptions Options;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -33,6 +33,7 @@ public:<br>
bool isLittle);<br>
<br>
const ARMSubtarget *getSubtargetImpl() const override { return &Subtarget; }<br>
+ ARMSubtarget *getSubtargetImpl() override { return &Subtarget; }<br>
const ARMBaseRegisterInfo *getRegisterInfo() const override {<br>
return getSubtargetImpl()->getRegisterInfo();<br>
}<br>
@@ -54,7 +55,7 @@ public:<br>
const DataLayout *getDataLayout() const override {<br>
return getSubtargetImpl()->getDataLayout();<br>
}<br>
- ARMJITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }<br>
+ ARMJITInfo *getJITInfo() override { return getSubtargetImpl()->getJITInfo(); }<br>
<br>
/// \brief Register ARM analysis passes with a pass manager.<br>
void addAnalysisPasses(PassManagerBase &PM) override;<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -50,13 +50,18 @@ public:<br>
return Subtarget;<br>
return &DefaultSubtarget;<br>
}<br>
+ MipsSubtarget *getSubtargetImpl() override {<br>
+ if (Subtarget)<br>
+ return Subtarget;<br>
+ return &DefaultSubtarget;<br>
+ }<br>
const InstrItineraryData *getInstrItineraryData() const override {<br>
return Subtarget->inMips16Mode()<br>
? nullptr<br>
: &getSubtargetImpl()->getInstrItineraryData();<br>
}<br>
MipsJITInfo *getJITInfo() override {<br>
- return Subtarget->getJITInfo();<br>
+ return getSubtargetImpl()->getJITInfo();<br>
}<br>
const MipsRegisterInfo *getRegisterInfo() const override {<br>
return getSubtargetImpl()->getRegisterInfo();<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -38,7 +38,7 @@ public:<br>
const PPCFrameLowering *getFrameLowering() const override {<br>
return getSubtargetImpl()->getFrameLowering();<br>
}<br>
- PPCJITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }<br>
+ PPCJITInfo *getJITInfo() override { return getSubtargetImpl()->getJITInfo(); }<br>
const PPCTargetLowering *getTargetLowering() const override {<br>
return getSubtargetImpl()->getTargetLowering();<br>
}<br>
@@ -53,6 +53,7 @@ public:<br>
return getSubtargetImpl()->getDataLayout();<br>
}<br>
const PPCSubtarget *getSubtargetImpl() const override { return &Subtarget; }<br>
+ PPCSubtarget *getSubtargetImpl() override { return &Subtarget; }<br>
const InstrItineraryData *getInstrItineraryData() const override {<br>
return &getSubtargetImpl()->getInstrItineraryData();<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h (original)<br>
+++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -35,6 +35,7 @@ public:<br>
return getSubtargetImpl()->getFrameLowering();<br>
}<br>
const SparcSubtarget *getSubtargetImpl() const override { return &Subtarget; }<br>
+ SparcSubtarget *getSubtargetImpl() override { return &Subtarget; }<br>
const SparcRegisterInfo *getRegisterInfo() const override {<br>
return getSubtargetImpl()->getRegisterInfo();<br>
}<br>
@@ -44,7 +45,9 @@ public:<br>
const SparcSelectionDAGInfo *getSelectionDAGInfo() const override {<br>
return getSubtargetImpl()->getSelectionDAGInfo();<br>
}<br>
- SparcJITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }<br>
+ SparcJITInfo *getJITInfo() override {<br>
+ return getSubtargetImpl()->getJITInfo();<br>
+ }<br>
const DataLayout *getDataLayout() const override {<br>
return getSubtargetImpl()->getDataLayout();<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=214560&r1=214559&r2=214560&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original)<br>
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Fri Aug 1 16:18:01 2014<br>
@@ -41,8 +41,9 @@ public:<br>
const TargetFrameLowering *getFrameLowering() const override {<br>
return getSubtargetImpl()->getFrameLowering();<br>
}<br>
- X86JITInfo *getJITInfo() override { return Subtarget.getJITInfo(); }<br>
+ X86JITInfo *getJITInfo() override { return getSubtargetImpl()->getJITInfo(); }<br>
const X86Subtarget *getSubtargetImpl() const override { return &Subtarget; }<br>
+ X86Subtarget *getSubtargetImpl() override { return &Subtarget; }<br>
const X86TargetLowering *getTargetLowering() const override {<br>
return getSubtargetImpl()->getTargetLowering();<br>
}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>