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;
109 FunctionAnalysisManager::Invalidator &Inv);
126 return Roots.erase(position);
133 SafePoints.emplace_back(Label,
DL);
143 size_t size()
const {
return SafePoints.size(); }
167 ModuleAnalysisManager::Invalidator &Inv);
184 bool empty()
const {
return Strategies.empty(); }
187 auto I = Strategies.find(GCName);
188 assert(
I != Strategies.end() &&
"Required strategy doesn't exist!");
193 return Strategies.try_emplace(GCName);
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.
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)
std::vector< std::unique_ptr< GCFunctionInfo > > FuncInfoVec
List of per function info objects.
FuncInfoVec::iterator funcinfo_end()
FuncInfoVec::iterator funcinfo_begin()
LLVM_ABI GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
SmallVector< std::unique_ptr< GCStrategy >, 1 >::const_iterator iterator
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::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,...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
This class implements a map that also provides access to all stored values in a deterministic order.
typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::iterator iterator
typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::const_reverse_iterator const_reverse_iterator
bool contains(const KeyT &Key) const
typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::reverse_iterator reverse_iterator
typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::const_iterator const_iterator
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.
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.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
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(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 StackOffset
Offset from the stack pointer.
int Num
Usually a frame index.
A CRTP mix-in to automatically provide informational APIs needed for passes.