• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- MipsAsmPrinter.h - Mips LLVM assembly writer ----------------------===//
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 // Mips Assembly printer class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MIPSASMPRINTER_H
15 #define MIPSASMPRINTER_H
16 
17 #include "MipsSubtarget.h"
18 #include "llvm/CodeGen/AsmPrinter.h"
19 #include "llvm/Support/Compiler.h"
20 #include "llvm/Target/TargetMachine.h"
21 
22 namespace llvm {
23 class MCStreamer;
24 class MachineInstr;
25 class raw_ostream;
26 class MachineBasicBlock;
27 class Module;
28 
29 class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
30   const MipsSubtarget *Subtarget;
31 
32 public:
MipsAsmPrinter(TargetMachine & TM,MCStreamer & Streamer)33   explicit MipsAsmPrinter(TargetMachine &TM,  MCStreamer &Streamer)
34     : AsmPrinter(TM, Streamer) {
35     Subtarget = &TM.getSubtarget<MipsSubtarget>();
36   }
37 
getPassName()38   virtual const char *getPassName() const {
39     return "Mips Assembly Printer";
40   }
41 
42   void EmitInstruction(const MachineInstr *MI);
43   void printSavedRegsBitmask(raw_ostream &O);
44   void printHex32(unsigned int Value, raw_ostream &O);
45   void emitFrameDirective();
46   const char *getCurrentABIString() const;
47   virtual void EmitFunctionEntryLabel();
48   virtual void EmitFunctionBodyStart();
49   virtual void EmitFunctionBodyEnd();
50   virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock*
51                                                  MBB) const;
52   bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
53                        unsigned AsmVariant, const char *ExtraCode,
54                        raw_ostream &O);
55   bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
56                              unsigned AsmVariant, const char *ExtraCode,
57                              raw_ostream &O);
58   void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
59   void printUnsignedImm(const MachineInstr *MI, int opNum, raw_ostream &O);
60   void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
61   void printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O);
62   void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
63                        const char *Modifier = 0);
64   void EmitStartOfAsmFile(Module &M);
65   virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
66   void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
67 };
68 }
69 
70 #endif
71 
72