summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsDelaySlotFiller.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
commit41e632d9e1a55d36cb08b0551ad82a13d9137a5e (patch)
tree52d4b47f777e9928012d6028eefa27bedf9f4a12 /lib/Target/Mips/MipsDelaySlotFiller.cpp
parented8b5b55a4416286758c5567c2602d2c7d0be585 (diff)
downloadllvm-41e632d9e1a55d36cb08b0551ad82a13d9137a5e.tar.gz
llvm-41e632d9e1a55d36cb08b0551ad82a13d9137a5e.tar.bz2
llvm-41e632d9e1a55d36cb08b0551ad82a13d9137a5e.tar.xz
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsDelaySlotFiller.cpp')
-rw-r--r--lib/Target/Mips/MipsDelaySlotFiller.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp
index d07a595af3..928a43d69e 100644
--- a/lib/Target/Mips/MipsDelaySlotFiller.cpp
+++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp
@@ -177,7 +177,7 @@ namespace {
class Filler : public MachineFunctionPass {
public:
Filler(TargetMachine &tm)
- : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
+ : MachineFunctionPass(ID), TM(tm) { }
virtual const char *getPassName() const {
return "Mips Delay Slot Filler";
@@ -243,7 +243,6 @@ namespace {
bool terminateSearch(const MachineInstr &Candidate) const;
TargetMachine &TM;
- const TargetInstrInfo *TII;
static char ID;
};
@@ -514,6 +513,8 @@ bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
}
// Bundle the NOP to the instruction with the delay slot.
+ const MipsInstrInfo *TII =
+ static_cast<const MipsInstrInfo*>(TM.getInstrInfo());
BuildMI(MBB, llvm::next(I), I->getDebugLoc(), TII->get(Mips::NOP));
MIBundleBuilder(MBB, I, llvm::next(llvm::next(I)));
}