2009-07-18 04:42:00 +08:00
|
|
|
//===-- X86AsmParser.cpp - Parse X86 assembly to MCInst instructions ------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-19 07:03:22 +08:00
|
|
|
#include "X86.h"
|
2009-07-21 04:01:54 +08:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
2009-07-21 02:55:04 +08:00
|
|
|
#include "llvm/MC/MCAsmParser.h"
|
2009-07-18 04:42:00 +08:00
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
|
|
#include "llvm/Target/TargetAsmParser.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
2009-07-21 04:01:54 +08:00
|
|
|
struct X86Operand {
|
|
|
|
};
|
2009-07-18 04:42:00 +08:00
|
|
|
|
2009-07-21 04:01:54 +08:00
|
|
|
class X86ATTAsmParser : public TargetAsmParser {
|
|
|
|
bool ParseOperand(X86Operand &Op);
|
|
|
|
|
|
|
|
bool MatchInstruction(const char *Name,
|
|
|
|
llvm::SmallVector<X86Operand, 3> &Operands,
|
|
|
|
MCInst &Inst);
|
2009-07-18 04:42:00 +08:00
|
|
|
|
2009-07-21 04:01:54 +08:00
|
|
|
public:
|
|
|
|
explicit X86ATTAsmParser(const Target &);
|
|
|
|
|
|
|
|
virtual bool ParseInstruction(MCAsmParser &AP, const char *Name,
|
|
|
|
MCInst &Inst);
|
|
|
|
};
|
2009-07-18 04:42:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
X86ATTAsmParser::X86ATTAsmParser(const Target &T)
|
|
|
|
: TargetAsmParser(T)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-07-21 04:01:54 +08:00
|
|
|
bool X86ATTAsmParser::ParseOperand(X86Operand &Op) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
X86ATTAsmParser::MatchInstruction(const char *Name,
|
|
|
|
llvm::SmallVector<X86Operand, 3> &Operands,
|
|
|
|
MCInst &Inst) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-07-21 02:55:04 +08:00
|
|
|
bool X86ATTAsmParser::ParseInstruction(MCAsmParser &AP, const char *Name,
|
|
|
|
MCInst &Inst) {
|
2009-07-21 04:01:54 +08:00
|
|
|
llvm::SmallVector<X86Operand, 3> Operands;
|
|
|
|
|
|
|
|
return MatchInstruction(Name, Operands, Inst);
|
2009-07-21 02:55:04 +08:00
|
|
|
}
|
|
|
|
|
2009-07-18 04:42:00 +08:00
|
|
|
namespace {
|
|
|
|
TargetAsmParser *createAsmParser(const Target &T) {
|
|
|
|
return new X86ATTAsmParser(T);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Force static initialization.
|
|
|
|
extern "C" void LLVMInitializeX86AsmParser() {
|
|
|
|
TargetRegistry::RegisterAsmParser(TheX86_32Target, &createAsmParser);
|
|
|
|
TargetRegistry::RegisterAsmParser(TheX86_64Target, &createAsmParser);
|
|
|
|
}
|