1 #ifndef TREE_ALIAS_COMMON
2 #define TREE_ALIAS_COMMON
3 #include "tree-alias-type.h"
4 /* Alias analysis function pointers.
5 Functions implemented by the actual alias analysis algorithms in
6 order for them to work with the common points-to structure. */
10 Called right before we start using the other functions. */
11 void (*init
) (struct tree_alias_ops
*);
14 Called when we are finished with the alias analyzer. */
15 void (*cleanup
) (struct tree_alias_ops
*);
18 Called when we want to inform the alias analyzer about a new
19 variable we've found. */
20 alias_var (*add_var
) (struct tree_alias_ops
*, tree
);
22 /* Add variable equivalent to existing one.
23 Called when we want to inform the alias analyzer about a new
24 variable that has the same points-to set as an existing
26 alias_var (*add_var_same
) (struct tree_alias_ops
*, tree
,
29 /* Process a simple assignment (a = b).
30 Called to process simple assignment statements of the form a = b,
31 where a and b are both variables. */
32 void (*simple_assign
) (struct tree_alias_ops
*, alias_var
,
34 /* Process an address assignment (a = &b).
35 Called to process address assignment statements of the form a =
36 &b, where a and b are both variables. */
37 void (*addr_assign
) (struct tree_alias_ops
*, alias_var
, alias_var
);
39 /* Process a pointer assignment (a = *b).
40 Called to process pointer assignment statements of the form a =
41 *b, where a and b are both variables. */
42 void (*ptr_assign
) (struct tree_alias_ops
*, alias_var
, alias_var
);
44 /* Process an operator assignment (a = op (...))
45 Called to process operators of the form a = op(...), where a is a
47 void (*op_assign
) (struct tree_alias_ops
*, alias_var
, varray_type
,
49 /* Process a heap assignment (a = alloc (...))
50 Called to process a heap assignment of the form a = alloc
51 (...), where a is a variable, and *alloc is a function that
52 returns new memory. */
53 void (*heap_assign
) (struct tree_alias_ops
*, alias_var
);
55 /* Process an assignment to a pointer (*a = b)
56 Called to process assignment to pointer statements of the form
57 *a = b, where a and b are both variables. */
58 void (*assign_ptr
) (struct tree_alias_ops
*, alias_var
, alias_var
);
60 /* Process a function definition.
61 Called to inform the alias analyzer about a new function
63 void (*function_def
) (struct tree_alias_ops
*, alias_var
,
64 varray_type
, alias_var
);
66 /* Process a function call.
67 Return 1 if we need to assume conservative side-effects. */
68 int (*function_call
) (struct tree_alias_ops
*, alias_var
,
69 alias_var
, varray_type
, bitmap
);
71 /* Determine if two alias variables may alias. */
72 bool (*may_alias
) (struct tree_alias_ops
*, alias_var
, alias_var
);
74 /* Determine if two alias variables have the same points-to set. */
75 bool (*same_points_to_set
) (struct tree_alias_ops
*, alias_var
,
78 /* Determine if the alias variable has an empty points-to set. */
79 bool (*empty_points_to_set
) (struct tree_alias_ops
*, alias_var
);
84 /* Interprocedural. */
87 /* Can do conservative interprocedural analysis if we save the
93 extern struct tree_alias_ops
*current_alias_ops
;
94 extern void init_alias_vars (void);
95 extern bool ptr_may_alias_var (tree
, tree
);
96 extern bool same_points_to_set (tree
, tree
);
97 extern bool empty_points_to_set (tree
);
98 extern const char *alias_get_name (tree
);