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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: None (abhishek-kaushik22)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp (+1-1) 


``````````diff
diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp
index 5de5dd894f84ec..15ec7e17130de4 100644
--- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp
+++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp
@@ -842,7 +842,7 @@ Error RuleMatcher::defineComplexSubOperand(StringRef SymbolicName,
 
   ComplexSubOperands[SymbolicName] =
       std::tuple(ComplexPattern, RendererID, SubOperandID);
-  ComplexSubOperandsParentName[SymbolicName] = ParentName;
+  ComplexSubOperandsParentName[SymbolicName] = std::move(ParentName);
 
   return Error::success();
 }

``````````

</details>


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


More information about the llvm-commits mailing list