OSDN Git Service

2008-05-21 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-structalias.h
1 /* Tree based points-to analysis
2    Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
3    Contributed by Daniel Berlin <dberlin@dberlin.org>
4
5    This file is part of GCC.
6
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 3 of the License, or
10    (at your option) any later version.
11
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.
16
17    You should have received a copy of the GNU General Public License
18    along with GCC; see the file COPYING3.  If not see
19    <http://www.gnu.org/licenses/>.  */
20
21 #ifndef TREE_SSA_STRUCTALIAS_H
22 #define TREE_SSA_STRUCTALIAS_H
23
24 struct constraint;
25 typedef struct constraint *constraint_t;
26
27 /* Alias information used by compute_may_aliases and its helpers.  */
28 struct alias_info
29 {
30   /* SSA names visited while collecting points-to information.  If bit I
31      is set, it means that SSA variable with version I has already been
32      visited.  */
33   sbitmap ssa_names_visited;
34
35   /* Array of SSA_NAME pointers processed by the points-to collector.  */
36   VEC(tree,heap) *processed_ptrs;
37
38   /* ADDRESSABLE_VARS contains all the global variables and locals that
39      have had their address taken.  */
40   struct alias_map_d **addressable_vars;
41   size_t num_addressable_vars;
42
43   /* POINTERS contains all the _DECL pointers with unique memory tags
44      that have been referenced in the program.  */
45   struct alias_map_d **pointers;
46   size_t num_pointers;
47
48   /* Variables that have been written to directly (i.e., not through a
49      pointer dereference).  */
50   struct pointer_set_t *written_vars;
51
52   /* Pointers that have been used in an indirect store operation.  */
53   struct pointer_set_t *dereferenced_ptrs_store;
54
55   /* Pointers that have been used in an indirect load operation.  */
56   struct pointer_set_t *dereferenced_ptrs_load;
57 };
58
59 /* In tree-ssa-alias.c.  */
60 enum escape_type is_escape_site (tree);
61 void update_mem_sym_stats_from_stmt (tree, tree, long, long);
62
63 /* In tree-ssa-structalias.c.  */
64 extern void compute_points_to_sets (struct alias_info *);
65 extern void delete_points_to_sets (void);
66 extern void dump_constraint (FILE *, constraint_t);
67 extern void dump_constraints (FILE *);
68 extern void debug_constraint (constraint_t);
69 extern void debug_constraints (void);
70 extern void dump_solution_for_var (FILE *, unsigned int);
71 extern void debug_solution_for_var (unsigned int);
72 extern void dump_sa_points_to_info (FILE *);
73 extern void debug_sa_points_to_info (void);
74 extern void set_used_smts (void);
75
76 #endif /* TREE_SSA_STRUCTALIAS_H  */