llvm.org GIT mirror llvm / d717a06
[ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164420 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 7 years ago
6 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7777 /// \param DirectiveID - the identifier token of the directive.
7878 virtual bool ParseDirective(AsmToken DirectiveID) = 0;
7979
80 /// mnemonicIsValid - This returns true if this is a valid mnemonic and false
81 /// otherwise.
82 virtual bool mnemonicIsValid(StringRef Mnemonic) = 0;
83
8084 /// MatchInstruction - Recognize a series of operands of a parsed instruction
8185 /// as an actual MCInst. This returns false on success and returns true on
8286 /// failure to match.
255255 bool ParseInstruction(StringRef Name, SMLoc NameLoc,
256256 SmallVectorImpl &Operands);
257257 bool ParseDirective(AsmToken DirectiveID);
258
259 bool mnemonicIsValid(StringRef Mnemonic) {
260 return mnemonicIsValidImpl(Mnemonic);
261 }
258262
259263 unsigned checkTargetMatchPredicate(MCInst &Inst);
260264
4242 virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc);
4343
4444 bool ParseDirectiveWord(unsigned Size, SMLoc L);
45
46 bool mnemonicIsValid(StringRef Mnemonic) {
47 return mnemonicIsValidImpl(Mnemonic);
48 }
4549
4650 bool MatchAndEmitInstruction(SMLoc IDLoc,
4751 SmallVectorImpl &Operands,
3939
4040 #define GET_ASSEMBLER_HEADER
4141 #include "MipsGenAsmMatcher.inc"
42
43 bool mnemonicIsValid(StringRef Mnemonic) {
44 return mnemonicIsValidImpl(Mnemonic);
45 }
4246
4347 bool MatchAndEmitInstruction(SMLoc IDLoc,
4448 SmallVectorImpl &Operands,
5858
5959 bool ParseDirectiveWord(unsigned Size, SMLoc L);
6060 bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
61
62 bool mnemonicIsValid(StringRef Mnemonic) {
63 return mnemonicIsValidImpl(Mnemonic);
64 }
6165
6266 bool processInstruction(MCInst &Inst,
6367 const SmallVectorImpl &Ops);
26202620 << " const "
26212621 << "SmallVectorImpl &Operands,\n "
26222622 << " unsigned OperandNum, unsigned &NumMCOperands);\n";
2623 OS << " bool MnemonicIsValid(StringRef Mnemonic);\n";
2623 OS << " bool mnemonicIsValidImpl(StringRef Mnemonic);\n";
26242624 OS << " unsigned MatchInstructionImpl(\n"
26252625 << " const SmallVectorImpl &Operands,\n"
26262626 << " unsigned &Kind, MCInst &Inst, "
27992799
28002800 // A method to determine if a mnemonic is in the list.
28012801 OS << "bool " << Target.getName() << ClassName << "::\n"
2802 << "MnemonicIsValid(StringRef Mnemonic) {\n";
2802 << "mnemonicIsValidImpl(StringRef Mnemonic) {\n";
28032803 OS << " // Search the table.\n";
28042804 OS << " std::pair MnemonicRange =\n";
28052805 OS << " std::equal_range(MatchTable, MatchTable+"