mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
[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
This commit is contained in:
parent
7b451cf356
commit
d717a066c6
@ -78,6 +78,10 @@ public:
|
|||||||
/// \param DirectiveID - the identifier token of the directive.
|
/// \param DirectiveID - the identifier token of the directive.
|
||||||
virtual bool ParseDirective(AsmToken DirectiveID) = 0;
|
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
|
/// MatchInstruction - Recognize a series of operands of a parsed instruction
|
||||||
/// as an actual MCInst. This returns false on success and returns true on
|
/// as an actual MCInst. This returns false on success and returns true on
|
||||||
/// failure to match.
|
/// failure to match.
|
||||||
|
@ -257,6 +257,10 @@ public:
|
|||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands);
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands);
|
||||||
bool ParseDirective(AsmToken DirectiveID);
|
bool ParseDirective(AsmToken DirectiveID);
|
||||||
|
|
||||||
|
bool mnemonicIsValid(StringRef Mnemonic) {
|
||||||
|
return mnemonicIsValidImpl(Mnemonic);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned checkTargetMatchPredicate(MCInst &Inst);
|
unsigned checkTargetMatchPredicate(MCInst &Inst);
|
||||||
|
|
||||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||||
|
@ -44,6 +44,10 @@ class MBlazeAsmParser : public MCTargetAsmParser {
|
|||||||
|
|
||||||
bool ParseDirectiveWord(unsigned Size, SMLoc L);
|
bool ParseDirectiveWord(unsigned Size, SMLoc L);
|
||||||
|
|
||||||
|
bool mnemonicIsValid(StringRef Mnemonic) {
|
||||||
|
return mnemonicIsValidImpl(Mnemonic);
|
||||||
|
}
|
||||||
|
|
||||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out);
|
MCStreamer &Out);
|
||||||
|
@ -41,6 +41,10 @@ class MipsAsmParser : public MCTargetAsmParser {
|
|||||||
#define GET_ASSEMBLER_HEADER
|
#define GET_ASSEMBLER_HEADER
|
||||||
#include "MipsGenAsmMatcher.inc"
|
#include "MipsGenAsmMatcher.inc"
|
||||||
|
|
||||||
|
bool mnemonicIsValid(StringRef Mnemonic) {
|
||||||
|
return mnemonicIsValidImpl(Mnemonic);
|
||||||
|
}
|
||||||
|
|
||||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out);
|
MCStreamer &Out);
|
||||||
|
@ -60,6 +60,10 @@ private:
|
|||||||
bool ParseDirectiveWord(unsigned Size, SMLoc L);
|
bool ParseDirectiveWord(unsigned Size, SMLoc L);
|
||||||
bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
|
bool ParseDirectiveCode(StringRef IDVal, SMLoc L);
|
||||||
|
|
||||||
|
bool mnemonicIsValid(StringRef Mnemonic) {
|
||||||
|
return mnemonicIsValidImpl(Mnemonic);
|
||||||
|
}
|
||||||
|
|
||||||
bool processInstruction(MCInst &Inst,
|
bool processInstruction(MCInst &Inst,
|
||||||
const SmallVectorImpl<MCParsedAsmOperand*> &Ops);
|
const SmallVectorImpl<MCParsedAsmOperand*> &Ops);
|
||||||
|
|
||||||
|
@ -2621,7 +2621,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
|
|||||||
<< " const "
|
<< " const "
|
||||||
<< "SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n "
|
<< "SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n "
|
||||||
<< " unsigned OperandNum, unsigned &NumMCOperands);\n";
|
<< " unsigned OperandNum, unsigned &NumMCOperands);\n";
|
||||||
OS << " bool MnemonicIsValid(StringRef Mnemonic);\n";
|
OS << " bool mnemonicIsValidImpl(StringRef Mnemonic);\n";
|
||||||
OS << " unsigned MatchInstructionImpl(\n"
|
OS << " unsigned MatchInstructionImpl(\n"
|
||||||
<< " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
<< " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,\n"
|
||||||
<< " unsigned &Kind, MCInst &Inst, "
|
<< " unsigned &Kind, MCInst &Inst, "
|
||||||
@ -2800,7 +2800,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
|
|||||||
|
|
||||||
// A method to determine if a mnemonic is in the list.
|
// A method to determine if a mnemonic is in the list.
|
||||||
OS << "bool " << Target.getName() << ClassName << "::\n"
|
OS << "bool " << Target.getName() << ClassName << "::\n"
|
||||||
<< "MnemonicIsValid(StringRef Mnemonic) {\n";
|
<< "mnemonicIsValidImpl(StringRef Mnemonic) {\n";
|
||||||
OS << " // Search the table.\n";
|
OS << " // Search the table.\n";
|
||||||
OS << " std::pair<const MatchEntry*, const MatchEntry*> MnemonicRange =\n";
|
OS << " std::pair<const MatchEntry*, const MatchEntry*> MnemonicRange =\n";
|
||||||
OS << " std::equal_range(MatchTable, MatchTable+"
|
OS << " std::equal_range(MatchTable, MatchTable+"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user