LLVM  13.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 
22 #include "llvm/Support/Registry.h"
23 
24 namespace llvm {
25 
26 class AsmPrinter;
27 class GCMetadataPrinter;
28 class GCModuleInfo;
29 class GCStrategy;
30 class Module;
31 class StackMaps;
32 
33 /// GCMetadataPrinterRegistry - The GC assembly printer registry uses all the
34 /// defaults from Registry.
36 
37 /// GCMetadataPrinter - Emits GC metadata as assembly code. Instances are
38 /// created, managed, and owned by the AsmPrinter.
40 private:
41  friend class AsmPrinter;
42 
43  GCStrategy *S;
44 
45 protected:
46  // May only be subclassed.
48 
49 public:
50  GCMetadataPrinter(const GCMetadataPrinter &) = delete;
52  virtual ~GCMetadataPrinter();
53 
54  GCStrategy &getStrategy() { return *S; }
55 
56  /// Called before the assembly for the module is generated by
57  /// the AsmPrinter (but after target specific hooks.)
58  virtual void beginAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) {}
59 
60  /// Called after the assembly for the module is generated by
61  /// the AsmPrinter (but before target specific hooks)
63 
64  /// Called when the stack maps are generated. Return true if
65  /// stack maps with a custom format are generated. Otherwise
66  /// returns false and the default format will be used.
67  virtual bool emitStackMaps(StackMaps &SM, AsmPrinter &AP) { return false; }
68 };
69 
70 } // end namespace llvm
71 
72 #endif // LLVM_CODEGEN_GCMETADATAPRINTER_H
llvm::GCMetadataPrinter::getStrategy
GCStrategy & getStrategy()
Definition: GCMetadataPrinter.h:54
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::GCStrategy
GCStrategy describes a garbage collector algorithm's code generation requirements,...
Definition: GCStrategy.h:66
llvm::GCMetadataPrinter::GCMetadataPrinter
GCMetadataPrinter()
llvm::GCMetadataPrinter::operator=
GCMetadataPrinter & operator=(const GCMetadataPrinter &)=delete
llvm::GCMetadataPrinter
GCMetadataPrinter - Emits GC metadata as assembly code.
Definition: GCMetadataPrinter.h:39
llvm::GCMetadataPrinter::finishAssembly
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...
Definition: GCMetadataPrinter.h:62
llvm::StackMaps
Definition: StackMaps.h:251
llvm::GCMetadataPrinter::beginAssembly
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...
Definition: GCMetadataPrinter.h:58
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
Registry.h
llvm::GCMetadataPrinter::emitStackMaps
virtual bool emitStackMaps(StackMaps &SM, AsmPrinter &AP)
Called when the stack maps are generated.
Definition: GCMetadataPrinter.h:67
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
llvm::Registry
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:44
llvm::GCMetadataPrinter::~GCMetadataPrinter
virtual ~GCMetadataPrinter()
llvm::GCModuleInfo
An analysis pass which caches information about the entire Module.
Definition: GCMetadata.h:152