Remove unnecessary calls to getSubtarget/getSubtargetImpl from the

MSP430 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-01-29 23:46:42 +00:00
parent a5119bd010
commit 5d51c0ee04
2 changed files with 3 additions and 10 deletions

View File

@ -92,14 +92,9 @@ namespace {
///
namespace {
class MSP430DAGToDAGISel : public SelectionDAGISel {
const MSP430TargetLowering &Lowering;
const MSP430Subtarget &Subtarget;
public:
MSP430DAGToDAGISel(MSP430TargetMachine &TM, CodeGenOpt::Level OptLevel)
: SelectionDAGISel(TM, OptLevel),
Lowering(*TM.getSubtargetImpl()->getTargetLowering()),
Subtarget(*TM.getSubtargetImpl()) {}
: SelectionDAGISel(TM, OptLevel) {}
const char *getPassName() const override {
return "MSP430 DAG->DAG Pattern Instruction Selection";

View File

@ -1201,8 +1201,7 @@ MSP430TargetLowering::EmitShiftInstr(MachineInstr *MI,
MachineFunction *F = BB->getParent();
MachineRegisterInfo &RI = F->getRegInfo();
DebugLoc dl = MI->getDebugLoc();
const TargetInstrInfo &TII =
*getTargetMachine().getSubtargetImpl()->getInstrInfo();
const TargetInstrInfo &TII = *F->getSubtarget().getInstrInfo();
unsigned Opc;
const TargetRegisterClass * RC;
@ -1313,8 +1312,7 @@ MSP430TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
Opc == MSP430::Srl8 || Opc == MSP430::Srl16)
return EmitShiftInstr(MI, BB);
const TargetInstrInfo &TII =
*getTargetMachine().getSubtargetImpl()->getInstrInfo();
const TargetInstrInfo &TII = *BB->getParent()->getSubtarget().getInstrInfo();
DebugLoc dl = MI->getDebugLoc();
assert((Opc == MSP430::Select16 || Opc == MSP430::Select8) &&