summaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-06 04:22:11 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-06 04:22:11 +0000
commit437f5d6b63de42b928cc20f255b172d1f22e9d98 (patch)
tree88dba83e793d94c96e1d4866470453d1f88073c6 /gcc/tree.h
parent0811bc7e12bccb801de8d103c76730a220c73a55 (diff)
downloadgcc-437f5d6b63de42b928cc20f255b172d1f22e9d98.tar.gz
In gcc/
2005-12-05 Daniel Berlin <dberlin@dberlin.org> * print-tree.c (print_node): Ditto. * tree-dfa.c (add_referenced_var): Tag's don't have DECL_INITIAL. * tree-dump.c (dequeue_and_dump): Check for decl_common structure before accessing DECL_ARTIFICIAL. Handle new tag tree codes. * tree-flow-inline.h (clear_call_clobbered): Update for tag changes. (unmodifiable_var_p): Ditto. * tree-flow.h (mem_tag_kind): Remove. (struct var_ann_d): Remove mem_tag_kind member. * tree-gimple.c (is_gimple_reg): Tags are not gimple registers. * tree-pretty-print.c (dump_generic_node): Handle memory tags. * tree-ssa-alias.c (init_alias_info): Update for memory tag changes. (group_aliases): Ditto. (setup_pointers_and_addressables): Ditto. (is_escape_site): Ditto. (may_alias_p): Ditto. (create_tag_raw): New function. (create_memory_tag): Use it. (dump_alias_info): Update for tags. (may_be_aliased): Ditto. (add_type_alias): Ditto. (new_type_alias): Ditto. (create_sft): Ditto. (create_structure_vars): Ditto. * tree-ssa-ccp.c (get_default_value): Ditto. * tree-ssa-operands.c (get_expr_operands): Ditto. (add_stmt_operand): Ditto. (add_call_clobber_ops): Remove duplicated condition. * tree-ssa.c (verify_flow_insensitive_alias_info): Update for tags. * tree-tailcall.c (suitable_for_tail_opt_p): Ditto. * tree-vect-transform.c (vect_create_data_ref_ptr): Ditto. * tree.c (init_ttree): Update structures for new tree codes. (tree_code_size): Update sizes for new tree codes. (make_node_stat): Don't try to set common things on minimal structures. (tree_node_structure): Update for tags. (is_global_var): Ditto. * tree.def: Add new tree codes. * tree.h (MTAG_P): New macro. (TREE_MEMORY_TAG_CHECK): Ditto. (SSA_VAR_P): Update for tags. (struct tree_memory_tag): New structure. (MTAG_GLOBAL): New macro. (union tree_node): Add memory tag member. * treestruct.def (TS_MEMORY_TAG): New. In gcc/cp 2005-12-05 Daniel Berlin <dberlin@dberlin.org> * ptree.c (cxx_print_decl): Update to check for decl_common structure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h46
1 files changed, 38 insertions, 8 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 6946dd450a8..99c18f4e1a6 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -100,6 +100,14 @@ extern const enum tree_code_class tree_code_type[];
#define DECL_P(CODE)\
(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration)
+/* Nonzero if CODE represents a memory tag. */
+
+#define MTAG_P(CODE) \
+ (TREE_CODE (CODE) == STRUCT_FIELD_TAG \
+ || TREE_CODE (CODE) == NAME_MEMORY_TAG \
+ || TREE_CODE (CODE) == TYPE_MEMORY_TAG)
+
+
/* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL. */
#define VAR_OR_FUNCTION_DECL_P(DECL)\
@@ -692,6 +700,7 @@ extern void tree_operand_check_failed (int, enum tree_code,
#define TYPE_CHECK(T) TREE_CLASS_CHECK (T, tcc_type)
#define DECL_MINIMAL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
+#define TREE_MEMORY_TAG_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_MEMORY_TAG)
#define DECL_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
#define DECL_WRTL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
#define DECL_WITH_VIS_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
@@ -1972,14 +1981,16 @@ struct tree_binfo GTY (())
/* Define fields and accessors for nodes representing declared names. */
/* Nonzero if DECL represents a variable for the SSA passes. */
-#define SSA_VAR_P(DECL) \
- (TREE_CODE (DECL) == VAR_DECL \
- || TREE_CODE (DECL) == PARM_DECL \
- || TREE_CODE (DECL) == RESULT_DECL \
- || (TREE_CODE (DECL) == SSA_NAME \
- && (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL \
- || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL \
- || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL)))
+#define SSA_VAR_P(DECL) \
+ (TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == PARM_DECL \
+ || TREE_CODE (DECL) == RESULT_DECL \
+ || MTAG_P (DECL) \
+ || (TREE_CODE (DECL) == SSA_NAME \
+ && (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL \
+ || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL \
+ || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL \
+ || MTAG_P (SSA_NAME_VAR (DECL)))))
@@ -2038,6 +2049,24 @@ struct tree_decl_minimal GTY(())
tree context;
};
+/* When computing aliasing information, we represent the memory pointed-to
+ by pointers with artificial variables called "memory tags" (MT). There
+ are two kinds of tags: type and name. Type tags (TMT) are used in
+ type-based alias analysis, they represent all the pointed-to locations
+ and variables of the same alias set class. Name tags (NMT) are used in
+ flow-sensitive points-to alias analysis, they represent the variables
+ and memory locations pointed-to by a specific SSA_NAME pointer. */
+
+struct tree_memory_tag GTY(())
+{
+ struct tree_decl_minimal common;
+ tree parent_var;
+ unsigned int is_global:1;
+};
+
+#define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
+#define SFT_PARENT_VAR(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->mtag.parent_var)
+
/* For any sort of a ..._DECL node, this points to the original (abstract)
decl node which this decl is an instance of, or else it is NULL indicating
that this decl is not an instance of some other decl. For example,
@@ -2834,6 +2863,7 @@ union tree_node GTY ((ptr_alias (union lang_tree_node),
struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
+ struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
};
/* Standard named or nameless data types of the C compiler. */