1 //===-- MipsAsmPrinter.h - Mips LLVM Assembly Printer ----------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Mips Assembly printer class.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSASMPRINTER_H
15 #define MIPSASMPRINTER_H
17 #include "MipsMachineFunction.h"
18 #include "MipsMCInstLower.h"
19 #include "MipsSubtarget.h"
20 #include "llvm/CodeGen/AsmPrinter.h"
21 #include "llvm/Support/Compiler.h"
22 #include "llvm/Target/TargetMachine.h"
27 class MachineBasicBlock;
31 class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
33 void EmitInstrWithMacroNoAT(const MachineInstr *MI);
37 const MipsSubtarget *Subtarget;
38 const MipsFunctionInfo *MipsFI;
39 MipsMCInstLower MCInstLowering;
41 explicit MipsAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
42 : AsmPrinter(TM, Streamer), MCInstLowering(*this) {
43 Subtarget = &TM.getSubtarget<MipsSubtarget>();
46 virtual const char *getPassName() const {
47 return "Mips Assembly Printer";
50 virtual bool runOnMachineFunction(MachineFunction &MF);
52 void EmitInstruction(const MachineInstr *MI);
53 void printSavedRegsBitmask(raw_ostream &O);
54 void printHex32(unsigned int Value, raw_ostream &O);
55 void emitFrameDirective();
56 const char *getCurrentABIString() const;
57 virtual void EmitFunctionEntryLabel();
58 virtual void EmitFunctionBodyStart();
59 virtual void EmitFunctionBodyEnd();
60 virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock*
62 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
63 unsigned AsmVariant, const char *ExtraCode,
65 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
66 unsigned AsmVariant, const char *ExtraCode,
68 void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
69 void printUnsignedImm(const MachineInstr *MI, int opNum, raw_ostream &O);
70 void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
71 void printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O);
72 void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
73 const char *Modifier = 0);
74 void EmitStartOfAsmFile(Module &M);
75 virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
76 void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);