From: David Malcolm Date: Fri, 20 Mar 2020 19:16:00 +0000 (-0400) Subject: analyzer: improvements to diagnostic-manager.cc logging X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f02357571a858f7ff5ca7734e5344d989a7fd0c;p=gcc.git analyzer: improvements to diagnostic-manager.cc logging gcc/analyzer/ChangeLog: * diagnostic-manager.cc (dedupe_winners::add): Show the exploded_node index in the log messages. (diagnostic_manager::emit_saved_diagnostics): Log a summary of m_saved_diagnostics at entry. --- diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index fd3d4e03311..a04b5cc099e 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,10 @@ +2020-03-27 David Malcolm + + * diagnostic-manager.cc (dedupe_winners::add): Show the + exploded_node index in the log messages. + (diagnostic_manager::emit_saved_diagnostics): Log a summary of + m_saved_diagnostics at entry. + 2020-03-27 David Malcolm * supergraph.cc (superedge::dump): Add space before description; diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index 9bd018a3aac..e27e6269915 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -358,21 +358,25 @@ public: This could introduce false negatives, as there could be longer feasible paths within the egraph. */ if (logger) - logger->log ("considering %qs at SN: %i", - sd.m_d->get_kind (), sd.m_snode->m_index); + logger->log ("considering %qs at EN: %i, SN: %i", + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); + if (!dc->get_path ().feasible_p (logger)) { if (logger) - logger->log ("rejecting %qs at SN: %i" + logger->log ("rejecting %qs at EN: %i, SN: %i" " due to infeasible path", - sd.m_d->get_kind (), sd.m_snode->m_index); + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); delete dc; return; } else if (logger) - logger->log ("accepting %qs at SN: %i with feasible path", - sd.m_d->get_kind (), sd.m_snode->m_index); + logger->log ("accepting %qs at EN: %i, SN: %i with feasible path", + sd.m_d->get_kind (), sd.m_enode->m_index, + sd.m_snode->m_index); dedupe_key *key = new dedupe_key (sd, dc->get_path ()); if (dedupe_candidate **slot = m_map.get (key)) @@ -466,6 +470,15 @@ diagnostic_manager::emit_saved_diagnostics (const exploded_graph &eg) LOG_SCOPE (get_logger ()); auto_timevar tv (TV_ANALYZER_DIAGNOSTICS); log ("# saved diagnostics: %i", m_saved_diagnostics.length ()); + if (get_logger ()) + { + unsigned i; + saved_diagnostic *sd; + FOR_EACH_VEC_ELT (m_saved_diagnostics, i, sd) + log ("[%i] sd: %qs at EN: %i, SN: %i", + i, sd->m_d->get_kind (), sd->m_enode->m_index, + sd->m_snode->m_index); + } if (m_saved_diagnostics.length () == 0) return;