[llvm] [perf] Replace extra copy-assign by move-assign in llvm/lib/ (PR #179465)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 3 05:58:45 PST 2026
https://github.com/serge-sans-paille created https://github.com/llvm/llvm-project/pull/179465
None
>From 52e03a036a6e5c181c0d8fae9f00a780497ae2f1 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Tue, 3 Feb 2026 14:57:51 +0100
Subject: [PATCH] [perf] Replace extra copy-assign by move-assign in llvm/lib/
---
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 2 +-
llvm/lib/Support/VirtualFileSystem.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 6dda0fddbcec8..7754f5ed079bf 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -446,7 +446,7 @@ class TransferTracker {
auto NewValue = ResolvedDbgValue{ResolvedDbgOps, Value.Properties};
auto Result = ActiveVLocs.insert(std::make_pair(VarID, NewValue));
if (!Result.second)
- Result.first->second = NewValue;
+ Result.first->second = std::move(NewValue);
}
/// Load object with live-in variable values. \p mlocs contains the live-in
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 49a5cefe6a7d7..8a7ca35a8dd25 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -278,7 +278,7 @@ class RealFileSystem : public FileSystem {
if (!LinkCWDToProcess) {
SmallString<128> PWD, RealPWD;
if (std::error_code EC = llvm::sys::fs::current_path(PWD))
- WD = EC;
+ WD = std::move(EC);
else if (llvm::sys::fs::real_path(PWD, RealPWD))
WD = WorkingDirectory{PWD, PWD};
else
More information about the llvm-commits
mailing list