[llvm-commits] [llvm] r94456 - /llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
Sean Callanan
scallanan at apple.com
Mon Jan 25 13:59:20 PST 2010
Author: spyffe
Date: Mon Jan 25 15:59:20 2010
New Revision: 94456
URL: http://llvm.org/viewvc/llvm-project?rev=94456&view=rev
Log:
Implemented the dialect decision logic for the X86
TargetAsmLexer. Dialect-specific lexing code will
be placed in the functions LexTokenATT() and
LexTokenIntel().
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp?rev=94456&r1=94455&r2=94456&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp Mon Jan 25 15:59:20 2010
@@ -9,6 +9,7 @@
#include "llvm/Target/TargetAsmLexer.h"
#include "llvm/Target/TargetRegistry.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "X86.h"
@@ -19,8 +20,21 @@
class X86AsmLexer : public TargetAsmLexer {
const MCAsmInfo &AsmInfo;
+
+ AsmToken LexTokenATT();
+ AsmToken LexTokenIntel();
protected:
- AsmToken LexToken();
+ AsmToken LexToken() {
+ switch (AsmInfo.getAssemblerDialect()) {
+ default:
+ SetError(SMLoc(), "Unhandled dialect");
+ return AsmToken(AsmToken::Error, "", 0);
+ case 0:
+ return LexTokenATT();
+ case 1:
+ return LexTokenIntel();
+ }
+ }
public:
X86AsmLexer(const Target &T, const MCAsmInfo &MAI)
: TargetAsmLexer(T), AsmInfo(MAI) {
@@ -29,7 +43,11 @@
}
-AsmToken X86AsmLexer::LexToken() {
+AsmToken X86AsmLexer::LexTokenATT() {
+ return AsmToken(AsmToken::Error, "", 0);
+}
+
+AsmToken X86AsmLexer::LexTokenIntel() {
return AsmToken(AsmToken::Error, "", 0);
}
More information about the llvm-commits
mailing list