LLVM  3.7.0
HexagonAsmPrinter.h
Go to the documentation of this file.
1 //===-- HexagonAsmPrinter.h - Print machine code to an Hexagon .s file ----===//
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 // Hexagon Assembly printer class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H
15 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H
16 
17 #include "Hexagon.h"
18 #include "HexagonTargetMachine.h"
20 #include "llvm/Support/Compiler.h"
22 
23 namespace llvm {
24  class HexagonAsmPrinter : public AsmPrinter {
25  const HexagonSubtarget *Subtarget;
26 
27  public:
29  std::unique_ptr<MCStreamer> Streamer);
30 
32  Subtarget = &Fn.getSubtarget<HexagonSubtarget>();
34  }
35 
36  const char *getPassName() const override {
37  return "Hexagon Assembly Printer";
38  }
39 
41  const MachineBasicBlock *MBB) const override;
42 
43  void EmitInstruction(const MachineInstr *MI) override;
44 
45  void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O);
46  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
47  unsigned AsmVariant, const char *ExtraCode,
48  raw_ostream &OS) override;
49  bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
50  unsigned AsmVariant, const char *ExtraCode,
51  raw_ostream &OS) override;
52 
53  static const char *getRegisterName(unsigned RegNo);
54  };
55 
56 } // end of llvm namespace
57 
58 #endif
bool runOnMachineFunction(MachineFunction &Fn) override
Emit the specified function out to the OutStreamer.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
Definition: AsmPrinter.h:201
HexagonAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void EmitInstruction(const MachineInstr *MI) override
printMachineInstruction – Print out a single Hexagon MI in Darwin syntax to the current output stream...
static const char * getRegisterName(unsigned RegNo)
TargetMachine & TM
Target machine description.
Definition: AsmPrinter.h:70
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:66
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O)
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) override
PrintAsmOperand - Print out an operand for an inline asm expression.
Representation of each machine instruction.
Definition: MachineInstr.h:51
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
Primary interface to the complete machine description for the target machine.
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const override
Return true if the basic block has exactly one predecessor and the control transfer mechanism between...
const char * getPassName() const override
getPassName - Return a nice clean name for a pass.