units: store what sort of units a variable is in
[smatch.git] / smatch_slist.h
blobf08ed46332efacfe0ab989af8e0916f2d414eac5
1 struct stree;
3 extern int unfree_stree;
5 DECLARE_PTR_LIST(state_list, struct sm_state);
6 DECLARE_PTR_LIST(state_list_stack, struct state_list);
8 struct named_stree {
9 char *name;
10 struct symbol *sym;
11 struct stree *stree;
13 DECLARE_ALLOCATOR(named_stree);
14 DECLARE_PTR_LIST(named_stree_stack, struct named_stree);
17 extern struct state_list_stack *implied_pools;
18 extern int __stree_id;
19 extern int sm_state_counter;
21 const char *show_sm(struct sm_state *sm);
22 void __print_stree(struct stree *stree);
23 void add_history(struct sm_state *sm);
24 int cmp_tracker(const struct sm_state *a, const struct sm_state *b);
25 char *alloc_sname(const char *str);
26 struct sm_state *alloc_sm_state(int owner, const char *name,
27 struct symbol *sym, struct smatch_state *state);
29 void free_every_single_sm_state(void);
30 struct sm_state *clone_sm(struct sm_state *s);
31 int is_merged(struct sm_state *sm);
32 int is_leaf(struct sm_state *sm);
33 struct state_list *clone_slist(struct state_list *from_slist);
35 int slist_has_state(struct state_list *slist, struct smatch_state *state);
37 int too_many_possible(struct sm_state *sm);
38 void add_possible_sm(struct sm_state *to, struct sm_state *new);
39 struct sm_state *merge_sm_states(struct sm_state *one, struct sm_state *two);
40 struct smatch_state *get_state_stree(struct stree *stree, int owner, const char *name,
41 struct symbol *sym);
43 struct sm_state *get_sm_state_stree(struct stree *stree, int owner, const char *name,
44 struct symbol *sym);
46 void overwrite_sm_state_stree(struct stree **stree, struct sm_state *sm);
47 void overwrite_sm_state_stree_stack(struct stree_stack **stack, struct sm_state *sm);
48 struct sm_state *set_state_stree(struct stree **stree, int owner, const char *name,
49 struct symbol *sym, struct smatch_state *state);
50 void set_state_stree_perm(struct stree **stree, int owner, const char *name,
51 struct symbol *sym, struct smatch_state *state);
52 void delete_state_stree(struct stree **stree, int owner, const char *name,
53 struct symbol *sym);
55 void delete_state_stree_stack(struct stree_stack **stack, int owner, const char *name,
56 struct symbol *sym);
58 void push_stree(struct stree_stack **list_stack, struct stree *stree);
59 struct stree *pop_stree(struct stree_stack **list_stack);
60 struct stree *top_stree(struct stree_stack *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);
65 unsigned long get_pool_count(void);
67 struct sm_state *set_state_stree_stack(struct stree_stack **stack, int owner, const char *name,
68 struct symbol *sym, struct smatch_state *state);
70 struct sm_state *get_sm_state_stree_stack(struct stree_stack *stack,
71 int owner, const char *name,
72 struct symbol *sym);
73 struct smatch_state *get_state_stree_stack(struct stree_stack *stack, int owner,
74 const char *name, struct symbol *sym);
76 int out_of_memory(void);
77 int low_on_memory(void);
78 void merge_stree(struct stree **to, struct stree *stree);
79 void merge_stree_no_pools(struct stree **to, struct stree *stree);
80 void merge_stree(struct stree **to, struct stree *right);
81 void merge_fake_stree(struct stree **to, struct stree *stree);
82 void filter_stree(struct stree **stree, struct stree *filter);
83 void and_stree_stack(struct stree_stack **stree_stack);
85 void or_stree_stack(struct stree_stack **pre_conds,
86 struct stree *cur_stree,
87 struct stree_stack **stack);
89 struct stree **get_named_stree(struct named_stree_stack *stack,
90 const char *name,
91 struct symbol *sym);
93 void overwrite_stree(struct stree *from, struct stree **to);
95 /* add stuff smatch_returns.c here */
97 void all_return_states_hook(void (*callback)(void));
99 void allocate_dynamic_states_array(int num_checks);