aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/exploded-graph.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/analyzer/exploded-graph.h')
-rw-r--r--gcc/analyzer/exploded-graph.h55
1 files changed, 24 insertions, 31 deletions
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index b3e89d4..e36f94e 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -36,44 +36,30 @@ class impl_region_model_context : public region_model_context
old state, rather than the new? */
const program_state *old_state,
program_state *new_state,
- state_change *change,
const gimple *stmt,
stmt_finder *stmt_finder = NULL);
impl_region_model_context (program_state *state,
- state_change *change,
const extrinsic_state &ext_state,
logger *logger = NULL);
void warn (pending_diagnostic *d) FINAL OVERRIDE;
-
- void remap_svalue_ids (const svalue_id_map &map) FINAL OVERRIDE;
-
- int on_svalue_purge (svalue_id first_unused_sid,
- const svalue_id_map &map) FINAL OVERRIDE;
-
+ void on_svalue_leak (const svalue *) OVERRIDE;
+ void on_liveness_change (const svalue_set &live_svalues,
+ const region_model *model) FINAL OVERRIDE;
logger *get_logger () FINAL OVERRIDE
{
return m_logger.get_logger ();
}
void on_state_leak (const state_machine &sm,
- int sm_idx,
- svalue_id sid,
- svalue_id first_unused_sid,
- const svalue_id_map &map,
+ const svalue *sval,
state_machine::state_t state);
- void on_inherited_svalue (svalue_id parent_sid,
- svalue_id child_sid) FINAL OVERRIDE;
-
- void on_cast (svalue_id src_sid,
- svalue_id dst_sid) FINAL OVERRIDE;
-
void on_condition (tree lhs, enum tree_code op, tree rhs) FINAL OVERRIDE;
- void on_unknown_change (svalue_id sid ATTRIBUTE_UNUSED) FINAL OVERRIDE;
+ void on_unknown_change (const svalue *sval, bool is_mutable) FINAL OVERRIDE;
void on_phi (const gphi *phi, tree rhs) FINAL OVERRIDE;
@@ -85,7 +71,6 @@ class impl_region_model_context : public region_model_context
const exploded_node *m_enode_for_diag;
const program_state *m_old_state;
program_state *m_new_state;
- state_change *m_change;
const gimple *m_stmt;
stmt_finder *m_stmt_finder;
const extrinsic_state &m_ext_state;
@@ -145,6 +130,9 @@ struct eg_traits
struct dump_args_t
{
dump_args_t (const exploded_graph &eg) : m_eg (eg) {}
+
+ bool show_enode_details_p (const exploded_node &enode) const;
+
const exploded_graph &m_eg;
};
typedef exploded_cluster cluster_t;
@@ -172,7 +160,7 @@ class exploded_node : public dnode<eg_traits>
/* Node was left unprocessed due to merger; it won't have had
exploded_graph::process_node called on it. */
- STATUS_MERGER
+ STATUS_MERGER,
};
exploded_node (const point_and_state &ps, int index);
@@ -224,13 +212,11 @@ class exploded_node : public dnode<eg_traits>
on_stmt_flags on_stmt (exploded_graph &eg,
const supernode *snode,
const gimple *stmt,
- program_state *state,
- state_change *change) const;
+ program_state *state) const;
bool on_edge (exploded_graph &eg,
const superedge *succ,
program_point *next_point,
- program_state *next_state,
- state_change *change) const;
+ program_state *next_state) const;
void on_longjmp (exploded_graph &eg,
const gcall *call,
program_state *new_state,
@@ -252,6 +238,7 @@ class exploded_node : public dnode<eg_traits>
return get_point ().get_stack_depth ();
}
const gimple *get_stmt () const { return get_point ().get_stmt (); }
+ const gimple *get_processed_stmt (unsigned idx) const;
const program_state &get_state () const { return m_ps.get_state (); }
@@ -279,6 +266,10 @@ private:
public:
/* The index of this exploded_node. */
const int m_index;
+
+ /* The number of stmts that were processed when process_node was
+ called on this enode. */
+ unsigned m_num_processed_stmts;
};
/* An edge within the exploded graph.
@@ -307,9 +298,7 @@ class exploded_edge : public dedge<eg_traits>
};
exploded_edge (exploded_node *src, exploded_node *dest,
- const extrinsic_state &ext_state,
const superedge *sedge,
- const state_change &change,
custom_info_t *custom_info);
~exploded_edge ();
void dump_dot (graphviz_out *gv, const dump_args_t &args)
@@ -318,8 +307,6 @@ class exploded_edge : public dedge<eg_traits>
//private:
const superedge *const m_sedge;
- const state_change m_change;
-
/* NULL for most edges; will be non-NULL for special cases
such as an unwind from a longjmp to a setjmp, or when
a signal is delivered to a signal-handler.
@@ -733,6 +720,7 @@ public:
const supergraph &get_supergraph () const { return m_sg; }
const extrinsic_state &get_ext_state () const { return m_ext_state; }
+ engine *get_engine () const { return m_ext_state.get_engine (); }
const state_purge_map *get_purge_map () const { return m_purge_map; }
const analysis_plan &get_analysis_plan () const { return m_plan; }
@@ -746,14 +734,15 @@ public:
exploded_node *get_or_create_node (const program_point &point,
const program_state &state,
- state_change *change);
+ const exploded_node *enode_for_diag);
exploded_edge *add_edge (exploded_node *src, exploded_node *dest,
const superedge *sedge,
- const state_change &change,
exploded_edge::custom_info_t *custom = NULL);
per_program_point_data *
get_or_create_per_program_point_data (const program_point &);
+ per_program_point_data *
+ get_per_program_point_data (const program_point &) const;
per_call_string_data *
get_or_create_per_call_string_data (const call_string &);
@@ -785,6 +774,8 @@ public:
void dump_states_for_supernode (FILE *, const supernode *snode) const;
void dump_exploded_nodes () const;
+ exploded_node *get_node_by_index (int idx) const;
+
const call_string_data_map_t *get_per_call_string_data () const
{ return &m_per_call_string_data; }
@@ -857,6 +848,8 @@ public:
void dump () const;
bool feasible_p (logger *logger, feasibility_problem **out) const;
+ bool feasible_p (logger *logger, feasibility_problem **out,
+ engine *eng, const exploded_graph *eg) const;
auto_vec<const exploded_edge *> m_edges;
};