1//===-- SystemZAsmPrinter.h - SystemZ 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#ifndef SYSTEMZASMPRINTER_H
11#define SYSTEMZASMPRINTER_H
12
13#include "SystemZTargetMachine.h"
14#include "llvm/CodeGen/AsmPrinter.h"
15#include "llvm/Support/Compiler.h"
16
17namespace llvm {
18class MCStreamer;
19class MachineBasicBlock;
20class MachineInstr;
21class Module;
22class raw_ostream;
23
24class LLVM_LIBRARY_VISIBILITY SystemZAsmPrinter : public AsmPrinter {
25private:
26  const SystemZSubtarget *Subtarget;
27
28public:
29  SystemZAsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
30    : AsmPrinter(TM, Streamer) {
31    Subtarget = &TM.getSubtarget<SystemZSubtarget>();
32  }
33
34  // Override AsmPrinter.
35  const char *getPassName() const override {
36    return "SystemZ Assembly Printer";
37  }
38  void EmitInstruction(const MachineInstr *MI) override;
39  void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
40  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
41                       unsigned AsmVariant, const char *ExtraCode,
42                       raw_ostream &OS) override;
43  bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
44                             unsigned AsmVariant, const char *ExtraCode,
45                             raw_ostream &OS) override;
46  void EmitEndOfAsmFile(Module &M) override;
47};
48} // end namespace llvm
49
50#endif
51