14 #ifndef LLVM_OBJECT_BINARY_H
15 #define LLVM_OBJECT_BINARY_H
67 static inline unsigned int getELFType(
bool isLE,
bool is64Bits) {
145 std::unique_ptr<T> Bin;
146 std::unique_ptr<MemoryBuffer> Buf;
150 OwningBinary(std::unique_ptr<T> Bin, std::unique_ptr<MemoryBuffer> Buf);
154 std::pair<std::unique_ptr<T>, std::unique_ptr<MemoryBuffer>>
takeBinary();
160 template <
typename T>
162 std::unique_ptr<MemoryBuffer> Buf)
163 : Bin(std::move(Bin)), Buf(std::move(Buf)) {}
167 template <
typename T>
169 : Bin(std::move(
Other.Bin)), Buf(std::move(
Other.Buf)) {}
171 template <
typename T>
173 Bin = std::move(
Other.Bin);
174 Buf = std::move(
Other.Buf);
178 template <
typename T>
179 std::pair<std::unique_ptr<T>, std::unique_ptr<MemoryBuffer>>
181 return std::make_pair(std::move(Bin), std::move(Buf));
static unsigned int getMachOType(bool isLE, bool is64Bits)
bool isModuleSummaryIndex() const
Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr)
Create a Binary from Source, autodetecting the file type.
StringRef getData() const
Tagged union holding either a T or a Error.
MemoryBufferRef getMemoryBufferRef() const
bool isCOFFImportFile() const
unsigned int getType() const
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
static unsigned int getELFType(bool isLE, bool is64Bits)
StringRef getFileName() const
std::pair< std::unique_ptr< T >, std::unique_ptr< MemoryBuffer > > takeBinary()
OwningBinary< T > & operator=(OwningBinary< T > &&Other)
bool isLittleEndian() const
Provides ErrorOr<T> smart pointer.
StringRef - Represent a constant reference to a string, i.e.
bool isMachOUniversalBinary() const