/// \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.
SmallVectorImpl<MCParsedAsmOperand*> &Operands);
bool ParseDirective(AsmToken DirectiveID);
+ bool mnemonicIsValid(StringRef Mnemonic) {
+ return mnemonicIsValidImpl(Mnemonic);
+ }
+
unsigned checkTargetMatchPredicate(MCInst &Inst);
bool MatchAndEmitInstruction(SMLoc IDLoc,
bool ParseDirectiveWord(unsigned Size, SMLoc L);
+ bool mnemonicIsValid(StringRef Mnemonic) {
+ return mnemonicIsValidImpl(Mnemonic);
+ }
+
bool MatchAndEmitInstruction(SMLoc IDLoc,
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
MCStreamer &Out);
#define GET_ASSEMBLER_HEADER
#include "MipsGenAsmMatcher.inc"
+ bool mnemonicIsValid(StringRef Mnemonic) {
+ return mnemonicIsValidImpl(Mnemonic);
+ }
+
bool MatchAndEmitInstruction(SMLoc IDLoc,
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
MCStreamer &Out);
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);
<< " 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, "
// 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+"