LLVM  6.0.0svn
GCMetadataPrinter.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/GCMetadataPrinter.h - Prints asm GC tables --*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // The abstract base class GCMetadataPrinter supports writing GC metadata tables
11 // as assembly code. This is a separate class from GCStrategy in order to allow
12 // users of the LLVM JIT to avoid linking with the AsmWriter.
13 //
14 // Subclasses of GCMetadataPrinter must be registered using the
15 // GCMetadataPrinterRegistry. This is separate from the GCStrategy itself
16 // because these subclasses are logically plugins for the AsmWriter.
17 //
18 //===----------------------------------------------------------------------===//
19 
20 #ifndef LLVM_CODEGEN_GCMETADATAPRINTER_H
21 #define LLVM_CODEGEN_GCMETADATAPRINTER_H
22 
23 #include "llvm/Support/Registry.h"
24 
25 namespace llvm {
26 
27 class AsmPrinter;
28 class GCMetadataPrinter;
29 class GCModuleInfo;
30 class GCStrategy;
31 class Module;
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)
62  virtual void finishAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) {}
63 };
64 
65 } // end namespace llvm
66 
67 #endif // LLVM_CODEGEN_GCMETADATAPRINTER_H
GCMetadataPrinter & operator=(const GCMetadataPrinter &)=delete
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:63
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition: Registry.h:45
An analysis pass which caches information about the entire Module.
Definition: GCMetadata.h:154
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...
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:77
GCStrategy describes a garbage collector algorithm's code generation requirements, and provides overridable hooks for those needs which cannot be abstractly described.
Definition: GCStrategy.h:80
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 - Emits GC metadata as assembly code.