43 Y(
"ocaml",
"ocaml 3.10-compatible collector");
52 size_t Letter = SymName.size();
53 SymName.append(MId.begin(), std::find(MId.begin(), MId.end(),
'.'));
58 SymName[Letter] = toupper(SymName[Letter]);
69 void OcamlGCMetadataPrinter::beginAssembly(
AsmPrinter &AP) {
93 void OcamlGCMetadataPrinter::finishAssembly(
AsmPrinter &AP) {
108 int NumDescriptors = 0;
116 if (NumDescriptors >= 1<<16) {
127 if (FrameSize >= 1<<16) {
130 "' is too large for the ocaml GC! "
131 "Frame size " +
Twine(FrameSize) +
">= 65536.\n"
132 "(" +
Twine(uintptr_t(&FI)) +
")");
141 if (LiveCount >= 1<<16) {
144 "' is too large for the ocaml GC! "
145 "Live root count "+
Twine(LiveCount)+
" >= 65536.");
153 KE = FI.
live_end(J); K != KE; ++K) {
154 if (K->StackOffset >= 1<<16) {
157 "GC root stack offset is outside of fixed stack frame and out "
158 "of range for ocaml GC!");
const_iterator end(StringRef path)
Get end iterator over path.
virtual void AddComment(const Twine &T)
The main container class for the LLVM Intermediate Representation.
virtual void AddBlankLine()
AddBlankLine - Emit a blank line to a .s file to pretty it up.
unsigned getPointerSize(unsigned AS=0) const
void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, bool isImplicitlyPrivate, bool UseGlobalPrefix=true)
const_iterator begin(StringRef path)
Get begin iterator over path.
const MCSection * getDataSection() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
StringRef getName() const
std::vector< GCPoint >::iterator iterator
MCSymbol * GetOrCreateSymbol(StringRef Name)
const std::string & getModuleIdentifier() const
void SwitchSection(const MCSection *Section, const MCExpr *Subsection=0)
void EmitInt16(int Value) const
const MCSection * getTextSection() const
virtual void EmitIntValue(uint64_t Value, unsigned Size)
uint64_t getFrameSize() const
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
EmitSymbolAttribute - Add the given Attribute to Symbol.
size_t live_size(const iterator &p) const
static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id)
virtual void EmitLabel(MCSymbol *Symbol)
live_iterator live_begin(const iterator &p)
virtual const DataLayout * getDataLayout() const
void EmitAlignment(unsigned NumBits, const GlobalValue *GV=0) const
const TargetLoweringObjectFile & getObjFileLowering() const
getObjFileLowering - Return information about object file lowering.
const Function & getFunction() const
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size)
live_iterator live_end(const iterator &p)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
std::vector< GCRoot >::const_iterator live_iterator
void linkOcamlGCPrinter()
Creates an ocaml-compatible metadata printer.