1 DECLARE_PTR_LIST(state_list
, struct sm_state
);
2 DECLARE_PTR_LIST(state_list_stack
, struct state_list
);
5 struct state_list
*slist
;
7 DECLARE_ALLOCATOR(named_slist
);
8 DECLARE_PTR_LIST(named_stack
, struct named_slist
);
10 extern struct state_list_stack
*implied_pools
;
12 void __print_slist(struct state_list
*slist
);
13 void add_history(struct sm_state
*sm
);
14 int cmp_tracker(const struct sm_state
*a
, const struct sm_state
*b
);
15 char *alloc_sname(const char *str
);
17 void free_every_single_sm_state(void);
18 struct sm_state
*clone_sm(struct sm_state
*s
);
19 int is_merged(struct sm_state
*sm
);
20 int is_implied(struct sm_state
*sm
);
21 struct state_list
*clone_slist(struct state_list
*from_slist
);
22 struct state_list_stack
*clone_stack(struct state_list_stack
*from_stack
);
24 int slist_has_state(struct state_list
*slist
, struct smatch_state
*state
);
25 struct smatch_state
*merge_states(int owner
, const char *name
,
27 struct smatch_state
*state1
,
28 struct smatch_state
*state2
);
30 void add_pool(struct state_list_stack
**pools
, struct state_list
*new);
31 struct sm_state
*merge_sm_states(struct sm_state
*one
, struct sm_state
*two
);
32 struct smatch_state
*get_state_slist(struct state_list
*slist
, int owner
, const char *name
,
35 struct sm_state
*get_sm_state_slist(struct state_list
*slist
, int owner
, const char *name
,
38 void overwrite_sm_state(struct state_list
**slist
, struct sm_state
*sm
);
39 void overwrite_sm_state_stack(struct state_list_stack
**stack
, struct sm_state
*sm
);
40 struct sm_state
*set_state_slist(struct state_list
**slist
, int owner
, const char *name
,
41 struct symbol
*sym
, struct smatch_state
*state
);
43 void delete_state_slist(struct state_list
**slist
, int owner
, const char *name
,
46 void delete_state_stack(struct state_list_stack
**stack
, int owner
, const char *name
,
48 void push_slist(struct state_list_stack
**list_stack
, struct state_list
*slist
);
50 struct state_list
*pop_slist(struct state_list_stack
**list_stack
);
52 void free_slist(struct state_list
**slist
);
53 void free_stack(struct state_list_stack
**stack
);
54 void free_stack_and_slists(struct state_list_stack
**slist_stack
);
56 struct sm_state
*set_state_stack(struct state_list_stack
**stack
, int owner
, const char *name
,
57 struct symbol
*sym
, struct smatch_state
*state
);
59 struct smatch_state
*get_state_stack(struct state_list_stack
*stack
, int owner
,
60 const char *name
, struct symbol
*sym
);
62 int out_of_memory(void);
63 void merge_slist(struct state_list
**to
, struct state_list
*slist
);
64 void filter_slist(struct state_list
**slist
, struct state_list
*filter
);
65 void and_slist_stack(struct state_list_stack
**slist_stack
);
67 void or_slist_stack(struct state_list_stack
**pre_conds
,
68 struct state_list
*cur_slist
,
69 struct state_list_stack
**slist_stack
);
71 struct state_list
**get_slist_from_named_stack(struct named_stack
*stack
,
74 void overwrite_slist(struct state_list
*from
, struct state_list
**to
);