[clang] [Clang][NFC] Move FatbinFileName instead of copy (PR #143827)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 11 21:00:44 PDT 2025
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/143827
Static analysis flagged FatbinFileName since we can move it instead of copying it.
>From 5fd6d2ff512a971b8e6ad8f900c31a1b74b49ed5 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Wed, 11 Jun 2025 20:58:07 -0700
Subject: [PATCH] [Clang][NFC] Move FatbinFileName instead of copy
Static analysis flagged FatbinFileName since we can move it instead of copying
it.
---
clang/lib/Interpreter/DeviceOffload.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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();
More information about the cfe-commits
mailing list