[llvm] r227839 - Use the getSubtarget call off of the MachineFunction rather than
Eric Christopher
echristo at gmail.com
Mon Feb 2 11:22:01 PST 2015
Author: echristo
Date: Mon Feb 2 13:22:01 2015
New Revision: 227839
URL: http://llvm.org/viewvc/llvm-project?rev=227839&view=rev
Log:
Use the getSubtarget call off of the MachineFunction rather than
the TargetMachine.
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp?rev=227839&r1=227838&r2=227839&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp Mon Feb 2 13:22:01 2015
@@ -50,10 +50,8 @@ void HexagonFrameLowering::determineFram
unsigned FrameSize = MFI->getStackSize();
// Get the alignments provided by the target.
- unsigned TargetAlign = MF.getTarget()
- .getSubtargetImpl()
- ->getFrameLowering()
- ->getStackAlignment();
+ unsigned TargetAlign =
+ MF.getSubtarget().getFrameLowering()->getStackAlignment();
// Get the maximum call frame size of all the calls.
unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
@@ -80,8 +78,8 @@ void HexagonFrameLowering::emitPrologue(
MachineBasicBlock &MBB = MF.front();
MachineFrameInfo *MFI = MF.getFrameInfo();
MachineBasicBlock::iterator MBBI = MBB.begin();
- const HexagonRegisterInfo *QRI = static_cast<const HexagonRegisterInfo *>(
- MF.getSubtarget().getRegisterInfo());
+ const HexagonRegisterInfo *QRI =
+ MF.getSubtarget<HexagonSubtarget>().getRegisterInfo();
DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
determineFrameLayout(MF);
@@ -168,7 +166,7 @@ void HexagonFrameLowering::emitEpilogue(
}
// Replace 'jumpr r31' instruction with dealloc_return for V4 and higher
// versions.
- if (MF.getTarget().getSubtarget<HexagonSubtarget>().hasV4TOps() &&
+ if (MF.getSubtarget<HexagonSubtarget>().hasV4TOps() &&
MBBI->getOpcode() == Hexagon::JMPret && !DisableDeallocRet) {
// Check for RESTORE_DEALLOC_RET_JMP_V4 call. Don't emit an extra DEALLOC
// instruction if we encounter it.
More information about the llvm-commits
mailing list