21#ifndef GCC_ANALYZER_SM_H
22#define GCC_ANALYZER_SM_H
30class pending_diagnostic;
99 const gimple *stmt)
const = 0;
103 const gphi *phi ATTRIBUTE_UNUSED,
104 tree rhs ATTRIBUTE_UNUSED)
const
110 const gimple *stmt ATTRIBUTE_UNUSED,
111 const svalue *lhs ATTRIBUTE_UNUSED,
113 const svalue *rhs ATTRIBUTE_UNUSED)
const
120 const gimple *stmt ATTRIBUTE_UNUSED,
121 const svalue &sval ATTRIBUTE_UNUSED,
138 virtual std::unique_ptr<pending_diagnostic>
149 bool is_mutable)
const
164 if (state_a == state_b)
173 state_t state_b ATTRIBUTE_UNUSED)
const
289 std::unique_ptr<pending_diagnostic> d) = 0;
292 std::unique_ptr<pending_diagnostic> d) = 0;
virtual void impl_transition(exploded_graph *eg, exploded_node *src_enode, int sm_idx)=0
virtual ~custom_transition()
Definition sm.h:220
Definition exploded-graph.h:791
Definition exploded-graph.h:203
Definition program-state.h:31
Definition analyzer-logging.h:147
Definition analyzer-logging.h:34
Definition analyzer.h:399
Definition program-state.h:209
Definition region-model.h:263
virtual void warn(const supernode *node, const gimple *stmt, const svalue *var, std::unique_ptr< pending_diagnostic > d)=0
const state_machine & m_sm
Definition sm.h:337
virtual state_machine::state_t get_state(const gimple *stmt, tree var)=0
virtual void set_next_state(const gimple *stmt, const svalue *var, state_machine::state_t to, tree origin=NULL_TREE)=0
virtual tree get_diagnostic_tree(tree expr)
Definition sm.h:299
virtual state_machine::state_t get_state(const gimple *stmt, const svalue *)=0
virtual void set_global_state(state_machine::state_t)=0
virtual void set_next_state(const gimple *stmt, tree var, state_machine::state_t to, tree origin=NULL_TREE)=0
virtual void warn(const supernode *node, const gimple *stmt, tree var, std::unique_ptr< pending_diagnostic > d)=0
virtual tree get_fndecl_for_call(const gcall *call)=0
virtual const program_state * get_old_program_state() const =0
virtual ~sm_context()
Definition sm.h:232
virtual state_machine::state_t get_global_state() const =0
virtual tree is_zero_assignment(const gimple *stmt)=0
virtual void clear_all_per_svalue_state()=0
virtual const program_state * get_new_program_state() const =0
const region_model * get_old_region_model() const
virtual path_context * get_path_context() const
Definition sm.h:319
int m_sm_idx
Definition sm.h:336
virtual bool unknown_side_effects_p() const
Definition sm.h:325
sm_context(int sm_idx, const state_machine &sm)
Definition sm.h:333
virtual tree get_diagnostic_tree(const svalue *)=0
void on_transition(const supernode *node, const gimple *stmt, const svalue *var, state_machine::state_t from, state_machine::state_t to, tree origin=NULL_TREE)
Definition sm.h:273
void on_transition(const supernode *node, const gimple *stmt, tree var, state_machine::state_t from, state_machine::state_t to, tree origin=NULL_TREE)
Definition sm.h:261
virtual void on_custom_transition(custom_transition *transition)=0
Definition program-state.h:77
virtual void dump_to_pp(pretty_printer *pp) const
unsigned m_id
Definition sm.h:58
virtual json::value * to_json() const
unsigned get_id() const
Definition sm.h:54
state(const char *name, unsigned id)
Definition sm.h:47
virtual ~state()
Definition sm.h:48
const char * m_name
Definition sm.h:57
const char * get_name() const
Definition sm.h:50
const char * get_name() const
Definition sm.h:92
virtual std::unique_ptr< pending_diagnostic > on_leak(tree var) const
virtual state_t maybe_get_merged_states_nonequal(state_t state_a, state_t state_b) const
Definition sm.h:172
virtual void on_phi(sm_context &sm_ctxt, const supernode *node, const gphi *phi, tree rhs) const
Definition sm.h:101
void validate(state_t s) const
virtual ~state_machine()
Definition sm.h:63
virtual bool inherited_state_p() const =0
virtual state_machine::state_t get_default_state(const svalue *) const
Definition sm.h:87
virtual void on_bounded_ranges(sm_context &sm_ctxt, const supernode *node, const gimple *stmt, const svalue &sval, const bounded_ranges &ranges) const
Definition sm.h:118
auto_delete_vec< state > m_states
Definition sm.h:203
const state_machine::state * state_t
Definition sm.h:60
state_t maybe_get_merged_state(state_t state_a, state_t state_b) const
Definition sm.h:161
virtual bool reset_when_passed_to_unknown_fn_p(state_t s, bool is_mutable) const
Definition sm.h:148
virtual void on_condition(sm_context &sm_ctxt, const supernode *node, const gimple *stmt, const svalue *lhs, enum tree_code op, const svalue *rhs) const
Definition sm.h:108
state_t add_custom_state(state *s)
Definition sm.h:189
virtual void on_pop_frame(sm_state_map *smap, const frame_region *frame_reg) const
Definition sm.h:127
virtual bool on_stmt(sm_context &sm_ctxt, const supernode *node, const gimple *stmt) const =0
unsigned m_next_state_id
Definition sm.h:205
state_t get_start_state() const
Definition sm.h:185
const char * m_name
Definition sm.h:200
state_machine(const char *name, logger *logger)
virtual bool has_alt_get_inherited_state_p() const
Definition sm.h:82
virtual state_t alt_get_inherited_state(const sm_state_map &, const svalue *, const extrinsic_state &) const
Definition sm.h:74
void dump_to_pp(pretty_printer *pp) const
unsigned alloc_state_id()
Definition sm.h:195
state_t get_state_by_name(const char *name) const
state_t m_start
Definition sm.h:209
DISABLE_COPY_AND_ASSIGN(state_machine)
state_t add_state(const char *name)
json::object * to_json() const
virtual bool can_purge_p(state_t s) const =0
Definition supergraph.h:235
Definition genmatch.cc:832
Definition pretty-print.h:241
Definition genrecog.cc:1504
union tree_node * tree
Definition coretypes.h:97
tree_code
Definition genmatch.cc:334
Definition access-diagram.h:30
state_machine * make_fileptr_state_machine(logger *logger)
state_machine * make_va_list_state_machine(logger *logger)
state_machine * make_taint_state_machine(logger *logger)
state_machine * make_signal_state_machine(logger *logger)
state_machine * make_sensitive_state_machine(logger *logger)
void make_checkers(auto_delete_vec< state_machine > &out, logger *logger)
state_machine * make_fd_state_machine(logger *logger)
state_machine * make_pattern_test_state_machine(logger *logger)
bool any_pointer_p(tree expr)
state_machine * make_malloc_state_machine(logger *logger)
rtx expr
Definition postreload.cc:697
Definition constraint-manager.h:123
Definition collect2.cc:168
Definition genautomata.cc:669
#define NULL
Definition system.h:50
#define NULL_TREE
Definition tree.h:317