aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-08-24 10:24:38 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2023-08-24 10:24:38 -0400
commit9aaec66917c96a8d27166049d14c092da9e8361b (patch)
treea265b125845a1b98c2a2d24909df4cea3fcbbdce /gcc/analyzer
parentabf915193fbf725bb359e6936e10dcc282eb94cc (diff)
downloadgcc-9aaec66917c96a8d27166049d14c092da9e8361b.zip
gcc-9aaec66917c96a8d27166049d14c092da9e8361b.tar.gz
gcc-9aaec66917c96a8d27166049d14c092da9e8361b.tar.bz2
analyzer: add logging to impl_path_context
gcc/analyzer/ChangeLog: * engine.cc (impl_path_context::impl_path_context): Add logger param. (impl_path_context::bifurcate): Add log message. (impl_path_context::terminate_path): Likewise. (impl_path_context::m_logger): New field. (exploded_graph::process_node): Pass logger to path_ctxt ctor. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/analyzer')
-rw-r--r--gcc/analyzer/engine.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 3700154..a1908cd 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3848,8 +3848,10 @@ exploded_graph::maybe_create_dynamic_call (const gcall *call,
class impl_path_context : public path_context
{
public:
- impl_path_context (const program_state *cur_state)
+ impl_path_context (const program_state *cur_state,
+ logger *logger)
: m_cur_state (cur_state),
+ m_logger (logger),
m_terminate_path (false)
{
}
@@ -3868,6 +3870,9 @@ public:
void
bifurcate (std::unique_ptr<custom_edge_info> info) final override
{
+ if (m_logger)
+ m_logger->log ("bifurcating path");
+
if (m_state_at_bifurcation)
/* Verify that the state at bifurcation is consistent when we
split into multiple out-edges. */
@@ -3884,6 +3889,8 @@ public:
void terminate_path () final override
{
+ if (m_logger)
+ m_logger->log ("terminating path");
m_terminate_path = true;
}
@@ -3900,6 +3907,8 @@ public:
private:
const program_state *m_cur_state;
+ logger *m_logger;
+
/* Lazily-created copy of the state before the split. */
std::unique_ptr<program_state> m_state_at_bifurcation;
@@ -4044,7 +4053,7 @@ exploded_graph::process_node (exploded_node *node)
exactly one stmt, the one that caused the change. */
program_state next_state (state);
- impl_path_context path_ctxt (&next_state);
+ impl_path_context path_ctxt (&next_state, logger);
uncertainty_t uncertainty;
const supernode *snode = point.get_supernode ();