From 1234ce0d352322195a3ef5b841783ed05df00745 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 28 Jan 2026 17:57:53 -0500 Subject: [PATCH 53/98] FIXME: more experiments on capturing heap usage of analyzer --- gcc/analyzer/engine.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 03adb4a1fbbd..cbfc95676ed3 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +#include #include "analyzer/common.h" #include @@ -4778,6 +4779,15 @@ maybe_dump_supergraph (const supergraph &sg, const char *name, sg.dump_dot (filename.c_str (), args); } +#if 0 +static void +print_mallinfo (const struct mallinfo &info, FILE *out) +{ + +} +#endif + + /* Run the analysis "engine". */ void @@ -4793,6 +4803,12 @@ impl_run_checkers (logger *logger) log_stashed_constants (logger); } +#if 0 + struct mallinfo mallinfo_before (mallinfo ()); + print_mallinfo (mallinfo_before, stderr); +#endif + malloc_info (0, stderr); + /* If using LTO, ensure that the cgraph nodes have function bodies. */ cgraph_node *node; FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) @@ -4901,6 +4917,14 @@ impl_run_checkers (logger *logger) if (flag_dump_analyzer_untracked) eng.get_model_manager ()->dump_untracked_regions (); +#if 0 + struct mallinfo mallinfo_after (mallinfo ()); + print_mallinfo (mallinfo_after, stderr); +#endif + malloc_info (0, stderr); + fprintf (stderr, "#snodes: %i\n", sg.m_nodes.length ()); + fprintf (stderr, "#enodes: %i\n", eg.m_nodes.length ()); + delete purge_map; /* Free up any dominance info that we may have created. */ -- 2.49.0