[clang] [clang] Shrink AutoTypes map key to reduce peak memory (PR #218278)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 23 18:29:57 PDT 2026


================
@@ -4014,5 +4016,33 @@ template <> struct llvm::DenseMapInfo<llvm::FoldingSetNodeID> {
     return LHS == RHS;
   }
 };
+// The empty/tombstone keys have a null Data, which no interned ref has, so
+// isEqual guards against comparing through their null pointer.
+template <> struct llvm::DenseMapInfo<llvm::FoldingSetNodeIDRef> {
+  static FoldingSetNodeIDRef getEmptyKey() {
+    return FoldingSetNodeIDRef(nullptr, 0);
+  }
+  static FoldingSetNodeIDRef getTombstoneKey() {
+    return FoldingSetNodeIDRef(nullptr, 1);
+  }
----------------
zwuis wrote:

Unused functions.

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


More information about the cfe-commits mailing list