mirror of
https://github.com/boostorg/unordered.git
synced 2025-08-13 18:24:29 +02:00
Fix pretty-printers not working when constexpr variables are optimized away
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2024 Braden Ganetsky
|
||||
# Copyright 2024-2025 Braden Ganetsky
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
@@ -191,8 +191,8 @@ class BoostUnorderedFoaPrinter:
|
||||
m = group["m"]
|
||||
at = lambda b: BoostUnorderedHelpers.maybe_unwrap_atomic(m[b]["n"])
|
||||
|
||||
N = group["N"]
|
||||
sentinel_ = group["sentinel_"]
|
||||
N = 15 # `group["N"]` may be optimized out
|
||||
sentinel_ = 1 # `group["sentinel_"]` may be optimized out
|
||||
if self.is_regular_layout(group):
|
||||
return pos == N-1 and at(N-1) == sentinel_
|
||||
else:
|
||||
@@ -234,7 +234,7 @@ class BoostUnorderedFoaPrinter:
|
||||
mask = (self.match_occupied(pc_.cast(groups.type).dereference()) >> (n0+1)) << (n0+1)
|
||||
while mask == 0:
|
||||
pc_ = self.cpo.next(pc_, groups.dereference().type.sizeof)
|
||||
p_ = self.cpo.next(p_, groups.dereference()["N"])
|
||||
p_ = self.cpo.next(p_, 15) # Use 15 because `groups.dereference()["N"]` may be optimized out
|
||||
mask = self.match_occupied(pc_.cast(groups.type).dereference())
|
||||
|
||||
n = BoostUnorderedHelpers.countr_zero(mask)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
// Copyright 2024 Braden Ganetsky
|
||||
// Copyright 2024-2025 Braden Ganetsky
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Generated on 2024-08-25T17:48:54
|
||||
// Generated on 2025-08-08T03:34:52
|
||||
|
||||
#ifndef BOOST_UNORDERED_UNORDERED_PRINTERS_HPP
|
||||
#define BOOST_UNORDERED_UNORDERED_PRINTERS_HPP
|
||||
@@ -204,8 +204,8 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
|
||||
".ascii \" m = group[\\\"m\\\"]\\n\"\n"
|
||||
".ascii \" at = lambda b: BoostUnorderedHelpers.maybe_unwrap_atomic(m[b][\\\"n\\\"])\\n\"\n"
|
||||
|
||||
".ascii \" N = group[\\\"N\\\"]\\n\"\n"
|
||||
".ascii \" sentinel_ = group[\\\"sentinel_\\\"]\\n\"\n"
|
||||
".ascii \" N = 15 # `group[\\\"N\\\"]` may be optimized out\\n\"\n"
|
||||
".ascii \" sentinel_ = 1 # `group[\\\"sentinel_\\\"]` may be optimized out\\n\"\n"
|
||||
".ascii \" if self.is_regular_layout(group):\\n\"\n"
|
||||
".ascii \" return pos == N-1 and at(N-1) == sentinel_\\n\"\n"
|
||||
".ascii \" else:\\n\"\n"
|
||||
@@ -247,7 +247,7 @@ __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
|
||||
".ascii \" mask = (self.match_occupied(pc_.cast(groups.type).dereference()) >> (n0+1)) << (n0+1)\\n\"\n"
|
||||
".ascii \" while mask == 0:\\n\"\n"
|
||||
".ascii \" pc_ = self.cpo.next(pc_, groups.dereference().type.sizeof)\\n\"\n"
|
||||
".ascii \" p_ = self.cpo.next(p_, groups.dereference()[\\\"N\\\"])\\n\"\n"
|
||||
".ascii \" p_ = self.cpo.next(p_, 15) # Use 15 because `groups.dereference()[\\\"N\\\"]` may be optimized out\\n\"\n"
|
||||
".ascii \" mask = self.match_occupied(pc_.cast(groups.type).dereference())\\n\"\n"
|
||||
|
||||
".ascii \" n = BoostUnorderedHelpers.countr_zero(mask)\\n\"\n"
|
||||
|
Reference in New Issue
Block a user