[llvm] [LLVM][TableGen] Use StringRef for various members `CGIOperandList::OperandInfo` (PR #140625)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 15:56:07 PDT 2025


================
@@ -142,8 +142,8 @@ bool CodeEmitterGen::addCodeToMergeInOperand(const Record *R,
   }
 
   std::pair<unsigned, unsigned> SO = CGI.Operands.getSubOperandNumber(OpIdx);
-  std::string &EncoderMethodName =
-      CGI.Operands[SO.first].EncoderMethodNames[SO.second];
+  const std::string EncoderMethodName =
----------------
jurahul wrote:

Note, I have another change in pipe to simplify such code by adding a std::string += Twine operator, so that code like this can be more naturally written without converting StringRefs to strings.

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


More information about the llvm-commits mailing list