Go to the documentation of this file.
41 bool doFinalization(
Module &M)
override;
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";
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;
132 bool 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();
149 return GCStrategyList.back().get();
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.
live_iterator live_begin(const iterator &p)
live_begin/live_end - Iterators for live roots at a given safe point.
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.
GCRoot - Metadata for a pointer to an object managed by the garbage collector.
Garbage collection metadata for a single function.
std::vector< GCPoint >::iterator iterator
roots_iterator roots_begin()
roots_begin/roots_end - Iterators for all roots in the function.
FunctionPass * createGCInfoPrinter(raw_ostream &OS)
Creates a pass to print GC metadata.
void initializeGCModuleInfoPass(PassRegistry &)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
iterator begin()
begin/end - Iterators for safe points.
Represent the analysis usage information of a pass.
GCStrategy * getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
void clear()
clear - Resets the pass.
This class implements an extremely fast bulk output stream that can only output to a stream.
live_iterator live_end(const iterator &p)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
iterator find(const_arg_type_t< KeyT > Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
Memory true print Memory SSA Printer
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
StringRef getName() const
Return a constant reference to the value's name.
static bool runOnFunction(Function &F, bool PostInlining)
void setPreservesAll()
Set by analyses that do not transform their input at all.
std::unique_ptr< GCStrategy > getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
FunctionPass class - This class is used to implement most global optimizations.
std::vector< GCRoot >::iterator roots_iterator
AnalysisUsage & addRequired()
roots_iterator roots_end()
An analysis pass which caches information about the entire Module.
const Function & getFunction() const
getFunction - Return the function to which this metadata applies.