[clang] 3133c95 - [clang-sycl-linker] Fix a warning
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 17 10:19:43 PDT 2025
Author: Kazu Hirata
Date: 2025-04-17T10:19:37-07:00
New Revision: 3133c956c57c5b952d3289323891dcdc252ea333
URL: https://github.com/llvm/llvm-project/commit/3133c956c57c5b952d3289323891dcdc252ea333
DIFF: https://github.com/llvm/llvm-project/commit/3133c956c57c5b952d3289323891dcdc252ea333.diff
LOG: [clang-sycl-linker] Fix a warning
This patch fixes:
clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp:368:14: error:
moving a local object in a return statement prevents copy elision
[-Werror,-Wpessimizing-move]
Added:
Modified:
clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
Removed:
################################################################################
diff --git a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
index 79747b0550417..61ec4dbc1489d 100644
--- a/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+++ b/clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
@@ -365,7 +365,7 @@ Error runSYCLLink(ArrayRef<std::string> Files, const ArgList &Args) {
SPVFile.append("_" + utostr(I) + ".spv");
auto Err = runSPIRVCodeGen(SplitModules[I], Args, SPVFile, C);
if (Err)
- return std::move(Err);
+ return Err;
SplitModules[I] = SPVFile;
}
More information about the cfe-commits
mailing list