flow: clear_buffer: revert part of commit that uses too much memory
[smatch.git] / smatch_slist.h
blobbd89e75644711af7c7317b7882d36fb9e645550f
1 DECLARE_PTR_LIST(state_list, struct sm_state);
2 DECLARE_PTR_LIST(state_list_stack, struct state_list);
3 struct named_slist {
4 char *name;
5 struct state_list *slist;
6 };
7 DECLARE_ALLOCATOR(named_slist);
8 DECLARE_PTR_LIST(named_stack, struct named_slist);
10 extern struct state_list_stack *implied_pools;
11 extern int __slist_id;
13 char *show_sm(struct sm_state *sm);
14 void __print_slist(struct state_list *slist);
15 void add_history(struct sm_state *sm);
16 int cmp_tracker(const struct sm_state *a, const struct sm_state *b);
17 char *alloc_sname(const char *str);
19 void free_every_single_sm_state(void);
20 struct sm_state *clone_sm(struct sm_state *s);
21 int is_merged(struct sm_state *sm);
22 int is_implied(struct sm_state *sm);
23 struct state_list *clone_slist(struct state_list *from_slist);
24 struct state_list_stack *clone_stack(struct state_list_stack *from_stack);
26 int slist_has_state(struct state_list *slist, struct smatch_state *state);
27 struct smatch_state *merge_states(int owner, const char *name,
28 struct symbol *sym,
29 struct smatch_state *state1,
30 struct smatch_state *state2);
32 struct sm_state *merge_sm_states(struct sm_state *one, struct sm_state *two);
33 struct smatch_state *get_state_slist(struct state_list *slist, int owner, const char *name,
34 struct symbol *sym);
36 struct sm_state *get_sm_state_slist(struct state_list *slist, int owner, const char *name,
37 struct symbol *sym);
39 void overwrite_sm_state(struct state_list **slist, struct sm_state *sm);
40 void overwrite_sm_state_stack(struct state_list_stack **stack, struct sm_state *sm);
41 struct sm_state *set_state_slist(struct state_list **slist, int owner, const char *name,
42 struct symbol *sym, struct smatch_state *state);
44 void delete_state_slist(struct state_list **slist, int owner, const char *name,
45 struct symbol *sym);
47 void delete_state_stack(struct state_list_stack **stack, int owner, const char *name,
48 struct symbol *sym);
49 void push_slist(struct state_list_stack **list_stack, struct state_list *slist);
51 struct state_list *pop_slist(struct state_list_stack **list_stack);
53 void free_slist(struct state_list **slist);
54 void free_stack(struct state_list_stack **stack);
55 void free_stack_and_slists(struct state_list_stack **slist_stack);
57 struct sm_state *set_state_stack(struct state_list_stack **stack, int owner, const char *name,
58 struct symbol *sym, struct smatch_state *state);
60 struct smatch_state *get_state_stack(struct state_list_stack *stack, int owner,
61 const char *name, struct symbol *sym);
63 int out_of_memory(void);
64 int low_on_memory(void);
65 void merge_slist(struct state_list **to, struct state_list *slist);
66 void filter_slist(struct state_list **slist, struct state_list *filter);
67 void and_slist_stack(struct state_list_stack **slist_stack);
69 void or_slist_stack(struct state_list_stack **pre_conds,
70 struct state_list *cur_slist,
71 struct state_list_stack **slist_stack);
73 struct state_list **get_slist_from_named_stack(struct named_stack *stack,
74 const char *name);
76 void overwrite_slist(struct state_list *from, struct state_list **to);
78 /* add stuff smatch_returns.c here */
80 void all_return_states_hook(void (*callback)(struct state_list *slist));
81 int get_slist_id(struct state_list *slist);