diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-06-13 19:31:46 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-06-13 19:37:19 +0000 |
commit | e8d8bef961a50d4dc22501cde4fb9fb0be1b2532 (patch) | |
tree | 94f04805f47bb7c59ae29690d8952b6074fff602 /contrib/llvm-project/llvm/lib/Object/Binary.cpp | |
parent | bb130ff39747b94592cb26d71b7cb097b9a4ea6b (diff) | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
download | src-e8d8bef961a50d4dc22501cde4fb9fb0be1b2532.tar.gz src-e8d8bef961a50d4dc22501cde4fb9fb0be1b2532.zip |
Merge llvm-project main llvmorg-12-init-17869-g8e464dd76bef
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the
upstream release/12.x branch was created.
PR: 255570
MFC after: 6 weeks
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/Binary.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Object/Binary.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/Binary.cpp b/contrib/llvm-project/llvm/lib/Object/Binary.cpp index 944d2bc1bca7..e741cbba2882 100644 --- a/contrib/llvm-project/llvm/lib/Object/Binary.cpp +++ b/contrib/llvm-project/llvm/lib/Object/Binary.cpp @@ -44,7 +44,8 @@ StringRef Binary::getFileName() const { return Data.getBufferIdentifier(); } MemoryBufferRef Binary::getMemoryBufferRef() const { return Data; } Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, - LLVMContext *Context) { + LLVMContext *Context, + bool InitContent) { file_magic Type = identify_magic(Buffer.getBuffer()); switch (Type) { @@ -73,7 +74,7 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, case file_magic::xcoff_object_32: case file_magic::xcoff_object_64: case file_magic::wasm_object: - return ObjectFile::createSymbolicFile(Buffer, Type, Context); + return ObjectFile::createSymbolicFile(Buffer, Type, Context, InitContent); case file_magic::macho_universal_binary: return MachOUniversalBinary::create(Buffer); case file_magic::windows_resource: @@ -93,7 +94,8 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, llvm_unreachable("Unexpected Binary File Type"); } -Expected<OwningBinary<Binary>> object::createBinary(StringRef Path) { +Expected<OwningBinary<Binary>> +object::createBinary(StringRef Path, LLVMContext *Context, bool InitContent) { ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr = MemoryBuffer::getFileOrSTDIN(Path, /*FileSize=*/-1, /*RequiresNullTerminator=*/false); @@ -102,7 +104,7 @@ Expected<OwningBinary<Binary>> object::createBinary(StringRef Path) { std::unique_ptr<MemoryBuffer> &Buffer = FileOrErr.get(); Expected<std::unique_ptr<Binary>> BinOrErr = - createBinary(Buffer->getMemBufferRef()); + createBinary(Buffer->getMemBufferRef(), Context, InitContent); if (!BinOrErr) return BinOrErr.takeError(); std::unique_ptr<Binary> &Bin = BinOrErr.get(); |