13#ifndef LLVM_OBJECT_BINARY_H
14#define LLVM_OBJECT_BINARY_H
80 static inline unsigned int getELFType(
bool isLE,
bool is64Bits) {
106 unsigned int getType()
const {
return TypeID; }
148 return TypeID ==
ID_IR;
182 Addr +
Size >
reinterpret_cast<uintptr_t
>(M.getBufferEnd()) ||
183 Addr <
reinterpret_cast<uintptr_t
>(M.getBufferStart())) {
198 bool InitContent =
true);
201 std::unique_ptr<T> Bin;
202 std::unique_ptr<MemoryBuffer> Buf;
206 OwningBinary(std::unique_ptr<T> Bin, std::unique_ptr<MemoryBuffer> Buf);
210 std::pair<std::unique_ptr<T>, std::unique_ptr<MemoryBuffer>>
takeBinary();
218 std::unique_ptr<MemoryBuffer> Buf)
229 Bin = std::move(
Other.Bin);
230 Buf = std::move(
Other.Buf);
235std::pair<std::unique_ptr<T>, std::unique_ptr<MemoryBuffer>>
237 return std::make_pair(std::move(Bin), std::move(Buf));
250 bool InitContent =
true);
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
static Expected< StringRef > getFileName(const DebugStringTableSubsectionRef &Strings, const DebugChecksumsSubsectionRef &Checksums, uint32_t FileID)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
This is an important class for using LLVM in a threaded context.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
Binary(unsigned int Type, MemoryBufferRef Source)
const T * getBinary() const
OwningBinary< T > & operator=(OwningBinary< T > &&Other)
std::pair< std::unique_ptr< T >, std::unique_ptr< MemoryBuffer > > takeBinary()
OwningBinary(std::unique_ptr< T > Bin, std::unique_ptr< MemoryBuffer > Buf)
OwningBinary(OwningBinary< T > &&Other)
bool isTapiUniversal() const
bool isMachOUniversalBinary() const
static unsigned int getELFType(bool isLE, bool is64Bits)
Triple::ObjectFormatType getTripleObjectFormat() const
bool isCOFFImportFile() const
Binary(unsigned int Type, MemoryBufferRef Source)
unsigned int getType() const
bool isLittleEndian() const
virtual Error initContent()
bool isOffloadFile() const
static unsigned int getMachOType(bool isLE, bool is64Bits)
bool isDXContainer() const
Binary(const Binary &other)=delete
@ ID_MachOUniversalBinary
static Error checkOffset(MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
OwningBinary< T > & operator=(OwningBinary< T > &&Other)
std::pair< std::unique_ptr< T >, std::unique_ptr< MemoryBuffer > > takeBinary()
struct LLVMOpaqueBinary * LLVMBinaryRef
LLVM_ABI Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Implement std::hash so that hash_code can be used in STL containers.