diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1998-10-20 11:16:37 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1998-10-20 04:16:37 -0700 |
commit | b351b287b70b47f67c310858202042d6b270938a (patch) | |
tree | dfc31a7ace81e0e453bad8eb1c3f339df92a71cb /gcc/java/class.c | |
parent | 2331d640cee930caa1464c0d754846d339168bc8 (diff) | |
download | gcc-b351b287b70b47f67c310858202042d6b270938a.zip gcc-b351b287b70b47f67c310858202042d6b270938a.tar.gz gcc-b351b287b70b47f67c310858202042d6b270938a.tar.bz2 |
class.c (is_compiled_class): New local variable seen_in_zip.
Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (is_compiled_class): New local variable
seen_in_zip. Identify classes found in currently compiled source
file(s).
* decl.c (complete_start_java_method): Fixed typo.
* java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
(CLASS_P): Moved around.
(java_parse_abort_on_error): Macro moved from jcf-parse.c
* jcf-parse.c (java_parse_abort_on_error): Macro moved to
java-parse.h
(jcf_parse_source): Changed leading comment. Removed unnecessary
fclose and CLASS_FROM_SOURCE_P marking.
(parse_source_file): New local variables remember_for_generation
and filename. Mark parsed file name identifier node. Removed block
executed when parse_only was null. Set remember_for_generation.
Use it as an argument to java_pop_parser_context.
(yyparse): New local variables several_files, list, next node and
current_file_list. Split ampersand separated file names into
current_file_list. Iterate through the list and parse accordingly.
* parse.h (java_pop_parser_context): New function prototype.
* parse.y (ctxp_for_generation): New static global variable.
(java_pop_parser_context): New argument generate. Link popped ctxp
to ctxp_for_generation list accordingly.
(java_complete_expand_methods): Fixed indentation.
(java_expand_classes): New function.
Add support for the use of `&' as a file separator on the jc1 command
line.
From-SVN: r23201
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index ef01813..c637c76 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1131,6 +1131,7 @@ int is_compiled_class (class) tree class; { + int seen_in_zip; if (TREE_CODE (class) == POINTER_TYPE) class = TREE_TYPE (class); if (TREE_CODE (class) != RECORD_TYPE) /* Primitive types are static. */ @@ -1139,18 +1140,21 @@ is_compiled_class (class) return 0; if (class == current_class) return 2; - if ((TYPE_LANG_SPECIFIC (class) && TYPE_LANG_SPECIFIC (class)->jcf && - TYPE_LANG_SPECIFIC (class)->jcf->seen_in_zip)) + + seen_in_zip = (TYPE_LANG_SPECIFIC (class) && TYPE_LANG_SPECIFIC (class)->jcf + && TYPE_LANG_SPECIFIC (class)->jcf->seen_in_zip); + if (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P (class) || seen_in_zip) { /* The class was seen in the current ZIP file and will be available as a compiled class in the future but may not have been loaded already. Load it if necessary. This prevent - build_class_ref () from crashing. This should take into - consideration class specified in a multiple class file - command line. FIXME if necessary. */ + build_class_ref () from crashing. */ - if (!CLASS_LOADED_P (class)) + if (seen_in_zip && !CLASS_LOADED_P (class)) load_class (class, 1); + + /* We return 2 for class seen in ZIP and class from files + belonging to the same compilation unit */ return 2; } |