48 Y(
"ocaml",
"ocaml 3.10-compatible collector");
57 size_t Letter = SymName.size();
58 SymName.append(MId.begin(),
llvm::find(MId,
'.'));
63 SymName[Letter] = toupper(SymName[Letter]);
115 int NumDescriptors = 0;
128 if (NumDescriptors >= 1 << 16) {
144 if (FrameSize >= 1 << 16) {
147 "' is too large for the ocaml GC! " 149 Twine(FrameSize) +
">= 65536.\n" 151 Twine(uintptr_t(&FI)) +
")");
160 if (LiveCount >= 1 << 16) {
163 "' is too large for the ocaml GC! " 165 Twine(LiveCount) +
" >= 65536.");
168 AP.
OutStreamer->EmitSymbolValue(J->Label, IntPtrSize);
175 if (K->StackOffset >= 1 << 16) {
178 "GC root stack offset is outside of fixed stack frame and out " 179 "of range for ocaml GC!");
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
size_t live_size(const iterator &p) const
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.
This class represents lattice values for constants.
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.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An analysis pass which caches information about the entire Module.
MCSection * getDataSection() const
const std::string & getName() const
Return the name of the GC strategy.
Analysis containing CSE Info
const Function & getFunction() const
getFunction - Return the function to which this metadata applies.
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
void EmitAlignment(unsigned NumBits, const GlobalObject *GV=nullptr) const
Emit an alignment directive to the specified power of two boundary.
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.
FuncInfoVec::iterator funcinfo_begin()
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id)
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.
std::vector< GCPoint >::iterator iterator
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
StringRef getName() const
Return a constant reference to the value's name.
uint64_t getFrameSize() const
getFrameSize/setFrameSize - Records the function's frame size.
MCSection * getTextSection() const
std::vector< GCRoot >::const_iterator live_iterator
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
live_iterator live_end(const iterator &p)
Garbage collection metadata for a single function.
A static registration template.
void emitInt16(int Value) const
Emit a short directive and value.
void linkOcamlGCPrinter()
Creates an ocaml-compatible metadata printer.