[llvm] [NFC][TableGen] `emitGetOperandIdxName`: Pass arg by const& (PR #164563)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 00:02:05 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tablegen

Author: Abhishek Kaushik (abhishek-kaushik22)

<details>
<summary>Changes</summary>

 Take `OperandNameToID` by const& to avoid copying

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


1 Files Affected:

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


``````````diff
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index d1b14fbbdcd3e..0b90f9104208a 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -285,7 +285,7 @@ emitGetNamedOperandIdx(raw_ostream &OS,
 
 static void
 emitGetOperandIdxName(raw_ostream &OS,
-                      MapVector<StringRef, unsigned> OperandNameToID,
+                      const MapVector<StringRef, unsigned> &OperandNameToID,
                       const MapVector<SmallVector<int>, unsigned> &OperandMap,
                       unsigned MaxNumOperands, unsigned NumOperandNames) {
   OS << "LLVM_READONLY OpName getOperandIdxName(uint16_t Opcode, int16_t Idx) "

``````````

</details>


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


More information about the llvm-commits mailing list