aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-09-16 09:38:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-09-16 09:38:13 +0000
commit6be14c0ebc4ba0c43a78a54254c89e07cb2cfc48 (patch)
treedb74c86f639c1dd58991243eee16d61445974c50 /gcc/tree.h
parent0c3dbcf05753a1e3d817b77db96e87eab72c91f6 (diff)
downloadgcc-6be14c0ebc4ba0c43a78a54254c89e07cb2cfc48.zip
gcc-6be14c0ebc4ba0c43a78a54254c89e07cb2cfc48.tar.gz
gcc-6be14c0ebc4ba0c43a78a54254c89e07cb2cfc48.tar.bz2
tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL is TS_TRANSLATION_UNIT_DECL.
2010-09-16 Richard Guenther <rguenther@suse.de> * tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL is TS_TRANSLATION_UNIT_DECL. (initialize_tree_contains_struct): Adjust. (all_translation_units): New global vector. (build_translation_unit_decl): New function. * tree.h (TRANSLATION_UNIT_LANGUAGE): New macro. (struct tree_translation_unit_decl): New. (all_translation_units): Declare. (union tree_node): Add translation_unit_decl member. (build_translation_unit_decl): Declare. * treestruct.def (TS_TRANSLATION_UNIT_DECL): New. * lto-streamer-out.c (pack_ts_translation_unit_decl_value_fields): New function. (pack_value_fields): Call it. (lto_output_tree_ref): Handle references to TRANSLATION_UNIT_DECL. (lto_output_ts_translation_unit_decl_tree_pointers): New function. (lto_output_tree_pointers): Call it. * lto-streamer-in.c (lto_input_tree_ref): Handle references to TRANSLATION_UNIT_DECL. (unpack_ts_translation_unit_decl_value_fields): New function. (unpack_value_fields): Call it. (lto_input_ts_translation_unit_decl_tree_pointers): New function. (lto_input_tree_pointers): Call it. * lto-streamer.c (check_handled_ts_structures): Adjust. * lto-streamer.h (enum LTO_tags): Add LTO_translation_unit_decl_ref. * c-decl.c (all_translation_units): Remove. (pop_scope): Use build_translation_unit_decl. (collect_all_refs): Adjust. (for_each_global_decl): Likewise. (c_write_global_declarations): Likewise. java/ * jcf-parse.c (current_file_list): Remove. (java_parse_file): Use build_translation_unit_decl. Adjust. From-SVN: r164331
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index d261c3f..1ff9d35 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3385,6 +3385,23 @@ struct GTY(()) tree_function_decl {
/* 3 bits left */
};
+/* The source language of the translation-unit. */
+#define TRANSLATION_UNIT_LANGUAGE(NODE) \
+ (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
+
+/* TRANSLATION_UNIT_DECL inherits from DECL_MINIMAL. */
+
+struct GTY(()) tree_translation_unit_decl {
+ struct tree_decl_common common;
+ /* Source language of this translation unit. Used for DWARF output. */
+ const char * GTY((skip(""))) language;
+ /* TODO: Non-optimization used to build this translation unit. */
+ /* TODO: Root of a partial DWARF tree for global types and decls. */
+};
+
+/* A vector of all translation-units. */
+extern GTY (()) VEC(tree,gc) *all_translation_units;
+
/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
#define DECL_ORIGINAL_TYPE(NODE) \
(TYPE_DECL_CHECK (NODE)->decl_non_common.result)
@@ -3490,6 +3507,8 @@ union GTY ((ptr_alias (union lang_tree_node),
struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
+ struct tree_translation_unit_decl GTY ((tag ("TS_TRANSLATION_UNIT_DECL")))
+ translation_unit_decl;
struct tree_type GTY ((tag ("TS_TYPE"))) type;
struct tree_list GTY ((tag ("TS_LIST"))) list;
struct tree_vec GTY ((tag ("TS_VEC"))) vec;
@@ -4048,6 +4067,7 @@ extern tree build_decl_stat (location_t, enum tree_code,
tree, tree MEM_STAT_DECL);
extern tree build_fn_decl (const char *, tree);
#define build_decl(l,c,t,q) build_decl_stat (l,c,t,q MEM_STAT_INFO)
+extern tree build_translation_unit_decl (tree);
extern tree build_block (tree, tree, tree, tree);
extern tree build_empty_stmt (location_t);
extern tree build_omp_clause (location_t, enum omp_clause_code);