1 /* Tree based points-to analysis
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 Contributed by Daniel Berlin <dberlin@dberlin.org>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef TREE_SSA_STRUCTALIAS_H
23 #define TREE_SSA_STRUCTALIAS_H
25 /* True if the data pointed to by PTR can alias anything. */
26 #define PTR_IS_REF_ALL(PTR) TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (PTR))
29 typedef struct constraint
*constraint_t
;
31 /* Alias information used by compute_may_aliases and its helpers. */
34 /* SSA names visited while collecting points-to information. If bit I
35 is set, it means that SSA variable with version I has already been
37 sbitmap ssa_names_visited
;
39 /* Array of SSA_NAME pointers processed by the points-to collector. */
40 VEC(tree
,heap
) *processed_ptrs
;
42 /* ADDRESSABLE_VARS contains all the global variables and locals that
43 have had their address taken. */
44 struct alias_map_d
**addressable_vars
;
45 size_t num_addressable_vars
;
47 /* POINTERS contains all the _DECL pointers with unique memory tags
48 that have been referenced in the program. */
49 struct alias_map_d
**pointers
;
52 /* Variables that have been written to directly (i.e., not through a
53 pointer dereference). */
54 struct pointer_set_t
*written_vars
;
56 /* Pointers that have been used in an indirect store operation. */
57 struct pointer_set_t
*dereferenced_ptrs_store
;
59 /* Pointers that have been used in an indirect load operation. */
60 struct pointer_set_t
*dereferenced_ptrs_load
;
62 /* Memory tag for all the PTR_IS_REF_ALL pointers. */
63 tree ref_all_symbol_mem_tag
;
66 /* In tree-ssa-alias.c. */
67 enum escape_type
is_escape_site (tree
);
68 void update_mem_sym_stats_from_stmt (tree
, tree
, long, long);
70 /* In tree-ssa-structalias.c. */
71 extern void compute_points_to_sets (struct alias_info
*);
72 extern void delete_points_to_sets (void);
73 extern void dump_constraint (FILE *, constraint_t
);
74 extern void dump_constraints (FILE *);
75 extern void debug_constraint (constraint_t
);
76 extern void debug_constraints (void);
77 extern void dump_solution_for_var (FILE *, unsigned int);
78 extern void debug_solution_for_var (unsigned int);
79 extern void dump_sa_points_to_info (FILE *);
80 extern void debug_sa_points_to_info (void);
81 extern void set_used_smts (void);
83 #endif /* TREE_SSA_STRUCTALIAS_H */