23 return reinterpret_cast<OwningBinary<ObjectFile> *
>(OF);
28 const_cast<OwningBinary<ObjectFile> *
>(OF));
42 return reinterpret_cast<symbol_iterator*
>(
SI);
48 (
const_cast<symbol_iterator*
>(
SI));
63 std::unique_ptr<MemoryBuffer> Buf(
unwrap(MemBuf));
66 std::unique_ptr<ObjectFile> Obj;
73 auto *
Ret =
new OwningBinary<ObjectFile>(std::move(ObjOrErr.
get()), std::move(Buf));
83 OwningBinary<ObjectFile> *
OB =
unwrap(OF);
94 OwningBinary<ObjectFile> *
OB =
unwrap(OF);
95 return (*
unwrap(SI) == OB->getBinary()->section_end()) ? 1 : 0;
112 *
unwrap(Sect) = *SecOrErr;
117 OwningBinary<ObjectFile> *
OB =
unwrap(OF);
118 symbol_iterator
SI = OB->getBinary()->symbol_begin();
119 return wrap(
new symbol_iterator(SI));
128 OwningBinary<ObjectFile> *
OB =
unwrap(OF);
129 return (*
unwrap(SI) == OB->getBinary()->symbol_end()) ? 1 : 0;
145 return (*
unwrap(SI))->getSize();
150 if (std::error_code ec = (*
unwrap(SI))->getContents(ret))
156 return (*
unwrap(SI))->getAddress();
176 return (*
unwrap(SI) == (*
unwrap(Section))->relocation_end()) ? 1 : 0;
210 return (*
unwrap(SI))->getCommonSize();
215 return (*
unwrap(RI))->getOffset();
220 return wrap(
new symbol_iterator(ret));
224 return (*
unwrap(RI))->getType();
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI)
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.
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym)
StringRef getTypeName()
We provide a function which tries to compute the (demangled) name of a type statically.
LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf)
Error takeError()
Take ownership of the stored error.
const char * LLVMGetSectionContents(LLVMSectionIteratorRef SI)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Attribute unwrap(LLVMAttributeRef Attr)
LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, LLVMRelocationIteratorRef SI)
static StringRef getName(Value *V)
Tagged union holding either a T or a Error.
void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI)
Expected< const typename ELFT::Shdr * > getSection(typename ELFT::ShdrRange Sections, uint32_t Index)
void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect, LLVMSymbolIteratorRef Sym)
content_iterator< SectionRef > section_iterator
struct LLVMOpaqueSectionIterator * LLVMSectionIteratorRef
void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI)
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef SI)
LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI)
uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI)
struct LLVMOpaqueSymbolIterator * LLVMSymbolIteratorRef
struct LLVMOpaqueObjectFile * LLVMObjectFileRef
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef OF, LLVMSectionIteratorRef SI)
void consumeError(Error Err)
Consume a Error without doing anything.
void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner={})
Log all errors (if any) in E to OS.
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef OF)
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section)
const char * LLVMGetSectionName(LLVMSectionIteratorRef SI)
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
const char * LLVMGetSymbolName(LLVMSymbolIteratorRef SI)
reference get()
Returns a reference to the stored T value.
void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI)
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef OF)
LLVMAttributeRef wrap(Attribute Attr)
void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI)
uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI)
const char * LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI)
struct LLVMOpaqueRelocationIterator * LLVMRelocationIteratorRef
uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI)
uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI)
void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile)
A raw_ostream that writes to an std::string.
LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef OF, LLVMSymbolIteratorRef SI)
content_iterator< RelocationRef > relocation_iterator
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI)
StringRef - Represent a constant reference to a string, i.e.
const char * LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI)
OutputIt copy(R &&Range, OutputIt Out)
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI)