[Lldb-commits] [clang] [lld] [lldb] [llvm] [Option] Shrink Info from 40 to 24 bytes (PR #224807)

Fangrui Song via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 18 23:54:51 PDT 2026


================
@@ -433,6 +427,29 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
   }
   OS << "\n};\n\n";
 
+  // Rarely set fields, in OptTable::InfoExtra order. Options with equal values
+  // share a row; row 0 is all zero.
+  OS << "constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = "
+        "{\n  {0, 0, 0, 0, 0},\n";
+  std::map<std::array<unsigned, 5>, unsigned> ExtraRows;
----------------
MaskRay wrote:

Switched to
```
+  using ExtraRowT =
+      std::tuple<unsigned, unsigned, unsigned, unsigned, unsigned>;
+  DenseMap<ExtraRowT, unsigned> ExtraRows;
```

std::tuple is used because there is no `DenseMapInfo<std::array<...>>`.

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


More information about the lldb-commits mailing list