[llvm] [llvm][utils] Add synthetic provider for llvm::DenseSet (PR #143631)

Dave Lee via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 16:46:41 PDT 2025


================
@@ -372,7 +378,8 @@ def update(self):
         # For each key, collect a list of buckets it appears in.
         key_buckets: dict[str, list[int]] = collections.defaultdict(list)
         for index in range(num_buckets):
-            key = buckets.GetValueForExpressionPath(f"[{index}].first")
+            bucket = buckets.GetValueForExpressionPath(f"[{index}]")
+            key = bucket.GetChildAtIndex(0)
----------------
kastiglione wrote:

This change is because the entries of a DenseSet are `DenseSetPair`, which is not actually a pair. There's only one child, and its name is `key`. The original code works for `DenseMapPair`, which has two children, `first` and `second`. Using `GetChildAtIndex(0)` will retrieve `first` for maps, and `key` for sets.

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


More information about the llvm-commits mailing list