]>
Commit | Line | Data |
---|---|---|
223e47cc LB |
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 | ||
1a4d82fc JJ |
14 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H |
15 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONASMPRINTER_H | |
223e47cc LB |
16 | |
17 | #include "Hexagon.h" | |
18 | #include "HexagonTargetMachine.h" | |
19 | #include "llvm/CodeGen/AsmPrinter.h" | |
20 | #include "llvm/Support/Compiler.h" | |
21 | #include "llvm/Support/raw_ostream.h" | |
22 | ||
23 | namespace llvm { | |
24 | class HexagonAsmPrinter : public AsmPrinter { | |
25 | const HexagonSubtarget *Subtarget; | |
26 | ||
27 | public: | |
28 | explicit HexagonAsmPrinter(TargetMachine &TM, MCStreamer &Streamer) | |
29 | : AsmPrinter(TM, Streamer) { | |
30 | Subtarget = &TM.getSubtarget<HexagonSubtarget>(); | |
31 | } | |
32 | ||
1a4d82fc | 33 | const char *getPassName() const override { |
223e47cc LB |
34 | return "Hexagon Assembly Printer"; |
35 | } | |
36 | ||
1a4d82fc JJ |
37 | bool isBlockOnlyReachableByFallthrough( |
38 | const MachineBasicBlock *MBB) const override; | |
223e47cc | 39 | |
1a4d82fc | 40 | void EmitInstruction(const MachineInstr *MI) override; |
223e47cc LB |
41 | |
42 | void printOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O); | |
43 | bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, | |
44 | unsigned AsmVariant, const char *ExtraCode, | |
1a4d82fc | 45 | raw_ostream &OS) override; |
223e47cc LB |
46 | bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, |
47 | unsigned AsmVariant, const char *ExtraCode, | |
1a4d82fc | 48 | raw_ostream &OS) override; |
223e47cc LB |
49 | |
50 | static const char *getRegisterName(unsigned RegNo); | |
223e47cc LB |
51 | }; |
52 | ||
53 | } // end of llvm namespace | |
54 | ||
55 | #endif |