1251607Sdim//===-- SystemZAsmPrinter.h - SystemZ LLVM assembly printer ----*- C++ -*--===//
2251607Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6251607Sdim//
7251607Sdim//===----------------------------------------------------------------------===//
8251607Sdim
9280031Sdim#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZASMPRINTER_H
10280031Sdim#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZASMPRINTER_H
11251607Sdim
12251607Sdim#include "SystemZTargetMachine.h"
13341825Sdim#include "SystemZMCInstLower.h"
14251607Sdim#include "llvm/CodeGen/AsmPrinter.h"
15341825Sdim#include "llvm/CodeGen/StackMaps.h"
16251607Sdim#include "llvm/Support/Compiler.h"
17251607Sdim
18251607Sdimnamespace llvm {
19251607Sdimclass MCStreamer;
20251607Sdimclass MachineBasicBlock;
21251607Sdimclass MachineInstr;
22251607Sdimclass Module;
23251607Sdimclass raw_ostream;
24251607Sdim
25251607Sdimclass LLVM_LIBRARY_VISIBILITY SystemZAsmPrinter : public AsmPrinter {
26341825Sdimprivate:
27341825Sdim  StackMaps SM;
28341825Sdim
29251607Sdimpublic:
30288943Sdim  SystemZAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer)
31341825Sdim      : AsmPrinter(TM, std::move(Streamer)), SM(*this) {}
32251607Sdim
33251607Sdim  // Override AsmPrinter.
34314564Sdim  StringRef getPassName() const override { return "SystemZ Assembly Printer"; }
35276479Sdim  void EmitInstruction(const MachineInstr *MI) override;
36276479Sdim  void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
37341825Sdim  void EmitEndOfAsmFile(Module &M) override;
38276479Sdim  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
39353358Sdim                       const char *ExtraCode, raw_ostream &OS) override;
40276479Sdim  bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
41353358Sdim                             const char *ExtraCode, raw_ostream &OS) override;
42341825Sdim
43341825Sdim  bool doInitialization(Module &M) override {
44341825Sdim    SM.reset();
45341825Sdim    return AsmPrinter::doInitialization(M);
46341825Sdim  }
47341825Sdim
48341825Sdimprivate:
49360784Sdim  void LowerFENTRY_CALL(const MachineInstr &MI, SystemZMCInstLower &MCIL);
50341825Sdim  void LowerSTACKMAP(const MachineInstr &MI);
51341825Sdim  void LowerPATCHPOINT(const MachineInstr &MI, SystemZMCInstLower &Lower);
52251607Sdim};
53251607Sdim} // end namespace llvm
54251607Sdim
55251607Sdim#endif
56