[clang] [Clang][NFC] Move FatbinFileName instead of copy (PR #143827)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 11 21:01:14 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Shafik Yaghmour (shafik)
<details>
<summary>Changes</summary>
Static analysis flagged FatbinFileName since we can move it instead of copying it.
---
Full diff: https://github.com/llvm/llvm-project/pull/143827.diff
1 Files Affected:
- (modified) clang/lib/Interpreter/DeviceOffload.cpp (+1-1)
``````````diff
diff --git a/clang/lib/Interpreter/DeviceOffload.cpp b/clang/lib/Interpreter/DeviceOffload.cpp
index 05625ddedb72f..9a25a264b2d5c 100644
--- a/clang/lib/Interpreter/DeviceOffload.cpp
+++ b/clang/lib/Interpreter/DeviceOffload.cpp
@@ -151,7 +151,7 @@ llvm::Error IncrementalCUDADeviceParser::GenerateFatbinary() {
llvm::StringRef(FatbinContent.data(), FatbinContent.size()),
"", false));
- CodeGenOpts.CudaGpuBinaryFileName = FatbinFileName;
+ CodeGenOpts.CudaGpuBinaryFileName = std::move(FatbinFileName);
FatbinContent.clear();
``````````
</details>
https://github.com/llvm/llvm-project/pull/143827
More information about the cfe-commits
mailing list