/* Data and Control Flow Analysis for Trees.
- Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
#define _TREE_FLOW_H 1
#include "bitmap.h"
-#include "hard-reg-set.h"
+#include "sbitmap.h"
#include "basic-block.h"
#include "hashtab.h"
#include "gimple.h"
/* Artificial variable used for the virtual operand FUD chain. */
tree vop;
- /* Artificial variable used to model the effects of nonlocal
- variables. */
- tree nonlocal_all;
-
/* The PTA solution for the ESCAPED artificial variable. */
struct pt_solution escaped;
- /* The PTA solution for the CALLUSED artificial variable. */
- struct pt_solution callused;
-
/* A map of decls to artificial ssa-names that point to the partition
of the decl. */
struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
/* True if the code is in ssa form. */
unsigned int in_ssa_p : 1;
+ /* True if IPA points-to information was computed for this function. */
+ unsigned int ipa_pta : 1;
+
struct ssa_operands ssa_operands;
};
/*---------------------------------------------------------------------------
Attributes for SSA_NAMEs.
-
+
NOTE: These structures are stored in struct tree_ssa_name
but are only used by the tree optimizers, so it makes better sense
to declare them here to avoid recompiling unrelated files when
---------------------------------------------------------------------------*/
/* Aliasing information for SSA_NAMEs representing pointer variables. */
+
struct GTY(()) ptr_info_def
{
- /* The points-to solution, TBAA-pruned if the pointer is dereferenced. */
+ /* The points-to solution. */
struct pt_solution pt;
};
needs PHI nodes. This is probably an overly conservative assumption. */
NEED_PHI_STATE_UNKNOWN,
- /* This state indicates that we have seen one or more sets of the
+ /* This state indicates that we have seen one or more sets of the
variable in a single basic block and that the sets dominate all
uses seen so far. If after finding all definition and use sites
we are still in this state, then the variable does not need any
};
-/* The "no alias" attribute allows alias analysis to make more
- aggressive assumptions when assigning alias sets, computing
- points-to information and memory partitions. These attributes
- are the result of user annotations or flags (e.g.,
- -fargument-noalias). */
-enum noalias_state {
- /* Default state. No special assumptions can be made about this
- symbol. */
- MAY_ALIAS = 0,
-
- /* The symbol does not alias with other symbols that have a
- NO_ALIAS* attribute. */
- NO_ALIAS,
-
- /* The symbol does not alias with other symbols that have a
- NO_ALIAS*, and it may not alias with global symbols. */
- NO_ALIAS_GLOBAL,
-
- /* The symbol does not alias with any other symbols. */
- NO_ALIAS_ANYTHING
-};
-
-
struct GTY(()) var_ann_d {
/* Used when building base variable structures in a var_map. */
unsigned base_var_processed : 1;
the memory area allocated by a call to malloc. */
unsigned is_heapvar : 1;
- /* This field describes several "no alias" attributes that some
- symbols are known to have. See the enum's definition for more
- information on each attribute. */
- ENUM_BITFIELD (noalias_state) noalias_state : 2;
-
/* Used by var_map for the base index of ssa base variables. */
unsigned base_index;
/* Immediate use lists are used to directly access all uses for an SSA
- name and get pointers to the statement for each use.
+ name and get pointers to the statement for each use.
The structure ssa_use_operand_d consists of PREV and NEXT pointers
to maintain the list. A USE pointer, which points to address where
iterator manages this by inserting a marker node into the list
immediately before the node currently being examined in the list.
this marker node is uniquely identified by having null stmt *and* a
- null use pointer.
+ null use pointer.
When iterating to the next use, the iteration routines check to see
if the node after the marker has changed. if it has, then the node
/* Use this iterator when simply looking at stmts. Adding, deleting or
modifying stmts will cause this iterator to malfunction. */
-#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
+#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
!end_readonly_imm_use_p (&(ITER)); \
- (DEST) = next_readonly_imm_use (&(ITER)))
-
+ (void) ((DEST) = next_readonly_imm_use (&(ITER))))
+
/* Use this iterator to visit each stmt which has a use of SSAVAR. */
#define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \
for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR)); \
!end_imm_use_stmt_p (&(ITER)); \
- (STMT) = next_imm_use_stmt (&(ITER)))
+ (void) ((STMT) = next_imm_use_stmt (&(ITER))))
-/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early. Failure to
+/* Use this to terminate the FOR_EACH_IMM_USE_STMT loop early. Failure to
do so will result in leaving a iterator marker node in the immediate
use list, and nothing good will come from that. */
#define BREAK_FROM_IMM_USE_STMT(ITER) \
}
-/* Use this iterator in combination with FOR_EACH_IMM_USE_STMT to
+/* Use this iterator in combination with FOR_EACH_IMM_USE_STMT to
get access to each occurrence of ssavar on the stmt returned by
that iterator.. for instance:
#define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \
for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
!end_imm_use_on_stmt_p (&(ITER)); \
- (DEST) = next_imm_use_on_stmt (&(ITER)))
+ (void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
Global declarations
---------------------------------------------------------------------------*/
struct GTY(()) int_tree_map {
-
+
unsigned int uid;
tree to;
};
extern unsigned int uid_decl_map_hash (const void *);
extern int uid_decl_map_eq (const void *, const void *);
-typedef struct
+typedef struct
{
htab_iterator hti;
} referenced_var_iterator;
-
/* This macro loops over all the referenced vars, one at a time, putting the
current var in VAR. Note: You are not allowed to add referenced variables
to the hashtable while using this macro. Doing so may cause it to behave
#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
for ((VAR) = first_referenced_var (&(ITER)); \
!end_referenced_vars_p (&(ITER)); \
- (VAR) = next_referenced_var (&(ITER)))
-
-
-typedef struct
-{
- int i;
-} safe_referenced_var_iterator;
-
-/* This macro loops over all the referenced vars, one at a time, putting the
- current var in VAR. You are allowed to add referenced variables during the
- execution of this macro, however, the macro will not iterate over them. It
- requires a temporary vector of trees, VEC, whose lifetime is controlled by
- the caller. The purpose of the vector is to temporarily store the
- referenced_variables hashtable so that adding referenced variables does not
- affect the hashtable. */
-
-#define FOR_EACH_REFERENCED_VAR_SAFE(VAR, VEC, ITER) \
- for ((ITER).i = 0, fill_referenced_var_vec (&(VEC)); \
- VEC_iterate (tree, (VEC), (ITER).i, (VAR)); \
- (ITER).i++)
+ (VAR) = next_referenced_var (&(ITER)))
extern tree referenced_var_lookup (unsigned int);
extern bool referenced_var_check_and_insert (tree);
extern basic_block move_sese_region_to_fn (struct function *, basic_block,
basic_block, tree);
void remove_edge_and_dominated_blocks (edge);
-void mark_virtual_ops_in_bb (basic_block);
bool tree_node_can_be_shared (tree);
/* In tree-cfgcleanup.c */
/* In gimple-low.c */
extern void record_vars_into (tree, tree);
extern void record_vars (tree);
-extern bool block_may_fallthru (const_tree);
extern bool gimple_seq_may_fallthru (gimple_seq);
extern bool gimple_stmt_may_fallthru (gimple);
extern bool gimple_check_call_args (gimple);
extern void verify_ssa (bool);
extern void delete_tree_ssa (void);
extern bool ssa_undefined_value_p (tree);
+extern void warn_uninit (tree, const char *, void *);
+extern unsigned int warn_uninitialized_vars (bool);
extern void execute_update_addresses_taken (bool);
/* Call-back function for walk_use_def_chains(). At each reaching
#endif
/* In tree-ssa-ccp.c */
-bool fold_stmt (gimple_stmt_iterator *);
-bool fold_stmt_inplace (gimple);
-tree get_symbol_constant_value (tree);
tree fold_const_aggregate_ref (tree);
-bool may_propagate_address_into_dereference (tree, tree);
-
/* In tree-ssa-dom.c */
extern void dump_dominator_optimization_stats (FILE *);
/* In tree-ssa-loop*.c */
-void tree_ssa_lim (void);
+unsigned int tree_ssa_lim (void);
unsigned int tree_ssa_unswitch_loops (void);
unsigned int canonicalize_induction_variables (void);
unsigned int tree_unroll_loops_completely (bool, bool);
unsigned int tree_ssa_prefetch_arrays (void);
void tree_ssa_iv_optimize (void);
unsigned tree_predictive_commoning (void);
-tree canonicalize_loop_ivs (struct loop *, tree *);
+tree canonicalize_loop_ivs (struct loop *, tree *, bool);
bool parallelize_loops (void);
bool loop_only_exit_p (const struct loop *, const_edge);
tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *);
void estimate_numbers_of_iterations (void);
+bool array_at_struct_end_p (tree);
bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool);
bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool);
void free_numbers_of_iterations_estimates (void);
void free_numbers_of_iterations_estimates_loop (struct loop *);
void rewrite_into_loop_closed_ssa (bitmap, unsigned);
-void verify_loop_closed_ssa (void);
+void verify_loop_closed_ssa (bool);
bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
void create_iv (tree, tree, tree, struct loop *, gimple_stmt_iterator *, bool,
tree *, tree *);
char *get_lsm_tmp_name (tree, unsigned);
/* In tree-flow-inline.h */
-static inline bool is_call_clobbered (const_tree);
static inline void set_is_used (tree);
static inline bool unmodifiable_var_p (const_tree);
static inline bool ref_contains_array_ref (const_tree);
-static inline bool array_ref_contains_indirect_ref (const_tree);
/* In tree-eh.c */
extern void make_eh_edges (gimple);
};
struct affine_tree_combination;
-tree create_mem_ref (gimple_stmt_iterator *, tree,
+tree create_mem_ref (gimple_stmt_iterator *, tree,
struct affine_tree_combination *, tree, bool);
rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool);
void get_address_description (tree, struct mem_address *);
unsigned int execute_free_datastructures (void);
unsigned int execute_fixup_cfg (void);
+bool fixup_noreturn_call (gimple stmt);
+
+/* In ipa-pure-const.c */
+void warn_function_noreturn (tree);
#include "tree-flow-inline.h"