43 Y(
"ocaml",
"ocaml 3.10-compatible collector");
52 size_t Letter = SymName.size();
53 SymName.append(MId.begin(),
find(MId,
'.'));
58 SymName[Letter] = toupper(SymName[Letter]);
110 int NumDescriptors = 0;
123 if (NumDescriptors >= 1 << 16) {
139 if (FrameSize >= 1 << 16) {
142 "' is too large for the ocaml GC! "
144 Twine(FrameSize) +
">= 65536.\n"
146 Twine(uintptr_t(&FI)) +
")");
155 if (LiveCount >= 1 << 16) {
158 "' is too large for the ocaml GC! "
160 Twine(LiveCount) +
" >= 65536.");
163 AP.
OutStreamer->EmitSymbolValue(J->Label, IntPtrSize);
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!");
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
MCContext & OutContext
This is the context for the output file that we are streaming.
MCSection * getDataSection() const
StringRef getName() const
Return a constant reference to the value's name.
std::vector< GCPoint >::iterator iterator
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An analysis pass which caches information about the entire Module.
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
const std::string & getName() const
Return the name of the GC strategy.
void EmitInt16(int Value) const
Emit a short directive and value.
GCStrategy & getStrategy()
getStrategy - Return the GC strategy for the function.
This class is intended to be used as a driving class for all asm writers.
uint64_t getFrameSize() const
getFrameSize/setFrameSize - Records the function's frame size.
MCSection * getTextSection() const
FuncInfoVec::iterator funcinfo_begin()
size_t live_size(const iterator &p) const
void EmitAlignment(unsigned NumBits, const GlobalObject *GO=nullptr) const
Emit an alignment directive to the specified power of two boundary.
static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id)
auto find(R &&Range, const T &Val) -> decltype(std::begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
live_iterator live_begin(const iterator &p)
live_begin/live_end - Iterators for live roots at a given safe point.
Module.h This file contains the declarations for the Module class.
FuncInfoVec::iterator funcinfo_end()
iterator begin()
begin/end - Iterators for safe points.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
const Function & getFunction() const
getFunction - Return the function to which this metadata applies.
live_iterator live_end(const iterator &p)
Garbage collection metadata for a single function.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
std::vector< GCRoot >::const_iterator live_iterator
A static registration template.
void linkOcamlGCPrinter()
Creates an ocaml-compatible metadata printer.