summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-06-07 07:04:14 +0000
committerBill Wendling <isanbard@gmail.com>2013-06-07 07:04:14 +0000
commitead89ef63e9de8069085f7fe908c64bb990bc4d9 (patch)
tree4c3be84aa62883d1e9c283c1dcfb76844a9eeebd /llvm/lib/Target/Mips/Mips16RegisterInfo.cpp
parentf5358213644b38e1d85ad2ce12ffa6c1cf319f57 (diff)
downloadbcm5719-llvm-ead89ef63e9de8069085f7fe908c64bb990bc4d9.tar.gz
bcm5719-llvm-ead89ef63e9de8069085f7fe908c64bb990bc4d9.zip
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change. llvm-svn: 183493
Diffstat (limited to 'llvm/lib/Target/Mips/Mips16RegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/Mips16RegisterInfo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp b/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp
index 4756b1e84dc..018f56c06a0 100644
--- a/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp
+++ b/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp
@@ -41,9 +41,8 @@
using namespace llvm;
-Mips16RegisterInfo::Mips16RegisterInfo(const MipsSubtarget &ST,
- const Mips16InstrInfo &I)
- : MipsRegisterInfo(ST), TII(I) {}
+Mips16RegisterInfo::Mips16RegisterInfo(const MipsSubtarget &ST)
+ : MipsRegisterInfo(ST) {}
bool Mips16RegisterInfo::requiresRegisterScavenging
(const MachineFunction &MF) const {
@@ -66,6 +65,7 @@ bool Mips16RegisterInfo::saveScavengerRegister
const TargetRegisterClass *RC,
unsigned Reg) const {
DebugLoc DL;
+ const TargetInstrInfo &TII = *MBB.getParent()->getTarget().getInstrInfo();
TII.copyPhysReg(MBB, I, DL, Mips::T0, Reg, true);
TII.copyPhysReg(MBB, UseMI, DL, Reg, Mips::T0, true);
return true;
@@ -139,6 +139,9 @@ void Mips16RegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
MachineBasicBlock &MBB = *MI.getParent();
DebugLoc DL = II->getDebugLoc();
unsigned NewImm;
+ const Mips16InstrInfo &TII =
+ *static_cast<const Mips16InstrInfo*>(
+ MBB.getParent()->getTarget().getInstrInfo());
FrameReg = TII.loadImmediate(FrameReg, Offset, MBB, II, DL, NewImm);
Offset = SignExtend64<16>(NewImm);
IsKill = true;
OpenPOWER on IntegriCloud