From f49b8ab731d5e9c459dc1bf5bef65d2df68013fd Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 2 Feb 2015 17:52:25 +0000 Subject: [PATCH] Use the function template getSubtarget on the MachineFunction rather than a larger explicit cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227818 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/XCore/XCoreFrameLowering.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Target/XCore/XCoreFrameLowering.cpp b/lib/Target/XCore/XCoreFrameLowering.cpp index 7c743401ae1..e0ac0e56781 100644 --- a/lib/Target/XCore/XCoreFrameLowering.cpp +++ b/lib/Target/XCore/XCoreFrameLowering.cpp @@ -226,8 +226,7 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const { MachineFrameInfo *MFI = MF.getFrameInfo(); MachineModuleInfo *MMI = &MF.getMMI(); const MCRegisterInfo *MRI = MMI->getContext().getRegisterInfo(); - const XCoreInstrInfo &TII = - *static_cast(MF.getSubtarget().getInstrInfo()); + const XCoreInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); XCoreFunctionInfo *XFI = MF.getInfo(); // Debug location must be unknown since the first debug location is used // to determine the end of the prologue. @@ -341,8 +340,7 @@ void XCoreFrameLowering::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { MachineFrameInfo *MFI = MF.getFrameInfo(); MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); - const XCoreInstrInfo &TII = - *static_cast(MF.getSubtarget().getInstrInfo()); + const XCoreInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); XCoreFunctionInfo *XFI = MF.getInfo(); DebugLoc dl = MBBI->getDebugLoc(); unsigned RetOpcode = MBBI->getOpcode(); @@ -480,8 +478,7 @@ restoreCalleeSavedRegisters(MachineBasicBlock &MBB, void XCoreFrameLowering:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { - const XCoreInstrInfo &TII = - *static_cast(MF.getSubtarget().getInstrInfo()); + const XCoreInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); if (!hasReservedCallFrame(MF)) { // Turn the adjcallstackdown instruction into 'extsp ' and the // adjcallstackup instruction into 'ldaw sp, sp[]' -- 2.34.1