From: Bill Wendling Date: Fri, 7 Jun 2013 06:26:43 +0000 (+0000) Subject: Don't cache the instruction and register info from the TargetMachine, because X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=637eab6a3be3a15fbf2057328ec4773d77467a76;p=oota-llvm.git 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@183491 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp b/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp index 3d0d1cecd1f..1d18cc454bc 100644 --- a/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp +++ b/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp @@ -37,13 +37,11 @@ static cl::opt MBDisableDelaySlotFiller( namespace { struct Filler : public MachineFunctionPass { - TargetMachine &TM; - const TargetInstrInfo *TII; static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "MBlaze Delay Slot Filler"; @@ -239,7 +237,7 @@ bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) { Changed = true; if (D == MBB.end()) - BuildMI(MBB, ++J, I->getDebugLoc(), TII->get(MBlaze::NOP)); + BuildMI(MBB, ++J, I->getDebugLoc(),TM.getInstrInfo()->get(MBlaze::NOP)); else MBB.splice(++J, &MBB, D); } diff --git a/lib/Target/MBlaze/MBlazeInstrInfo.cpp b/lib/Target/MBlaze/MBlazeInstrInfo.cpp index 79449f73f74..ab069e6716a 100644 --- a/lib/Target/MBlaze/MBlazeInstrInfo.cpp +++ b/lib/Target/MBlaze/MBlazeInstrInfo.cpp @@ -29,7 +29,7 @@ using namespace llvm; MBlazeInstrInfo::MBlazeInstrInfo(MBlazeTargetMachine &tm) : MBlazeGenInstrInfo(MBlaze::ADJCALLSTACKDOWN, MBlaze::ADJCALLSTACKUP), - TM(tm), RI(*TM.getSubtargetImpl(), *this) {} + TM(tm), RI(*TM.getSubtargetImpl()) {} static bool isZeroImm(const MachineOperand &op) { return op.isImm() && op.getImm() == 0; diff --git a/lib/Target/MBlaze/MBlazeRegisterInfo.cpp b/lib/Target/MBlaze/MBlazeRegisterInfo.cpp index bd83afc1cc8..72fb8c62aff 100644 --- a/lib/Target/MBlaze/MBlazeRegisterInfo.cpp +++ b/lib/Target/MBlaze/MBlazeRegisterInfo.cpp @@ -42,8 +42,8 @@ using namespace llvm; MBlazeRegisterInfo:: -MBlazeRegisterInfo(const MBlazeSubtarget &ST, const TargetInstrInfo &tii) - : MBlazeGenRegisterInfo(MBlaze::R15), Subtarget(ST), TII(tii) {} +MBlazeRegisterInfo(const MBlazeSubtarget &ST) + : MBlazeGenRegisterInfo(MBlaze::R15), Subtarget(ST) {} unsigned MBlazeRegisterInfo::getPICCallReg() { return MBlaze::R20; diff --git a/lib/Target/MBlaze/MBlazeRegisterInfo.h b/lib/Target/MBlaze/MBlazeRegisterInfo.h index 497f3866c9c..b463478a90e 100644 --- a/lib/Target/MBlaze/MBlazeRegisterInfo.h +++ b/lib/Target/MBlaze/MBlazeRegisterInfo.h @@ -37,10 +37,8 @@ namespace MBlaze { struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo { const MBlazeSubtarget &Subtarget; - const TargetInstrInfo &TII; - MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget, - const TargetInstrInfo &tii); + MBlazeRegisterInfo(const MBlazeSubtarget &Subtarget); /// Get PIC indirect call register static unsigned getPICCallReg();