ranges: in cast_rl() sometimes it's better to just give up
[smatch.git] / smatch_slist.h
blob5cb8f72102ae606eb1a54e23191faa1f4a24b01b
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 void merge_slist(struct state_list **to, struct state_list *slist);
65 void filter_slist(struct state_list **slist, struct state_list *filter);
66 void and_slist_stack(struct state_list_stack **slist_stack);
68 void or_slist_stack(struct state_list_stack **pre_conds,
69 struct state_list *cur_slist,
70 struct state_list_stack **slist_stack);
72 struct state_list **get_slist_from_named_stack(struct named_stack *stack,
73 const char *name);
75 void overwrite_slist(struct state_list *from, struct state_list **to);
77 /* add stuff smatch_returns.c here */
79 void all_return_states_hook(void (*callback)(struct state_list *slist));
80 int get_slist_id(struct state_list *slist);