From 0a66c687fdad0d214f29570672986c2fa6654cc7 Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Sat, 1 Jun 2024 09:26:37 -0500 Subject: [PATCH] Write natvis for foa and cfoa containers --- extra/boost_unordered.natvis | 142 ++++++++++++++++++++ include/boost/unordered/detail/foa/core.hpp | 6 + 2 files changed, 148 insertions(+) diff --git a/extra/boost_unordered.natvis b/extra/boost_unordered.natvis index 02b85421..b00f49bb 100644 --- a/extra/boost_unordered.natvis +++ b/extra/boost_unordered.natvis @@ -159,4 +159,146 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *p_ + + first_time = false + + n0 = reinterpret_cast<uintptr_t>(pc_) % sizeof(group_type) + pc_ -= (ptrdiff_t)n0 + + mask = (reinterpret_cast<group_type*>(pc_)->match_occupied() >> (n0+1)) << (n0+1) + + pc_ += sizeof(group_type) + p_ += group_type::N + mask = reinterpret_cast<group_type*>(pc_)->match_occupied() + + + n = countr_zero(mask) + + p_ = nullptr + + + pc_ += (ptrdiff_t)n + p_ -= (ptrdiff_t)n0 + p_ += (ptrdiff_t)n + + + + + + + + + + + + + + + + + + + + + + + *p_ + + first_time = false + + n0 = reinterpret_cast<uintptr_t>(pc_) % sizeof(group_type) + pc_ -= (ptrdiff_t)n0 + + mask = (reinterpret_cast<group_type*>(pc_)->match_occupied() >> (n0+1)) << (n0+1) + + pc_ += sizeof(group_type) + p_ += group_type::N + mask = reinterpret_cast<group_type*>(pc_)->match_occupied() + + + n = countr_zero(mask) + + p_ = nullptr + + + pc_ += (ptrdiff_t)n + p_ -= (ptrdiff_t)n0 + p_ += (ptrdiff_t)n + + + + + + + + + + + + + + {{ size={table_.size_ctrl.size} }} + + *reinterpret_cast<hasher*>(static_cast<table_type::super::base1*>(&table_)) + *reinterpret_cast<key_equal*>(static_cast<table_type::super::base2*>(&table_)) + *reinterpret_cast<allocator_type*>(static_cast<table_type::super::base3*>(&table_)) + table_ + + + + + + + {{ size={table_.size_ctrl.size} }} + + *reinterpret_cast<hasher*>(static_cast<table_type::super::base1*>(&table_)) + *reinterpret_cast<key_equal*>(static_cast<table_type::super::base2*>(&table_)) + *reinterpret_cast<allocator_type*>(static_cast<table_type::super::base3*>(&table_)) + table_,view(MapHelper) + + + diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index db73a866..513b433d 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -1413,6 +1413,12 @@ __declspec(empty_bases) /* activate EBO with multiple inheritance */ table_core:empty_value,empty_value,empty_value { +private: + // These `baseN` aliases are for debugger visualizations, like natvis + using base1=empty_value; + using base2=empty_value; + using base3=empty_value; + public: using type_policy=TypePolicy; using group_type=Group;