Skip to content

Commit 3f3663c

Browse files
committed
Update the generated pretty-printer header
1 parent cad6ed6 commit 3f3663c

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

include/boost/unordered/detail/unordered_printers.hpp

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// Copyright 2024 Braden Ganetsky
1+
// Copyright 2024-2025 Braden Ganetsky
22
// Distributed under the Boost Software License, Version 1.0.
33
// https://www.boost.org/LICENSE_1_0.txt
44

5-
// Generated on 2024-08-25T17:48:54
5+
// Generated on 2025-08-21T03:09:19
66

77
#ifndef BOOST_UNORDERED_DETAIL_UNORDERED_PRINTERS_HPP
88
#define BOOST_UNORDERED_DETAIL_UNORDERED_PRINTERS_HPP
@@ -58,22 +58,23 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
5858

5959
".ascii \"class BoostUnorderedFcaPrinter:\\n\"\n"
6060
".ascii \" def __init__(self, val):\\n\"\n"
61-
".ascii \" self.val = BoostUnorderedHelpers.maybe_unwrap_reference(val)\\n\"\n"
62-
".ascii \" self.name = f\\\"{self.val.type.strip_typedefs()}\\\".split(\\\"<\\\")[0]\\n\"\n"
61+
".ascii \" val = BoostUnorderedHelpers.maybe_unwrap_reference(val)\\n\"\n"
62+
".ascii \" self.table = val[\\\"table_\\\"]\\n\"\n"
63+
".ascii \" self.name = f\\\"{val.type.strip_typedefs()}\\\".split(\\\"<\\\")[0]\\n\"\n"
6364
".ascii \" self.name = self.name.replace(\\\"boost::unordered::\\\", \\\"boost::\\\")\\n\"\n"
6465
".ascii \" self.is_map = self.name.endswith(\\\"map\\\")\\n\"\n"
65-
".ascii \" self.cpo = BoostUnorderedPointerCustomizationPoint(self.val[\\\"table_\\\"][\\\"buckets_\\\"][\\\"buckets\\\"])\\n\"\n"
66+
".ascii \" self.cpo = BoostUnorderedPointerCustomizationPoint(self.table[\\\"buckets_\\\"][\\\"buckets\\\"])\\n\"\n"
6667

6768
".ascii \" def to_string(self):\\n\"\n"
68-
".ascii \" size = self.val[\\\"table_\\\"][\\\"size_\\\"]\\n\"\n"
69+
".ascii \" size = self.table[\\\"size_\\\"]\\n\"\n"
6970
".ascii \" return f\\\"{self.name} with {size} elements\\\"\\n\"\n"
7071

7172
".ascii \" def display_hint(self):\\n\"\n"
7273
".ascii \" return \\\"map\\\"\\n\"\n"
7374

7475
".ascii \" def children(self):\\n\"\n"
7576
".ascii \" def generator():\\n\"\n"
76-
".ascii \" grouped_buckets = self.val[\\\"table_\\\"][\\\"buckets_\\\"]\\n\"\n"
77+
".ascii \" grouped_buckets = self.table[\\\"buckets_\\\"]\\n\"\n"
7778

7879
".ascii \" size = grouped_buckets[\\\"size_\\\"]\\n\"\n"
7980
".ascii \" buckets = grouped_buckets[\\\"buckets\\\"]\\n\"\n"
@@ -167,14 +168,20 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
167168

168169
".ascii \"class BoostUnorderedFoaPrinter:\\n\"\n"
169170
".ascii \" def __init__(self, val):\\n\"\n"
170-
".ascii \" self.val = BoostUnorderedHelpers.maybe_unwrap_reference(val)\\n\"\n"
171-
".ascii \" self.name = f\\\"{self.val.type.strip_typedefs()}\\\".split(\\\"<\\\")[0]\\n\"\n"
171+
".ascii \" val = BoostUnorderedHelpers.maybe_unwrap_reference(val)\\n\"\n"
172+
".ascii \" self.table = val[\\\"table_\\\"]\\n\"\n"
173+
".ascii \" self.name = f\\\"{val.type.strip_typedefs()}\\\".split(\\\"<\\\")[0]\\n\"\n"
172174
".ascii \" self.name = self.name.replace(\\\"boost::unordered::\\\", \\\"boost::\\\")\\n\"\n"
173175
".ascii \" self.is_map = self.name.endswith(\\\"map\\\")\\n\"\n"
174-
".ascii \" self.cpo = BoostUnorderedPointerCustomizationPoint(self.val[\\\"table_\\\"][\\\"arrays\\\"][\\\"groups_\\\"])\\n\"\n"
176+
".ascii \" self.cpo = BoostUnorderedPointerCustomizationPoint(self.table[\\\"arrays\\\"][\\\"groups_\\\"])\\n\"\n"
177+
".ascii \" self.groups = self.cpo.to_address(self.table[\\\"arrays\\\"][\\\"groups_\\\"])\\n\"\n"
178+
".ascii \" self.elements = self.cpo.to_address(self.table[\\\"arrays\\\"][\\\"elements_\\\"])\\n\"\n"
179+
180+
".ascii \" self.N = 15 # `self.groups.dereference()[\\\"N\\\"]` may be optimized out\\n\"\n"
181+
".ascii \" self.sentinel_ = 1 # `self.groups.dereference()[\\\"sentinel_\\\"]` may be optimized out\\n\"\n"
175182

176183
".ascii \" def to_string(self):\\n\"\n"
177-
".ascii \" size = BoostUnorderedHelpers.maybe_unwrap_atomic(self.val[\\\"table_\\\"][\\\"size_ctrl\\\"][\\\"size\\\"])\\n\"\n"
184+
".ascii \" size = BoostUnorderedHelpers.maybe_unwrap_atomic(self.table[\\\"size_ctrl\\\"][\\\"size\\\"])\\n\"\n"
178185
".ascii \" return f\\\"{self.name} with {size} elements\\\"\\n\"\n"
179186

180187
".ascii \" def display_hint(self):\\n\"\n"
@@ -204,30 +211,21 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
204211
".ascii \" m = group[\\\"m\\\"]\\n\"\n"
205212
".ascii \" at = lambda b: BoostUnorderedHelpers.maybe_unwrap_atomic(m[b][\\\"n\\\"])\\n\"\n"
206213

207-
".ascii \" N = group[\\\"N\\\"]\\n\"\n"
208-
".ascii \" sentinel_ = group[\\\"sentinel_\\\"]\\n\"\n"
209214
".ascii \" if self.is_regular_layout(group):\\n\"\n"
210-
".ascii \" return pos == N-1 and at(N-1) == sentinel_\\n\"\n"
215+
".ascii \" return pos == self.N-1 and at(self.N-1) == self.sentinel_\\n\"\n"
211216
".ascii \" else:\\n\"\n"
212-
".ascii \" return pos == N-1 and (at(0) & 0x4000400040004000) == 0x4000 and (at(1) & 0x4000400040004000) == 0\\n\"\n"
217+
".ascii \" return pos == self.N-1 and (at(0) & 0x4000400040004000) == 0x4000 and (at(1) & 0x4000400040004000) == 0\\n\"\n"
213218

214219
".ascii \" def children(self):\\n\"\n"
215220
".ascii \" def generator():\\n\"\n"
216-
".ascii \" table = self.val[\\\"table_\\\"]\\n\"\n"
217-
".ascii \" groups = self.cpo.to_address(table[\\\"arrays\\\"][\\\"groups_\\\"])\\n\"\n"
218-
".ascii \" elements = self.cpo.to_address(table[\\\"arrays\\\"][\\\"elements_\\\"])\\n\"\n"
219-
220-
".ascii \" pc_ = groups.cast(gdb.lookup_type(\\\"unsigned char\\\").pointer())\\n\"\n"
221-
".ascii \" p_ = elements\\n\"\n"
221+
".ascii \" pc_ = self.groups.cast(gdb.lookup_type(\\\"unsigned char\\\").pointer())\\n\"\n"
222+
".ascii \" p_ = self.elements\\n\"\n"
222223
".ascii \" first_time = True\\n\"\n"
223-
".ascii \" mask = 0\\n\"\n"
224-
".ascii \" n0 = 0\\n\"\n"
225-
".ascii \" n = 0\\n\"\n"
226224

227225
".ascii \" count = 0\\n\"\n"
228226
".ascii \" while p_ != 0:\\n\"\n"
229227
".ascii \" # This if block mirrors the condition in the begin() call\\n\"\n"
230-
".ascii \" if (not first_time) or (self.match_occupied(groups.dereference()) & 1):\\n\"\n"
228+
".ascii \" if (not first_time) or (self.match_occupied(self.groups.dereference()) & 1):\\n\"\n"
231229
".ascii \" pointer = BoostUnorderedHelpers.maybe_unwrap_foa_element(p_)\\n\"\n"
232230
".ascii \" value = self.cpo.to_address(pointer).dereference()\\n\"\n"
233231
".ascii \" if self.is_map:\\n\"\n"
@@ -241,17 +239,17 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
241239
".ascii \" count += 1\\n\"\n"
242240
".ascii \" first_time = False\\n\"\n"
243241

244-
".ascii \" n0 = pc_.cast(gdb.lookup_type(\\\"uintptr_t\\\")) % groups.dereference().type.sizeof\\n\"\n"
242+
".ascii \" n0 = pc_.cast(gdb.lookup_type(\\\"uintptr_t\\\")) % self.groups.dereference().type.sizeof\\n\"\n"
245243
".ascii \" pc_ = self.cpo.next(pc_, -n0)\\n\"\n"
246244

247-
".ascii \" mask = (self.match_occupied(pc_.cast(groups.type).dereference()) >> (n0+1)) << (n0+1)\\n\"\n"
245+
".ascii \" mask = (self.match_occupied(pc_.cast(self.groups.type).dereference()) >> (n0+1)) << (n0+1)\\n\"\n"
248246
".ascii \" while mask == 0:\\n\"\n"
249-
".ascii \" pc_ = self.cpo.next(pc_, groups.dereference().type.sizeof)\\n\"\n"
250-
".ascii \" p_ = self.cpo.next(p_, groups.dereference()[\\\"N\\\"])\\n\"\n"
251-
".ascii \" mask = self.match_occupied(pc_.cast(groups.type).dereference())\\n\"\n"
247+
".ascii \" pc_ = self.cpo.next(pc_, self.groups.dereference().type.sizeof)\\n\"\n"
248+
".ascii \" p_ = self.cpo.next(p_, self.N)\\n\"\n"
249+
".ascii \" mask = self.match_occupied(pc_.cast(self.groups.type).dereference())\\n\"\n"
252250

253251
".ascii \" n = BoostUnorderedHelpers.countr_zero(mask)\\n\"\n"
254-
".ascii \" if self.is_sentinel(pc_.cast(groups.type).dereference(), n):\\n\"\n"
252+
".ascii \" if self.is_sentinel(pc_.cast(self.groups.type).dereference(), n):\\n\"\n"
255253
".ascii \" p_ = 0\\n\"\n"
256254
".ascii \" else:\\n\"\n"
257255
".ascii \" pc_ = self.cpo.next(pc_, n)\\n\"\n"

0 commit comments

Comments
 (0)