[llvm] [TableGen] Use std::move properly (NFC) (PR #166104)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 2 14:53:53 PST 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/166104

This patch removes const to allow std::move a couple of lines below to
perform a move operation as intended.

Identified with performance-move-const.


>From c07f855ea004778ecee59dfd60800605e011fe01 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 2 Nov 2025 14:12:13 -0800
Subject: [PATCH] [TableGen] Use std::move properly (NFC)

This patch removes const to allow std::move a couple of lines below to
perform a move operation as intended.

Identified with performance-move-const.
---
 llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
index 3f284ee1b1032..b63ce3671f922 100644
--- a/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
@@ -220,7 +220,7 @@ static void emitARMTargetDef(const RecordKeeper &RK, raw_ostream &OS) {
                           ProfileLower + "'");
 
     // Name of the object in C++
-    const std::string CppSpelling = ArchInfoName(Major, Minor, ProfileUpper);
+    std::string CppSpelling = ArchInfoName(Major, Minor, ProfileUpper);
     OS << "inline constexpr ArchInfo " << CppSpelling << " = {\n";
     CppSpellings.push_back(std::move(CppSpelling));
 



More information about the llvm-commits mailing list