[llvm] r243445 - MIR Parser: Remove redundant parameters. NFC.

Alex Lorenz arphaman at gmail.com
Tue Jul 28 09:48:38 PDT 2015


Author: arphaman
Date: Tue Jul 28 11:48:37 2015
New Revision: 243445

URL: http://llvm.org/viewvc/llvm-project?rev=243445&view=rev
Log:
MIR Parser: Remove redundant parameters. NFC.

This commit removes the redundant parameters from the two methods
'initializeRegisterInfo' and 'initializeFrameInfo'. The removed parameters are
redundant as we are already passing in the 'MachineFunction' to those methods,
and those parameters can be derived from the machine function parameter.

Modified:
    llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp

Modified: llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp?rev=243445&r1=243444&r2=243445&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp Tue Jul 28 11:48:37 2015
@@ -103,11 +103,11 @@ public:
                                    const yaml::MachineBasicBlock &YamlMBB,
                                    const PerFunctionMIParsingState &PFS);
 
-  bool initializeRegisterInfo(MachineFunction &MF, MachineRegisterInfo &RegInfo,
+  bool initializeRegisterInfo(MachineFunction &MF,
                               const yaml::MachineFunction &YamlMF,
                               PerFunctionMIParsingState &PFS);
 
-  bool initializeFrameInfo(MachineFunction &MF, MachineFrameInfo &MFI,
+  bool initializeFrameInfo(MachineFunction &MF,
                            const yaml::MachineFunction &YamlMF,
                            PerFunctionMIParsingState &PFS);
 
@@ -276,9 +276,9 @@ bool MIRParserImpl::initializeMachineFun
   MF.setExposesReturnsTwice(YamlMF.ExposesReturnsTwice);
   MF.setHasInlineAsm(YamlMF.HasInlineAsm);
   PerFunctionMIParsingState PFS;
-  if (initializeRegisterInfo(MF, MF.getRegInfo(), YamlMF, PFS))
+  if (initializeRegisterInfo(MF, YamlMF, PFS))
     return true;
-  if (initializeFrameInfo(MF, *MF.getFrameInfo(), YamlMF, PFS))
+  if (initializeFrameInfo(MF, YamlMF, PFS))
     return true;
   if (!YamlMF.Constants.empty()) {
     auto *ConstantPool = MF.getConstantPool();
@@ -377,9 +377,9 @@ bool MIRParserImpl::initializeMachineBas
 }
 
 bool MIRParserImpl::initializeRegisterInfo(MachineFunction &MF,
-                                           MachineRegisterInfo &RegInfo,
                                            const yaml::MachineFunction &YamlMF,
                                            PerFunctionMIParsingState &PFS) {
+  MachineRegisterInfo &RegInfo = MF.getRegInfo();
   assert(RegInfo.isSSA());
   if (!YamlMF.IsSSA)
     RegInfo.leaveSSA();
@@ -428,9 +428,9 @@ bool MIRParserImpl::initializeRegisterIn
 }
 
 bool MIRParserImpl::initializeFrameInfo(MachineFunction &MF,
-                                        MachineFrameInfo &MFI,
                                         const yaml::MachineFunction &YamlMF,
                                         PerFunctionMIParsingState &PFS) {
+  MachineFrameInfo &MFI = *MF.getFrameInfo();
   const Function &F = *MF.getFunction();
   const yaml::MachineFrameInfo &YamlMFI = YamlMF.FrameInfo;
   MFI.setFrameAddressIsTaken(YamlMFI.IsFrameAddressTaken);





More information about the llvm-commits mailing list