From 5d51c0ee04b0b00a198cb94a562e4aaeec59d3e2 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 29 Jan 2015 23:46:42 +0000 Subject: [PATCH] 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 --- lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 7 +------ lib/Target/MSP430/MSP430ISelLowering.cpp | 6 ++---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp index 81c176b8262..2f70cde75d4 100644 --- a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -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"; diff --git a/lib/Target/MSP430/MSP430ISelLowering.cpp b/lib/Target/MSP430/MSP430ISelLowering.cpp index 04bb6d041cf..0ef9fe22e63 100644 --- a/lib/Target/MSP430/MSP430ISelLowering.cpp +++ b/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -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) &&