1//===-- SystemZELFAsmPrinter.h - SystemZ ELF asm printer --------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the SystemZELFAsmPrinter class, which owns ELF-specific
10// asm printer behaviour: ELF instruction lowering, fentry/stackmap/patchpoint,
11// TLS block address, stack-guard address, and the ELF vector-ABI attribute.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZELFASMPRINTER_H
16#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZELFASMPRINTER_H
17
18#include "MCTargetDesc/SystemZTargetStreamer.h"
19#include "SystemZAsmPrinter.h"
20#include "SystemZMCInstLower.h"
21
22namespace llvm {
23
24class LLVM_LIBRARY_VISIBILITY SystemZELFAsmPrinter : public SystemZAsmPrinter {
25 SystemZTargetStreamer *getTargetStreamer() {
26 MCTargetStreamer *TS = OutStreamer->getTargetStreamer();
27 assert(TS && "do not have a target streamer");
28 return static_cast<SystemZTargetStreamer *>(TS);
29 }
30
31public:
32 SystemZELFAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer);
33
34 void emitInstruction(const MachineInstr *MI) override;
35 void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
36 void emitEndOfAsmFile(Module &M) override;
37
38private:
39 void LowerFENTRY_CALL(const MachineInstr &MI, SystemZMCInstLower &Lower);
40 void LowerSTACKMAP(const MachineInstr &MI);
41 void LowerPATCHPOINT(const MachineInstr &MI, SystemZMCInstLower &Lower);
42 void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI,
43 SystemZMCInstLower &Lower);
44 void LowerPATCHABLE_RET(const MachineInstr &MI, SystemZMCInstLower &Lower);
45 void lowerLOAD_TLS_BLOCK_ADDR(const MachineInstr &MI,
46 SystemZMCInstLower &Lower);
47 void lowerLOAD_GLOBAL_STACKGUARD_ADDR(const MachineInstr &MI,
48 SystemZMCInstLower &Lower);
49 void emitAttributes(Module &M);
50};
51
52} // end namespace llvm
53
54#endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZELFASMPRINTER_H
55