llvm/llvm/lib/Object/Object.cpp

//===- Object.cpp - C bindings to the object file library--------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the C bindings to the file-format-independent object
// library.
//
//===----------------------------------------------------------------------===//

#include "llvm-c/Object.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Support/MemAlloc.h"

usingnamespacellvm;
usingnamespaceobject;

inline OwningBinary<ObjectFile> *unwrap(LLVMObjectFileRef OF) {}

inline LLVMObjectFileRef wrap(const OwningBinary<ObjectFile> *OF) {}

inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {}

inline LLVMSectionIteratorRef
wrap(const section_iterator *SI) {}

inline symbol_iterator *unwrap(LLVMSymbolIteratorRef SI) {}

inline LLVMSymbolIteratorRef
wrap(const symbol_iterator *SI) {}

inline relocation_iterator *unwrap(LLVMRelocationIteratorRef SI) {}

inline LLVMRelocationIteratorRef
wrap(const relocation_iterator *SI) {}

/*--.. Operations on binary files ..........................................--*/

LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
                               LLVMContextRef Context,
                               char **ErrorMessage) {}

LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR) {}

void LLVMDisposeBinary(LLVMBinaryRef BR) {}

LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR) {}

LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
                                                        const char *Arch,
                                                        size_t ArchLen,
                                                        char **ErrorMessage) {}

LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR) {}

LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
                                              LLVMSectionIteratorRef SI) {}

LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR) {}

LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR,
                                             LLVMSymbolIteratorRef SI) {}

// ObjectFile creation
LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf) {}

void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile) {}

// ObjectFile Section iterators
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef OF) {}

void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI) {}

LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef OF,
                                    LLVMSectionIteratorRef SI) {}

void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {}

void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
                                 LLVMSymbolIteratorRef Sym) {}

// ObjectFile Symbol iterators
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef OF) {}

void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI) {}

LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef OF,
                                   LLVMSymbolIteratorRef SI) {}

void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI) {}

// SectionRef accessors
const char *LLVMGetSectionName(LLVMSectionIteratorRef SI) {}

uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI) {}

const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI) {}

uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI) {}

LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
                                 LLVMSymbolIteratorRef Sym) {}

// Section Relocation iterators
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section) {}

void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI) {}

LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
                                       LLVMRelocationIteratorRef SI) {}

void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef SI) {}


// SymbolRef accessors
const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI) {}

uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI) {}

uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI) {}

// RelocationRef accessors
uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI) {}

LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI) {}

uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI) {}

// NOTE: Caller takes ownership of returned string.
const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI) {}

// NOTE: Caller takes ownership of returned string.
const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI) {}