diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-11-13 08:26:58 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-11-13 08:26:58 -0500 |
commit | 5ace2b23199f4216b0cdb0a41a68617bcdee9b3e (patch) | |
tree | e57010b45c79427d8d67631825cf6ef31faa38c9 /gcc/lazy-diagnostic-path.cc | |
parent | 5a674367c6da870184f3bdb7ec110b96aa91bb2b (diff) | |
download | gcc-5ace2b23199f4216b0cdb0a41a68617bcdee9b3e.zip gcc-5ace2b23199f4216b0cdb0a41a68617bcdee9b3e.tar.gz gcc-5ace2b23199f4216b0cdb0a41a68617bcdee9b3e.tar.bz2 |
diagnostics: avoid using global_dc in path-printing
gcc/analyzer/ChangeLog:
* checker-path.cc (checker_path::debug): Explicitly use
global_dc's reference printer.
* diagnostic-manager.cc
(diagnostic_manager::prune_interproc_events): Likewise.
(diagnostic_manager::prune_system_headers): Likewise.
gcc/ChangeLog:
* diagnostic-path.cc (diagnostic_event::get_desc): Add param
"ref_pp" and use instead of global_dc.
(class path_label): Likewise, adding field m_ref_pp.
(event_range::event_range): Add param "ref_pp" and pass to
m_path_label.
(path_summary::path_summary): Add param "ref_pp" and pass to
event_range ctor.
(diagnostic_text_output_format::print_path): Pass *pp to
path_summary ctor.
(selftest::test_empty_path): Pass *event_pp to pass_summary ctor.
(selftest::test_intraprocedural_path): Likewise.
(selftest::test_interprocedural_path_1): Likewise.
(selftest::test_interprocedural_path_2): Likewise.
(selftest::test_recursion): Likewise.
(selftest::test_control_flow_1): Likewise.
(selftest::test_control_flow_2): Likewise.
(selftest::test_control_flow_3): Likewise.
(selftest::assert_cfg_edge_path_streq): Likewise.
(selftest::test_control_flow_5): Likewise.
(selftest::test_control_flow_6): Likewise.
* diagnostic-path.h (diagnostic_event::get_desc): Add param
"ref_pp".
* lazy-diagnostic-path.cc (selftest::test_intraprocedural_path):
Pass *event_pp to get_desc.
* simple-diagnostic-path.cc (selftest::test_intraprocedural_path):
Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/lazy-diagnostic-path.cc')
-rw-r--r-- | gcc/lazy-diagnostic-path.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/lazy-diagnostic-path.cc b/gcc/lazy-diagnostic-path.cc index 0650065..683388c 100644 --- a/gcc/lazy-diagnostic-path.cc +++ b/gcc/lazy-diagnostic-path.cc @@ -119,8 +119,10 @@ test_intraprocedural_path (pretty_printer *event_pp) ASSERT_TRUE (path.generated_p ()); ASSERT_EQ (path.num_threads (), 1); ASSERT_FALSE (path.interprocedural_p ()); - ASSERT_STREQ (path.get_event (0).get_desc ().get (), "first `free'"); - ASSERT_STREQ (path.get_event (1).get_desc ().get (), "double `free'"); + ASSERT_STREQ (path.get_event (0).get_desc (*event_pp).get (), + "first `free'"); + ASSERT_STREQ (path.get_event (1).get_desc (*event_pp).get (), + "double `free'"); } /* Implementation of diagnostic_option_manager for which all |