Sean Callanan | 5bbbc37 | 2010-01-23 02:43:15 +0000 | [diff] [blame^] | 1 | //===-- X86AsmLexer.cpp - Tokenize X86 assembly to AsmTokens --------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/Target/TargetAsmLexer.h" |
| 11 | #include "llvm/Target/TargetRegistry.h" |
| 12 | #include "llvm/MC/MCParser/MCAsmLexer.h" |
| 13 | #include "llvm/MC/MCParser/MCParsedAsmOperand.h" |
| 14 | #include "X86.h" |
| 15 | |
| 16 | using namespace llvm; |
| 17 | |
| 18 | namespace { |
| 19 | |
| 20 | class X86AsmLexer : public TargetAsmLexer { |
| 21 | const MCAsmInfo &AsmInfo; |
| 22 | protected: |
| 23 | AsmToken LexToken(); |
| 24 | public: |
| 25 | X86AsmLexer(const Target &T, const MCAsmInfo &MAI) |
| 26 | : TargetAsmLexer(T), AsmInfo(MAI) { |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | } |
| 31 | |
| 32 | AsmToken X86AsmLexer::LexToken() { |
| 33 | return AsmToken(AsmToken::Error, "", 0); |
| 34 | } |
| 35 | |
| 36 | extern "C" void LLVMInitializeX86AsmLexer() { |
| 37 | RegisterAsmLexer<X86AsmLexer> X(TheX86_32Target); |
| 38 | RegisterAsmLexer<X86AsmLexer> Y(TheX86_64Target); |
| 39 | } |
| 40 | |
| 41 | //#define REGISTERS_ONLY |
| 42 | //#include "../X86GenAsmMatcher.inc" |
| 43 | //#undef REGISTERS_ONLY |