Home | History | Annotate | Download | only in AsmParser
      1 //===-- 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 
     15 using namespace llvm;
     16 
     17 namespace {
     18 class 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 
     30 public:
     31   MipsAsmParser(MCSubtargetInfo &sti, MCAsmParser &parser)
     32     : MCTargetAsmParser() {
     33   }
     34 
     35 };
     36 }
     37 
     38 bool MipsAsmParser::
     39 MatchAndEmitInstruction(SMLoc IDLoc,
     40                         SmallVectorImpl<MCParsedAsmOperand*> &Operands,
     41                         MCStreamer &Out) {
     42   return true;
     43 }
     44 
     45 bool MipsAsmParser::
     46 ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) {
     47   return true;
     48 }
     49 
     50 bool MipsAsmParser::
     51 ParseInstruction(StringRef Name, SMLoc NameLoc,
     52                  SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
     53   return true;
     54 }
     55 
     56 bool MipsAsmParser::
     57 ParseDirective(AsmToken DirectiveID) {
     58   return true;
     59 }
     60 
     61 extern "C" void LLVMInitializeMipsAsmParser() {
     62   RegisterMCAsmParser<MipsAsmParser> X(TheMipsTarget);
     63   RegisterMCAsmParser<MipsAsmParser> Y(TheMipselTarget);
     64   RegisterMCAsmParser<MipsAsmParser> A(TheMips64Target);
     65   RegisterMCAsmParser<MipsAsmParser> B(TheMips64elTarget);
     66 }
     67