diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-09-21 22:21:26 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-09-21 22:21:26 +0000 |
commit | 17ede627f0e7ee317f94372a4ab49f9ae0fc6b2c (patch) | |
tree | 48aa877934eaace8be487cb1476e703c0d5eff3e | |
parent | c1c8a1bb6ad9f95f1e9affb9d1f22ff5a1b70b3a (diff) | |
download | bcm5719-llvm-17ede627f0e7ee317f94372a4ab49f9ae0fc6b2c.tar.gz bcm5719-llvm-17ede627f0e7ee317f94372a4ab49f9ae0fc6b2c.zip |
[ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
llvm-svn: 164420
-rw-r--r-- | llvm/include/llvm/MC/MCTargetAsmParser.h | 4 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 4 | ||||
-rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 4 |
6 files changed, 22 insertions, 2 deletions
diff --git a/llvm/include/llvm/MC/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCTargetAsmParser.h index 709c2d245cc..a771ed7a9d6 100644 --- a/llvm/include/llvm/MC/MCTargetAsmParser.h +++ b/llvm/include/llvm/MC/MCTargetAsmParser.h @@ -78,6 +78,10 @@ public: /// \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. diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 6431b75c548..3e68a0b865a 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -257,6 +257,10 @@ public: SmallVectorImpl<MCParsedAsmOperand*> &Operands); bool ParseDirective(AsmToken DirectiveID); + bool mnemonicIsValid(StringRef Mnemonic) { + return mnemonicIsValidImpl(Mnemonic); + } + unsigned checkTargetMatchPredicate(MCInst &Inst); bool MatchAndEmitInstruction(SMLoc IDLoc, diff --git a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp index 40594030e57..daceb88076d 100644 --- a/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp +++ b/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp @@ -44,6 +44,10 @@ class MBlazeAsmParser : public MCTargetAsmParser { bool ParseDirectiveWord(unsigned Size, SMLoc L); + bool mnemonicIsValid(StringRef Mnemonic) { + return mnemonicIsValidImpl(Mnemonic); + } + bool MatchAndEmitInstruction(SMLoc IDLoc, SmallVectorImpl<MCParsedAsmOperand*> &Operands, MCStreamer &Out); diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 8418b7542f2..4cbd4c8e128 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -41,6 +41,10 @@ class MipsAsmParser : public MCTargetAsmParser { #define GET_ASSEMBLER_HEADER #include "MipsGenAsmMatcher.inc" + bool mnemonicIsValid(StringRef Mnemonic) { + return mnemonicIsValidImpl(Mnemonic); + } + bool MatchAndEmitInstruction(SMLoc IDLoc, SmallVectorImpl<MCParsedAsmOperand*> &Operands, MCStreamer &Out); diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 28cf5d3e6a2..77961e53aec 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -60,6 +60,10 @@ private: 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); diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 3d74c904f37..593de698a94 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -2621,7 +2621,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) { << " 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 @@ void AsmMatcherEmitter::run(raw_ostream &OS) { // 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+" |