Go to the documentation of this file.
47 Y(
"ocaml",
"ocaml 3.10-compatible collector");
52 const std::string &MId =
M.getModuleIdentifier();
56 size_t Letter = SymName.size();
57 SymName.append(MId.begin(),
llvm::find(MId,
'.'));
62 SymName[Letter] = toupper(SymName[Letter]);
100 unsigned IntPtrSize =
M.getDataLayout().getPointerSize();
114 int NumDescriptors = 0;
115 for (std::unique_ptr<GCFunctionInfo> &FI :
117 if (FI->getStrategy().getName() != getStrategy().
getName())
120 NumDescriptors += FI->size();
123 if (NumDescriptors >= 1 << 16) {
130 for (std::unique_ptr<GCFunctionInfo> &FI :
132 if (FI->getStrategy().getName() != getStrategy().
getName())
136 uint64_t FrameSize = FI->getFrameSize();
137 if (FrameSize >= 1 << 16) {
140 "' is too large for the ocaml GC! "
145 Twine(
reinterpret_cast<uintptr_t
>(FI.get())) +
")");
149 Twine(FI->getFunction().getName()));
154 size_t LiveCount = FI->live_size(J);
155 if (LiveCount >= 1 << 16) {
158 "' is too large for the ocaml GC! "
160 Twine(LiveCount) +
" >= 65536.");
163 AP.
OutStreamer->emitSymbolValue(J->Label, IntPtrSize);
168 KE = FI->live_end(J);
170 if (K->StackOffset >= 1 << 16) {
173 "GC root stack offset is outside of fixed stack frame and out "
174 "of range for ocaml GC!");
static StringRef getName(Value *V)
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
std::vector< GCPoint >::iterator iterator
void emitAlignment(Align Alignment, const GlobalObject *GV=nullptr, unsigned MaxBytesToEmit=0) const
Emit an alignment directive to the specified power of two boundary.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
MCSection * getDataSection() const
std::vector< GCRoot >::const_iterator live_iterator
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Analysis containing CSE Info
MCSection * getTextSection() const
static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id)
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
void linkOcamlGCPrinter()
Creates an ocaml-compatible metadata printer.
MCContext & OutContext
This is the context for the output file that we are streaming.
A Module instance is used to store all the information related to an LLVM module.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class is intended to be used as a driving class for all asm writers.
@ MCSA_Global
.type _foo, @gnu_unique_object
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
A static registration template.
An analysis pass which caches information about the entire Module.
void emitInt16(int Value) const
Emit a short directive and value.