From 83f611b5f79eca1c75e7441f04cbc5f8d9266ffd Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 5 Sep 2024 15:17:04 +0200 Subject: [PATCH] ir: Improve the checks done by 'abidw --debug-tc' The abidw --debug-tc option (enabled by the --enable-debug-type-canonicalization configure option) performs every type comparison twice; once structurally and once canonically. This patch improves that checking mode by disabling comparison result caching. It makes things slower but it makes the checking more reliable. * src/abg-ir.cc (compare_types_during_canonicalization): Disable type comparison result caching during type canonicalization debugging. Signed-off-by: Dodji Seketeli --- src/abg-ir.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 9348d3c9..bc4eb2b3 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -15214,10 +15214,12 @@ compare_types_during_canonicalization(const type_base& canonical_type, if (env.debug_type_canonicalization_is_on()) { bool canonical_equality = false, structural_equality = false; + env.priv_->allow_type_comparison_results_caching(false); env.priv_->use_canonical_type_comparison_ = false; structural_equality = canonical_type == candidate_type; env.priv_->use_canonical_type_comparison_ = true; canonical_equality = canonical_type == candidate_type; + env.priv_->allow_type_comparison_results_caching(true); if (canonical_equality != structural_equality) { std::cerr << "structural & canonical equality different for type: "