[llvm] c27aae0 - [Offload] Fix not copying the buffer identifier of offloading files
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 07:47:43 PDT 2024
Author: Joseph Huber
Date: 2024-10-18T09:47:34-05:00
New Revision: c27aae0035d2cf490c02a0cc0e2e1fbe4f12512a
URL: https://github.com/llvm/llvm-project/commit/c27aae0035d2cf490c02a0cc0e2e1fbe4f12512a
DIFF: https://github.com/llvm/llvm-project/commit/c27aae0035d2cf490c02a0cc0e2e1fbe4f12512a.diff
LOG: [Offload] Fix not copying the buffer identifier of offloading files
Summary:
This caused an error when copying a file of the same name when multiple
architectures needed the file. The buffer identifier which we use for
the name in `-save-temps` mode would be empty and create in invalid
filename. Copy this correctly now.
Added:
Modified:
llvm/include/llvm/Object/OffloadBinary.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Object/OffloadBinary.h b/llvm/include/llvm/Object/OffloadBinary.h
index 13383d5f07ba0f..c02aec8d956ed6 100644
--- a/llvm/include/llvm/Object/OffloadBinary.h
+++ b/llvm/include/llvm/Object/OffloadBinary.h
@@ -165,7 +165,8 @@ class OffloadFile : public OwningBinary<OffloadBinary> {
/// Make a deep copy of this offloading file.
OffloadFile copy() const {
std::unique_ptr<MemoryBuffer> Buffer = MemoryBuffer::getMemBufferCopy(
- getBinary()->getMemoryBufferRef().getBuffer());
+ getBinary()->getMemoryBufferRef().getBuffer(),
+ getBinary()->getMemoryBufferRef().getBufferIdentifier());
// This parsing should never fail because it has already been parsed.
auto NewBinaryOrErr = OffloadBinary::create(*Buffer);
More information about the llvm-commits
mailing list