LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MipsAsmPrinter.h
Go to the documentation of this file.
1 //===-- MipsAsmPrinter.h - Mips LLVM Assembly Printer ----------*- C++ -*--===//
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 "MipsMCInstLower.h"
18 #include "MipsMachineFunction.h"
19 #include "MipsSubtarget.h"
21 #include "llvm/Support/Compiler.h"
23 
24 namespace llvm {
25 class MCStreamer;
26 class MachineInstr;
27 class MachineBasicBlock;
28 class MipsTargetStreamer;
29 class Module;
30 class raw_ostream;
31 
33  MipsTargetStreamer &getTargetStreamer();
34 
35  void EmitInstrWithMacroNoAT(const MachineInstr *MI);
36 
37 private:
38  // tblgen'erated function.
39  bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,
40  const MachineInstr *MI);
41 
42  // lowerOperand - Convert a MachineOperand into the equivalent MCOperand.
43  bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp);
44 
45  /// MCP - Keep a pointer to constantpool entries of the current
46  /// MachineFunction.
47  const MachineConstantPool *MCP;
48 
49  /// InConstantPool - Maintain state when emitting a sequence of constant
50  /// pool entries so we can properly mark them as data regions.
51  bool InConstantPool;
52 
53  bool UsingConstantPools;
54 
55 public:
56 
60 
61  explicit MipsAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
62  : AsmPrinter(TM, Streamer), MCP(0), InConstantPool(false),
63  MCInstLowering(*this) {
64  Subtarget = &TM.getSubtarget<MipsSubtarget>();
65  UsingConstantPools =
66  (Subtarget->inMips16Mode() && Subtarget->useConstantIslands());
67  }
68 
69  virtual const char *getPassName() const {
70  return "Mips Assembly Printer";
71  }
72 
73  virtual bool runOnMachineFunction(MachineFunction &MF);
74 
76  if (!UsingConstantPools)
78  // we emit constant pools customly!
79  }
80 
81  void EmitInstruction(const MachineInstr *MI);
82  void printSavedRegsBitmask(raw_ostream &O);
83  void printHex32(unsigned int Value, raw_ostream &O);
84  void emitFrameDirective();
85  const char *getCurrentABIString() const;
86  virtual void EmitFunctionEntryLabel();
87  virtual void EmitFunctionBodyStart();
88  virtual void EmitFunctionBodyEnd();
89  virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock*
90  MBB) const;
91  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
92  unsigned AsmVariant, const char *ExtraCode,
93  raw_ostream &O);
94  bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
95  unsigned AsmVariant, const char *ExtraCode,
96  raw_ostream &O);
97  void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
98  void printUnsignedImm(const MachineInstr *MI, int opNum, raw_ostream &O);
99  void printUnsignedImm8(const MachineInstr *MI, int opNum, raw_ostream &O);
100  void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
101  void printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O);
102  void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
103  const char *Modifier = 0);
104  void EmitStartOfAsmFile(Module &M);
105  void EmitEndOfAsmFile(Module &M);
106  void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
107 };
108 }
109 
110 #endif
111 
The machine constant pool.
The main container class for the LLVM Intermediate Representation.
Definition: Module.h:112
virtual void EmitConstantPool()
MipsMCInstLower - This class is used to lower an MachineInstr into an.
virtual void EmitConstantPool() LLVM_OVERRIDE
#define false
Definition: ConvertUTF.c:64
#define LLVM_LIBRARY_VISIBILITY
Definition: Compiler.h:173
MipsMCInstLower MCInstLowering
const STC & getSubtarget() const
virtual const char * getPassName() const
const MipsSubtarget * Subtarget
MipsAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
LLVM Value Representation.
Definition: Value.h:66
const MipsFunctionInfo * MipsFI
#define LLVM_OVERRIDE
Definition: Compiler.h:155