aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/sm.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/analyzer/sm.h')
-rw-r--r--gcc/analyzer/sm.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/analyzer/sm.h b/gcc/analyzer/sm.h
index a932765..6298fb6 100644
--- a/gcc/analyzer/sm.h
+++ b/gcc/analyzer/sm.h
@@ -28,6 +28,7 @@ namespace ana {
class state_machine;
class sm_context;
class pending_diagnostic;
+class xml_state;
extern bool any_pointer_p (tree expr);
extern bool any_pointer_p (const svalue *sval);
@@ -75,7 +76,7 @@ public:
const svalue *,
const extrinsic_state &) const
{
- return NULL;
+ return nullptr;
}
virtual bool
@@ -136,7 +137,9 @@ public:
/* Called when VAR leaks (and !can_purge_p). */
virtual std::unique_ptr<pending_diagnostic>
- on_leak (tree var ATTRIBUTE_UNUSED) const;
+ on_leak (tree var ATTRIBUTE_UNUSED,
+ const program_state *old_state,
+ const program_state *new_state) const;
/* Return true if S should be reset to "start" for values passed (or reachable
from) calls to unknown functions. IS_MUTABLE is true for pointers as
@@ -152,7 +155,7 @@ public:
}
/* Attempt to get a state for the merger of STATE_A and STATE_B,
- or return NULL if merging shouldn't occur, so that differences
+ or return nullptr if merging shouldn't occur, so that differences
between sm-state will lead to separate exploded nodes.
Most state machines will only merge equal states, but can
@@ -173,7 +176,7 @@ public:
state_t state_b ATTRIBUTE_UNUSED) const
{
/* By default, non-equal sm states should inhibit merger of enodes. */
- return NULL;
+ return nullptr;
}
void validate (state_t s) const;
@@ -184,6 +187,15 @@ public:
state_t get_start_state () const { return m_start; }
+ virtual void
+ add_state_to_xml (xml_state &out_xml,
+ const svalue &sval,
+ state_machine::state_t state) const;
+
+ virtual void
+ add_global_state_to_xml (xml_state &out_xml,
+ state_machine::state_t state) const;
+
protected:
state_t add_state (const char *name);
state_t add_custom_state (state *s)
@@ -318,7 +330,7 @@ public:
virtual path_context *get_path_context () const
{
- return NULL;
+ return nullptr;
}
/* Are we handling an external function with unknown side effects? */