[llvm] [MC] Use `std::move` to avoid copy (PR #126700)

Abhishek Kaushik via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 01:04:28 PST 2025


https://github.com/abhishek-kaushik22 created https://github.com/llvm/llvm-project/pull/126700

None

>From fbd19c2ae02520a295d2d7d783945c10794e9876 Mon Sep 17 00:00:00 2001
From: Abhishek Kaushik <abhishek.kaushik at intel.com>
Date: Tue, 11 Feb 2025 14:33:51 +0530
Subject: [PATCH] [MC] Use std::move to avoid copy

---
 llvm/include/llvm/MC/MCELFStreamer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index 9c86b4ecc659992..8065d17546d2e1e 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -105,7 +105,7 @@ class MCELFStreamer : public MCObjectStreamer {
     unsigned IntValue;
     std::string StringValue;
     AttributeItem(Types Ty, unsigned Tg, unsigned IV, std::string SV)
-        : Type(Ty), Tag(Tg), IntValue(IV), StringValue(SV) {}
+        : Type(Ty), Tag(Tg), IntValue(IV), StringValue(std::move(SV)) {}
   };
 
   /// ELF object attributes subsection support



More information about the llvm-commits mailing list