[llvm] Use `std::move` to avoid redundant copy (PR #113054)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 10:14:16 PDT 2024


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

None

>From 76050379ac9d7d485bedf2661bd10a900379f582 Mon Sep 17 00:00:00 2001
From: abhishek-kaushik22 <abhishek.kaushik at intel.com>
Date: Sat, 19 Oct 2024 22:43:52 +0530
Subject: [PATCH] Use `std::move` to avoid redundant copy

---
 llvm/utils/TableGen/DecoderEmitter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 4d2320b31ea94a..55af5fdc3d6a37 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -2059,7 +2059,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef,
           MyName = Op.Name;
 
         TiedNames[MyName] = TiedName;
-        TiedNames[TiedName] = MyName;
+        TiedNames[TiedName] = std::move(MyName);
       }
     }
   }



More information about the llvm-commits mailing list