[llvm] r205305 - [mips] Renamed ParseAnyRegisterWithoutDollar to MatchAnyRegisterWithoutDollar

Daniel Sanders Daniel.Sanders at imgtec.com
Tue Apr 1 06:04:42 PDT 2014


I forgot to mention that I added some additional comments at the same time.

> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of Daniel Sanders
> Sent: 01 April 2014 13:35
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm] r205305 - [mips] Renamed ParseAnyRegisterWithoutDollar to
> MatchAnyRegisterWithoutDollar
> 
> Author: dsanders
> Date: Tue Apr  1 07:35:23 2014
> New Revision: 205305
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=205305&view=rev
> Log:
> [mips] Renamed ParseAnyRegisterWithoutDollar to
> MatchAnyRegisterWithoutDollar
> 
> This is for consistency with other functions. The Parse* functions consume
> tokens and the Match* functions don't.
> 
> No functional change.
> 
> 
> Modified:
>     llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> 
> Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=20
> 5305&r1=205304&r2=205305&view=diff
> ==========================================================
> ====================
> --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Tue Apr  1
> +++ 07:35:23 2014
> @@ -98,7 +98,7 @@ class MipsAsmParser : public MCTargetAsm
>        SMLoc S);
> 
>    MipsAsmParser::OperandMatchResultTy
> -  ParseAnyRegisterWithoutDollar(SmallVectorImpl<MCParsedAsmOperand
> *> &Operands,
> +  MatchAnyRegisterWithoutDollar(SmallVectorImpl<MCParsedAsmOperand
> *>
> + &Operands,
>                                  SMLoc S);
> 
>    MipsAsmParser::OperandMatchResultTy
> @@ -275,11 +275,11 @@ public:
> 
>  private:
>    enum KindTy {
> -    k_Immediate,
> -    k_Memory,
> -    k_PhysRegister,
> -    k_RegisterIndex,
> -    k_Token
> +    k_Immediate,     /// An immediate (possibly involving symbol references)
> +    k_Memory,        /// Base + Offset Memory Address
> +    k_PhysRegister,  /// A physical register from the Mips namespace
> +    k_RegisterIndex, /// A register index in one or more RegKind.
> +    k_Token          /// A simple token
>    } Kind;
> 
>    MipsOperand(KindTy K, MipsAsmParser &Parser) @@ -477,11 +477,17 @@
> public:
>      llvm_unreachable("Use a custom parser instead");
>    }
> 
> +  /// Render the operand to an MCInst as a GPR32  /// Asserts if the
> + wrong number of operands are requested, or the operand  /// is not a
> + k_RegisterIndex compatible with RegKind_GPR
>    void addGPR32AsmRegOperands(MCInst &Inst, unsigned N) const {
>      assert(N == 1 && "Invalid number of operands!");
>      Inst.addOperand(MCOperand::CreateReg(getGPR32Reg()));
>    }
> 
> +  /// Render the operand to an MCInst as a GPR64  /// Asserts if the
> + wrong number of operands are requested, or the operand  /// is not a
> + k_RegisterIndex compatible with RegKind_GPR
>    void addGPR64AsmRegOperands(MCInst &Inst, unsigned N) const {
>      assert(N == 1 && "Invalid number of operands!");
>      Inst.addOperand(MCOperand::CreateReg(getGPR64Reg()));
> @@ -1779,7 +1785,7 @@ MipsAsmParser::MatchAnyRegisterNameWitho
>  }
> 
>  MipsAsmParser::OperandMatchResultTy
> -MipsAsmParser::ParseAnyRegisterWithoutDollar(
> +MipsAsmParser::MatchAnyRegisterWithoutDollar(
>      SmallVectorImpl<MCParsedAsmOperand *> &Operands, SMLoc S) {
>    auto Token = Parser.getLexer().peekTok(false);
> 
> @@ -1821,7 +1827,7 @@ MipsAsmParser::OperandMatchResultTy Mips
>    }
>    DEBUG(dbgs() << ".. $\n");
> 
> -  OperandMatchResultTy ResTy =
> ParseAnyRegisterWithoutDollar(Operands, S);
> +  OperandMatchResultTy ResTy =
> MatchAnyRegisterWithoutDollar(Operands,
> + S);
>    if (ResTy == MatchOperand_Success) {
>      Parser.Lex(); // $
>      Parser.Lex(); // identifier
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list