31 #include <system_error> 36 void ObjectFile::anchor() {}
48 return *
this == **SymSec;
66 return std::error_code();
74 return SectName ==
".llvmbc";
164 if (std::error_code EC = FileOrErr.
getError())
166 std::unique_ptr<MemoryBuffer> Buffer = std::move(FileOrErr.
get());
170 if (
Error Err = ObjOrErr.takeError())
171 return std::move(Err);
172 std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Represents either an error or a value T.
virtual bool isBerkeleyData(DataRefImpl Sec) const
This class represents lattice values for constants.
Microsoft cl.exe's intermediate code file.
ELF dynamically linked shared lib.
Triple makeTriple() const
Create a triple from the data in this object file.
Windows compiled resource file (.res)
virtual std::error_code getSectionName(DataRefImpl Sec, StringRef &Res) const =0
Error takeError()
Take ownership of the stored error.
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const
virtual Expected< StringRef > getSymbolName(DataRefImpl Symb) const =0
virtual bool isSectionStripped(DataRefImpl Sec) const
Mach-O Preloaded Executable.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
StringRef getBuffer() const
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
The Mach-O dynamic linker.
Tagged union holding either a T or a Error.
ELF Relocatable object file.
content_iterator< SectionRef > section_iterator
virtual bool isSectionBitcode(DataRefImpl Sec) const
Expected< section_iterator > getSection() const
Get section this symbol is defined in reference to.
Mach-O dSYM companion file.
virtual uint32_t getSymbolFlags(DataRefImpl Symb) const =0
void setObjectFormat(ObjectFormatType Kind)
setObjectFormat - Set the object file format
The instances of the Type class are immutable: once they are created, they are never changed...
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
static Expected< std::unique_ptr< ObjectFile > > createELFObjectFile(MemoryBufferRef Object)
std::error_code getError() const
bool containsSymbol(SymbolRef S) const
void consumeError(Error Err)
Consume a Error without doing anything.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile(MemoryBufferRef Object)
std::error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override
Mach-O dynlinked shared lib.
static Expected< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile(MemoryBufferRef Object)
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile(MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
virtual void setARMSubArch(Triple &TheTriple) const
virtual Triple::ArchType getArch() const =0
uint64_t getSymbolValue(DataRefImpl Symb) const
virtual bool isSectionText(DataRefImpl Sec) const =0
This is a value type class that represents a single symbol in the list of symbols in the object file...
virtual bool isBerkeleyText(DataRefImpl Sec) const
virtual bool isSectionData(DataRefImpl Sec) const =0
uint64_t getCommonSymbolSize(DataRefImpl Symb) const
virtual section_iterator getRelocatedSection(DataRefImpl Sec) const
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
virtual uint64_t getSymbolValueImpl(DataRefImpl Symb) const =0
Provides ErrorOr<T> smart pointer.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
Windows PDB debug info file.
void setArch(ArchType Kind)
setArch - Set the architecture (first) component of the triple to a known type.
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...