aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2013-10-09 13:42:17 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2013-10-09 13:42:17 +0000
commitcc524fc7b800bff51dc86d05d8ce80d9c5524ef3 (patch)
tree40318ce4bf8ae61fbdc6507579e982b6008fb23f /gcc/tree.h
parent713438778be52a0cb0533fad271c05481435b519 (diff)
downloadgcc-cc524fc7b800bff51dc86d05d8ce80d9c5524ef3.zip
gcc-cc524fc7b800bff51dc86d05d8ce80d9c5524ef3.tar.gz
gcc-cc524fc7b800bff51dc86d05d8ce80d9c5524ef3.tar.bz2
tree-flow.h (tm_restart_node, gimple_df): Move to gimple-ssa.h.
* tree-flow.h (tm_restart_node, gimple_df): Move to gimple-ssa.h. (struct int_tree_map): Move to tree-hasher.h (SCALE, LABEL, PERCENT): Move to gimple.h * tree-flow-inline.h: Delete. Move functions to other files. (unmodifiable_var_p, ref_contains_array_ref): Unused, so delete. * gimple-ssa.h (tm_restart_node, gimple_df): Relocate from tree-flow.h. (gimple_in_ssa_p, gimple_vop): Relocate from tree-flow-inline.h * gimple.h (imple_stmt_max_uid, set_gimple_stmt_max_uid, inc_gimple_stmt_max_uid, get_lineno): Relocate from tree-flow-inline.h. (SCALE, LABEL, PERCENT): Relocate from tree-flow.h * tree-hasher.h: Don't include tree-flow.h. (struct int_tree_map): Relocate from tree-flow.h. * tree-sra.c (contains_view_convert_expr_p): Relocate from tree-flow-inline.h and make static. * tree-ssa-alias.h (ranges_overlap_p): Relocate from tree-flow-inline.h. * tree-ssa-operands.c (gimple_ssa_operands): Relocate from tree-flow-inline.h and make static. * tree.h (is_global_var, may_be_aliased): Relocate from tree-flow-inline.h. * Makefile.in (GTFILES): Remove tree-flow.h and add gimple-ssa.h. * value-prof.c: No longer include tree-flow-inline.h. * tree-switch-conversion.c: No longer include tree-flow-inline.h. From-SVN: r203318
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 8a6a8f3..fa9d605 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4951,6 +4951,31 @@ builtin_decl_implicit_p (enum built_in_function fncode)
&& builtin_info.implicit_p[uns_fncode]);
}
+/* Return true if T (assumed to be a DECL) is a global variable.
+ A variable is considered global if its storage is not automatic. */
+
+static inline bool
+is_global_var (const_tree t)
+{
+ return (TREE_STATIC (t) || DECL_EXTERNAL (t));
+}
+
+/* Return true if VAR may be aliased. A variable is considered as
+ maybe aliased if it has its address taken by the local TU
+ or possibly by another TU and might be modified through a pointer. */
+
+static inline bool
+may_be_aliased (const_tree var)
+{
+ return (TREE_CODE (var) != CONST_DECL
+ && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
+ && TREE_READONLY (var)
+ && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))
+ && (TREE_PUBLIC (var)
+ || DECL_EXTERNAL (var)
+ || TREE_ADDRESSABLE (var)));
+}
+
/* For anonymous aggregate types, we need some sort of name to
hold on to. In practice, this should not appear, but it should
not be harmful if it does. */