[llvm] [docs] Fix PDB serialized hash table on-disk format description (PR #225889)
Tim Misiak via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 11:52:08 PDT 2026
https://github.com/TimMisiak created https://github.com/llvm/llvm-project/pull/225889
Fixes #76602
Updating HashTable.md to match how the PDB hash table format is serialized according to the microsoft-pdb repository:
https://github.com/microsoft/microsoft-pdb/blob/805655a28bd8198004be2ac27e6e0290121a5e89/PDB/include/map.h#L584
The key/value list contains Size entries rather than Capacity entries, and the present bit vector identifies which bucket each pair belongs to.
>From e82041f55885ed0f317ff1e344751b634e90fff6 Mon Sep 17 00:00:00 2001
From: Tim Misiak <tim.misiak+github at gmail.com>
Date: Wed, 23 Sep 2026 11:14:47 -0700
Subject: [PATCH] [docs] Fix PDB serialized hash table on-disk format
description
Updating HashTable.md to match how the PDB hash table format is
serialized according to the microsoft-pdb repository:
https://github.com/microsoft/microsoft-pdb/blob/805655a28bd8198004be2ac27e6e0290121a5e89/PDB/include/map.h#L584
The key/value list contains Size entries rather than Capacity entries,
and the present bit vector identifies which bucket each pair belongs to.
---
llvm/docs/PDB/HashTable.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/llvm/docs/PDB/HashTable.md b/llvm/docs/PDB/HashTable.md
index f7b32163ef9935..9f1ddb8be63a64 100644
--- a/llvm/docs/PDB/HashTable.md
+++ b/llvm/docs/PDB/HashTable.md
@@ -32,7 +32,7 @@ file hash table, the appropriate hash function is being used.
.--------------------.-- +M+4 │
| Value | │
.--------------------.-- +M+4+sizeof(Value) │
- ... ├─ |Capacity| Bucket entries
+ ... ├─ |Size| Bucket entries
.--------------------. │
| Key | │
.--------------------. │
@@ -51,10 +51,12 @@ file hash table, the appropriate hash function is being used.
- **Deleted Bit Vector** - A serialized bit vector which contains information
about which buckets have tombstone values. If the entry in this bucket is
deleted, the bit will be set, otherwise it will be unset.
-- **Keys and Values** - A list of `Capacity` hash buckets, where the first
+- **Keys and Values** - A list of `Size` key value pairs, where the first
entry is the key (always a uint32), and the second entry is the value. The
- state of each bucket (valid, empty, deleted) can be determined by examining
- the present and deleted bit vectors.
+ present bit vector can be examined to determine the bucket for the pair.
+ In other words, if size is 2 and the present bit vector has bits 4 and 9
+ set, then the first element is in bucket 4 and the second element is in
+ bucket 9.
(hash_bit_vectors)=
More information about the llvm-commits
mailing list