[llvm] r258126 - [WebAssembly] Use the templated form of MachineFunction::getSubtarget(). NFC.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 06:53:20 PST 2016


Author: djg
Date: Tue Jan 19 08:53:19 2016
New Revision: 258126

URL: http://llvm.org/viewvc/llvm-project?rev=258126&view=rev
Log:
[WebAssembly] Use the templated form of MachineFunction::getSubtarget(). NFC.

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp?rev=258126&r1=258125&r2=258126&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp Tue Jan 19 08:53:19 2016
@@ -109,8 +109,7 @@ static void adjustStackPointer(unsigned
 void WebAssemblyFrameLowering::eliminateCallFramePseudoInstr(
     MachineFunction &MF, MachineBasicBlock &MBB,
     MachineBasicBlock::iterator I) const {
-  const auto *TII =
-      static_cast<const WebAssemblyInstrInfo*>(MF.getSubtarget().getInstrInfo());
+  const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
   DebugLoc DL = I->getDebugLoc();
   unsigned Opc = I->getOpcode();
   bool IsDestroy = Opc == TII->getCallFrameDestroyOpcode();
@@ -132,7 +131,7 @@ void WebAssemblyFrameLowering::emitProlo
   if (!StackSize && (!MFI->adjustsStack() || MFI->getMaxCallFrameSize() == 0))
     return;
 
-  const auto *TII = MF.getSubtarget().getInstrInfo();
+  const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
 
   auto InsertPt = MBB.begin();
   DebugLoc DL;
@@ -145,7 +144,7 @@ void WebAssemblyFrameLowering::emitEpilo
   uint64_t StackSize = MF.getFrameInfo()->getStackSize();
   if (!StackSize)
     return;
-  const auto *TII = MF.getSubtarget().getInstrInfo();
+  const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
   auto &MRI = MF.getRegInfo();
   unsigned OffsetReg = MRI.createVirtualRegister(&WebAssembly::I32RegClass);
   auto InsertPt = MBB.getFirstTerminator();

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp?rev=258126&r1=258125&r2=258126&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp Tue Jan 19 08:53:19 2016
@@ -79,7 +79,7 @@ void WebAssemblyRegisterInfo::eliminateF
   } else {
     // Otherwise create an i32.add SP, offset and make it the operand.
     auto &MRI = MF.getRegInfo();
-    const auto *TII = MF.getSubtarget().getInstrInfo();
+    const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
 
     unsigned OffsetReg = MRI.createVirtualRegister(&WebAssembly::I32RegClass);
     BuildMI(MBB, MI, MI.getDebugLoc(), TII->get(WebAssembly::CONST_I32), OffsetReg)




More information about the llvm-commits mailing list