From 6be14c0ebc4ba0c43a78a54254c89e07cb2cfc48 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 16 Sep 2010 09:38:13 +0000 Subject: tree.c (tree_node_structure_for_code): TRANSLATION_UNIT_DECL is TS_TRANSLATION_UNIT_DECL. 2010-09-16 Richard Guenther * 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 --- gcc/java/ChangeLog | 5 +++++ gcc/java/jcf-parse.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'gcc/java') diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 2866cf9..4685dd4 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2010-09-16 Richard Guenther + + * jcf-parse.c (current_file_list): Remove. + (java_parse_file): Use build_translation_unit_decl. Adjust. + 2010-09-03 Joseph Myers * lang.opt (d): New. diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index cb486ae..908ed63 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -80,9 +80,6 @@ static GTY(()) tree parse_roots[2]; /* The METHOD_DECL for the current method. */ #define current_method parse_roots[1] -/* A list of TRANSLATION_UNIT_DECLs for the files to be compiled. */ -static GTY(()) VEC(tree,gc) *current_file_list; - /* Line 0 in current file, if compiling from bytecode. */ static location_t file_start_location; @@ -1840,9 +1837,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) duplicate_class_warning (IDENTIFIER_POINTER (node)); else { - tree file_decl = build_decl (input_location, - TRANSLATION_UNIT_DECL, node, NULL); - VEC_safe_push (tree, gc, current_file_list, file_decl); + build_translation_unit_decl (node); IS_A_COMMAND_LINE_FILENAME_P (node) = 1; } } @@ -1860,16 +1855,18 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) const char *resource_filename; /* Only one resource file may be compiled at a time. */ - assert (VEC_length (tree, current_file_list) == 1); + assert (VEC_length (tree, all_translation_units) == 1); - resource_filename = IDENTIFIER_POINTER (DECL_NAME (VEC_index (tree, current_file_list, 0))); + resource_filename + = IDENTIFIER_POINTER + (DECL_NAME (VEC_index (tree, all_translation_units, 0))); compile_resource_file (resource_name, resource_filename); goto finish; } current_jcf = main_jcf; - FOR_EACH_VEC_ELT (tree, current_file_list, ix, node) + FOR_EACH_VEC_ELT (tree, all_translation_units, ix, node) { unsigned char magic_string[4]; char *real_path; @@ -1956,7 +1953,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) } } - FOR_EACH_VEC_ELT (tree, current_file_list, ix, node) + FOR_EACH_VEC_ELT (tree, all_translation_units, ix, node) { input_location = DECL_SOURCE_LOCATION (node); if (CLASS_FILE_P (node)) -- cgit v1.1