[RISCV][NFC] Use templated getSubtarget in RISCVExpandPseudo::runOnMachineFunction
authorAlex Bradbury <asb@igalia.com>
Thu, 20 Jul 2023 13:05:17 +0000 (14:05 +0100)
committerAlex Bradbury <asb@igalia.com>
Thu, 20 Jul 2023 13:08:41 +0000 (14:08 +0100)
This avoids a static_cast.

llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp

index 00b2959..6bb388f 100644 (file)
@@ -68,7 +68,7 @@ private:
 char RISCVExpandPseudo::ID = 0;
 
 bool RISCVExpandPseudo::runOnMachineFunction(MachineFunction &MF) {
-  TII = static_cast<const RISCVInstrInfo *>(MF.getSubtarget().getInstrInfo());
+  TII = MF.getSubtarget<RISCVSubtarget>().getInstrInfo();
 
 #ifndef NDEBUG
   const unsigned OldSize = getInstSizeInBytes(MF);