32#ifndef LLVM_CODEGEN_GCMETADATA_H
33#define LLVM_CODEGEN_GCMETADATA_H
82 using iterator = std::vector<GCPoint>::iterator;
90 std::vector<GCRoot> Roots;
91 std::vector<GCPoint> SafePoints;
126 return Roots.erase(position);
133 SafePoints.emplace_back(Label,
DL);
143 size_t size()
const {
return SafePoints.size(); }
187 auto I = Strategies.
find(GCName);
188 assert(
I != Strategies.
end() &&
"Required strategy doesn't exist!");
263 finfo_map_type FInfoMap;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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.
This file implements a map that provides insertion order iteration.
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.
LLVM_ABI 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.
LLVM_ABI ~GCFunctionInfo()
void addSafePoint(MCSymbol *Label, const DebugLoc &DL)
addSafePoint - Notes the existence of a safe point.
std::vector< GCRoot >::iterator roots_iterator
LLVM_ABI 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.
LLVM_ABI GCFunctionInfo(const Function &F, GCStrategy &S)
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.
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,...
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
An analysis pass which caches information about the entire Module.
FuncInfoVec::iterator funcinfo_end()
FuncInfoVec::iterator funcinfo_begin()
LLVM_ABI GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
iterator begin() const
begin/end - Iterators for used strategies.
LLVM_ABI void clear()
clear - Resets the pass.
LLVM_ABI 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.
std::pair< iterator, bool > try_emplace(StringRef GCName)
reverse_iterator rbegin()
GCStrategyMap(GCStrategyMap &&)=default
MapT::const_reverse_iterator const_reverse_iterator
const_reverse_iterator rend() const
const_iterator begin() const
MapT::const_iterator const_iterator
MapT::reverse_iterator reverse_iterator
LLVM_ABI bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &Inv)
Handle invalidation explicitly.
bool contains(StringRef GCName) const
const GCStrategy & operator[](StringRef GCName) const
const_reverse_iterator rbegin() const
const_iterator end() const
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 ...
typename VectorType::iterator iterator
typename VectorType::const_reverse_iterator const_reverse_iterator
iterator find(const KeyT &Key)
bool contains(const KeyT &Key) const
std::pair< iterator, bool > try_emplace(const KeyT &Key, Ts &&...Args)
typename VectorType::reverse_iterator reverse_iterator
typename VectorType::const_iterator const_iterator
reverse_iterator rbegin()
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.
A CRTP mix-in to automatically provide informational APIs needed for passes.