47 "Create Garbage Collector Module Metadata",
false,
false)
52 :
F(
F), S(S), FrameSize(~0LL) {}
65 assert(!
F.isDeclaration() &&
"Can only get GCFunctionInfo for a definition!");
69 if (
I != FInfoMap.
end())
73 Functions.push_back(std::make_unique<GCFunctionInfo>(
F, *S));
82 GCStrategyList.clear();
94 return "Print Garbage Collector Information";
103bool Printer::runOnFunction(
Function &
F) {
113 OS <<
"\t" << RI->Num <<
"\t" << RI->StackOffset <<
"[sp]\n";
119 OS <<
"\t" << PI->Label->getName() <<
": " <<
"post-call"
122 ListSeparator
LS(
",");
124 OS <<
LS <<
" " <<
R.Num;
132bool Printer::doFinalization(
Module &M) {
133 GCModuleInfo *GMI = getAnalysisIfAvailable<GCModuleInfo>();
134 assert(GMI &&
"Printer didn't require GCModuleInfo?!");
141 auto NMI = GCStrategyMap.find(
Name);
142 if (NMI != GCStrategyMap.end())
143 return NMI->getValue();
146 S->Name = std::string(
Name);
147 GCStrategyMap[
Name] = S.get();
148 GCStrategyList.push_back(std::move(S));
149 return GCStrategyList.back().get();
dxil pretty DXIL Metadata Pretty Printer
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
iterator find(const_arg_type_t< KeyT > Val)
FunctionPass class - This class is used to implement most global optimizations.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Garbage collection metadata for a single function.
std::vector< GCRoot >::iterator roots_iterator
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.
live_iterator live_end(const iterator &p)
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.
An analysis pass which caches information about the entire Module.
GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
void clear()
clear - Resets the pass.
GCStrategy * getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
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.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
Return a constant reference to the value's name.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void initializeGCModuleInfoPass(PassRegistry &)
FunctionPass * createGCInfoPrinter(raw_ostream &OS)
Creates a pass to print GC metadata.
std::unique_ptr< GCStrategy > getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
GCRoot - Metadata for a pointer to an object managed by the garbage collector.