Module llvm_object

This header declares the C interface to libLLVMObject.a, which implements object file reading and writing.

Many exotic languages can interoperate with C code but have a harder time with C++ due to name mangling. So in addition to C, this interface enables tools written in such languages.

Procs

proc createObjectFile(memBuf: MemoryBufferRef): ObjectFileRef {.
    importc: "LLVMCreateObjectFile", cdecl, dynlib: dllname.}
proc disposeObjectFile(objectFile: ObjectFileRef) {.
    importc: "LLVMDisposeObjectFile", cdecl, dynlib: dllname.}
proc getSections(objectFile: ObjectFileRef): SectionIteratorRef {.
    importc: "LLVMSectionIteratorRef", cdecl, dynlib: dllname.}
proc disposeSectionIterator(si: SectionIteratorRef) {.
    importc: "LLVMDisposeSectionIterator", cdecl, dynlib: dllname.}
proc isSectionIteratorAtEnd(objectFile: ObjectFileRef; si: SectionIteratorRef): Bool {.
    importc: "LLVMIsSectionIteratorAtEnd", cdecl, dynlib: dllname.}
proc moveToNextSection(si: SectionIteratorRef) {.
    importc: "LLVMMoveToNextSection", cdecl, dynlib: dllname.}
proc moveToContainingSection(sect: SectionIteratorRef; sym: SymbolIteratorRef) {.
    importc: "LLVMMoveToContainingSection", cdecl, dynlib: dllname.}
proc getSymbols(objectFile: ObjectFileRef): SymbolIteratorRef {.
    importc: "LLVMGetSymbols", cdecl, dynlib: dllname.}
proc disposeSymbolIterator(si: SymbolIteratorRef) {.
    importc: "LLVMDisposeSymbolIterator", cdecl, dynlib: dllname.}
proc isSymbolIteratorAtEnd(objectFile: ObjectFileRef; si: SectionIteratorRef): Bool {.
    importc: "LLVMIsSymbolIteratorAtEnd", cdecl, dynlib: dllname.}
proc moveToNextSymbol(si: SectionIteratorRef) {.importc: "LLVMMoveToNextSymbol", 
    cdecl, dynlib: dllname.}
proc getSectionName(si: SectionIteratorRef): cstring {.
    importc: "LLVMGetSectionName", cdecl, dynlib: dllname.}
proc getSectionSize(si: SectionIteratorRef): culonglong {.
    importc: "LLVMGetSectionSize", cdecl, dynlib: dllname.}
proc getSectionContents(si: SectionIteratorRef): cstring {.
    importc: "LLVMGetSectionContents", cdecl, dynlib: dllname.}
proc getSectionAddress(si: SectionIteratorRef): culonglong {.
    importc: "LLVMGetSectionAddress", cdecl, dynlib: dllname.}
proc getSectionContainsSymbol(si: SectionIteratorRef; sym: SymbolIteratorRef): Bool {.
    importc: "LLVMGetSectionContainsSymbol", cdecl, dynlib: dllname.}
proc getRelocations(section: SectionIteratorRef): RelocationIteratorRef {.
    importc: "LLVMGetRelocations", cdecl, dynlib: dllname.}
proc disposeRelocationIterator(ri: RelocationIteratorRef) {.
    importc: "LLVMDisposeRelocationIterator", cdecl, dynlib: dllname.}
proc isRelocationIteratorAtEnd(section: SectionIteratorRef; 
                               ri: RelocationIteratorRef): Bool {.
    importc: "LLVMIsRelocationIteratorAtEnd", cdecl, dynlib: dllname.}
proc moveToNextRelocation(ri: RelocationIteratorRef) {.
    importc: "LLVMMoveToNextRelocation", cdecl, dynlib: dllname.}
proc getSymbolName(si: SymbolIteratorRef): cstring {.
    importc: "LLVMGetSymbolName", cdecl, dynlib: dllname.}
proc getSymbolAddress(si: SymbolIteratorRef): culonglong {.
    importc: "LLVMGetSymbolAddress", cdecl, dynlib: dllname.}
proc getSymbolSize(si: SymbolIteratorRef): culonglong {.
    importc: "LLVMGetSymbolSize", cdecl, dynlib: dllname.}
proc getRelocationAddress(ri: RelocationIteratorRef): culonglong {.
    importc: "LLVMGetRelocationAddress", cdecl, dynlib: dllname.}
proc getRelocationOffset(ri: RelocationIteratorRef): culonglong {.
    importc: "LLVMGetRelocationOffset", cdecl, dynlib: dllname.}
proc getRelocationSymbol(ri: RelocationIteratorRef): SymbolIteratorRef {.
    importc: "LLVMGetRelocationSymbol", cdecl, dynlib: dllname.}
proc getRelocationType(ri: RelocationIteratorRef): culonglong {.
    importc: "LLVMGetRelocationType", cdecl, dynlib: dllname.}
proc getRelocationTypeName(ri: RelocationIteratorRef): cstring {.
    importc: "LLVMGetRelocationTypeName", cdecl, dynlib: dllname.}
proc getRelocationValueString(ri: RelocationIteratorRef): cstring {.
    importc: "LLVMGetRelocationValueString", cdecl, dynlib: dllname.}