[llvm-commits] [llvm] r94275 - in /llvm/trunk/lib/Target/X86/AsmParser: X86AsmLexer.cpp X86AsmParser.cpp
Sean Callanan
scallanan at apple.com
Fri Jan 22 18:43:15 PST 2010
Author: spyffe
Date: Fri Jan 22 20:43:15 2010
New Revision: 94275
URL: http://llvm.org/viewvc/llvm-project?rev=94275&view=rev
Log:
Added the skeleton for the implementation of the X86
target-specific AsmLexer, and added the appropriate
registration calls.
Added:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Added: llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp?rev=94275&view=auto
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp (added)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp Fri Jan 22 20:43:15 2010
@@ -0,0 +1,43 @@
+//===-- X86AsmLexer.cpp - Tokenize X86 assembly to AsmTokens --------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Target/TargetAsmLexer.h"
+#include "llvm/Target/TargetRegistry.h"
+#include "llvm/MC/MCParser/MCAsmLexer.h"
+#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
+#include "X86.h"
+
+using namespace llvm;
+
+namespace {
+
+class X86AsmLexer : public TargetAsmLexer {
+ const MCAsmInfo &AsmInfo;
+protected:
+ AsmToken LexToken();
+public:
+ X86AsmLexer(const Target &T, const MCAsmInfo &MAI)
+ : TargetAsmLexer(T), AsmInfo(MAI) {
+ }
+};
+
+}
+
+AsmToken X86AsmLexer::LexToken() {
+ return AsmToken(AsmToken::Error, "", 0);
+}
+
+extern "C" void LLVMInitializeX86AsmLexer() {
+ RegisterAsmLexer<X86AsmLexer> X(TheX86_32Target);
+ RegisterAsmLexer<X86AsmLexer> Y(TheX86_64Target);
+}
+
+//#define REGISTERS_ONLY
+//#include "../X86GenAsmMatcher.inc"
+//#undef REGISTERS_ONLY
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=94275&r1=94274&r2=94275&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Fri Jan 22 20:43:15 2010
@@ -488,10 +488,13 @@
return false;
}
+extern "C" void LLVMInitializeX86AsmLexer();
+
// Force static initialization.
extern "C" void LLVMInitializeX86AsmParser() {
RegisterAsmParser<X86ATTAsmParser> X(TheX86_32Target);
RegisterAsmParser<X86ATTAsmParser> Y(TheX86_64Target);
+ LLVMInitializeX86AsmLexer();
}
#include "X86GenAsmMatcher.inc"
More information about the llvm-commits
mailing list