[llvm] r245483 - MIR Parser: Rename 'MachineOperandWithLocation' to 'ParsedMachineOperand'. NFC.

Alex Lorenz via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 12:19:16 PDT 2015


Author: arphaman
Date: Wed Aug 19 14:19:16 2015
New Revision: 245483

URL: http://llvm.org/viewvc/llvm-project?rev=245483&view=rev
Log:
MIR Parser: Rename 'MachineOperandWithLocation' to 'ParsedMachineOperand'. NFC.

Besides storing the operand's source range, this structure now stores other
attributes as well, so the name should reflect this fact.

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

Modified: llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp?rev=245483&r1=245482&r2=245483&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp Wed Aug 19 14:19:16 2015
@@ -38,16 +38,15 @@ using namespace llvm;
 namespace {
 
 /// A wrapper struct around the 'MachineOperand' struct that includes a source
-/// range.
-struct MachineOperandWithLocation {
+/// range and other attributes.
+struct ParsedMachineOperand {
   MachineOperand Operand;
   StringRef::iterator Begin;
   StringRef::iterator End;
   Optional<unsigned> TiedDefIdx;
 
-  MachineOperandWithLocation(const MachineOperand &Operand,
-                             StringRef::iterator Begin, StringRef::iterator End,
-                             Optional<unsigned> &TiedDefIdx)
+  ParsedMachineOperand(const MachineOperand &Operand, StringRef::iterator Begin,
+                       StringRef::iterator End, Optional<unsigned> &TiedDefIdx)
       : Operand(Operand), Begin(Begin), End(End), TiedDefIdx(TiedDefIdx) {
     if (TiedDefIdx)
       assert(Operand.isReg() && Operand.isUse() &&
@@ -185,9 +184,9 @@ private:
   bool parseInstruction(unsigned &OpCode, unsigned &Flags);
 
   bool assignRegisterTies(MachineInstr &MI,
-                          ArrayRef<MachineOperandWithLocation> Operands);
+                          ArrayRef<ParsedMachineOperand> Operands);
 
-  bool verifyImplicitOperands(ArrayRef<MachineOperandWithLocation> Operands,
+  bool verifyImplicitOperands(ArrayRef<ParsedMachineOperand> Operands,
                               const MCInstrDesc &MCID);
 
   void initNames2Regs();
@@ -562,14 +561,14 @@ bool MIParser::parseBasicBlocks() {
 bool MIParser::parse(MachineInstr *&MI) {
   // Parse any register operands before '='
   MachineOperand MO = MachineOperand::CreateImm(0);
-  SmallVector<MachineOperandWithLocation, 8> Operands;
+  SmallVector<ParsedMachineOperand, 8> Operands;
   while (Token.isRegister() || Token.isRegisterFlag()) {
     auto Loc = Token.location();
     Optional<unsigned> TiedDefIdx;
     if (parseRegisterOperand(MO, TiedDefIdx, /*IsDef=*/true))
       return true;
     Operands.push_back(
-        MachineOperandWithLocation(MO, Loc, Token.location(), TiedDefIdx));
+        ParsedMachineOperand(MO, Loc, Token.location(), TiedDefIdx));
     if (Token.isNot(MIToken::comma))
       break;
     lex();
@@ -589,7 +588,7 @@ bool MIParser::parse(MachineInstr *&MI)
     if (parseMachineOperandAndTargetFlags(MO, TiedDefIdx))
       return true;
     Operands.push_back(
-        MachineOperandWithLocation(MO, Loc, Token.location(), TiedDefIdx));
+        ParsedMachineOperand(MO, Loc, Token.location(), TiedDefIdx));
     if (Token.isNewlineOrEOF() || Token.is(MIToken::coloncolon) ||
         Token.is(MIToken::lbrace))
       break;
@@ -719,8 +718,8 @@ static std::string getRegisterName(const
   return StringRef(TRI->getName(Reg)).lower();
 }
 
-bool MIParser::verifyImplicitOperands(
-    ArrayRef<MachineOperandWithLocation> Operands, const MCInstrDesc &MCID) {
+bool MIParser::verifyImplicitOperands(ArrayRef<ParsedMachineOperand> Operands,
+                                      const MCInstrDesc &MCID) {
   if (MCID.isCall())
     // We can't verify call instructions as they can contain arbitrary implicit
     // register and register mask operands.
@@ -893,8 +892,8 @@ bool MIParser::parseRegisterTiedDefIndex
   return false;
 }
 
-bool MIParser::assignRegisterTies(
-    MachineInstr &MI, ArrayRef<MachineOperandWithLocation> Operands) {
+bool MIParser::assignRegisterTies(MachineInstr &MI,
+                                  ArrayRef<ParsedMachineOperand> Operands) {
   SmallVector<std::pair<unsigned, unsigned>, 4> TiedRegisterPairs;
   for (unsigned I = 0, E = Operands.size(); I != E; ++I) {
     if (!Operands[I].TiedDefIdx)




More information about the llvm-commits mailing list