Skip to content

Commit c4450aa

Browse files
[Lanai] Remove unnecessary casts (NFC) (#148765)
getInstrInfo() already returns const LanaiInstrInfo *. Likewise, getRegisterInfo() already returns const LanaiRegisterInfo *.
1 parent a869f7e commit c4450aa

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/Target/Lanai/LanaiFrameLowering.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ void LanaiFrameLowering::determineFrameLayout(MachineFunction &MF) const {
5959
// ADJDYNALLOC pseudo instructions with a Lanai:ADDI with the
6060
// maximum call frame size as the immediate.
6161
void LanaiFrameLowering::replaceAdjDynAllocPseudo(MachineFunction &MF) const {
62-
const LanaiInstrInfo &LII =
63-
*static_cast<const LanaiInstrInfo *>(STI.getInstrInfo());
62+
const LanaiInstrInfo &LII = *STI.getInstrInfo();
6463
unsigned MaxCallFrameSize = MF.getFrameInfo().getMaxCallFrameSize();
6564

6665
for (MachineBasicBlock &MBB : MF) {
@@ -88,8 +87,7 @@ void LanaiFrameLowering::emitPrologue(MachineFunction &MF,
8887
assert(&MF.front() == &MBB && "Shrink-wrapping not yet supported");
8988

9089
MachineFrameInfo &MFI = MF.getFrameInfo();
91-
const LanaiInstrInfo &LII =
92-
*static_cast<const LanaiInstrInfo *>(STI.getInstrInfo());
90+
const LanaiInstrInfo &LII = *STI.getInstrInfo();
9391
MachineBasicBlock::iterator MBBI = MBB.begin();
9492

9593
// Debug location must be unknown since the first debug location is used
@@ -173,8 +171,7 @@ MachineBasicBlock::iterator LanaiFrameLowering::eliminateCallFramePseudoInstr(
173171
void LanaiFrameLowering::emitEpilogue(MachineFunction & /*MF*/,
174172
MachineBasicBlock &MBB) const {
175173
MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
176-
const LanaiInstrInfo &LII =
177-
*static_cast<const LanaiInstrInfo *>(STI.getInstrInfo());
174+
const LanaiInstrInfo &LII = *STI.getInstrInfo();
178175
DebugLoc DL = MBBI->getDebugLoc();
179176

180177
// Restore the stack pointer using the callee's frame pointer value.
@@ -195,8 +192,7 @@ void LanaiFrameLowering::determineCalleeSaves(MachineFunction &MF,
195192
TargetFrameLowering::determineCalleeSaves(MF, SavedRegs, RS);
196193

197194
MachineFrameInfo &MFI = MF.getFrameInfo();
198-
const LanaiRegisterInfo *LRI =
199-
static_cast<const LanaiRegisterInfo *>(STI.getRegisterInfo());
195+
const LanaiRegisterInfo *LRI = STI.getRegisterInfo();
200196
int Offset = -4;
201197

202198
// Reserve 4 bytes for the saved RCA

0 commit comments

Comments
 (0)