32#ifndef LLVM_CODEGEN_GCMETADATA_H
33#define LLVM_CODEGEN_GCMETADATA_H
80 using iterator = std::vector<GCPoint>::iterator;
88 std::vector<GCRoot> Roots;
89 std::vector<GCPoint> SafePoints;
124 return Roots.erase(position);
131 SafePoints.emplace_back(Label,
DL);
141 size_t size()
const {
return SafePoints.size(); }
229 finfo_map_type FInfoMap;
This file defines the StringMap class.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file defines the DenseMap class.
This header defines various interfaces for pass management in LLVM.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
This file defines the SmallVector class.
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
This is an important base class in LLVM.
An analysis pass which caches information about the Function.
Result run(Function &F, FunctionAnalysisManager &FAM)
Garbage collection metadata for a single function.
void setFrameSize(uint64_t S)
size_t roots_size() const
void addStackRoot(int Num, const Constant *Metadata)
addStackRoot - Registers a root that lives on the stack.
void addSafePoint(MCSymbol *Label, const DebugLoc &DL)
addSafePoint - Notes the existence of a safe point.
std::vector< GCRoot >::iterator roots_iterator
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation explicitly.
size_t live_size(const iterator &p) const
uint64_t getFrameSize() const
getFrameSize/setFrameSize - Records the function's frame size.
iterator begin()
begin/end - Iterators for safe points.
live_iterator live_begin(const iterator &p)
live_begin/live_end - Iterators for live roots at a given safe point.
roots_iterator removeStackRoot(roots_iterator position)
removeStackRoot - Removes a root.
GCStrategy & getStrategy()
getStrategy - Return the GC strategy for the function.
live_iterator live_end(const iterator &p)
std::vector< GCRoot >::const_iterator live_iterator
roots_iterator roots_end()
std::vector< GCPoint >::iterator iterator
const Function & getFunction() const
getFunction - Return the function to which this metadata applies.
GCFunctionInfo(const Function &F, GCStrategy &S)
roots_iterator roots_begin()
roots_begin/roots_end - Iterators for all roots in the function.
LowerIntrinsics - This pass rewrites calls to the llvm.gcread or llvm.gcwrite intrinsics,...
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
An analysis pass which caches information about the entire Module.
FuncInfoVec::iterator funcinfo_end()
FuncInfoVec::iterator funcinfo_begin()
GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
iterator begin() const
begin/end - Iterators for used strategies.
void clear()
clear - Resets the pass.
GCStrategy * getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
std::vector< std::unique_ptr< GCFunctionInfo > > FuncInfoVec
List of per function info objects.
GCStrategy describes a garbage collector algorithm's code generation requirements,...
ImmutablePass class - This class is used to provide information that does not need to be run.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StackOffset holds a fixed and a scalable offset in bytes.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
GCPoint - Metadata for a collector-safe point in machine code.
GCPoint(MCSymbol *L, DebugLoc DL)
GCRoot - Metadata for a pointer to an object managed by the garbage collector.
GCRoot(int N, const Constant *MD)
const Constant * Metadata
Metadata straight from the call to llvm.gcroot.
int Num
Usually a frame index.
GCStrategyMap(GCStrategyMap &&)=default
bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &Inv)
Handle invalidation explicitly.
StringMap< std::unique_ptr< GCStrategy > > StrategyMap
A CRTP mix-in to automatically provide informational APIs needed for passes.