aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/OffloadBundle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/OffloadBundle.cpp')
-rw-r--r--llvm/lib/Object/OffloadBundle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Object/OffloadBundle.cpp b/llvm/lib/Object/OffloadBundle.cpp
index 0dd378e..329dcbf 100644
--- a/llvm/lib/Object/OffloadBundle.cpp
+++ b/llvm/lib/Object/OffloadBundle.cpp
@@ -120,14 +120,15 @@ OffloadBundleFatBin::create(MemoryBufferRef Buf, uint64_t SectionOffset,
if (identify_magic(Buf.getBuffer()) != file_magic::offload_bundle)
return errorCodeToError(object_error::parse_failed);
- OffloadBundleFatBin *TheBundle = new OffloadBundleFatBin(Buf, FileName);
+ std::unique_ptr<OffloadBundleFatBin> TheBundle(
+ new OffloadBundleFatBin(Buf, FileName));
// Read the Bundle Entries
Error Err = TheBundle->readEntries(Buf.getBuffer(), SectionOffset);
if (Err)
return Err;
- return std::unique_ptr<OffloadBundleFatBin>(TheBundle);
+ return std::move(TheBundle);
}
Error OffloadBundleFatBin::extractBundle(const ObjectFile &Source) {