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

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 2 22:42:37 PST 2025


Author: Kazu Hirata
Date: 2025-11-02T22:42:32-08:00
New Revision: fe01594a651a691f75d87337bc222fddf7fc049b

URL: https://github.com/llvm/llvm-project/commit/fe01594a651a691f75d87337bc222fddf7fc049b
DIFF: https://github.com/llvm/llvm-project/commit/fe01594a651a691f75d87337bc222fddf7fc049b.diff

LOG: [TableGen] Use std::move properly (NFC) (#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.

Added: 
    

Modified: 
    llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp

Removed: 
    


################################################################################
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