mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-27 15:29:51 +00:00
Implemented the dialect decision logic for the X86
TargetAsmLexer. Dialect-specific lexing code will be placed in the functions LexTokenATT() and LexTokenIntel(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e43b6c9695
commit
436c48485c
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "llvm/Target/TargetAsmLexer.h"
|
#include "llvm/Target/TargetAsmLexer.h"
|
||||||
#include "llvm/Target/TargetRegistry.h"
|
#include "llvm/Target/TargetRegistry.h"
|
||||||
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
||||||
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
|
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
|
||||||
#include "X86.h"
|
#include "X86.h"
|
||||||
@ -19,8 +20,21 @@ namespace {
|
|||||||
|
|
||||||
class X86AsmLexer : public TargetAsmLexer {
|
class X86AsmLexer : public TargetAsmLexer {
|
||||||
const MCAsmInfo &AsmInfo;
|
const MCAsmInfo &AsmInfo;
|
||||||
|
|
||||||
|
AsmToken LexTokenATT();
|
||||||
|
AsmToken LexTokenIntel();
|
||||||
protected:
|
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:
|
public:
|
||||||
X86AsmLexer(const Target &T, const MCAsmInfo &MAI)
|
X86AsmLexer(const Target &T, const MCAsmInfo &MAI)
|
||||||
: TargetAsmLexer(T), AsmInfo(MAI) {
|
: TargetAsmLexer(T), AsmInfo(MAI) {
|
||||||
@ -29,7 +43,11 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AsmToken X86AsmLexer::LexToken() {
|
AsmToken X86AsmLexer::LexTokenATT() {
|
||||||
|
return AsmToken(AsmToken::Error, "", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
AsmToken X86AsmLexer::LexTokenIntel() {
|
||||||
return AsmToken(AsmToken::Error, "", 0);
|
return AsmToken(AsmToken::Error, "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user