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

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 2 14:54:24 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tablegen

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

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.


---
Full diff: https://github.com/llvm/llvm-project/pull/166104.diff


1 Files Affected:

- (modified) llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp (+1-1) 


``````````diff
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));
 

``````````

</details>


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


More information about the llvm-commits mailing list