[OffloadPackager] Add necessary move statement on returned value
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 23 Aug 2022 13:44:13 +0000 (08:44 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 23 Aug 2022 13:45:30 +0000 (08:45 -0500)
Summary:
Some older compilers cannot automatically elide the returned vector of
unique pointers, causing build errors. This patch explicitly moves the
returned value instead which should solve the problem.

clang/tools/clang-offload-packager/ClangOffloadPackager.cpp

index 0f90263..b8d1565 100644 (file)
@@ -143,7 +143,7 @@ extractOffloadFiles(MemoryBufferRef Contents) {
     Binaries.emplace_back(std::move(*BinaryOrErr));
   }
 
-  return Binaries;
+  return std::move(Binaries);
 }
 
 static Error unbundleImages() {