LLVM 24.0.0git
SystemZELFAsmPrinter.h
Go to the documentation of this file.
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
19#include "SystemZAsmPrinter.h"
20#include "SystemZMCInstLower.h"
21
22namespace llvm {
23
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;
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,
44 void LowerPATCHABLE_RET(const MachineInstr &MI, SystemZMCInstLower &Lower);
45 void lowerLOAD_TLS_BLOCK_ADDR(const MachineInstr &MI,
47 void lowerLOAD_GLOBAL_STACKGUARD_ADDR(const MachineInstr &MI,
49 void emitAttributes(Module &M);
50};
51
52} // end namespace llvm
53
54#endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZELFASMPRINTER_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_LIBRARY_VISIBILITY
Definition Compiler.h:137
IRTranslator LLVM IR MI
std::unique_ptr< MCStreamer > && Streamer
return new SystemZELFAsmPrinter(TM, std::move(Streamer))
TargetMachine & TM
Target machine description.
Definition AsmPrinter.h:94
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition AsmPrinter.h:106
Target specific streamer interface.
Definition MCStreamer.h:95
Abstract base class for all machine specific constantpool value subclasses.
Representation of each machine instruction.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
SystemZAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
SystemZELFAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
void emitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
Primary interface to the complete machine description for the target machine.
This is an optimization pass for GlobalISel generic memory operations.