[llvm-commits] [llvm] r164420 - in /llvm/trunk: include/llvm/MC/MCTargetAsmParser.h lib/Target/ARM/AsmParser/ARMAsmParser.cpp lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp lib/Target/Mips/AsmParser/MipsAsmParser.cpp lib/Target/X86/AsmParser/X86AsmParser.cpp utils/TableGen/AsmMatcherEmitter.cpp
Chad Rosier
mcrosier at apple.com
Mon Sep 24 12:34:32 PDT 2012
Taken care of in revision 164548. Thanks, Jim.
Chad
On Sep 24, 2012, at 12:06 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Rather than have a wrapper function, why not have tblgen instantiate the method implementation itself directly?
>
> -Jim
>
> On Sep 21, 2012, at 3:21 PM, Chad Rosier <mcrosier at apple.com> wrote:
>
>> Author: mcrosier
>> Date: Fri Sep 21 17:21:26 2012
>> New Revision: 164420
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=164420&view=rev
>> Log:
>> [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
>>
>> Modified:
>> llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
>> llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
>> llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp
>> llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
>> llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
>> llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
>>
>> Modified: llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetAsmParser.h?rev=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/include/llvm/MC/MCTargetAsmParser.h (original)
>> +++ llvm/trunk/include/llvm/MC/MCTargetAsmParser.h Fri Sep 21 17:21:26 2012
>> @@ -78,6 +78,10 @@
>> /// \param DirectiveID - the identifier token of the directive.
>> virtual bool ParseDirective(AsmToken DirectiveID) = 0;
>>
>> + /// mnemonicIsValid - This returns true if this is a valid mnemonic and false
>> + /// otherwise.
>> + virtual bool mnemonicIsValid(StringRef Mnemonic) = 0;
>> +
>> /// MatchInstruction - Recognize a series of operands of a parsed instruction
>> /// as an actual MCInst. This returns false on success and returns true on
>> /// failure to match.
>>
>> Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Sep 21 17:21:26 2012
>> @@ -257,6 +257,10 @@
>> SmallVectorImpl<MCParsedAsmOperand*> &Operands);
>> bool ParseDirective(AsmToken DirectiveID);
>>
>> + bool mnemonicIsValid(StringRef Mnemonic) {
>> + return mnemonicIsValidImpl(Mnemonic);
>> + }
>> +
>> unsigned checkTargetMatchPredicate(MCInst &Inst);
>>
>> bool MatchAndEmitInstruction(SMLoc IDLoc,
>>
>> Modified: llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp?rev=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp Fri Sep 21 17:21:26 2012
>> @@ -44,6 +44,10 @@
>>
>> bool ParseDirectiveWord(unsigned Size, SMLoc L);
>>
>> + bool mnemonicIsValid(StringRef Mnemonic) {
>> + return mnemonicIsValidImpl(Mnemonic);
>> + }
>> +
>> bool MatchAndEmitInstruction(SMLoc IDLoc,
>> SmallVectorImpl<MCParsedAsmOperand*> &Operands,
>> MCStreamer &Out);
>>
>> 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=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Fri Sep 21 17:21:26 2012
>> @@ -41,6 +41,10 @@
>> #define GET_ASSEMBLER_HEADER
>> #include "MipsGenAsmMatcher.inc"
>>
>> + bool mnemonicIsValid(StringRef Mnemonic) {
>> + return mnemonicIsValidImpl(Mnemonic);
>> + }
>> +
>> bool MatchAndEmitInstruction(SMLoc IDLoc,
>> SmallVectorImpl<MCParsedAsmOperand*> &Operands,
>> MCStreamer &Out);
>>
>> Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Fri Sep 21 17:21:26 2012
>> @@ -60,6 +60,10 @@
>> bool ParseDirectiveWord(unsigned Size, SMLoc L);
>> bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
>>
>> + bool mnemonicIsValid(StringRef Mnemonic) {
>> + return mnemonicIsValidImpl(Mnemonic);
>> + }
>> +
>> bool processInstruction(MCInst &Inst,
>> const SmallVectorImpl<MCParsedAsmOperand*> &Ops);
>>
>>
>> Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=164420&r1=164419&r2=164420&view=diff
>> ==============================================================================
>> --- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
>> +++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Fri Sep 21 17:21:26 2012
>> @@ -2621,7 +2621,7 @@
>> << " const "
>> << "SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n "
>> << " unsigned OperandNum, unsigned &NumMCOperands);\n";
>> - OS << " bool MnemonicIsValid(StringRef Mnemonic);\n";
>> + OS << " bool mnemonicIsValidImpl(StringRef Mnemonic);\n";
>> OS << " unsigned MatchInstructionImpl(\n"
>> << " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
>> << " unsigned &Kind, MCInst &Inst, "
>> @@ -2800,7 +2800,7 @@
>>
>> // A method to determine if a mnemonic is in the list.
>> OS << "bool " << Target.getName() << ClassName << "::\n"
>> - << "MnemonicIsValid(StringRef Mnemonic) {\n";
>> + << "mnemonicIsValidImpl(StringRef Mnemonic) {\n";
>> OS << " // Search the table.\n";
>> OS << " std::pair<const MatchEntry*, const MatchEntry*> MnemonicRange =\n";
>> OS << " std::equal_range(MatchTable, MatchTable+"
>>
>>
>> _______________________________________________
>> 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