[llvm] [LLVM][TableGen] Minor cleanup in CGIOperandList (PR #142721)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 08:46:46 PDT 2025


================
@@ -1712,11 +1712,11 @@ void AsmMatcherInfo::buildInstructionOperandReference(MatchableInfo *II,
   MatchableInfo::AsmOperand *Op = &II->AsmOperands[AsmOpIdx];
 
   // Map this token to an operand.
-  unsigned Idx;
-  if (!Operands.hasOperandNamed(OperandName, Idx))
+  std::optional<unsigned> MayBeIdx = Operands.findOperandNamed(OperandName);
----------------
arsenm wrote:

MayBe->Maybe. But I'd probably just name it Idx and use *Idx throughout? 

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


More information about the llvm-commits mailing list