1c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===- GCMetadata.h - Garbage collector metadata ----------------*- C++ -*-===//
2c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
3c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//                     The LLVM Compiler Infrastructure
4c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
5c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// This file is distributed under the University of Illinois Open Source
6c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// License. See LICENSE.TXT for details.
7c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
8c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===----------------------------------------------------------------------===//
9c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
10c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// This file declares the GCFunctionInfo and GCModuleInfo classes, which are
11c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// used as a communication channel from the target code generator to the target
12c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// garbage collectors. This interface allows code generators and garbage
13c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// collectors to be developed independently.
14c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
15c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// The GCFunctionInfo class logs the data necessary to build a type accurate
16c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// stack map. The code generator outputs:
17c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
18c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//   - Safe points as specified by the GCStrategy's NeededSafePoints.
19c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//   - Stack offsets for GC roots, as specified by calls to llvm.gcroot
20c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
21c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// As a refinement, liveness analysis calculates the set of live roots at each
22c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// safe point. Liveness analysis is not presently performed by the code
23c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// generator, so all roots are assumed live.
24c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
25c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// GCModuleInfo simply collects GCFunctionInfo instances for each Function as
26c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// they are compiled. This accretion is necessary for collectors which must emit
27c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// a stack map for the compilation unit as a whole. Therefore, GCFunctionInfo
28c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// outlives the MachineFunction from which it is derived and must not refer to
29c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// any code generator data structures.
30c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//
31c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===----------------------------------------------------------------------===//
32c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
33c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#ifndef LLVM_CODEGEN_GCMETADATA_H
34c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#define LLVM_CODEGEN_GCMETADATA_H
35c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
36c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/ADT/DenseMap.h"
37c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/ADT/SmallVector.h"
38c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/ADT/StringMap.h"
39c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/ADT/StringRef.h"
40c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/CodeGen/GCStrategy.h"
41c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/IR/DebugLoc.h"
42c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/Pass.h"
43c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <algorithm>
44c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <cstddef>
45c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <cstdint>
46c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <memory>
47c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <vector>
48c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
49c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotnamespace llvm {
50c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
51c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass Constant;
52c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass Function;
53c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MCSymbol;
54c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
55c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// GCPoint - Metadata for a collector-safe point in machine code.
56c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot///
57c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotstruct GCPoint {
58c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GC::PointKind Kind; ///< The kind of the safe point.
59c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  MCSymbol *Label;    ///< A label.
60c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  DebugLoc Loc;
61c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
62c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCPoint(GC::PointKind K, MCSymbol *L, DebugLoc DL)
63c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot      : Kind(K), Label(L), Loc(std::move(DL)) {}
64c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot};
65c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
66c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// GCRoot - Metadata for a pointer to an object managed by the garbage
67c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// collector.
68c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotstruct GCRoot {
69c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  int Num;                  ///< Usually a frame index.
70c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  int StackOffset = -1;     ///< Offset from the stack pointer.
71c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  const Constant *Metadata; ///< Metadata straight from the call
72c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot                            ///< to llvm.gcroot.
73c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
74c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCRoot(int N, const Constant *MD) : Num(N), Metadata(MD) {}
75c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot};
76c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
77c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// Garbage collection metadata for a single function.  Currently, this
78c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// information only applies to GCStrategies which use GCRoot.
79c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass GCFunctionInfo {
80c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic:
81c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using iterator = std::vector<GCPoint>::iterator;
82c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using roots_iterator = std::vector<GCRoot>::iterator;
83c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using live_iterator = std::vector<GCRoot>::const_iterator;
84c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
85c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotprivate:
86c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  const Function &F;
87c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCStrategy &S;
88c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  uint64_t FrameSize;
89c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  std::vector<GCRoot> Roots;
90c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  std::vector<GCPoint> SafePoints;
91c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
92c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  // FIXME: Liveness. A 2D BitVector, perhaps?
93c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //
94c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //   BitVector Liveness;
95c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //
96c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //   bool islive(int point, int root) =
97c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //     Liveness[point * SafePoints.size() + root]
98c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //
99c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  // The bit vector is the more compact representation where >3.2% of roots
100c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  // are live per safe point (1.5% on 64-bit hosts).
101c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
102c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic:
103c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCFunctionInfo(const Function &F, GCStrategy &S);
104c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  ~GCFunctionInfo();
105c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
106c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// getFunction - Return the function to which this metadata applies.
107c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  const Function &getFunction() const { return F; }
108c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
109c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// getStrategy - Return the GC strategy for the function.
110c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCStrategy &getStrategy() { return S; }
111c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
112c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// addStackRoot - Registers a root that lives on the stack. Num is the
113c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  ///                stack object ID for the alloca (if the code generator is
114c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  //                 using  MachineFrameInfo).
115c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  void addStackRoot(int Num, const Constant *Metadata) {
116c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot    Roots.push_back(GCRoot(Num, Metadata));
117c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  }
118c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
119c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// removeStackRoot - Removes a root.
120c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  roots_iterator removeStackRoot(roots_iterator position) {
121c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot    return Roots.erase(position);
122c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  }
123c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
124c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// addSafePoint - Notes the existence of a safe point. Num is the ID of the
125c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// label just prior to the safe point (if the code generator is using
126c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// MachineModuleInfo).
127c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  void addSafePoint(GC::PointKind Kind, MCSymbol *Label, const DebugLoc &DL) {
128c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot    SafePoints.emplace_back(Kind, Label, DL);
129c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  }
130c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
131c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// getFrameSize/setFrameSize - Records the function's frame size.
132c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  uint64_t getFrameSize() const { return FrameSize; }
133c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  void setFrameSize(uint64_t S) { FrameSize = S; }
134c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
135c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// begin/end - Iterators for safe points.
136c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  iterator begin() { return SafePoints.begin(); }
137c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  iterator end() { return SafePoints.end(); }
138c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  size_t size() const { return SafePoints.size(); }
139c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
140c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// roots_begin/roots_end - Iterators for all roots in the function.
141c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  roots_iterator roots_begin() { return Roots.begin(); }
142c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  roots_iterator roots_end() { return Roots.end(); }
143c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  size_t roots_size() const { return Roots.size(); }
144c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
145c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// live_begin/live_end - Iterators for live roots at a given safe point.
146c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  live_iterator live_begin(const iterator &p) { return roots_begin(); }
147c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  live_iterator live_end(const iterator &p) { return roots_end(); }
148c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  size_t live_size(const iterator &p) const { return roots_size(); }
149c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot};
150c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
151c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// An analysis pass which caches information about the entire Module.
152c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// Records both the function level information used by GCRoots and a
153c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// cache of the 'active' gc strategy objects for the current Module.
154c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass GCModuleInfo : public ImmutablePass {
155c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// An owning list of all GCStrategies which have been created
156c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  SmallVector<std::unique_ptr<GCStrategy>, 1> GCStrategyList;
157c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// A helper map to speedup lookups into the above list
158c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  StringMap<GCStrategy*> GCStrategyMap;
159c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
160c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic:
161c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// Lookup the GCStrategy object associated with the given gc name.
162c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// Objects are owned internally; No caller should attempt to delete the
163c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// returned objects.
164c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCStrategy *getGCStrategy(const StringRef Name);
165c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
166c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// List of per function info objects.  In theory, Each of these
167c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// may be associated with a different GC.
168c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using FuncInfoVec = std::vector<std::unique_ptr<GCFunctionInfo>>;
169c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
170c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  FuncInfoVec::iterator funcinfo_begin() { return Functions.begin(); }
171c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  FuncInfoVec::iterator funcinfo_end() { return Functions.end(); }
172c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
173c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotprivate:
174c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// Owning list of all GCFunctionInfos associated with this Module
175c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  FuncInfoVec Functions;
176c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
177c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// Non-owning map to bypass linear search when finding the GCFunctionInfo
178c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// associated with a particular Function.
179c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using finfo_map_type = DenseMap<const Function *, GCFunctionInfo *>;
180c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  finfo_map_type FInfoMap;
181c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
182c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic:
183c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  using iterator = SmallVector<std::unique_ptr<GCStrategy>, 1>::const_iterator;
184c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
185c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  static char ID;
186c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
187c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCModuleInfo();
188c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
189c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// clear - Resets the pass. Any pass, which uses GCModuleInfo, should
190c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// call it in doFinalization().
191c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  ///
192c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  void clear();
193c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
194c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// begin/end - Iterators for used strategies.
195c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  ///
196c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  iterator begin() const { return GCStrategyList.begin(); }
197c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  iterator end() const { return GCStrategyList.end(); }
198c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
199c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// get - Look up function metadata.  This is currently assumed
200c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// have the side effect of initializing the associated GCStrategy.  That
201c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  /// will soon change.
202c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot  GCFunctionInfo &getFunctionInfo(const Function &F);
203c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot};
204c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
205c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot} // end namespace llvm
206c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot
207c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#endif // LLVM_CODEGEN_GCMETADATA_H
208