What happens before is that parameters would get assigned in one path but
[smatch.git] / smatch_slist.h
blob398b2c3510269a1d793e4e10a839e90290d3fbf8
1 struct state_history {
2 unsigned int loc;
3 };
4 DECLARE_PTR_LIST(history_list, struct state_history);
6 struct sm_state {
7 char *name;
8 unsigned int owner;
9 struct symbol *sym;
10 struct smatch_state *state;
11 struct history_list *line_history;
12 struct history_list *path_history;
15 DECLARE_ALLOCATOR(sm_state);
16 DECLARE_PTR_LIST(state_list, struct sm_state);
17 DECLARE_PTR_LIST(state_list_stack, struct state_list);
18 struct named_slist {
19 char *name;
20 struct state_list *slist;
22 DECLARE_ALLOCATOR(named_slist);
23 DECLARE_PTR_LIST(slist_stack, struct named_slist);
25 extern struct state_list *cur_slist; /* current states */
27 void add_history(struct sm_state *state);
28 struct sm_state *alloc_state(const char *name, int owner,
29 struct symbol *sym,
30 struct smatch_state *state);
32 struct sm_state *clone_state(struct sm_state *s);
33 struct state_list *clone_slist(struct state_list *from_slist);
35 struct smatch_state *merge_states(const char *name, int owner, struct symbol *sym,
36 struct smatch_state *state1, struct smatch_state *state2);
37 void merge_state_slist(struct state_list **slist, const char *name, int owner,
38 struct symbol *sym, struct smatch_state *state);
40 struct smatch_state *get_state_slist(struct state_list *slist, const char *name, int owner,
41 struct symbol *sym);
43 void add_state_slist(struct state_list **slist, struct sm_state *state);
45 void set_state_slist(struct state_list **slist, const char *name, int owner,
46 struct symbol *sym, struct smatch_state *state);
48 void merge_state_slist(struct state_list **slist, const char *name, int owner,
49 struct symbol *sym, struct smatch_state *state);
51 void delete_state_slist(struct state_list **slist, const char *name, int owner,
52 struct symbol *sym);
54 struct smatch_state *get_state_slist(struct state_list *slist, const char *name, int owner,
55 struct symbol *sym);
57 void push_slist(struct state_list_stack **list_stack, struct state_list *slist);
59 struct state_list *pop_slist(struct state_list_stack **list_stack);
61 void del_slist(struct state_list **slist);
63 void del_slist_stack(struct state_list_stack **slist_stack);
65 void set_state_stack(struct state_list_stack **stack, const char *name,
66 int owner, struct symbol *sym, struct smatch_state *state);
68 struct smatch_state *get_state_stack(struct state_list_stack *stack, const char *name,
69 int owner, struct symbol *sym);
71 void merge_state_stack(struct state_list_stack **stack, const char *name,
72 int owner, struct symbol *sym, struct smatch_state *state);
74 void merge_slist(struct state_list **to, struct state_list *slist);
75 void and_slist_stack(struct state_list_stack **slist_stack,
76 struct state_list *tmp_slist);
78 void or_slist_stack(struct state_list_stack **slist_stack);
80 struct state_list *get_slist_from_slist_stack(struct slist_stack *stack,
81 const char *name);
83 void overwrite_slist(struct state_list *from, struct state_list **to);