summaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index cb486ae111e..908ed63e205 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))