blob: c278de0af190cc13b39797da39c14a04824924c3 [file] [log] [blame]
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +00001//===-- X86AsmParser.cpp - Parse X86 assembly to MCInst instructions ------===//
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
Daniel Dunbar0b0441e2009-07-18 23:03:22 +000010#include "X86.h"
Daniel Dunbar78929e52009-07-20 20:01:54 +000011#include "llvm/ADT/SmallVector.h"
Daniel Dunbar4b0f4ef2009-07-20 18:55:04 +000012#include "llvm/MC/MCAsmParser.h"
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +000013#include "llvm/Target/TargetRegistry.h"
14#include "llvm/Target/TargetAsmParser.h"
15using namespace llvm;
16
17namespace {
Daniel Dunbar78929e52009-07-20 20:01:54 +000018 struct X86Operand {
19 };
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +000020
Daniel Dunbar78929e52009-07-20 20:01:54 +000021 class X86ATTAsmParser : public TargetAsmParser {
22 bool ParseOperand(X86Operand &Op);
23
24 bool MatchInstruction(const char *Name,
25 llvm::SmallVector<X86Operand, 3> &Operands,
26 MCInst &Inst);
Daniel Dunbar4b0f4ef2009-07-20 18:55:04 +000027
Daniel Dunbar78929e52009-07-20 20:01:54 +000028 public:
29 explicit X86ATTAsmParser(const Target &);
30
31 virtual bool ParseInstruction(MCAsmParser &AP, const char *Name,
32 MCInst &Inst);
33 };
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +000034}
35
36X86ATTAsmParser::X86ATTAsmParser(const Target &T)
37 : TargetAsmParser(T)
38{
39}
40
Daniel Dunbar78929e52009-07-20 20:01:54 +000041bool X86ATTAsmParser::ParseOperand(X86Operand &Op) {
42 return true;
43}
44
45bool
46X86ATTAsmParser::MatchInstruction(const char *Name,
47 llvm::SmallVector<X86Operand, 3> &Operands,
48 MCInst &Inst) {
49 return false;
50}
51
Daniel Dunbar4b0f4ef2009-07-20 18:55:04 +000052bool X86ATTAsmParser::ParseInstruction(MCAsmParser &AP, const char *Name,
53 MCInst &Inst) {
Daniel Dunbar78929e52009-07-20 20:01:54 +000054 llvm::SmallVector<X86Operand, 3> Operands;
Daniel Dunbar78929e52009-07-20 20:01:54 +000055
56 return MatchInstruction(Name, Operands, Inst);
Daniel Dunbar4b0f4ef2009-07-20 18:55:04 +000057}
58
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +000059// Force static initialization.
60extern "C" void LLVMInitializeX86AsmParser() {
Daniel Dunbarc680b012009-07-25 06:49:55 +000061 RegisterAsmParser<X86ATTAsmParser> X(TheX86_32Target);
62 RegisterAsmParser<X86ATTAsmParser> Y(TheX86_64Target);
Daniel Dunbarc7df3cb2009-07-17 20:42:00 +000063}