LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
25 #include "llvm/Support/Registry.h"
26 
27 namespace llvm {
28 
30 
31  /// GCMetadataPrinterRegistry - The GC assembly printer registry uses all the
32  /// defaults from Registry.
34 
35  /// GCMetadataPrinter - Emits GC metadata as assembly code.
36  ///
38  public:
41 
42  private:
43  GCStrategy *S;
44 
45  friend class AsmPrinter;
46 
47  protected:
48  // May only be subclassed.
50 
51  private:
54  operator=(const GCMetadataPrinter &) LLVM_DELETED_FUNCTION;
55 
56  public:
57  GCStrategy &getStrategy() { return *S; }
58  const Module &getModule() const { return S->getModule(); }
59 
60  /// begin/end - Iterate over the collected function metadata.
61  iterator begin() { return S->begin(); }
62  iterator end() { return S->end(); }
63 
64  /// beginAssembly/finishAssembly - Emit module metadata as assembly code.
65  virtual void beginAssembly(AsmPrinter &AP);
66 
67  virtual void finishAssembly(AsmPrinter &AP);
68 
69  virtual ~GCMetadataPrinter();
70  };
71 
72 }
73 
74 #endif
const Module & getModule() const
GCStrategy::list_type list_type
The main container class for the LLVM Intermediate Representation.
Definition: Module.h:112
virtual void beginAssembly(AsmPrinter &AP)
beginAssembly/finishAssembly - Emit module metadata as assembly code.
std::vector< GCFunctionInfo * > list_type
Definition: GCStrategy.h:57
iterator begin()
begin/end - Iterate over the collected function metadata.
iterator begin()
Definition: GCStrategy.h:134
Registry< GCMetadataPrinter > GCMetadataPrinterRegistry
GCStrategy::iterator iterator
list_type::iterator iterator
Definition: GCStrategy.h:58
iterator end()
Definition: GCStrategy.h:135
#define LLVM_DELETED_FUNCTION
Definition: Compiler.h:137
virtual void finishAssembly(AsmPrinter &AP)
const Module & getModule() const
Definition: GCStrategy.h:89