3 DECLARE_PTR_LIST(state_list
, struct sm_state
);
4 DECLARE_PTR_LIST(state_list_stack
, struct state_list
);
10 DECLARE_ALLOCATOR(named_stree
);
11 DECLARE_PTR_LIST(named_stree_stack
, struct named_stree
);
14 extern struct state_list_stack
*implied_pools
;
15 extern int __stree_id
;
17 char *show_sm(struct sm_state
*sm
);
18 void __print_stree(struct stree
*stree
);
19 void add_history(struct sm_state
*sm
);
20 int cmp_tracker(const struct sm_state
*a
, const struct sm_state
*b
);
21 char *alloc_sname(const char *str
);
22 struct sm_state
*alloc_sm_state(int owner
, const char *name
,
23 struct symbol
*sym
, struct smatch_state
*state
);
25 void free_every_single_sm_state(void);
26 struct sm_state
*clone_sm(struct sm_state
*s
);
27 int is_merged(struct sm_state
*sm
);
28 int is_implied(struct sm_state
*sm
);
29 struct state_list
*clone_slist(struct state_list
*from_slist
);
31 int slist_has_state(struct state_list
*slist
, struct smatch_state
*state
);
32 struct smatch_state
*merge_states(int owner
, const char *name
,
34 struct smatch_state
*state1
,
35 struct smatch_state
*state2
);
37 int too_many_possible(struct sm_state
*sm
);
38 struct sm_state
*merge_sm_states(struct sm_state
*one
, struct sm_state
*two
);
39 struct smatch_state
*get_state_stree(struct stree
*stree
, int owner
, const char *name
,
42 struct sm_state
*get_sm_state_stree(struct stree
*stree
, int owner
, const char *name
,
45 void overwrite_sm_state_stree(struct stree
**stree
, struct sm_state
*sm
);
46 void overwrite_sm_state_stree_stack(struct stree_stack
**stack
, struct sm_state
*sm
);
47 void set_sm_state_stree_stack_if_not_already_set(struct stree_stack
**stack
,
49 struct sm_state
*set_state_stree(struct stree
**stree
, int owner
, const char *name
,
50 struct symbol
*sym
, struct smatch_state
*state
);
51 void set_state_stree_perm(struct stree
**stree
, int owner
, const char *name
,
52 struct symbol
*sym
, struct smatch_state
*state
);
53 void delete_state_stree(struct stree
**stree
, int owner
, const char *name
,
56 void delete_state_stree_stack(struct stree_stack
**stack
, int owner
, const char *name
,
59 void push_stree(struct stree_stack
**list_stack
, struct stree
*stree
);
60 struct stree
*pop_stree(struct stree_stack
**list_stack
);
62 void free_slist(struct state_list
**slist
);
63 void free_stree_stack(struct stree_stack
**stack
);
64 void free_stack_and_strees(struct stree_stack
**stree_stack
);
66 struct sm_state
*set_state_stree_stack(struct stree_stack
**stack
, int owner
, const char *name
,
67 struct symbol
*sym
, struct smatch_state
*state
);
69 struct sm_state
*get_sm_state_stree_stack(struct stree_stack
*stack
,
70 int owner
, const char *name
,
72 struct smatch_state
*get_state_stree_stack(struct stree_stack
*stack
, int owner
,
73 const char *name
, struct symbol
*sym
);
75 int out_of_memory(void);
76 int low_on_memory(void);
77 void merge_stree(struct stree
**to
, struct stree
*stree
);
78 void merge_stree_no_pools(struct stree
**to
, struct stree
*stree
);
79 void merge_fake_stree(struct stree
**to
, struct stree
*stree
);
80 void filter_stree(struct stree
**stree
, struct stree
*filter
);
81 void and_stree_stack(struct stree_stack
**stree_stack
);
83 void or_stree_stack(struct stree_stack
**pre_conds
,
84 struct stree
*cur_stree
,
85 struct stree_stack
**stack
);
87 struct stree
**get_named_stree(struct named_stree_stack
*stack
,
90 void overwrite_stree(struct stree
*from
, struct stree
**to
);
92 /* add stuff smatch_returns.c here */
94 void all_return_states_hook(void (*callback
)(struct stree
*slist
));