LLVM 20.0.0git
GCMetadataPrinter.h
Go to the documentation of this file.
1//===- llvm/CodeGen/GCMetadataPrinter.h - Prints asm GC tables --*- 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// The abstract base class GCMetadataPrinter supports writing GC metadata tables
10// as assembly code. This is a separate class from GCStrategy in order to allow
11// users of the LLVM JIT to avoid linking with the AsmWriter.
12//
13// Subclasses of GCMetadataPrinter must be registered using the
14// GCMetadataPrinterRegistry. This is separate from the GCStrategy itself
15// because these subclasses are logically plugins for the AsmWriter.
16//
17//===----------------------------------------------------------------------===//
18
19#ifndef LLVM_CODEGEN_GCMETADATAPRINTER_H
20#define LLVM_CODEGEN_GCMETADATAPRINTER_H
21
23
24namespace llvm {
25
26class AsmPrinter;
27class GCMetadataPrinter;
28class GCModuleInfo;
29class GCStrategy;
30class Module;
31class StackMaps;
32
33/// GCMetadataPrinterRegistry - The GC assembly printer registry uses all the
34/// defaults from Registry.
36
37extern template class LLVM_TEMPLATE_ABI Registry<GCMetadataPrinter>;
38
39/// GCMetadataPrinter - Emits GC metadata as assembly code. Instances are
40/// created, managed, and owned by the AsmPrinter.
42private:
43 friend class AsmPrinter;
44
45 GCStrategy *S;
46
47protected:
48 // May only be subclassed.
50
51public:
55
56 GCStrategy &getStrategy() { return *S; }
57
58 /// Called before the assembly for the module is generated by
59 /// the AsmPrinter (but after target specific hooks.)
60 virtual void beginAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) {}
61
62 /// Called after the assembly for the module is generated by
63 /// the AsmPrinter (but before target specific hooks)
65
66 /// Called when the stack maps are generated. Return true if
67 /// stack maps with a custom format are generated. Otherwise
68 /// returns false and the default format will be used.
69 virtual bool emitStackMaps(StackMaps &SM, AsmPrinter &AP) { return false; }
70};
71
72} // end namespace llvm
73
74#endif // LLVM_CODEGEN_GCMETADATAPRINTER_H
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
Machine Check Debug Module
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:86
GCMetadataPrinter - Emits GC metadata as assembly code.
virtual void finishAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP)
Called after the assembly for the module is generated by the AsmPrinter (but before target specific h...
virtual void beginAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP)
Called before the assembly for the module is generated by the AsmPrinter (but after target specific h...
GCMetadataPrinter(const GCMetadataPrinter &)=delete
virtual bool emitStackMaps(StackMaps &SM, AsmPrinter &AP)
Called when the stack maps are generated.
GCMetadataPrinter & operator=(const GCMetadataPrinter &)=delete
An analysis pass which caches information about the entire Module.
Definition: GCMetadata.h:203
GCStrategy describes a garbage collector algorithm's code generation requirements,...
Definition: GCStrategy.h:63
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:44
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18