[llvm] [NFC][TableGen] Refactor DecoderEmitter.cpp (PR #135510)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 12 22:52:32 PDT 2025


================
@@ -982,11 +979,10 @@ void DecoderEmitter::emitTable(formatted_raw_ostream &OS, DecoderTable &Table,
 }
 
 void DecoderEmitter::emitInstrLenTable(formatted_raw_ostream &OS,
-                                       std::vector<unsigned> &InstrLen) const {
+                                       ArrayRef<unsigned> InstrLen) const {
   OS << "static const uint8_t InstrLenTable[] = {\n";
-  for (unsigned &Len : InstrLen) {
+  for (const unsigned &Len : InstrLen)
----------------
topperc wrote:

Drop the reference. `unsigned` is cheap to copy.

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


More information about the llvm-commits mailing list