[llvm] [perf] Replace copy-assign by move-assign in llvm/lib/Object(YAML)/* (PR #178177)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 03:57:50 PST 2026


https://github.com/serge-sans-paille created https://github.com/llvm/llvm-project/pull/178177

None

>From eb1ad66c7ba8adc12a7bfd6cbddf9621899f6835 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Tue, 27 Jan 2026 11:24:00 +0100
Subject: [PATCH] [perf] Replace copy-assign by move-assign in
 llvm/lib/Object(YAML)/*

---
 llvm/lib/Object/GOFFObjectFile.cpp          | 2 +-
 llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp | 2 +-
 llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Object/GOFFObjectFile.cpp b/llvm/lib/Object/GOFFObjectFile.cpp
index a55005e689e62..4ee51a61c14fa 100644
--- a/llvm/lib/Object/GOFFObjectFile.cpp
+++ b/llvm/lib/Object/GOFFObjectFile.cpp
@@ -504,7 +504,7 @@ GOFFObjectFile::getSectionContents(DataRefImpl Sec) const {
               Data.begin() + TxtDataOffset);
   }
   auto &Cache = SectionDataCache[Sec.d.a];
-  Cache = Data;
+  Cache = std::move(Data);
   return ArrayRef<uint8_t>(Cache);
 }
 
diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
index fa7c92b34aa39..724ddc1c07d40 100644
--- a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
+++ b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
@@ -627,7 +627,7 @@ fromCodeViewSymbolImpl(CVSymbol Symbol) {
   auto Impl = std::make_shared<SymbolType>(Symbol.kind());
   if (auto EC = Impl->fromCodeViewSymbol(Symbol))
     return std::move(EC);
-  Result.Symbol = Impl;
+  Result.Symbol = std::move(Impl);
   return Result;
 }
 
diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
index f4ca1b22eafa0..29b5989feb99c 100644
--- a/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
+++ b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
@@ -681,7 +681,7 @@ static inline Expected<LeafRecord> fromCodeViewRecordImpl(CVType Type) {
   auto Impl = std::make_shared<LeafRecordImpl<T>>(Type.kind());
   if (auto EC = Impl->fromCodeViewRecord(Type))
     return std::move(EC);
-  Result.Leaf = Impl;
+  Result.Leaf = std::move(Impl);
   return Result;
 }
 



More information about the llvm-commits mailing list