[llvm] [NFC][TableGen] `emitGetOperandIdxName`: Pass arg by const& (PR #164563)
Abhishek Kaushik via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 22 00:01:18 PDT 2025
https://github.com/abhishek-kaushik22 created https://github.com/llvm/llvm-project/pull/164563
Take `OperandNameToID` by const& to avoid copying
>From 09ece49f5f7704805ce40c8cf95588713ba4608e Mon Sep 17 00:00:00 2001
From: Abhishek Kaushik <abhishek.kaushik at intel.com>
Date: Wed, 22 Oct 2025 12:30:21 +0530
Subject: [PATCH] [NFC][TableGen] `emitGetOperandIdxName`: Pass arg by const&
Take `OperandNameToID` by const& to avoid copying
---
llvm/utils/TableGen/InstrInfoEmitter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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) "
More information about the llvm-commits
mailing list