blob: 58b559025757cf3cf0ee3a1b86c5579aba58af27 [file] [log] [blame]
Rafael Espindolafddf8042012-01-11 03:56:41 +00001//===-- MipsAsmParser.cpp - Parse Mips 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
10#include "MCTargetDesc/MipsMCTargetDesc.h"
11#include "llvm/MC/MCParser/MCAsmLexer.h"
12#include "llvm/MC/MCTargetAsmParser.h"
13#include "llvm/Support/TargetRegistry.h"
14
15using namespace llvm;
16
17namespace {
18class MipsAsmParser : public MCTargetAsmParser {
19 bool MatchAndEmitInstruction(SMLoc IDLoc,
20 SmallVectorImpl<MCParsedAsmOperand*> &Operands,
21 MCStreamer &Out);
22
23 bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc);
24
25 bool ParseInstruction(StringRef Name, SMLoc NameLoc,
26 SmallVectorImpl<MCParsedAsmOperand*> &Operands);
27
28 bool ParseDirective(AsmToken DirectiveID);
29
30public:
31 MipsAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser)
32 : MCTargetAsmParser() {
33 }
34
35};
36}
37
38bool MipsAsmParser::
39MatchAndEmitInstruction(SMLoc IDLoc,
40 SmallVectorImpl<MCParsedAsmOperand*> &Operands,
41 MCStreamer &Out) {
42 return true;
43}
44
45bool MipsAsmParser::
46ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) {
47 return true;
48}
49
50bool MipsAsmParser::
51ParseInstruction(StringRef Name, SMLoc NameLoc,
52 SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
53 return true;
54}
55
56bool MipsAsmParser::
57ParseDirective(AsmToken DirectiveID) {
58 return true;
59}
60
61extern "C" void LLVMInitializeMipsAsmParser() {
62 RegisterMCAsmParser<MipsAsmParser> X(TheMipsTarget);
63 RegisterMCAsmParser<MipsAsmParser> Y(TheMipselTarget);
64 RegisterMCAsmParser<MipsAsmParser> A(TheMips64Target);
65 RegisterMCAsmParser<MipsAsmParser> B(TheMips64elTarget);
66}