00001 /* Tree based points-to analysis 00002 Copyright (C) 2002, 2003 Free Software Foundation, Inc. 00003 Contributed by Daniel Berlin <dberlin@dberlin.org> 00004 00005 This file is part of GCC. 00006 00007 GCC is free software; you can redistribute it and/or modify 00008 under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 GCC is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GCC; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef TREE_SSA_STRUCTALIAS_H 00023 #define TREE_SSA_STRUCTALIAS_H 00024 00025 /* True if the data pointed to by PTR can alias anything. */ 00026 #define PTR_IS_REF_ALL(PTR) TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (PTR)) 00027 00028 struct constraint; 00029 typedef struct constraint *constraint_t; 00030 00031 /* Alias information used by compute_may_aliases and its helpers. */ 00032 struct alias_info 00033 { 00034 /* SSA names visited while collecting points-to information. If bit I 00035 is set, it means that SSA variable with version I has already been 00036 visited. */ 00037 sbitmap ssa_names_visited; 00038 00039 /* Array of SSA_NAME pointers processed by the points-to collector. */ 00040 VEC(tree,heap) *processed_ptrs; 00041 00042 /* ADDRESSABLE_VARS contains all the global variables and locals that 00043 have had their address taken. */ 00044 struct alias_map_d **addressable_vars; 00045 size_t num_addressable_vars; 00046 00047 /* POINTERS contains all the _DECL pointers with unique memory tags 00048 that have been referenced in the program. */ 00049 struct alias_map_d **pointers; 00050 size_t num_pointers; 00051 00052 /* Number of function calls found in the program. */ 00053 size_t num_calls_found; 00054 00055 /* Number of const/pure function calls found in the program. */ 00056 size_t num_pure_const_calls_found; 00057 00058 /* Total number of virtual operands that will be needed to represent 00059 all the aliases of all the pointers found in the program. */ 00060 long total_alias_vops; 00061 00062 /* Variables that have been written to. */ 00063 bitmap written_vars; 00064 00065 /* Pointers that have been used in an indirect store operation. */ 00066 bitmap dereferenced_ptrs_store; 00067 00068 /* Pointers that have been used in an indirect load operation. */ 00069 bitmap dereferenced_ptrs_load; 00070 00071 /* Memory tag for all the PTR_IS_REF_ALL pointers. */ 00072 tree ref_all_symbol_mem_tag; 00073 }; 00074 00075 /* Keep track of how many times each pointer has been dereferenced in 00076 the program using the aux variable. This is used by the alias 00077 grouping heuristic in compute_flow_insensitive_aliasing. */ 00078 #define NUM_REFERENCES(ANN) ((size_t)((ANN)->common.aux)) 00079 #define NUM_REFERENCES_CLEAR(ANN) ((ANN)->common.aux) = 0 00080 #define NUM_REFERENCES_INC(ANN) (ANN)->common.aux = (void*) (((size_t)((ANN)->common.aux)) + 1) 00081 #define NUM_REFERENCES_SET(ANN, VAL) (ANN)->common.aux = (void*) ((void *)(VAL)) 00082 00083 /* In tree-ssa-alias.c. */ 00084 enum escape_type is_escape_site (tree); 00085 00086 /* In tree-ssa-structalias.c. */ 00087 extern void compute_points_to_sets (struct alias_info *); 00088 extern void delete_points_to_sets (void); 00089 extern void dump_constraint (FILE *, constraint_t); 00090 extern void dump_constraints (FILE *); 00091 extern void debug_constraint (constraint_t); 00092 extern void debug_constraints (void); 00093 extern void dump_solution_for_var (FILE *, unsigned int); 00094 extern void debug_solution_for_var (unsigned int); 00095 extern void dump_sa_points_to_info (FILE *); 00096 extern void debug_sa_points_to_info (void); 00097 00098 #endif /* TREE_SSA_STRUCTALIAS_H */
1.5.6