]> gcc.gnu.org Git - gcc.git/blob - gcc/java/ChangeLog
[multiple changes]
[gcc.git] / gcc / java / ChangeLog
1 1998-10-22 Tom Tromey <tromey@cygnus.com>
2
3 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
4
5 Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
6
7 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
8 (JV_SCAN_SOURCES): New macro.
9 (JCF_DUMP_SOURCES): Likewise.
10 (jcf-dump$(exeext)): New target.
11 (jv-scan$(exeext)): New target.
12
13 1998-10-22 Tom Tromey <tromey@cygnus.com>
14
15 * Makefile.in (LEX): Removed.
16 (LEXFLAGS): Likewise.
17 (SET_BISON): New macro.
18 (BISON): Removed.
19 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
20 spurious diffs in parse.c.
21 ($(PARSE_SCAN_C)): Likewise.
22 (PARSE_DIR): New macro.
23 (PARSE_C): Use it.
24 (PARSE_SCAN_C): Likewise.
25 (PARSE_RELDIR): New macro.
26
27 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
28
29 * jcf-io.c (find_class): Use saw_java_source to determine when to
30 look for `.java' file.
31 * jcf-parse.c (saw_java_source): New global.
32 (yyparse): Set it if `.java' file seen.
33
34 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
35 (GCJH_SOURCES): Likewise.
36 * Makefile.in (datadir): New macro.
37 (libjava_zip): Likewise.
38 (JAVA_OBJS): Added jcf-path.o.
39 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
40 (../gcjh$(exeext)): Likewise.
41 (jcf-path.o): New target.
42 * java-tree.h (fix_classpath): Removed decl.
43 * jcf-parse.c (fix_classpath): Removed.
44 (load_class): Don't call fix_classpath.
45 * parse.y (read_import_dir): Don't call fix_classpath.
46 * lex.h: Don't mention classpath.
47 * lex.c (java_init_lex): Don't initialize classpath.
48 * jcf-io.c (classpath): Removed global.
49 (find_class): Use jcf_path iteration functions. Correctly search
50 class path for .java file.
51 (open_in_zip): New argument `is_system'.
52 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
53 classpath-related options.
54 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
55 and -I.
56 (lang_init): Call jcf_path_init.
57 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
58 * lang-specs.h: Handle -I. Minor cleanup to -M options.
59 Correctly put braces around second string in each entry.
60 * gjavah.c (main): Call jcf_path_init. Recognize all the new
61 classpath-related options.
62 (help): Updated for new options.
63 * jcf.h: Declare functions from jcf-path.c. Don't mention
64 `classpath' global.
65 * jcf-path.c: New file.
66
67 * jcf-depend.c: Include jcf.h.
68
69 * jcf-write.c (localvar_alloc): Returns `void'.
70 (localvar_free): Removed unused variable.
71
72 * lang.c (OBJECT_SUFFIX): Define if not already defined.
73 (init_parse): Use OBJECT_SUFFIX, not ".o".
74
75 Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
76
77 * class.c (emit_register_classes): Renamed from
78 emit_register_class.
79 * java-tree.h (emit_register_classes): Prototype renamed from
80 emit_register_class.
81 * jcf-parse.c (yyparse): Call emit_register_classes once before
82 returning.
83 * parse.y (java_expand_classes): No longer register classes.
84
85 Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
86
87 * class.c (is_compiled_class): New local variable
88 seen_in_zip. Identify classes found in currently compiled source
89 file(s).
90 * decl.c (complete_start_java_method): Fixed typo.
91 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
92 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
93 (CLASS_P): Moved around.
94 (java_parse_abort_on_error): Macro moved from jcf-parse.c
95 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
96 java-parse.h
97 (jcf_parse_source): Changed leading comment. Removed unnecessary
98 fclose and CLASS_FROM_SOURCE_P marking.
99 (parse_source_file): New local variables remember_for_generation
100 and filename. Mark parsed file name identifier node. Removed block
101 executed when parse_only was null. Set remember_for_generation.
102 Use it as an argument to java_pop_parser_context.
103 (yyparse): New local variables several_files, list, next node and
104 current_file_list. Split ampersand separated file names into
105 current_file_list. Iterate through the list and parse accordingly.
106 * parse.h (java_pop_parser_context): New function prototype.
107 * parse.y (ctxp_for_generation): New static global variable.
108 (java_pop_parser_context): New argument generate. Link popped ctxp
109 to ctxp_for_generation list accordingly.
110 (java_complete_expand_methods): Fixed indentation.
111 (java_expand_classes): New function.
112
113 Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
114
115 * Makefile.in: Link with libiberty.a instead of memmove.o.
116
117 Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
118
119 * lex.c (setjmp.h): No longer included.
120 * lex.h (setjmp.h): Included.
121 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
122 (duplicate_declaration_error_p): Renamed from
123 duplicate_declaration_error.
124 (build_array_from_name): New function prototype.
125 * parse.y (setjmp.h): No longer included.
126 (variable_declarator_id): Define action.
127 (build_array_from_name): New function.
128 (duplicate_declaration_error_p): Renamed from
129 duplicate_declaration_error. Fixed leading comment.
130 (register_fields): Main `for' loop reorganized. Uses
131 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
132 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
133 build_array_from_name.
134 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
135 types.
136 (read_import_dir): Don't try to skip `.' and `..'.
137 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
138 build_array_from_name. Main `for' loop reorganized.
139 (resolve_qualified_expression_name): When building access to a
140 field, use the type where the field was found, not its own type.
141 (maybe_access_field): Use field DECL_CONTEXT if the type where the
142 field was found is null.
143 (qualify_ambiguous_name): Sweep through all successive array
144 dimensions.
145
146 Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
147
148 * java-tree.h (pop_labeled_block, lang_printable_name,
149 maybe_add_interface, set_super_info, get_access_flags_from_decl,
150 interface_of_p, inherits_from_p, fix_classpath,
151 complete_start_java_method, emit_handlers, init_outgoing_cpool,
152 make_class_data, register_class, alloc_name_constant): New
153 function prototypes.
154 * lang.c (lang_decode_option): Set argc argument unused. Fixed
155 indentation. Added cast to remove warning.
156 (lang_printable_name): Set v argument unused.
157 (lang_print_error): Added argument to lang_printable_name call.
158 (java_dummy_print, print_lang_decl, print_lang_type,
159 print_lang_identifier, lang_print_xnode): All argument marked
160 unused.
161 * lex.c (java_unget_unicode): Removed unnecessary argument.
162 (java_allocate_new_line): Unused local variable is gone.
163 (java_read_char): Added parenthesis in expressions to remove
164 warnings. Added final return statement.
165 (java_read_unicode): Added parenthesis in expression to remove
166 warning.
167 (java_parse_end_comment): Fixed java_unget_unicode invocation.
168 (java_parse_escape_sequence): Likewise.
169 (java_lex): Unused local variables are gone. Fixed
170 java_unget_unicode invocation.
171 * lex.h (set_float_handler): Prototype added when JC1_LITE not
172 defined.
173 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
174 lang_printable_name invocation in macro.
175 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
176 Likewise.
177 (duplicate_declaration_error): Suppressed unused argument in
178 prototype.
179 (identical_subpath_p): Function declaration is gone.
180 (patch_invoke): Suppressed unused argument in prototype.
181 (patch_cast, build_labeled_block, check_thrown_exceptions):
182 Likewise.
183 * parse.y (setjmp.h): Included
184 (toplev.h): Likewise.
185 (field_declaration:): Suppressed unused local
186 (label_decl:): Fixed build_labeled_block invocation.
187 (java_pop_parser_context): Put extra parenthesis around assignment
188 in if.
189 (yyerror): Suppressed unused local variables.
190 (variable_redefinition_error): Fixed lang_printable_name
191 invocation.
192 (create_interface): Suppressed unused local variables.
193 (create_class): Likewise.
194 (duplicate_declaration_error): Suppressed unused argument. Fixed
195 lang_printable_name invocation.
196 (register_fields): Suppressed unused local variable. Fixed
197 duplicate_declaration_error invocation.
198 (method_header): Suppressed unused local variable.
199 (method_declarator, parser_check_super): Likewise.
200 (java_complete_class): Suppressed unused local variable. Fixed
201 fatal error message.
202 (complete_class_report_errors): Added default: in switch.
203 (java_check_regular_methods): Fixed lang_printable_name
204 invocations.
205 (check_throws_clauses): Likewise.
206 (java_check_abstract_methods): Suppressed unused local
207 variable. Fixed lang_printable_name invocation.
208 (read_import_entry): Added supplemental return statement.
209 (read_import_dir): Suppressed unused local variables.
210 (check_pkg_class_access, declare_local_variables): Likewise.
211 (source_start_java_method): Suppressed unused extern variable
212 declarations
213 (expand_start_java_method): Suppressed unused extern and local
214 variable declarations.
215 (java_complete_expand_methods): Likewise.
216 (java_complete_expand_method): Suppressed unused local variables.
217 (make_qualified_name): Likewise.
218 (resolve_qualified_expression_name): Added default: in
219 switch. Fixed lang_printable_name invocation.
220 (class_instance_creation_expression): Added parenthesis around
221 expressions.
222 (patch_method_invocation_stmt): Fixed lang_printable_name and
223 patch_invoke invocations.
224 (check_for_static_method_reference): Fixed lang_printable_name
225 invocation.
226 (patch_invoke): Suppressed unused arguments and local variables.
227 (lookup_method_invoke): Suppressed unused local variables.
228 (qualify_ambiguous_name): Added default: in switch.
229 (identical_subpath_p): Function removed.
230 (patch_assignment): Suppressed unused local variables. Suppressed
231 unnecessary if statement. Fixed lang_printable_name invocations.
232 (try_builtin_assignconv): Fixed lang_printable_name invocations.
233 (valid_ref_assignconv_cast_p): Parenthesis around
234 expression. Suppressed unused local variables.
235 (build_binop): Suppressed unused local variables. fixed
236 lang_printable_name invocations.
237 (string_constant_concatenation): Suppressed unused local
238 variables.
239 (patch_unaryop): Fixed lang_printable_name invocation.
240 (patch_cast): Suppressed unnecessary argument. Fixed
241 lang_printable_name invocation.
242 (patch_array_ref): Fixed lang_printable_name invocation.
243 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
244 (build_labeled_block): Suppressed unused argument.
245 (generate_labeled_block): Fixed build_labeled_block invocation.
246 (build_loop_body): Suppressed unused local variables.
247 (patch_loop_statement): Likewise.
248 (patch_exit): Fixed lang_printable_name invocation.
249 (patch_switch_statement): Likewise.
250 (case_identity): First argument marked unused.
251 (patch_try_statement): Fixed lang_printable_name invocations.
252 (patch_synchronized_statement, patch_throw_statement): Likewise.
253 (check_thrown_exceptions): Fixed check_thrown_exceptions and
254 lang_printable_name invocations.
255 (check_thrown_exceptions_do): Suppressed unused argument.
256
257 1998-10-14 Tom Tromey <tromey@cygnus.com>
258
259 * jcf-write.c (write_classfile): Add output class file as target.
260 * lang-options.h: Added -MD, -MMD, -M, and -MM.
261 * jcf.h: Added declarations for dependency-tracking functions.
262 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
263 * lang.c (lang_decode_option): Recognize -MD and -MMD.
264 (finish_parse): Call jcf_dependency_write.
265 (dependency_tracking): New global.
266 (DEPEND_SET_FILE): New define.
267 (DEPEND_ENABLE): New define.
268 (init_parse): Enable dependency tracking if required.
269 Include "flags.h".
270 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
271 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
272 (../gcjh$(exeext)): Likewise.
273 (jcf-depend.o): New target.
274 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
275 (GCJH_SOURCES): Likewise.
276 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
277 dep_name argument.
278 (find_classfile): Added dep_name argument.
279 (find_class): Compute name of dependency.
280 (open_in_zip): Call jcf_dependency_add_file.
281 * gjavah.c (output_file): No longer global.
282 (usage): Don't mention "gjavah".
283 (help): Likewise.
284 (java_no_argument): Likewise.
285 (version): Likewise.
286 (main): Recognize and handle -M family of options.
287 (print_mangled_classname): Return is void.
288 (process_file): Handle case where output is suppressed.
289 (HANDLE_END_FIELD): Likewise.
290 (HANDLE_METHOD): Likewise.
291 * jcf-depend.c: New file.
292
293 Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
294
295 * java-tree.def: Add missing newline at EOF.
296
297 1998-10-13 Tom Tromey <tromey@cygnus.com>
298
299 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
300 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
301 function.
302 Include <config.h> and "system.h".
303 (disassemble_method): Undefine RET to avoid clash with
304 config/i386/i386.h.
305
306 Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
307
308 * decl.c (runtime_exception_type_node, error_exception_type_node):
309 New global variables.
310 (init_decl_processing): Initialized.
311 * expr.c (java_lang_expand_expr): Set caught exception type to
312 null if catch handler argument doesn't exit.
313 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
314 tree codes.
315 * java-tree.h (runtime_exception_type_node,
316 error_exception_type_node): Global variables declared.
317 (DECL_FUNCTION_THROWS): New macro.
318 (DECL_FUNCTION_BODY): Modified comment.
319 (DECL_SPECIFIC_COUNT): Likewise.
320 (struct lang_decl): New field throws_list.
321 (IS_UNCHECKED_EXPRESSION_P): New macro.
322 * lex.c (java_lex): Generate location information for THROW_TK.
323 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
324 EXCEPTIONS_P): New macros.
325 (enum jdep_code): New value JDEP_EXCEPTION.
326 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
327 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
328 PATCH_METHOD_RETURN_ERROR): New macros.
329 (patch_method_invocation_stmt): Added new argument to prototype.
330 (patch_synchronized_statement, patch_throw_statement,
331 check_thrown_exceptions, check_thrown_exceptions_do,
332 purge_unchecked_exceptions, check_throws_clauses): New function
333 prototypes.
334 * parse.y Fixed typo in keyword section.
335 (throw:): Rule tagged <node>.
336 (THROW_TK): Keyword tagged <operator>.
337 (method_header:): Last argument to call to method_header passed
338 from throws: rule.
339 (throws:, class_type_list:, throw_statement:,
340 synchronized_statement:, synchronized:): Defined actions.
341 (method_header): New local variable current. Register exceptions
342 from throws clause.
343 (java_complete_tree): Complete and verify exceptions from throws
344 clause.
345 (complete_class_report_errors): Error message on exceptions not
346 found
347 (java_check_regular_methods): Fixed typo. Shortcut on private
348 overriding methods. Changed error message on method
349 redefinition. Check for throws clause compatibility.
350 (check_throws_clauses): New function.
351 (java_check_abstract_methods): Use DECL_NAME for wfl or current
352 method. Changed error message on method redefinition.
353 (currently_caught_type_list): New static variable.
354 (java_complete_expand_methods): Purge unchecked exceptions from
355 throws clause list. Call PUSH_EXCEPTIONS before walk and
356 POP_EXCEPTIONS after.
357 (resolve_qualified_expression_name): Pass new argument as NULL to
358 patch_method_invocation_stmt.
359 (patch_method_invocation_stmt): New argument ref_decl. Invoke
360 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
361 argument list when appropriate. Use new argument if non null to
362 store selected method decl.
363 (patch_invoke): Convert if necessary args of builtin types before
364 forming CALL_EXPR. Argument list no longer reversed here.
365 (invocation_mode): Treat final methods as static methods.
366 (java_complete_tree): New cases for THROW_EXPR: and
367 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
368 function call.
369 (complete_function_arguments): No more RECORD_TYPE
370 conversion. Function parameter nodes no longer saved.
371 (valid_ref_assignconv_cast_p): Avoid handling null type.
372 (patch_binop): Fixed null constant reference handling.
373 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
374 BUILD_THROW macros.
375 (patch_try_statement): Fixed comments. Record caught types in
376 list, push the list, expand try block and pop the list.
377 (patch_synchronized_statement, patch_throw_statement,
378 check_thrown_exceptions, check_thrown_exceptions_do,
379 purge_unchecked_exceptions): New functions.
380 * typeck.c (lookup_argument_method): Allow WFL in place of method
381 DECL_NAME during method definition check
382
383 1998-10-09 Tom Tromey <tromey@cygnus.com>
384
385 * gjavah.c (decode_signature_piece): New function.
386 (print_c_decl): Use it. Added `name_override' argument.
387 (print_method_info): Use name_override argument to print_c_decl.
388 (seen_fields): Removed.
389 (print_field_info): Don't update seen_fields.
390 (struct method_name): New structure.
391 (method_name_list): New global.
392 (print_method_info): Add new method to list of methods.
393 (name_is_method_p): New function.
394 (print_field_info): If field name has same name as method, then
395 change field name.
396 (process_file): Parse methods before fields.
397 (field_pass): New global.
398 (HANDLE_END_FIELD): Take field_pass into account.
399
400 Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
401
402 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
403 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
404
405 Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
406
407 * jvspec.c: Fix bug in jvgenmain_spec patch.
408
409 Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
410
411 * Makefile.in (lang.o:): Install dependency on java-tree.def.
412 * decl.c (soft_exceptioninfo_call_node): New global variable.
413 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
414 takes extra integer argument. soft_exceptioninfo_call_node
415 initialized.
416 * except.c (java_set_exception_lang_code): New function
417 (method_init_exceptions): Called here.
418 (prepare_eh_table_type): New function.
419 (expand_end_java_handler): Called here.
420 * expr.c (build_java_throw_out_of_bounds_exception): Now features
421 one argument. Modified generation of call to
422 soft_badarrayindex_node to use new argument.
423 (build_java_arrayaccess): Pass faulty index value to
424 build_java_throw_out_of_bounds_exception.
425 (generate_name): New function.
426 (java_lang_expand_expr): New local variables node, current,
427 has_finally_p. Expand TRY_EXPR node.
428 (process_jvm_instruction): Replace top of the stack with thrown
429 object reference when entering exception handler.
430 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
431 specific tree codes.
432 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
433 global.
434 (DECL_SPECIFIC_COUNT): New macro.
435 (prepare_eh_table_type, java_set_exception_lang_code,
436 generate_name): New function declarations.
437 (match_java_method): Declaration deleted.
438 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
439 macros.
440 * lex.c (TRY_TK, CATCH_TK): Generate location information.
441 * parse.h (redefinition_error, refine_accessible_methods_list,
442 can_cast_to_p): Function declaration removed.
443 (classitf_redefinition_error, variable_redefinition_error,
444 parse_jdk1_1_error, find_applicable_accessible_methods_list,
445 find_most_specific_methods_list, argument_types_convertible,
446 enter_a_block, valid_builtin_assignconv_identity_widening_p,
447 valid_cast_to_p, valid_method_invocation_conversion_p,
448 try_reference_assignconv, add_stmt_to_compound,
449 build_jump_to_finally, build_tree_list, patch_try_statement,
450 java_get_catch_block): New function declarations.
451 * parse.y (string_buffer_type): Global variable deleted.
452 (group_of_labels, catches, catch_clause, catch_clause_parameter,
453 finally): Rules tagged <node>.
454 (TRY_TK, CATCH_TK): Token tagged <operator>.
455 (class_body_declaration:, class_member_declaration:,
456 formal_parameter:, explicit_constructor_invocation:,
457 interface_member_declaration:, constant_declaration:,
458 primary_no_new_array:, class_instance_creation_expression:,
459 array_creation_expression:): Issue error on unsuported JDK1.1
460 features.
461 (try_statement:, catches:, finally:): Define actions.
462 (catch_clause_parameter): New rule.
463 (catch_clause:): Use new rule catch_clause_parameter.
464 (parse_jdk1_1_error): New function.
465 (redefinition_error): Renamed classitf_redefinition_error.
466 (variable_redefinition_error): New function.
467 (check_class_interface_creation): Call
468 classitf_redefinition_error.
469 (java_complete_tree): Added error message on JDEP_TYPE: case.
470 (complete_class_report_errors): Fixed indentation.
471 (declare_local_variables): Call variable_redefinition_error.
472 (source_end_java_method): Call java_set_exception_lang_code and
473 emit_handlers where appropriate.
474 (java_method_add_stmt): Call add_stmt_to_block.
475 (add_stmt_to_block): New function.
476 (lookup_method_invoke): Fixed outside comment. new local variable
477 candicates. Call find_applicable_accessible_methods_list and
478 find_most_specific_methods_list when searching for a
479 method. Modified error report to list possible candidates when
480 applicable.
481 (find_applicable_accessible_methods_list,
482 find_most_specific_methods_list, argument_types_convertible): New
483 function.
484 (refine_accessible_methods_list): Function deleted.
485 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
486 expr (if applicable) before calling patch_array_ref.
487 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
488 (enter_block): Fixed comment.
489 (enter_a_block): New function.
490 (patch_assignment): Reorganized. Call try_reference_assignconv for
491 references. Call valid_cast_to_p instead of can_cast_to_p.
492 (try_reference_assignconv,
493 valid_builtin_assignconv_identity_widening_p): New functions.
494 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
495 (valid_cast_to_p, valid_method_invocation_conversion_p): New
496 functions.
497 (build_string_concatenation): Don't resolve StringBuffer.
498 (patch_cast): Fixed inverted arguments.
499 (patch_array_ref): Code to save array expr deleted. Call
500 valid_cast_to_p instead of can_cast_to_p.
501 (generate_labeled_block): Call generate_name.
502 (build_jump_to_finally, build_try_statement, java_get_catch_block,
503 patch_try_statement): New functions.
504 * typeck.c (match_java_method): Function deleted.
505
506 Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
507
508 * jvspec.c: jvgenmain_spec uses different temporary file names.
509
510 Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
511
512 * jvspec.c (lang_specific_driver): Fail if user specifies
513 --main= when not linking.
514
515 Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
516
517 * class.c (make_class_data): Push value for `thread' field.
518 * decl.c (init_decl_processing): Added `thread' field to class.
519
520 * class.c (add_field): Always make static fields externally
521 visible.
522
523 Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
524
525 * expr.c (build_java_athrow,
526 build_java_throw_out_of_bounds_exception, expand_invoke,
527 build_newarray, expand_java_multianewarray, build_java_monitor):
528 Update comments to reflect _Jv_* function names.
529
530 Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
531
532 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
533 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
534 * parse.y (expand_start_java_method): Likewise.
535
536 Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
537
538 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
539
540 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
541 (add_field): No longer need to convert from RECORD_TYPE to pointer,
542 * expr.c: Remove no-longer-needed calls to promote_type.
543 * decl.c (give_name_to_locals): Liekwise.
544 * jcf-parse.c (get_class_constant): Compensate for new signatures.
545 * parse.y: Add/remove promote_type calls as appropriate.
546 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
547 (parse_signature_string): Likewise.
548 (build_java_array_type): Fix for now signature convenions.
549
550 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
551
552 Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
553
554 * class.c (init_class_processing): libjava function renamed to
555 _Jv_RegisterClass.
556
557 Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
558
559 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
560 * java-tree.def: Fixed DEFTREECODE third argument.
561 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
562 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
563 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
564 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
565 JAVA_THIS_EXPR): Now replaced by tree code definitions.
566 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
567 * lang.c (java_tree_code_type, java_tree_code_length,
568 java_tree_code_name): New arrays.
569 (lang_init): Append Java tree node definitions to Gcc ones.
570 * lex.c (expression_obstack): Declared as extern when JC1_LITE
571 defined.
572 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
573 wfl_to_string.
574 (java_lex): Allow declaration of empty string constants. Retain
575 location information on CASE_TK and DEFAULT_TK.
576 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
577 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
578 Modified to be more robust.
579 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
580 (build_new_invocation, try_builtin_assignconv,
581 patch_switch_statement, string_constant_concatenation,
582 build_string_concatenation, patch_string_cst, patch_string,
583 java_expand_switch): New function declarations.
584 * parse.y: Rules related to switch and EH tagged <node>.
585 (label_id): Set to NULL_TREE
586 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
587 tree nodes.
588 (this_or_super:): Fixed indentation.
589 (statement:, statement_nsi:, statement_without_trailing_substatement:,
590 statement_expression:): Removed call to RULE on all sub-rules.
591 (switch_expression:, switch_labels:): New rules.
592 (switch_statement:, switch_block:, switch_block_statement_groups:,
593 switch_block_statement_group:, switch_labels:, switch_label:):
594 Defined actions.
595 (throw_statement:, synchronized_statement:, try_statement:):
596 Defined temporary actions.
597 (class_instance_creation_expression:): Call
598 build_new_invocation. Fixed indentation.
599 (field_access): Fixed indentation.
600 (method_invocation): Likewise.
601 (make_qualified_primary): Use THIS_EXPR.
602 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
603 resolving from SUPER, set *type_found.
604 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
605 (java_complete_tree): Removed unused local variable `location'. Case
606 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
607 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
608 on MODIFY_EXPR: and all binary operator tree code cases. Removed
609 STRING_CST: case. default: checks for patchable strings.
610 (complete_function_arguments): Transform string constant or
611 crafted StringBuffer if necessary.
612 (build_method_invocation): Fixed comments.
613 (build_new_invocation): New function.
614 (patch_assignment): Call try_builtin_assignconv to figure a valid
615 assignment conversion between builtin types.
616 (try_builtin_assignconv): New function.
617 (build_binop): Use URSHIFT_EXPR directly to call build.
618 (operator_string): Use UNARY_PLUS_EXPR.
619 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
620 operator.
621 (do_merge_string_cste, merge_string_cste,
622 string_constant_concatenation, build_string_concatenation,
623 patch_string, patch_string_cst): New function.
624 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
625 (patch_unaryop): Likewise. New test of valid ++/-- operands.
626 (build_newarray_node): Use NEW_ARRAY_EXPR.
627 (build_this): Use THIS_EXPR.
628 (build_return): Enable debug information on return statement.
629 (build_if_else_statement): Likewise.
630 (complete_labeled_statement): Fixed related comment.
631 (build_loop_body): Fixed comment.
632 (build_bc_statement): Enable debug information on break/continue
633 statements.
634 (patch_bc_statement): Fixed typos. Handle SWITCH statement
635 context.
636 (patch_switch_statement, case_identity, java_expand_switch): New
637 functions.
638
639 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
640
641 * buffer.h (BUFFER_INIT): New macro.
642 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
643 Pass (struct jcf_partial *state) to most functions.
644 (jcf_block, jcf_relocation): New types.
645 Support labels, branches, conditionals, loops.
646
647 Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
648
649 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
650
651 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
652
653 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
654 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
655 not integer_type_node (INT_TYPE_SIZ bits).
656
657 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
658
659 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
660 * jcf-dump.c (print_exception_table): New function.
661 (disassemble_method): Better handling of wide instructions.
662 Make more robust for bad input.
663
664 Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
665
666 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
667 FreeBSD.
668
669 Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
670
671 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
672
673 Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
674
675 * Makefile.in ($(PARSE_H)): Removed target.
676
677 Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
678
679 * Makefile.in (JAVA_OBJS): Add memmove.o
680 (memmove.o): New target & rules.
681
682 Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
683
684 * expr.c (expand_invoke): Don't generate a call to the class init
685 code.
686
687 Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
688
689 * Makefile.in: Add many missing dependencies.
690 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
691 as appropriate.
692 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
693 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
694
695 Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
696
697 * decl.c (complete_start_java_method): If method is static (and
698 not private) call _Jv_InitClass.
699 * expr.c (expand_invoke): Don't call build_class_init.
700
701 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
702
703 Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
704
705 * Make-lang.in (GCJ): Define before using.
706
707 Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
708
709 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
710 losing due to namespace pollution in GNU getopt.h
711
712 Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
713
714 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
715 (java.all.cross): Likewise.
716 (java.rest.encap): Likewise.
717
718 Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
719
720 * gjavah.c (print_class_decls): Fix thinko in arglist
721 * jcv-io.c (find_classfile): Similarly.
722
723 Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
724
725 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
726
727 Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
728
729 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
730 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
731 * Makefile.in (PARSE_C): New macro.
732 (PARSE_H): Likewise.
733 (PARSE_SCAN_C): Likewise.
734 ($(PARSE_C)): Target renamed from parse.c.
735 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
736 (clean): Remove parse-scan.c as well.
737 (parse.o): Depend on $(PARSE_C).
738
739 Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
740
741 * README, license.terms: Removed.
742
743 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
744 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
745 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
746 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
747 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
748 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
749 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
750 and Java trademark attribution.
751
752 Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
753
754 * Makefile.in: Use gcjh, not gjavah.
755 * config-lang.in (stagestuff): Use gcjh, not gjavah.
756 * Make-lang.in: Changed gjavah to gcjh everywhere.
757
758 Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
759
760 * gjavah.c: Support new -prepend -add -append flags.
761 (print_method_info): Method is not virtual if class is final.
762
763 Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
764
765 * jv-scan.c: Fixed copyright assignment.
766 * keyword.gperf: Likewise.
767 * keyword.h: Likewise.
768 * lex.c: Fixed copyright assignment.
769 (java_lex): Push unicode back when parsing '<'.
770 * lex.h: Fixed copyright assignment.
771 * parse-scan.y: Likewise.
772 * parse.h: Fixed copyright assignment.
773 (build_debugable_stmt, complete_for_loop): New function prototypes.
774 * parse.y: Fixed copyright assignment.
775 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
776 size_zero_node when completing a loop with no exit condition.
777 (for_statement_nsi:): Define action.
778 (for_init:, for_update:): Return size_zero_node when empty.
779 (declare_local_variables): Call build_debugable_stmt.
780 (build_debugable_stmt): New function.
781 (build_loop_body): Build debugable statement around loop
782 condition part.
783 (complete_loop_body): Take into account the debugable statement
784 around the EXIT_EXPR.
785 (complete_loop_body): New function.
786 (patch_exit_expr): Fixed condition inversion.
787
788 Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
789
790 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
791 name of thread define.
792 * jvspec.c (THREAD_NAME): New macro.
793 (GCLIB): Likewise.
794 (THREADLIB): Likewise.
795 (lang_specific_driver): Recognize attempt to link with thread
796 library or gc library. Recognize -ljava on command line so it
797 isn't linked against more than once.
798
799 Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
800
801 * parse-scan.y (report_main_declaration): Name of the class
802 containing `main' can be a qualified name.
803
804 Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
805
806 * config-lang.in: Changed gjavac to gjc everywhere.
807 * Make-lang.in: Changed gjavac to gjc everywhere.
808
809 Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
810
811 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
812 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
813 and install the files.
814 * Makefile.in (JAVA_OBJS_LITE): New variable.
815 (compiler:): Now include jv-scan as a dependency.
816 (../jv-scan$(exeext), parse-scan.c): New targets.
817 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
818 * config-lang.in (compilers): Removed gcj, gjavah from the list.
819 * jcf-parse.c (parse_source_file): Call java_layout_classes and
820 check for errors even if parse_only.
821 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
822 defined.
823 (yylex): New function. Uses java_lex body.
824 (java_lex): Removed commented out statement. Remove local variable
825 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
826 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
827 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
828 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
829 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
830 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
831 where appropriate.
832 (java_lex_error): Empty if JC1_LITE is defined.
833 (java_get_line_col): Return 0 if JC1_LITE is defined.
834 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
835 SET_MODIFIER_CTX): Moved into the section containing the macros
836 conditionally defined by JC1_LITE.
837 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
838 argument if JC1_LITE is defined.
839 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
840 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
841 is defined.
842 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
843 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
844 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
845 to different values according to JC1_LITE.
846 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
847 declared if JC1_LITE set.
848 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
849 defined if JC1_LITE not set.
850 (struct parser_ctx): Reorganized and skip the jc1 front end part
851 if JC1_LITE set.
852 (java_layout_classes): New function definition.
853 (java_push_parser_context, java_init_lex, yyparse, yylex,
854 yyerror): Prototype always declared. All other static function
855 prototypes declared only if JC1_LITE is not set.
856 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
857 declared in parse.h.
858 (java_layout_classes): New function.
859 (java_complete_expand_methods): No longer layout the class here.
860 * parse-scan.y: New file.
861 * jv-scan.c: New file.
862
863 Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
864
865 * gjavah.c (main): Handle -friend option.
866 (friend_specs): New global.
867 (generate_access): Handle friend_specs.
868 (process_file): Likewise.
869 (MAX_FRIENDS): New macro.
870 (friend_count): New global.
871 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
872 Changed all callers.
873
874 Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
875
876 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
877 (main): Handle processing all the entries of a named .zip archive.
878 * jcf-io.c (jcf_trim_old_input): New function.
879 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
880
881 Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
882
883 * lang.c (flag_assume_compiled): Make default be on.
884
885 Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
886
887 * jcf-dump.c: Add bunches of flags to control output more.
888 (process_class): New function; support printing more than one class.
889 (main): Support new --print-main and --javap flags.
890 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
891 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
892
893 Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
894
895 Change mangling of dispatch table to match C++ vtable (w/thunks).
896 * class.c (build_dtable_decl), java-tree.h: New function.
897 (make_class_data): Call it.
898 * decl.c (init_decl_processing): Likewise.
899
900 Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
901
902 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
903 soft_anewarray; adjust args passed.
904 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
905 match _Jv_NewObjectArray.
906
907 Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
908
909 * decl.c (push_labeled_block, pop_labeled_block): New functions.
910 * expr.c (loopup_label): Call create_label_decl.
911 (create_label_decl): New function.
912 (java_lang_expand_expr): Call expand_start_bindings with argument
913 set to zero.
914 * java-tree.h Added space after PROTO in function declarations
915 when necessary.
916 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
917 (create_label_decl, push_labeled_block): New function
918 declarations.
919 * lex.c (label_id): Initialize.
920 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
921 switch.
922 * parse.h Added space after PROTO in function declarations when
923 necessary.
924 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
925 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
926 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
927 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
928 macros.
929 (struct parser_ctxt): New fields current_loop,
930 current_labeled_block.
931 (build_if_else_statement, patch_if_else_statement,
932 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
933 generate_labeled_block, complete_labeled_statement,
934 build_bc_statement, patch_bc_statement, patch_loop_statement,
935 build_new_loop, build_loop_body, complete_loop_body): New function
936 declarations.
937 * parse.y (java_warning_count): New global variable.
938 (label_id): New static variable.
939 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
940 (block:): Return size_zero_node when block is empty.
941 (empty_statement:): Return size_zero_node.
942 (statement:): Implement supplemental action when for_statement: is
943 reduced.
944 (label_decl:): New rule.
945 (labeled_statement:): Rewritten using label_decl. Actions
946 implemented.
947 (labeled_statement_nsi:): Likewise.
948 (if_then_statement): Actions implemented.
949 (while_expression): New rule.
950 (while_statement:): Rewritten using while_expression. Actions
951 implemented.
952 (while_statement_nsi:): Likewise.
953 (do_statement_begin:): New rule.
954 (do_statement:): Rewritten using do_statement_begin. Actions
955 implemented.
956 (for_statement:): Rewritten using for_begin. Actions implemented.
957 (for_statement_nsi:): Likewise.
958 (for_header:, for_begin:): New rules.
959 (for_init:): Actions implemented.
960 (statement_expression_list:, break_statement:,
961 continue_statement:): Likewise.
962 (yyerror): Count number of issued warning(s).
963 (java_report_errors): Report error(s) and/or warning(s).
964 (java_complete_class): Use build_java_argument_signature to
965 recompute completed method signature.
966 (java_check_regular_methods): New locals method_wfl and aflags.
967 Use method_wfl instead of lookup_cl during error reports. Fixed
968 indentation and modified some error messages. Use
969 lang_printable_name in method instead of the DECL_NAME. New code
970 to issue warnings on methods not overriding corresponding methods
971 private to a different package.
972 (java_method_add_stmt): Call add_stmt_to_compound.
973 (add_stmt_to_compound): New function.
974 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
975 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
976 (build_if_else_statement, patch_if_else_statement,
977 build_labeled_block, generate_labeled_block,
978 complete_labeled_statement, build_new_loop, build_loop_body,
979 complete_loop_body, patch_loop_statement, build_bc_statement,
980 patch_bc_statement, patch_exit_expr): New functions.
981 * typeck.c (build_java_signature): Build argument signature before
982 enclosing it in between parenthesis.
983
984 Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
985
986 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
987 (JAVA_OBJS): Added reminder comment
988
989 Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
990
991 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
992 be interpreted as a long long.
993
994 Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
995
996 * decl.c (init_decl_processing): Use _Jv_InitClass, not
997 soft_initialise_class. Use _Jv_NewMultiArray, not
998 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
999 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
1000 _Jv_CheckArrayStore, not soft_checkarraystore. Use
1001 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
1002
1003 Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
1004
1005 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
1006 length_identifier_node): New global tree node constants.
1007 * parse.y (kw_super, kw_this, kw_length): Removed globals.
1008 Replace uses by super_identifier_node etc.
1009 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
1010
1011 * parse.y (resolve_field_access): Don't special-case ".length" if
1012 flag_emit_class_files.
1013 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
1014 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
1015 and ARRAY.length.
1016
1017 Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
1018
1019 * decl.c (init_decl_processing): Remove unused method_type_node fields.
1020 * class.c (make_method_value): Remove init for removed fields.
1021
1022 * class.c (layout_class): Use build_java_argument_signature.
1023 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
1024
1025 * typeck.c (push_java_argument_signature): Removed. Merged into ...
1026 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
1027 (build_java_signature): Don't use push_java_argument_signature.
1028
1029 * typeck.c (lookup_argument_method): New function.
1030 * parse.y (java_check_regular_methods): Use lookup_argument_method
1031 instead of lookup_java_method2 followed by lookup_java_method.
1032
1033 * parse.y (check_method_redefinition): Minor optimization.
1034
1035 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
1036 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
1037
1038 Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
1039
1040 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
1041 c-pragma.o.
1042
1043 * gjavah.c (java_float_finite): Use K&R-style definition.
1044 (java_double_finite): Likewise.
1045 (generate_access): Now returns void. Changed all callers.
1046 (last_access_generated): Removed.
1047 (process_file): Only make a single pass over the .class file.
1048
1049 Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
1050
1051 * class.c (get_dispatch_table): Add extra dummy vtable entry,
1052 for compatibility for G++ (with -fvtable-thunks).
1053 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
1054
1055 * gjavah.c (process_file): Use public inheritance for super-class.
1056
1057 Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1058
1059 * lex.c (java_init_lex): Initialize ctxp->package.
1060 * parse.h (struct parser_ctxt): package and package_len replaced
1061 by tree package, an identifier node. Field method_decl_list is
1062 gone. Fixed comments.
1063 (lookup_field_wrapper, merge_qualified_name, not_accessible,
1064 class_in_current_package): New function prototypes.
1065 * parse.y (array_type:): Set class loaded flag on primitive type
1066 arrays.
1067 (package_declaration:): Assign ctxp->package to the
1068 identifier node.
1069 (method_invocation:): Handle invocation of method qualified by
1070 `super'.
1071 (single_type_import_declaration:): Removed ambiguity check.
1072 (java_pop_parser_context): New local variable `next'. Reset and
1073 set IMPORT_CLASSFILE_NAME flags on current and previous import
1074 list.
1075 (java_accstring_lookup): Use new local macro COPY_RETURN.
1076 (lookup_field_wrapper): New function.
1077 (parser_qualified_classname): Use merge_qualified_name.
1078 (parser_check_super_interface): Broaden error message.
1079 (do_resolve_class): Check for qualified class name in the current
1080 compilation unit if appropriate.
1081 (process_imports): Check for already defined classes.
1082 (check_pkg_class_access): Got rid of call to
1083 get_access_flags_from_decl.
1084 (java_complete_expand_methods): Call safe_layout_class based on
1085 the current class size.
1086 (make_qualified_primary): Build a WFL qualification on primary if
1087 none exists.
1088 (merge_qualified_name): New function.
1089 (make_qualified_name): Use merge_qualified_name.
1090 (resolve_expression_name): Use safe_lookup_field.
1091 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
1092 (resolve_qualified_expression_name): Likewise. Check on resolved
1093 element accessibility.
1094 (not_accessible_p, class_in_current_package): New functions.
1095 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
1096 (patch_method_invocation_stmt): Merged common pieces. Check
1097 accessibility of invoked method.
1098 (check_for_static_method_reference): Add returned type in error
1099 message.
1100 (invocation_mode): Get rid of bogus check on PRIVATE methods.
1101 (refine_accessible_methods_list): Merged two conditions in test.
1102 (java_complete_class): Sanity check on stabilize_ref gone.
1103 * zextract.c (read_zip_archive): Cast lseek second argument to long.
1104
1105 Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
1106
1107 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
1108
1109 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
1110
1111 * gjavah.c (F_NAN): Removed.
1112 (F_NAN_MASK): New macro.
1113 (F_POSITIVE_INFINITY): Removed.
1114 (F_NEGATIVE_INFINITY): Likewise.
1115 (java_float_finite): Rewrote.
1116 (D_NAN_MASK): Renamed.
1117 (java_double_finite): Rewrote.
1118 (D_POSITIVE_INFINITY): Removed.
1119 (D_NEGATIVE_INFINITY): Likewise.
1120
1121 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
1122 If verbose, print underlying representation of value in hex.
1123
1124 Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
1125
1126 * buffer.h, buffer.c: New files.
1127 * Makefile.in (JAVA_OBJS): Add buffer.o.
1128
1129 Support locals variables and writing their debug entries to .class.
1130 * jcf-write.c: Simplify some by user new buffer type.
1131 (vode_buffer_grow): Removed.
1132 (struct localvar_info): New type.
1133 (localsvars, localvartable): New buffers.
1134 (localvar_alloc, localvar_free): New functions.
1135 (generate_bytecode_insns): Handle local variables.
1136 (generate_classfile): Write LocalVariableTable attribute.
1137
1138 Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1139
1140 * jcf-io.c (open_in_zip): Check the zipfile magic number.
1141 * zipfile.h (ZIPMAGIC): New macro.
1142
1143 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
1144
1145 * Makefile.in (gjavah.o): Updated dependencies.
1146 (jcf-dump.o): Likewise.
1147 (all.indirect): Use ../gjavah.
1148 (../gjavah$(exeext)): Likewise.
1149 (clean): Don't remove gjavah.
1150 (clean): Remove parse.c, not java/parse.c.
1151 * Make-lang.in (java): Added gjavah.
1152 (gjavah$(exeext)): New target.
1153 (GJAVAH_SOURCES): New macro.
1154 (java.all.build): Added gjavah.
1155 (java.all.cross): Likewise.
1156 (java.rest.encap): Likewise.
1157 * config-lang.in (compilers, stagestuff): Added gjavah.
1158
1159 Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
1160
1161 * gjavah.c (java_float_finite): New function.
1162 (java_double_finite): Likewise.
1163 (F_POSITIVE_INFINITY): New macro.
1164 (F_NEGATIVE_INFINITY): Likewise.
1165 (F_NAN): Likewise.
1166 (D_POSITIVE_INFINITY): Likewise.
1167 (D_NEGATIVE_INFINITY): Likewise.
1168 (D_NAN): Likewise.
1169 (print_field_info): Use java_float_finite and java_double_finite.
1170
1171 Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
1172
1173 * parse.y (method_header): Name "this" implicit argument.
1174
1175 Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
1176
1177 * jcf-write.c: Write out LineNumberTable attribute in .class file.
1178 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
1179 (put_linenumber): New function.
1180 (generate_bytecode_insns, generate_classfile): Write line numbers.
1181
1182 Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1183
1184 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
1185 (lookup_name, build_known_method_ref, build_class_init,
1186 build_invokevirtual, invoke_build_dtable, match_java_method,
1187 build_field_ref, pushdecl_force_head, build_java_binop,
1188 binary_numeric_promotion, build_decl_no_layout,
1189 build_java_arrayaccess, build_newarray, build_anewarray,
1190 build_java_array_length_access, build_java_arraynull_check): New
1191 extern function prototypes.
1192 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
1193 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
1194 java-tree.h.
1195 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
1196 to NULL
1197 * jcf.h (jcf_out_of_synch): New extern function prototype.
1198 * parse.h: Static/global function implemented in parse.y
1199 prototyped and declarations moved at the end of the file.
1200 (DECL_P): Check that the argument isn't null.
1201 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
1202 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
1203 (QUAL_DECL_TYPE): New macro.
1204 (PARAMS): Macro definition removed.
1205 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
1206 (return_statement:): Call build_return.
1207 (field_access:): Call make_qualified_primary in sub rule.
1208 (method_invocation:): Build method invocation and call
1209 make_qualified_primary when processing primaries.
1210 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
1211 get_type_from_signature.
1212 (java_check_regular_method): Extra integer 0 argument when calling
1213 lookup_java_method2.
1214 (lookup_java_interface_method2): Extra method DECL argument when
1215 calling lookup_java_interface_method2.
1216 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
1217 COMPOUND_EXPR node.
1218 (java_complete_expand_method): Layout current class iff not
1219 already done. Don't process interface's methods.
1220 (java_complete_expand_method): Use super class only if it
1221 exists. Use current class otherwise.
1222 (make_qualified_primary): New function.
1223 (resolve_expression_name): Process qualified expression or
1224 expression from primary the same way.
1225 (resolve_expression_name): Two last arguments to
1226 resolve_field_access are now NULL_TREEs.
1227 (resolve_field_access): New variable is_static. Local field must
1228 be DECLs. is_static computed on field DECLs only. Append code in
1229 where_found to the field access if necessary. Use QUAL_DECL_TYPE
1230 to initialize field_type.
1231 (resolve_qualified_expression_name): New local variable,
1232 previous_call_static and is_static. Handle primaries with function
1233 calls, casts, array references and `this'. `super' now handled as
1234 `(super_class)this'. Use is_static to clarify boolean expressions.
1235 Added code to handle case where a proper handle is required to
1236 access a field. Use QUAL_DECL_TYPE where applicable.
1237 (maybe_access_field): New function.
1238 (patch_method_invocation_stmt): New arguments primary, where,
1239 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
1240 deleted. Use `where' as a type to search from if specified. Check
1241 for static method reference where forbidden. Append primary or
1242 current_this to the argument list if not calling constructor nor
1243 static methods.
1244 (check_for_static_method_reference): New function.
1245 (patch_invoke): Layout the class on which new is done if
1246 necessary.
1247 (lookup_method_invoke): Changed format to report errors on
1248 methods.
1249 (qualify_ambiguous_name): New local variable this_found. Now
1250 handle things from primaries. Method call are considered
1251 expression names.
1252 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
1253 changed into NULLs.
1254 (not_initialized_as_it_should_p): Comply with the new DECL_P.
1255 (java_complete_tree): New case fo RETURN_EXPR. Process function
1256 call arguments in separate function.
1257 (complete_function_arguments): New function.
1258 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
1259 anymore.
1260 (patch_assignment): Take the return function slot into account as
1261 a RHS. Distinguish assignment from a return.
1262 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
1263 when checking methods in interfaces.
1264 (resolve_type_during_patch): NULL argument to unresolve_type_p
1265 instead of NULL_TREE.
1266 (patch_newarray): Fixed typo in comment.
1267 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
1268 (build_return, patch_return): New functions.
1269 * typeck.c (lookup_java_constructor): Fixed typo in comment.
1270
1271 Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
1272
1273 * constants.c (find_name_and_type_constant, find_fieldref_index,
1274 find_methodref_index): New methods.
1275 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
1276 just return given method. Also, rename to build_known_method_ref.
1277 (expand_invoke): Rename call to build_invoke_non_interface.
1278 * java-tree.h, parse.h: Update prototype.
1279 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
1280 (such as expand_expr_stmt) if flag_emit_class_files.
1281 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
1282 STACK_TARGET, IGNORE_TARGET): New macros.
1283 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
1284 (generate_bytecode_insn): New function to generate method's bytecode.
1285 (generate_classfile): Node generate Code attribute for a method.
1286 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
1287 push_long_const, field_op, adjust_typed_op, maybe_wide):
1288 New functions used by generate_bytecode_insn.
1289
1290 * typeck.c (signature_include_return): Remove variable.
1291 (push_java_argument_signature, build_java_argument_signature): New.
1292 (build_java_signature): Use push_java_argument_signature.
1293 * parse.y: Use build_java_argument_signature instead of fiddling
1294 with signature_include_return.
1295
1296 Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
1297
1298 * gjavah.c (print_c_decl): Always generate JArray<>* for array
1299 types.
1300
1301 * Makefile.in (all.indirect): Added gjavah$(exeext).
1302 (gjavah$(exeext)): Added $(exeext).
1303 (clean): Likewise.
1304
1305 Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1306
1307 * class.c (layout_class): Call to java_layout_parsed_class replace
1308 by safe_layout_class.
1309 * expr.c (build_java_array_length_access): Removed static storage
1310 class in the function definition.
1311 (build_java_arraynull_check): Likewise.
1312 Also fixed typos in two comments.
1313 * lex.c (java_init_lex): Initialize static global kw_length.
1314 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
1315 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
1316 java_lex_error.
1317 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
1318 * parse.h (resolve_no_layout): New static function declaration.
1319 (get_identifier_in_static): Declaration removed.
1320 (java_layout_parsed_class): Function name declaration changed to
1321 safe_layout_class.
1322 (build_newarray_node, patch_newarray, resolve_type_during_patch,
1323 not_initialized_as_it_should_p, build_this): New static function
1324 declarations.
1325 (pushdecl_force_head, build_java_binop, int_fits_type_p,
1326 binary_numeric_promotion, stabilize_reference,
1327 build_decl_no_layout, build_java_arrayaccess): Extern function
1328 declarations moved into their own section.
1329 (build_newarray, build_anewarray, build_java_array_length_access,
1330 build_java_arraynull_check): New extern function declarations.
1331 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
1332 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
1333 fake tree codes.
1334 (CALL_CONSTRUCTOR_P): New macro.
1335 * parse.y (kw_length): New static global tree node.
1336 (return_statement): Tagged <node>.
1337 (RETURN_TK): Tagged <operator>.
1338 (variable_declarator_id:): Build variable declaration with an
1339 empty initialization value if a syntax error was found in the
1340 initialization part of the variable declaration.
1341 (statement_without_trailing_substatement:): return_statement: now
1342 uses the default rule.
1343 (return_statement:): Temporarily fixed to return NULL_TREE.
1344 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
1345 (class_instance_creation_expression:): Class creation rules now
1346 call build_method_invocation upon reduction.
1347 (array_creation_expression:): Rules call build_newarray_node upon
1348 reduction.
1349 (dim_exprs:): Build a list of dimension expressions.
1350 (dim_expr:): Store location of the OSB_TK in the dimension
1351 expression node.
1352 (method_invocation:): Added a new error rule.
1353 (build_unresolved_array_type): WFL argument may also be an array
1354 on a primitive type. Name of the argument changed to reflect this.
1355 (method_declarator): Insert argument type at the beginning of the
1356 argument type list and later reverse the list.
1357 (unresolved_type_p): Argument 'returned' may be optionally
1358 NULL_TREE.
1359 (java_layout_class_from_source): Function renamed
1360 safe_layout_class.
1361 (resolve_and_layout): Now call resolve_no_layout and
1362 safe_layout_class.
1363 (resolve_no_layout): New function.
1364 (purify_type_name): New function.
1365 (complete_class_report_errors): Call purify_type_name during error
1366 report on a type not found.
1367 (process_imports): error_found local variable doesn't need to be
1368 initialized to zero.
1369 (declare_local_variables): New local type_wfl. Fixed typo in error
1370 message. type_wfl assigned to unresolved type and used to register
1371 incomplete type. Build a WFL around the variable initialization
1372 statement so that debug info can be generated on it.
1373 (source_start_java_method): Reverse argument list after they've
1374 been processed.
1375 (current_this): New static global variable.
1376 (java_complete_expand_methods): Set current_this when appropriate.
1377 (resolve_expression_name): Build correct static and non static
1378 field access bearing a simple name.
1379 (resolve_field_access): Resolve the length field of arrays. Handle
1380 f.m() cases.
1381 (patch_method_invocation_stmt): Set the type of the method
1382 invocation to error_mark_node. This value is later overridden by a
1383 valid type, if any. Don't handle qualified constructor invocation
1384 as qualified method invocation. Call lookup_method_invoke with its
1385 new flag. It's no longer necessary to access the selected method
1386 as the value of a tree list. Handle constructor invocation.
1387 (patch_invoke): Reverse argument list when invoking non interface
1388 methods. Insert call to new as the first argument of the
1389 constructor.
1390 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
1391 defined within a final class. Return INVOKE_STATIC if the invoked
1392 method is a constructor.
1393 (lookup_method_invoke): New lc argument is a flag to indicate a
1394 constructor lookup. Now handle constructor lookup. Choose the most
1395 specific method in case several were matching the invocation
1396 requirements. Return a method decl instead of a tree list featuring
1397 one single method decl element.
1398 (refine_accessible_methods_list): New lc flag argument to
1399 indicate that a constructor is being looked up.
1400 (not_initialized_as_it_should_p): New function.
1401 (java_complete_tree): Now process fake tree codes
1402 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
1403 save_expr on resolved function call arguments. Case on
1404 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
1405 (patch_assignment): LHS can be a field access expression. When
1406 dealing with reference, lhs_type is the promoted type of the
1407 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
1408 applicable.
1409 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
1410 (patch_binop): Use not_initialized_as_it_should_p where
1411 applicable.
1412 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
1413 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
1414 where applicable.
1415 (resolve_type_during_patch): New function.
1416 (patch_cast): Call resolve_type_during_patch to resolve type and
1417 report error accordingly.
1418 (patch_array_ref): Use not_initialized_as_it_should_p where
1419 applicable. Array base expression is saved before being
1420 used. Promote the type of an array elements if it contains non
1421 builtin types.
1422 (build_newarray_node, patch_newarray, build_this): New functions.
1423
1424 Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
1425
1426 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
1427 increment it in `for' statement.
1428 (print_field_info): If number is inf or nan, don't print it.
1429 (print_method_info): If method name is `delete', just ignore it.
1430 (print_c_decl): Special-case jstringArray.
1431
1432 * gjavah.c (help): New function.
1433 (no_argument): New function.
1434 (usage): Changed text.
1435 (main): Rewrote argument handling. Now handles -v, --help,
1436 --version.
1437 (version): New function.
1438 (found_error): New global.
1439 (main): Return found_error.
1440 (generate_access): Set found_error.
1441 (print_c_decl): Likewise.
1442
1443 Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
1444
1445 * gjavah.c (print_c_decl): Don't print "," when examining field.
1446 Skip type name when looking at "[L" types.
1447 (process_file): Now static.
1448 (generate_access): Now returns int.
1449 (last_access_generated): New global.
1450 (process_file): Clear last_access_generated; make multiple passes
1451 over the class.
1452 (print_field_info): Just return if generate_access returns true.
1453 (print_method_info): Likewise. Also, allow <init> functions to
1454 pass through.
1455 (print_c_decl): Added is_init argument. Print constructors
1456 properly.
1457 (print_cxx_classname): Use UTF8_GET to extract characters from
1458 string.
1459 (print_base_classname): New function.
1460 (print_class_decls): New function.
1461 (process_file): Use it.
1462 (utf8_cmp): New function.
1463
1464 Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
1465
1466 * lang-options.h: Format changed to match changes in gcc/toplev.c
1467 to implement a --help option.
1468
1469 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
1470
1471 * decl.c (init_decl_processing): Revert change to dtable_type.
1472
1473 Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
1474
1475 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
1476
1477 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
1478
1479 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
1480
1481 * lang.c (lang_init): Default flag_exceptions to 1, without
1482 checking to see if it's 2 first.
1483
1484 Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
1485
1486 * constants.c: Include "system.h".
1487 * decl.c: Likewise.
1488 * lang.c (flag_new_exceptions): Get via extern now.
1489 (lang_init_options): New functions. Turn on flag_new_exceptions.
1490
1491 Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1492
1493 * lex.c (java_lex): Return 0 when we see an invalid character in
1494 the input.
1495
1496 * lex.c (java_read_char): Specify extra argument when calling
1497 java_lex_error.
1498 (java_read_unicode, java_parse_end_comment,
1499 java_parse_escape_sequence): Likewise,
1500 (java_lex): Specify extra argument when calling
1501 java_lex_error. Test that IDs are beginning with a legal character
1502 for IDs. Handle invalid characters with an error message and a
1503 call to java_lex_error.
1504 (java_lex_error): Adjust column position by new argument
1505 `forward'. Issue an error even if in the middle of reporting an
1506 other error.
1507
1508 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
1509
1510 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
1511 we don't explicitly put a null pointer when we're copying it.
1512
1513 Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
1514
1515 * gjavah.c (print_cxx_classname): New function.
1516 (super_class_name): Likewise.
1517 (print_super_fields): Removed.
1518 (in_super): Removed.
1519 (print_field_info): Never generate #defines.
1520 (print_c_decl): Changed generated types to match JNI. No longer
1521 print class name before method name.
1522 (print_method_info): Print "static" before static methods.
1523 Print "virtual" before non-final methods.
1524 (usage): Use exit(1), not exit(-1).
1525 (main): Likewise.
1526 (print_field_info): Use %.17g to print a double.
1527 (last_access): New globals.
1528 (process_file): Initialize last_access.
1529 (usage): Now static.
1530 (ACC_VISIBILITY): New define.
1531 (generate_access): New function.
1532 (print_field_info): Call it.
1533 (print_method_info): Likewise. Also, generate information for all
1534 methods, not just native methods. Return void.
1535 (print_c_decl): Return void.
1536 (print_field_info): Return void.
1537
1538 Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1539
1540 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
1541 processing the jc1 grammar file. Prefix bison functions and
1542 variables with java_.
1543 (parse.c): Dependencies on parse.h and lex.h
1544 * expr.c (build_java_arrayaccess): Function now global.
1545 * java-tree.h: Comment reorganized to carry on previous
1546 classification effort.
1547 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
1548 RESOLVE_TYPE_NAME_P): New flags on WFLs.
1549 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
1550 java_parse (new prefix java_ generated by bison).
1551 (java_layout_parsed_class, java_register_parsed_class): Function
1552 call removed.
1553 (yyparse): Removed unnecessary call to init_outgoing_cpool.
1554 * lex.c (static tree wfl_op): Variable deleted.
1555 (java_init_lex): Initialize kw_super and kw_this. Initialize more
1556 ctxp fields to NULL_TREE.
1557 (java_lex): No longer create WFL for operators. Filename caching
1558 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
1559 created as STRING_CST and later expanded. Removed extra argument
1560 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
1561 and SUPER.
1562 (build_wfl_node): Removed code in comments.
1563 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
1564 store token and location data in the current bison token.
1565 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
1566 static/extern function declaration at the beginning of the file.
1567 (struct qualification): Data structure definition deleted.
1568 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
1569 (qualify_ambiguous_name): Function declaration modified. Function
1570 now returns nothing.
1571 (build_array_ref, patch_array_ref, make_qualified_name,
1572 resolve_qualified_expression_name, maybe_generate_clinit,
1573 resolve_field_access): New static function declarations.
1574 (build_java_arrayaccess): New extern function declaration.
1575 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
1576 (CALL_EXPR_PRIMARY): Macro deleted.
1577 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
1578 (struct parser_ctxt): Field initialized_final
1579 removed. non_static_initialized, static_initialized: New fields.
1580 * parse.y (static tree kw_super, static tree kw_this): New global
1581 static.
1582 (%union): tree wfl field of operator member replaced by int
1583 location. WFLs are non longer created for operators.
1584 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
1585 (qualified_name:): Now calls make_qualified_name to build the
1586 identifier.
1587 (type_declaration:): Consider generating <clinit> when class
1588 parsing completed.
1589 (variable_declarator:): Directly build an assignment node when the
1590 variable is initialized when declared.
1591 (this_or_super:): Build a WFL and set current location when THIS
1592 or SUPER are parsed.
1593 (expression_statement:): Wrap statement around a WFL.
1594 (primary_no_new_array:): Fixed typo. Changed value returned by
1595 THIS_TK because of its new type (temporary).
1596 (dim_exprs:): Temporary fix because of OSB_TK's new type.
1597 (field_access:): Build qualified name with SUPER.
1598 (method_invocation:): Fixed returned value because of SUPER's new
1599 type.
1600 (array_access:): Use OSB_TK location information.
1601 (post_increment_expression:, post_decrement_expression:,
1602 unary_expression:, pre_increment_expression:,
1603 pre_decrement_expression:, unary_expression_not_plus_minus:,
1604 cast_expression:, multiplicative_expression:,
1605 additive_expression:, shift_expression:, relational_expression:,
1606 equality_expression:, and_expression:, exclusive_or_expression:,
1607 inclusive_or_expression:, conditional_and_expression:,
1608 conditional_or_expression:, assignment:): Use new location/token
1609 information available on operators.
1610 (create_class): Set super_decl_type to NULL_TREE when processing
1611 java.lang.Object.
1612 (register_fields): Field initialization is now a MODIFY_EXPR
1613 node. Chain initialization code to the matching lists (according
1614 the the field declaration modifiers).
1615 (maybe_generate_clinit): New function.
1616 (method_header): Don't set method's DECL_NAME to a WFL when adding
1617 methods to java.lang.Object.
1618 (resolve_and_layout): Now can return NULL_TREE if the type
1619 resolution fails. Otherwise, return the class DECL instead of its
1620 TYPE.
1621 (check_method_redefinition): Don't patch method DECL_NAME if it
1622 belongs to java.lang.Object.
1623 (process_imports): Simply assign error_found to the value returned
1624 by check_pkg_class_access.
1625 (declare_local_variables): Don't use their init statements (if
1626 any) when parsing error were previously found. Reuse MODIFY_EXPR
1627 build during parsing as an init statement.
1628 (java_method_add_stmt): Now return the current method body.
1629 (java_layout_parsed_class, java_register_parsed_class): Functions
1630 removed.
1631 (java_complete_expand_methods): Initialize the constant pool on a
1632 per class basis. Layout the classes before expanding their method
1633 bodies. Don't try expand artificial constructor code if error were
1634 found. Make the classes data and register them if no error were
1635 found.
1636 (java_complete_expand_method): Retrieve an artificial constructor
1637 argument list before entering its body. Assign the top block to
1638 the artificial constructor function body and set types of declared
1639 blocks and compound statements to void. Walk method body if not an
1640 artificial constructor.
1641 (make_qualified_name, cut_identifier_in_qualified): New functions.
1642 (resolve_expression_name): Fixed comments. Save/restore the
1643 current class CLASS_LOADED_P flag value. Build non qualified
1644 static field access and handle qualified expression names.
1645 (resolve_field_access, resolve_qualified_expression_name): New
1646 functions.
1647 (patch_method_invocation_stmt): Use the new expression resolution
1648 scheme, calling resolve_field_access when the function call is
1649 resolved as an expression.
1650 (qualify_ambiguous_name): Function rewritten to work on qualified
1651 expression produced by make_qualified_name.
1652 (java_complete_tree): Promote type when function's argument are
1653 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
1654 the assignment to discover further errors if RHS is a expression
1655 name that fails to evaluate. Declare LHS initialized even though
1656 the assignment failed. Don't use the location variable and removed
1657 extra argument in patch function calls. Now handle the ARRAY_REF
1658 case and build internal string representation when STRING_CSTs are
1659 walked.
1660 (build_method_invocation): Don't wrap function call around a WFL.
1661 (build_assignment): Likewise. Use the operator location
1662 information.
1663 (patch_assignment): Handle array access LHSs. Handle error
1664 provenance, resulting in a better error report.
1665 (build_binop): Use op_location from operator as binop location
1666 information.
1667 (build_unaryop, build_incdec, build_cast): Likewise.
1668 (patch_binop): Extract location information from the node. Fixed
1669 typo in error message.
1670 (patch_unary_op): Extract location information from the node.
1671 (build_array_ref, patch_array_ref): New functions.
1672
1673 Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
1674
1675 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
1676 match _Jv_IsInstanceOf.
1677 * decl.c (init_decl_processing): Use _Jv_NewArray, not
1678 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
1679
1680 Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
1681
1682 * decl.c (init_decl_processing): Functions are now named
1683 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
1684
1685 Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
1686
1687 * java-tree.h (load_class): Add prototype.
1688 * class.c (is_compiled_class): Add missing arg to load_class.
1689 * expr.c (expand_java_NEW): Call load_class.
1690 * parse.y (process_import): Removed bogus use of void return value.
1691
1692 Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
1693
1694 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
1695 Function name is "_Jv_Throw" instead of "soft_athrow".
1696 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
1697 Function name is "_Jv_AllocObject" instead of "soft_new".
1698 Takes an extra parameter (object size).
1699 * expr.c: Update calls.
1700
1701 Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
1702
1703 * lex.c (java_get_line_col): Handle end-of-file.
1704 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
1705
1706 Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
1707
1708 * lang.c (lang_init): Make -fexceptions the default.
1709 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
1710 exception handling is not turned on.
1711
1712 Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
1713
1714 * lang.c (flag_new_exceptions): Make this this default.
1715 * decl.c (end_java_method): Call emit_handlers.
1716 * except.c (method_init_exceptions): Set language code and version.
1717 (expand_start_java_handler): Enable exception, and call
1718 expand_eh_region_start.
1719 (expand_end_java_handler): Enable exception, and set up catch blocks.
1720 (emit_handlers): New routine to generate the saved handlers.
1721 * java-except.h (emit_handlers): Add prototype.
1722
1723 Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
1724
1725 We used to have three different representations of the constant pool:
1726 the CPool structure, the tree_constant_pool, and the constructures
1727 used to build the Class object (which may need class and string
1728 constants) in compiled code. None were appropriate for compiling
1729 to .class files, so I did a major overhaul.
1730
1731 First, the tree_constant_pool array was removed. Things were
1732 modified to the CPool structure in the JCF could be used.
1733 Second, a "capacity" field was added to the CPool, and functions
1734 written to search for a matching constant, adding one if not found.
1735 The code that generated the Class object was changed to use a CPool.
1736 The actual TREE_LISTs used to build the CONSTRUCTORs used for
1737 the static Class object are now only in build_constants_constructor.
1738 Finally, I wrote code which can generate a .class file (including its
1739 constant pool) from the RECORD_TYPE of a class. This is a big step
1740 on the way to compiling Java source into .class files.
1741
1742 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
1743 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
1744
1745 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
1746 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
1747 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
1748 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
1749 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
1750 (lang_type): Removed constant_pool field.
1751 * jcf.h (CPool): Renamed size to count. Added field capacity.
1752 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
1753 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
1754 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
1755
1756 * constants.c (current_constant_pool_tags, current_constant_pool_data,
1757 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
1758 * constants.c (build_constants_constructor): Use new outgoing_cpool.
1759 (set_constant_entry, find_constant1, find_constant2,
1760 find_class_constant, count_constant_pool_bytes, write_constant_pool,
1761 find_utf8_constant, find_class_or_string_constant): New functions.
1762
1763 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
1764 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
1765 (give_name_to_class, get_class_constant): Likewise.
1766 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
1767 (get_name_and_type_constant, get_ref_constant): Removed.
1768 * parse.h (parser_ctxt): Remove field tree_constant_pool.
1769 * parse.y: Don't save/restore tree_constant_pool.
1770 * verify.c (verify_jvm_instructions): Update for new approach.
1771 * expr.c (expand_invoke, expand_java_field_op): Likewise.
1772
1773 * lang-options.h: Added -femit-class-file, -femit-class-files.
1774 * lang.c (flag_emit_class_files), java-tree.h: New flag.
1775 (lang_f_options): Added "emit-class-file(s)".
1776
1777 * expr.c (build_java_arrayaccess): Generate more efficient array
1778 bounds checking, by using unsigned compare.
1779
1780 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
1781
1782 Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1783
1784 * parse.h: New comment on the handling of unresolved type
1785 identifiers. JDEPs are now part of the jdep_code enum.
1786 (typedef struct jdep): Now use enum jdep_code or int, depending on
1787 availability. Both are narrowed down to an 8 bits bitfield.
1788 (CALL_EXPR_PRIMARY): Fixed comment.
1789
1790 Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
1791
1792 * Make-lang.in (java): Added gjavac and jvgenmain.
1793 (java.start.encap): Depend on gjavac.
1794 (java.rest.encap): Depend on jvgenmain.
1795
1796 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
1797 (JAVA_CROSS_NAME): Likewise.
1798 (java.all.build): Depend on jvgenmain and gjavac.
1799 (java.all.cross): Depend on jvgenmain and gjavac-cross.
1800 (jvgenmain$(exeext)): New target.
1801 (java.install-common): Wrote.
1802 * config-lang.in (compilers, stagestuff): Added gjavac and
1803 jvgenmain.
1804
1805 Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
1806
1807 * lang.c (lang_decode_option): New argc/argv interface.
1808
1809 Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1810
1811 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
1812 * decl.c (build_decl_no_layout): New function.
1813 * expr.c (java_lang_expand_expr): Layout declarations found in
1814 blocks before they're pushed.
1815 * jcf-parse.c (load_class): Save current line when parsing class
1816 file.
1817 (parse_source_file): Register class before expanding their
1818 methods.
1819 * lang.c (put_decl_node): Produce `null' when `void *' is
1820 processed.
1821 * lex.c (static tree wfl_op): New static global, for error report
1822 on casts.
1823 (java_init_lex): wfl_operator and wfl_op initialized
1824 here. Filename caching added for wfl_op. Return wfl_op when `(' is
1825 parsed.
1826 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
1827 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
1828 build_unresolved_array_type): New static function definitions.
1829 (build_decl_no_layout): New extern function declared.
1830 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
1831 faulty modifier exists.
1832 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
1833 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
1834 (UNARY_PLUS_EXPR): New fake operator.
1835 (struct parser_ctxt): New field osb_number.
1836 * parse.y (static tree wfl_operator): New static WFL for operator
1837 bound error messages.
1838 (DECR_TK, INCR_TK): Moved.
1839 (OP_TK): Tagged <operator>.
1840 (array_type:): Now call build_unresolved_array_type.
1841 (dim_expr:): Count the number of '[' seen.
1842 (post_increment_expression, post_decrement_expression,
1843 pre_increment_expression, pre_decrement_expression,
1844 unary_expression_not_plus_minus, unary_expression:): Actions are
1845 now building the corresponding unary expressions.
1846 (cast_expression:): Actions are now building cast expressions.
1847 (build_unresolved_array_type): New function.
1848 (create_interface): Reset the number of declared interfaces.
1849 (create_class): Likewise.
1850 (method_header): Methods declared within the scope of an interface
1851 are now implicitly set public and abstract.
1852 (java_complete_class): Variable's and parameter's type are patched
1853 with a promoted type.
1854 (declare_local_variables): Resolved non builtin types are promoted
1855 before being used to build a variable decl. Removed type patch
1856 posted on variable initialization statement.
1857 (source_start_java_method): Use build_decl_no_layout to build the
1858 decl of a parameter of incomplete type.
1859 (java_register_parsed_class): Process interfaces too. Call
1860 rest_of_decl_compilation on each processed class declarations.
1861 (java_complete_expand_methods): Don't attempt to expand things in
1862 interfaces.
1863 (java_complete_tree): Process CONVERT_EXPR, even though it always
1864 has a type. Propagate error_mark_node to node's type too. Promote
1865 method's call argument type and return error_mark_node if
1866 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
1867 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
1868 handle unary operator nodes.
1869 (build_assignment): Added comment.
1870 (print_int_node): New function.
1871 (patch_assignment): New second argument. New error handling. Use
1872 print_int_node. Handle references. Use can_cast_to_p to issue
1873 different error message according to the context and check upon
1874 the initialization of the RHS.
1875 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
1876 (operator_string): Handle more operators.
1877 (patch_binop): No longer use a function static
1878 wfl_operator. Improved error message on shift distance.
1879 (build_unaryop, build_incdec, build_cast, patch_unaryop,
1880 patch_cast): New functions.
1881
1882 Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
1883
1884 * jvspec.c: New file.
1885 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
1886
1887 * java-tree.h (identifier_subst): Add declaration.
1888
1889 Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
1890
1891 * jvgenmain.c (main): Generate call to JvRunMain.
1892
1893 * class.c (make_class_data): Push value for "sync_info" field.
1894 * decl.c (init_decl_processing): Push "sync_info" field.
1895
1896 Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
1897
1898 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
1899 Java (source) name, not signature.
1900 Set TYPE_ALIGN to (at least) that of element_type.
1901
1902 Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
1903
1904 * class.c: Moved classname-mangling-rekated code to ...
1905 * mangle.c: ... this new file.
1906 * jvgenmain.c: New program (needs mangle.c) to generate main program.
1907 * Makefile.in: Update for above changes.
1908
1909 Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1910
1911 * expr.c (truthvalue_conversion): Convert integer and floating
1912 point value to their truth value.
1913 * lex.c (java_lex): Handle the `null' literal.
1914 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
1915 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
1916 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
1917 New macros.
1918
1919 * parse.y: Reorganization/documentation on token declaration.
1920 (binop_lookup[]): New added new tree codes.
1921 (relational_expression): Build corresponding binary operators.
1922 (equality_expression, conditional_and_expression,
1923 conditional_or_expression): Likewise.
1924 (java_complete_class): Fix crash in debug message.
1925 (java_complete_tree): Check initialization of method call
1926 arguments. Further bogus node evaluation to detect more error
1927 during assignments. Handles more binary operators.
1928 (patch_assignment): Use DECL_P.
1929 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
1930 code.
1931 (operator_string): Handle more case. Compacted source.
1932 (patch_binop): Changed function comment. Checking for
1933 uninitialized first operand takes the compound assignment into
1934 account and uses DECL_P. Checking for uninitialized second operand
1935 delayed to routine's end. Use macros to issue type bound error
1936 messages and issue messages on both operands if their types are
1937 different. Force fixed type into node. Handle all binary
1938 operators.
1939
1940 Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1941
1942 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
1943 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
1944 build operator node and return tokens.
1945 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
1946 * parse.h (java_complete_tree): Changed returned type in prototype.
1947 (build_method_invocation, build_assignment, patch_assignment,
1948 patch_binop): New static function declarations.
1949 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
1950 BUILD_EXPR_WFL): New macros.
1951 * parse.y (enum tree_code binop_lookup[]): New static for token to
1952 TREE_CODE lookup.
1953 (%union): Parser union has new sub-structure `operator'.
1954 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
1955 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
1956 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
1957 ASSIGN_ANY_TK): Tokens tagged `operator'.
1958 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
1959 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
1960 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
1961 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
1962 (assignment_operator:): Rule tagged `operator'.
1963 (expression_statement:): Re-installed default rule.
1964 (method_invocation:): Sub rules call build_method_invocation.
1965 (postfix_expression:): Don't attempt to resolve name here. Just
1966 return an ID.
1967 (multiplicative_expression:): Sub-rules build corresponding binop
1968 expression node.
1969 (additive_expression:, shift_expression:, and_expression:,
1970 exclusive_or_expression:, inclusive_or_expression:): Likewise.
1971 (assignment:): Sub rule invoke build_assignment.
1972 (assignment_operator:): Default rules on sub rules.
1973 (force_error): Added documentation on this variable.
1974 (declare_local_variables): Build initialization calling
1975 build_assignment.
1976 (expand_start_java_method): Removed unused rtx declaration. Mark
1977 arguments as already initialized.
1978 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
1979 (java_complete_expand_methods): Don't process next method if
1980 completion of the previous one triggered errors.
1981 (java_complete_expand_method): Call source_end_java_method if no
1982 error were found during completion.
1983 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
1984 locals declaratilon. Handle names found within a class. Return
1985 error_mark_node when things aren't found.
1986 (patch_method_invocation_stmt): Return error_mark_node on failures.
1987 (patch_invoke): Removed unused local. Return the correct node.
1988 (java_complete_tree): Now returns a value. The BLOCK section binds
1989 local identifiers and the type of a BLOCK is now void. Assign the
1990 result of operand completion on COMPOUND_EXPR. Assign the
1991 encapsulated node of a WFL to the result of its completion, except
1992 when the node is an identifier. Now handle MODIFY_EXPR and several
1993 binary operators. Return error_mark_node on errors.
1994 (build_method_invocation, build_assignment, patch_assignment,
1995 build_binop, operator_string, patch_binop): New functions.
1996 * typeck.c (binary_numeric_promotion): New function.
1997
1998 Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
1999
2000 * class.c (identifier_subst): New convenience wrapper for ident_subst.
2001 Replace most uses of ident_subst by identifier_subst.
2002
2003 * class.c (push_class_static_dummy_field): Removed function.
2004 (build_class_ref): Find Class object decl by looking up "CNAME.class",
2005 instead of looking got "class" static field. Create that decl here.
2006 (class_identifier_node): Removed; no longer needed.
2007 (init_class_processing): Don't init class_identifier_node.
2008 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
2009 Do nreverse 0 times (instead of twice) for Object and Class.
2010 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
2011
2012 Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
2013
2014 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
2015 while initializing linenumber_count and linenumber_table.
2016 Do it before init_function_start (which calls emit_line_note).
2017 * expr.c (expand_byte_code): Don't need to clear lineno here.
2018
2019 Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
2020
2021 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
2022 then mangle number as _N_.
2023
2024 * class.c (mangle_class_field): New function.
2025 (build_class_ref): Set assembler name of class reference using
2026 mangle_class_field.
2027 (push_class_static_dummy_field): Likewise.
2028
2029 Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
2030
2031 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
2032 of assigning to TREE_CODE. The latter method exploits a feature
2033 of GCC that is not ANSI compliant.
2034
2035 Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2036
2037 * decl.c (pushdecl_force_head): New function.
2038 (pushlevel): Removed conditional printf.
2039 (complete_start_java_method): Don't enter local variable scope if
2040 function is compiled from source code.
2041 * expr.c: parse.h now included
2042 (java_lang_expand_expr): New function.
2043 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
2044 printf. Terminate buffer when doing directories.
2045 * jcf-parse.c (parse_source_file): Call lang_init_source before
2046 parsing and before code generation.
2047 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
2048 use printf if the macro is defined.
2049 * lang.c (lang_init): Install lang_expand_expr hook on
2050 java_lang_expand_expr.
2051 (java_dummy_print): New function.
2052 (lang_init_source): New function.
2053 * lex.c (java_lex): Remember location of an opening brace at the
2054 second nesting level.
2055 (java_is_eol): Unget character seen after a CR if it is EOF.
2056 * parse.h: Now includes lex.h
2057 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
2058 printf if the macro is defined.
2059 (expand_start_java_method, build_expr_block, enter_block,
2060 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
2061 New static function declarations.
2062 (pushdecl_force_head): New extern function declaration.
2063 (INCOMPLETE_TYPE_P): New macro.
2064 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
2065 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
2066 BLOCK_EXPR_ORIGIN): New macros.
2067 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
2068 DECL_SOURCE_LINE_LAST): New macros.
2069 (struct parser_ctxt): Removed field current_method_decl, redundant
2070 with the field current_function_decl. Added fields
2071 first_ccb_indent1 and pending_block.
2072 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
2073 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
2074 tagged <node>
2075 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
2076 (compilation_unit:): Cosmetic on sub rule.
2077 (type_declaration:): Cosmetic on sub rules. Added an error rule.
2078 (variable_initializer:): Installed default rule on expression:.
2079 (method_declaration:): method_header: starts a new
2080 method. method_body: installs the function body, absorbs blocks
2081 emitted for temporary variable scopings, pops function's body block
2082 and merges function's last statement lineno in DECL_SOURCE_LINE.
2083 (method_body:): Installed default rules.
2084 (block:): Call enter_block when an opening brace is seen. Absorb
2085 scoping blocks and call exit_block when a closing brace is seen.
2086 (block_statement:): Cosmetic changes.
2087 (method_invocation:): Create WFL around CALL_EXPR node.
2088 (patch_stage): Added comment around definition.
2089 (method_header): Try to use first_ccb_indent1 as the first line of
2090 the method, so BP debug info are emitted at the first opening
2091 brace of the function. If the function has no body, use the
2092 location of the function's name. Override currently defined method
2093 name with the matching WFL so we can point redefinition errors
2094 using the location where the function's name was declared.
2095 (check_abstract_method_header): Interprets DECL_NAME as an
2096 identifier or as a WFL, accordingly.
2097 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
2098 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
2099 location and name information out of it and reinstall DECL_NAME to
2100 its original identifier node value.
2101 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
2102 function's source code).
2103 (read_import_dir): Test the value returned by find_class and issue
2104 a fatal accordingly.
2105 (declare_local_variables): Push a new block for the scope of the
2106 new variable(s) if code has been already generated at that nesting
2107 level. Pinpoint redefinition errors using the variable id
2108 WFLs. Generate initialization code if necessary. If the variable
2109 type is incomplete, register a patch on its decl.
2110 (source_start_java_method): Rewritten. Define a new block for the
2111 function's parameters. Build parameter decl out of function's
2112 arguments and register them for a patch if their types are
2113 incomplete.
2114 (expand_start_java_method): Includes the part of
2115 source_start_java_method that was pushing the parameter decls and
2116 completing the method start code.
2117 (source_end_java_method): Removed call the expand_end_bindings and
2118 poplevel (already taken care of). Reinstall function's arguments
2119 and get function's last line of code before calling
2120 expand_function_end.
2121 (java_method_add_stmt): New comment before the function's
2122 code. Complement the second operand of the current COMPOUND_EXPR
2123 if necessary.
2124 (java_complete_expand_methods): Don't generate debug info on line
2125 zero when expanding a generated constructor.
2126 (java_complete_expand_method): Set start and end line numbers for
2127 a artificially generated constructor to one and manually call
2128 enter_block and exit_block when defining it. For all methods:
2129 expand function's start calling the new expand_start_java_method
2130 and invoke java_complete_tree on the effective method's body, if
2131 any.
2132 (resolve_expression_name): Now use lookup_name_in_blocks to search
2133 local variable decls and print out an error when variables are
2134 undefined.
2135 (patch_method_invocation_stmt): Inserted comment before the
2136 function's code.
2137 (lookup_method_invoke): Chain method's arguments using chainon
2138 with the current arg list as a second argument. Inserted missing
2139 IDENTIFIER_POINTER when reporting an error on methods not found.
2140 (refine_accessible_methods_list): Don't retain constructors.
2141 (patch_arguments): Function removed.
2142 (java_complete_tree): Inserted comment before the function's
2143 code. New case for BLOCKs. Moved the WFL case a bit
2144 further. Complete function's arguments.
2145 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
2146 maybe_absorb_scoping_blocks): New functions.
2147
2148 Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2149
2150 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
2151 previously set.
2152 * jcf-parse.c (parse_source_file, java_error_count): New forward
2153 and extern declarations.
2154 (java_parse_abort_on_error): Macro moved.
2155 (jcf_parse_source): fatal called if fopen fails. Now calls
2156 parse_source_file.
2157 (parse_source_file): New parse_only parameter. Reflects the
2158 elimination of the second pass.
2159 (yyparse): parse_source_file called with argument set to 0.
2160 * jcf.h (JCF_ZERO): Sets java_source to zero.
2161 * lex.c (java_init_lex): pass argument is gone. Function modified
2162 to be called once during the analysis of a file.
2163 (java_unget_unicode): Fixed typo in fatal message.
2164 (java_get_line_col): Likewise.
2165 (java_lval): Likewise. String literals no longer built during
2166 second pass.
2167 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
2168 account.
2169 * parse.h (MODIFIER_WFL): New macro.
2170 (parse_check_super, parser_check_super_interface): Now return int.
2171 (parser_chain_incomplete_item, not_builtin_p,
2172 complete_method_decl): Declarations removed.
2173 (build_method_invocation_stmt, build_invoke): Renamed using the
2174 `patch' instead of `build'
2175 (register-incomplete_type, obtain_incomplete_type,
2176 java_complete_tree, java_complete_expand_method,
2177 unresolved_type_p, create_jdep_list): New function declarations.
2178 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
2179 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
2180 (jdep): New typedef on new struct _jdep.
2181 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
2182 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
2183 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
2184 JDEP_RESOLVED_P): New macros.
2185 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
2186 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
2187 JDEP_VARIABLE): New enum values and jdep kinds.
2188 (jdeplist): New typedef on struct _jdeplist.
2189 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
2190 macros.
2191 (CALL_EXPR_PRIMARY): New macro.
2192 (struct parser_ctxt): Fields java_pass, current_method_decl,
2193 method_decl_list deleted. New field jdeplist.
2194 (INCOMPLETE_P): Macro deleted.
2195 * parse.y (single_type_import_declaration:): Removed pass switch.
2196 (type_import_on_demand_declaration): Likewise.
2197 (field_declaration:): Removed pass switch on all sub rules.
2198 (class_declaration:): Call the complete_class_decl removed on
2199 class_body rules.
2200 (method_declaration:): Removed second pass switch. No longer chain
2201 methods decl when method_header reduced.
2202 (method_header:): Sub rules no longer depend on pass switch.
2203 (method_declarator:): Likewise.
2204 (method_body:): Likewise.
2205 (abstract_method_declaration:): Likewise.
2206 (block_statement:): Likewise.
2207 (local_variable_declaration:): Likewise.
2208 (argument_list:): Likewise.
2209 (method_invocation:): Likewise. Call to build_method_invocation_stmt
2210 removed. Partial CLASS_EXPR tree node built instead.
2211 (postfix_expression:): Removed pass switch on all sub rules.
2212 (java_pop_parser_context): Free classd_list content.
2213 (yyerror): Call obstrack_grow0 to finalize error message.
2214 (check_class_interface_creation): Comment modified to reflect new
2215 returned value meaning. Removed second pass switch. Return 1 if an
2216 error was found, 0 otherwise. Adjust pointer on filename if a
2217 leading path separator was found.
2218 (maybe_create_class_interface_decl): Removed first pass switch
2219 when linking the class decl to the class_list. Install a new
2220 jdep_list for the class.
2221 (add_superinterfaces): List of unresolved interfaces is
2222 gone. Unresolved interfaces are directly added to the current
2223 dependencies list.
2224 (create_interface): Second pass shortcut removed.
2225 ctpx->modifier_ctx access through MODIFIER_WFL.
2226 (create_class): Second pass shortcut removed. Call to
2227 register_incomplete_type replaces the call to
2228 parser_chain_incomplete_item.
2229 (complete_class_decl): Function removed.
2230 (duplicate_declaration_error): New way of retrieving redeclared
2231 item type.
2232 (register_fields): Call to lookup_modifier_cl replaced by
2233 MODIFIER_WFL. New way of handling unresolved type, using
2234 unresolved_type_p and obtain_incomplete_type.
2235 register_incomplete_type replaces call to parser_chain_incomplete_item.
2236 (patch_stage): New static global variable.
2237 (method_header): New way of handling unresolved type, using
2238 unresolved_type_p and obtain_incomplete_type. patch_stage used to
2239 indicates that the method decl needs to be patched.
2240 (check_abstract_method_header): Call to lookup_modifier_cl
2241 replaced by MODIFIER_WFL.
2242 (method_declarator): Incomplete argument type are registered
2243 calling register_incomplete_type. Patch on the declared method is
2244 issued in that case.
2245 (unresolved_type_p): New function.
2246 (parser_check_super_interface): New comment to reflect function's
2247 modified returned type (int). Function and has a new argument
2248 this_wfl. Call to parse_error_context uses this_wfl instead of
2249 relying on lookup_cl.
2250 (parser_check_super): Comment reflects function's new returned
2251 type (int). Function returns non zero value on error.
2252 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
2253 register_incomplete_type, jdep_resolve_class): New functions to
2254 handle incomplete types in declarations.
2255 (java_complete_class): Rewritten to work with the new incomplete
2256 type handling scheme.
2257 (complete_class_report_errors): Likewise.
2258 (complete_method_decl): Removed: it jobs is now handled by
2259 java_complete_class.
2260 (do_resolve_class): Class loaded in not already loaded and not
2261 found in Java source code.
2262 (java_check_regular_methods, java_check_abstract_methods): Don't
2263 call complete_method_decl anymore.
2264 (lookup_modifier_cl, not_builtin_p): Functions deleted.
2265 (read_import_dir): Got rid of the pass number dependency.
2266 (declare_local_variables): New handling of unresolved types (patch
2267 issued).
2268 (source_start_java_method): New parameter level. Function called
2269 with level set to 1 when argument types are potentially
2270 unresolved. Called to complete the job with level set to 2 once
2271 types are complete.
2272 (source_end_java_method): Call to permanent_allocation
2273 removed. Waiting to be replaced by a more suitable obstack
2274 management.
2275 (java_complete_expand_methods, java_complete_expand_method,
2276 java_expand_finals): New functions.
2277 (build_method_invocation_stmt): Renamed
2278 patch_method_invocation_stmt. Extracts function call expression
2279 (wfl) and arguments (args) from CALL_EXPR tree operands.
2280 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
2281 call. Patch the function and argument operand of the CALL_EXPR
2282 tree argument.
2283 (patch_argument, java_complete_tree): New functions.
2284
2285 Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
2286
2287 Recover from missing fields and methods (i.e. error instead of fatal).
2288 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
2289 * expr.c (expand_invoke): Recover from missing method.
2290 (expand_java_field_op): Recover from missing field.
2291 Inline references to java.lang.{Integer,Char,...}.TYPE.
2292 * typeck.c (get_type_from_signature), java-tree.h: New function.
2293 * class.c (add_method): Use get_type_from_signature.
2294 (build_class_ref): Handle a class that was not found.
2295 * typeck.c (convert): Handle conversion to pointers (for convenience).
2296 * verify.c (verify_jvm_instructions): Use get_type_from_signature
2297 instead of lookup_field to handle missing fields.
2298
2299 * jcf-parse.c (process_zip_dir): Set java_source.
2300
2301 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
2302
2303 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
2304
2305 Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2306
2307 * jcf-parse.c (load_class): Don't change input_filename before
2308 calling jcf_parse_source (but still do it before calling
2309 jcf_parse).
2310 (jcf_parse_source): Assign input_filename after having saved the
2311 parser context.
2312 * lex.c (java_init_lex): Chain a WFL node to the import on demand
2313 list. ctxp->modifier_ctx zeroed according to its new
2314 definition. ctxp->filename initialized. Removed
2315 JAVA_MODIFIER_CTX_UNMARK.
2316 (java_unget_unicode): Update the character based column position.
2317 (java_allocate_new_line): ref_count not used anymore. Always free
2318 ctxp->p_line. Initialize c_line->char_col to 0.
2319 (java_get_unicode): Update the character based column position.
2320 (java_lex): Use ctxp->elc to store current position in source
2321 file, at the beginning of the parsed token. Set modifier_ctx entry
2322 corresponding to the parse modifier to a WFL node. Return a WFL
2323 node when an identifier is parsed.
2324 (java_lex_error): Now uses ctxp->elc to store current position in
2325 source.
2326 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
2327 * lex.h (build_wfl_node): New function definitions.
2328 (struct java_line): ref_count and next fields are gone. New field
2329 char_col.
2330 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
2331 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
2332 (JAVA_COLUMN_DELTA): New macro.
2333 (java_lc): New typedef on new struct _java_lc.
2334 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
2335 (parse_error_context, parse_warning_context): Changed prototypes.
2336 (java_get_line_col): Added as an available global function.
2337 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
2338 (IC_DECL): Replaced by macro IC_TYPE
2339 (DEPEND_WFL): New macro.
2340 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
2341 wrong modifier.
2342 (exit_java_complete_class): Removed a commented out statement.
2343 (struct parser_ctxt): Added comments on fields. modifier_ctx is
2344 now an array of tree nodes. Deleted fields line_list and
2345 e_line. New field elc, to replace e_line.
2346 * parse.y (array_type:): Build WFL node.
2347 (qualified_name:): Build a single WFL node out of two. Retain
2348 the location information of the first node in the resulting node.
2349 (package_declaration:): Use package name as a WFL node
2350 (single_type_import_declaration:): Use imported name as a WFL node.
2351 (type_import_on_demand_declaration:): Use root of the imported
2352 packages as a WFL node.
2353 (field_declaration:): Removed unused local variable cl.
2354 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
2355 (yyerror): New static elc. Removed static error_line, error_pos.
2356 New local code_from_source. Save ctxp->elc into elc at the first
2357 pass. Call java_get_line_col to get a string of the line where
2358 the error occured.
2359 (debug_line): Removed static function.
2360 (parse_error_context, parse_warning_context): Parameter cl is now
2361 a WFL node. Use its value to initialize ctxp->elc.
2362 (redefinition_error): Parameter cl is now a WFL node.
2363 (parse_add_interface): New parameter wfl. No longer call
2364 lookup_cl, use wfl instead.
2365 (check_class_interface_creation): Parameter cl is now a WFL node.
2366 (maybe_create_class_interface_decl): Likewise.
2367 (add_superinterfaces): New function.
2368 (create_interface): Removed local cl, node, super_decl,
2369 super_decl_type. Function now uses id as a WFL node. Better
2370 warning/error report on obsolete or forbidden mix of
2371 modifiers. Now calls add_superinterfaces to register interfaces.
2372 (create_class): Removed local cl, node. Local variable id is used
2373 as a WFL node. Better error report on forbidden modifier
2374 mix. Uses add_superinterfaces to register interfaces.
2375 (find_field): Argument cl is now a WFL node. Now store the WFL
2376 node of a fields that needs to be checked for their
2377 initialization.
2378 (method_header): Local variable node non longer used. Local
2379 variable id replaces cl.
2380 (check_modifiers_consistency): Local variable cl is now a WFL
2381 node.
2382 (method_declarator): Local variable cl replaced by parameter id.
2383 (parser_qualified_name): Now uses parameter name as a WFL node.
2384 (parser_check_super_interface): New parameter wfl, for achieve
2385 greater accuracy during error reports.
2386 (parser_chain_incomplete_item): New parameter named location. Used,
2387 along the decl, to construct the incomplete item node.
2388 (java_complete_class): resolve_class now uses WFL node extracted
2389 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
2390 where appropriate.
2391 (complete_method_decl): Unresolved function's argument types are WFL.
2392 (resolve_class): Parameter cl is now a WFL node.
2393 (resolve_and_layout): Likewise.
2394 (do_resolve_class): Likewise. Try first to use cl and then do the
2395 lookup on the decl when calling check_pkg_class_access.
2396 (complete_class_report_errors): Use IC_TYPE in place of
2397 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
2398 instead of doing a lookup over the decl.
2399 (java_check_final): Use WFL info from field tree list.
2400 (lookup_cl): Rewritten and returns a statically defined WFL node.
2401 (lookup_modifier_cl): Now uses information from WFL nodes.
2402 (process_imports): Likewise.
2403 (read_import_dir): name and cl arguments replaced by a single WFL
2404 node. Function modified accordingly.
2405 (find_in_imports_on_demand): Now uses WFL node.
2406 (check_pkg_class_access): cl argument is now a WFL node.
2407 (declare_local_variables): Fixed to use WFL nodes.
2408 (resolve_expression_name): Likewise.
2409 (build_method_invocation_stmt): name_combo argument renamed
2410 wfl. Function modified to use WFL nodes.
2411 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
2412 (lookup_method_invoke): cl is now a WFL node. Added missing
2413 IDENTIFIER_POINTER to class type decl name.
2414
2415 Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
2416
2417 * lang.c (init_parse): Now returns char* containing the filename.
2418
2419 Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
2420
2421 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
2422
2423 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
2424 * class.c (make_class_data): If flag_assume_compiled, initial class
2425 state is CSTATE_PREPARED; make superclass and interfaces direct
2426 references, rather than constant pool indexes.
2427
2428 Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2429
2430 * parser.y: Include flags.h. Removed debug variable pl.
2431 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
2432 (block:): Likewise.
2433 (labeled_statement_nsi:): Generate debug info when reducing
2434 expression_statement:.
2435 (check_pkg_class_access): get_access_flags_from_decl invokation
2436 fixed for new CLASS_* flags location.
2437 (source_end_java_method): Save/restore parser context when
2438 entering/leaving this routine. Restore lineno to its right value
2439 before calling expand_end_bindings.
2440 (build_method_invocation_stmt): build_invoke called with the
2441 current line information.
2442 (build_invoke): New argument cl. Wrap the function call around a
2443 wfl node.
2444 (refine_accessible_methods_list): Changed comment, removed
2445 unnecessary code.
2446 * parse.h: Fixed typo in comments.
2447 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
2448 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
2449 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
2450 parser_ccb_indent.
2451 * lex.c (java_lex): Record the last closing curly bracket of a
2452 function.
2453 * jcf-parse.c (jcf_parse_source): Now calls
2454 java_check_methods. Clarified comment, fixed typo.
2455
2456 1998-04-09 Dave Brolley <brolley@cygnus.com>
2457
2458 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
2459 (finish_parse): Expose for non USE_CPPLIB builds.
2460
2461 Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
2462
2463 * lang.c (lang_print_xnode): New function.
2464
2465 Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
2466
2467 * decl.c (class_dtable_decl), java-tree.h: New tree node.
2468 * class.c (get_dispatch_vector, get_dispatch_table): New functions
2469 used to build a class's dispatch table.
2470 (make_class_data): Generate dispatch table if flag_assume_compiled.
2471 Set dtable of class object to address of class_dtable_decl.
2472
2473 * decl.c (int_decl_processing): Make soft_badarrayindex_node
2474 be volatile and have side effects - generates better code.
2475
2476 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
2477 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
2478
2479 * expr.c (expand_invoke): If class is final, method is
2480 effectively final, so can call it directly.
2481
2482 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
2483
2484 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
2485
2486 Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2487
2488 * parse.y (build_method_invocation_stmt): Removed extra argument
2489 to build_invoke.
2490
2491 Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2492
2493 * expr.c (dtable_indent): Now static global.
2494 (expand_invoke): Now call invoke_build_dtable and
2495 build_invokevirtual.
2496 (invoke_build_dtable, build_invokevirtual): New functions.
2497 * jcf-io.c (find_class): Defer issuing a warning by setting
2498 jcf->outofsynch to 1.
2499 * jcf-parse.c (jcf_out_of_synch): New function.
2500 (load_class): Test this_jcf.outofsynch flag and call
2501 jcf_out_of_synch accordingly.
2502 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
2503 comment indentation.
2504 * lex.c (java_get_unicode): Fixed code indentation.
2505 (java_lex): Create string literal. Fixed typo. Removed several
2506 premature obstack_free.
2507 * parse.h: New enums for name resolution and invocation mode.
2508 (struct qualification): New data structure.
2509 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
2510 (do_resolve_class, build_method_invocation_stmt,
2511 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
2512 debug_line, identical_subpath_p, invocation_mode,
2513 refine_accessible_methods_list, build_invoke,
2514 lookup_method_invoke): New functions declared.
2515 (build_invokevirtual, invoke_build_dtable, match_java_method,
2516 build_field_ref, jcf_out_of_synch): New references to external
2517 functions.
2518 (struct parse_ctxt): Removed artificial_constructor field.
2519 * parse.y: (array_type:): Type defined for this rule.
2520 (class_type:): Installed default rule for interface_type:.
2521 (array_type:): Now build Java array type.
2522 (qualified_name:): Now use obstack_grow0.
2523 (method_declaration:): Skip the artificial constructor added to
2524 the list, if any.
2525 (abstract_method_declaration:): Execute the code only during pass 1.
2526 (block:): Installed default rule in block_statements:.
2527 (block_statement:): Add the statement to the method during pass 2.
2528 (statement_expression): Installed default rule for
2529 method_invocation:.
2530 (argument_list:): Added code to build the argument list.
2531 (method_invocation:): Added call to create the method invocation
2532 node.
2533 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
2534 (debug_line): New function for debug.
2535 (complete_class_decl): No longer do something during pass 1.
2536 (method_header): Use BUILD_PTR_FROM_NAME.
2537 (parser_qualified_classname): Use obstack_grow0. Removed bogus
2538 obstack_free.
2539 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
2540 function's main comment.
2541 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
2542 classes.
2543 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
2544 (resolve_class): Now works with arrays.
2545 (do_resolve_class, resolve_and_layout): New functions.
2546 (java_check_regular_methods): Reverse method list before and after
2547 having processed it. No longer set ctxp->artificial_constructor.
2548 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
2549 accordingly. Fixed typo in issued error message. Now use
2550 obstack_grow0.
2551 (find_in_imports_on_demand): Now use obstack_grow0.
2552 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
2553 (source_end_java_method): Call expand_expr_stmt instead of
2554 expand_expr. Calls it before calling expand_function_end.
2555 (java_method_add_stmt): Do nothing if errors were found during
2556 parsing.
2557 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
2558 (build_method_invocation_stmt, build_invoke, invocation_mode,
2559 lookup_method_invoke, refine_accessible_methods_list,
2560 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
2561 New functions.
2562 * typeck.c (build_java_signature): Properly end method signature
2563 if return type skipped.
2564 (match_java_method): New function.
2565
2566 Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
2567
2568 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
2569
2570 Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2571
2572 * expr.c (build_invoke_non_interface): New function.
2573 (methods_ident, ncode_ident): Now static globals.
2574 (expand_invoke): Use build_invoke_non_interface.
2575 * java-tree.h (struct lang_decl): New field function_decl_body.
2576 (DECL_FUNCTION_BODY): New macro.
2577 * jcf-parse.c (jcf_parse_source): Deeper check before setting
2578 CLASS_FROM_SOURCE_P.
2579 (parse_source_file): Fixed typos. Call java_layout_parsed_class
2580 before starting pass 2. Call to java_generate_parsed_class replaced
2581 by java_register_parsed_class.
2582 * lex.c: Fixed typo in header. Some line width related formating.
2583 * lex.h: Some line width related formating.
2584 * parse.h (source_end_java_method, resolve_expression_name,
2585 complete_class_decl, maybe_create_class_interface_decl,
2586 check_class_interface_creation): New static function declarations.
2587 (java_layout_parsed_class, java_method_add_stmt): New function
2588 declarations.
2589 (struct parser_ctxt): Field mark_class_generate removed. New
2590 fields class_list and artificial_constructor.
2591 * parse.y: Fixed typo in header.
2592 (class_declaration:): Call complete_class_decl when class body
2593 parsed.
2594 (method_declaration:): Call source_end_java_method in pass 2 when
2595 the method body is defined.
2596 (postfix_expression:): Do expression name resolution on sub-rule
2597 name during pass 2.
2598 (create_class, create_interface): Merged common pieces.
2599 (check_class_interface_creation, maybe_create_class_interface_decl):
2600 New functions.
2601 (complete_class_decl): New function.
2602 (register_fields): Fixed line width related typo.
2603 (method_header): Correctly skip first argument when fixing
2604 argument line. Changed the loop.
2605 (java_check_circular_reference): Now use ctxp->class_list.
2606 (java_complete_class): Removed start/stop marking.
2607 (java_check_regular_methods): Now takes a class decl as an
2608 argument. Add default constructor if none were encountered.
2609 (java_check_methods): Now use ctxp->class_list. Changed call to
2610 java_check_regular_methods.
2611 (source_start_java_method): Set DECL_ARG_TYPE for each function
2612 arguments.
2613 (source_end_java_method, java_method_add_stmt): New functions.
2614 (java_generate_parsed_class): No longer exists.
2615 (java_layout_parsed_class, java_register_parsed_class): New functions.
2616 (resolve_expression_name): New function.
2617
2618 Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2619
2620 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
2621 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
2622 until pass initializations are done. Call read_import_dir with
2623 pass set to 0.
2624 * parse.h: (lookup_modifier_cl): New function declared.
2625 (INTERFACE_FIELD_MODIFIERS): New macro.
2626 (OBSOLETE_MODIFIER_WARNING): New macro.
2627 * parse.y: (register_fields): Class type and current field name in
2628 local variables. Check modifier(s) if adding field(s) to an interface.
2629 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
2630 and report errors using the faulty modifier line context.
2631 (lookup_modifier_cl): New function.
2632 (read_import_dir): Detect and report default import processing
2633 failure.
2634
2635 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
2636
2637 Add a pair of -fassume-compiled/-fno-assume-compiled options.
2638 * class.c (is_compiled_class): Return 1 after making sure it
2639 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
2640 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
2641 * java-tree.h (flag_assume_compiled): Add decl.
2642 * lang.c (lang_f_options): Add the flag.
2643 (flag_assume_compiled): Add decl, default to 0.
2644
2645 Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2646
2647 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
2648 (is_compiled_class): Likewise.
2649 (layout_class): Likewise.
2650 (layout_class): Detect and lay out classes defined in source code.
2651 (interface_of_p, add_interface_do, may_add_interface): New
2652 function.
2653 (add_interface): Now use add_interface_do.
2654 (add_method_1): New function.
2655 (add_method): Now use add_method_1.
2656 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
2657 (complete_start_java_method): New function.
2658 (start_java_mehod): Now call complete_start_java_method.
2659 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
2660 (expand_invoke): Likewise and fixed typo.
2661 *gjava.c: (print_super_field): Use new argument to find_class
2662 DO_CLASS_FILE.
2663 (main): Likewise.
2664 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
2665 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
2666 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
2667 IDENTIFIER_NODE.
2668 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
2669 (add_method_1, push_class): New prototypes.
2670 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
2671 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
2672 directory where the class was found.
2673 (find_class): New argument DO_CLASS_FILE. Function find_class
2674 modified accordingly.
2675 *jcf-parse.c: (fix_class_path): New function.
2676 (load_class): Use new VERBOSE argument. load_class now finds and
2677 loads/parses .class/.java files. Save read_state of current_jcf
2678 if necessary.
2679 (java_parser_abort_on_error): New macro.
2680 (jcf_parse_source, parse_source_file): New function.
2681 (jcf_parse): Fixed typo.
2682 (yyparse): Call parse_source_file () only.
2683 (process_zip_dir): Fixed typo, fix zdir->filename_length when
2684 writing the real class name back in the zip directory entry.
2685 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
2686 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
2687 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
2688 (find_class): Prototype fixed.
2689 *lex.c: Added 1998 time stamp.
2690 Removed all static global variables, moved into the parser
2691 context data structure.. Now include unistd.h if SEEK_SET not
2692 defined.
2693 (java_init_lex): Rewritten.
2694 (java_sneak_unicode): Modified current unicode access in current line.
2695 (java_unget_unicode): Likewise.
2696 (java_allocate_new_line): New allocation management.
2697 (java_read_char): Modified access and storage of unget_utf8_value.
2698 New way of processing current unicode.
2699 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
2700 (java_get_unicode): Now use the parser context.
2701 (java_lineterminator): Likewise.
2702 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
2703 of the reentrant parser implementation. Function now use the
2704 parser context data structure and java_lval. Fixed production of
2705 the float and double constant "out of range" error message. Fixed
2706 obstack use. Return integer value when hitting a modifier. Now
2707 return type for TRUE, FALSE and other predefined types. Return
2708 identifier as a TREE_LIST list containing the current line context
2709 as the TREE_VALUE sub-node.
2710 (java_unicode_2_utf8): Fixed typo in declaration.
2711 (java_lex_error): Now use the parser context data structure.
2712 *lex.h: Added 1998 time stamp.
2713 (struct java_line): New fields ref_count and next.
2714 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
2715 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
2716 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
2717 *parse.h: Added 1998 time stamp.
2718 (java_parse_source_file): Renamed from parse_source_file.
2719 (YYERROR_NOW, YYNOT_TWICE): Fixed.
2720 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
2721 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
2722 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
2723 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
2724 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
2725 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
2726 (struct parser_ctxt): New data structure to keep the parser context.
2727 *parse.y: Added 1998 time stamp, got rid of static global variables.
2728 (java_error_count, ctxp): New global variables.
2729 (%union): New value field.
2730 (numeric_type, integral_type): Rules removed.
2731 (primitive_type): Rule defined to handle integral, float, double and
2732 boolean types.
2733 (qualified_name, package_declaration,
2734 single_type_import_declaration, type_import_on_demand_declaration,
2735 modifiers, class_declaration, super, interfaces,
2736 interface_type_list, class_body, field_declaration,
2737 field_declaration, variable_declarators, variable_declarator,
2738 variable_declarator_id, method_declaration, method_header,
2739 formal_parameter_list, formal_parameter, method_body, block,
2740 static, interface_declaration, extends_interfaces,
2741 abstract_method_declaration, local_variable_declarators): Rules now
2742 define actions.
2743 (force_error, do_warning): New global statics.
2744 (push_parser_context, parser_context_save_global,
2745 parser_context_restore_global, pop_parser_context): New functions.
2746 (yyerror): Now uses the global parser context. Fixed use of obstack.
2747 (parse_error, parse_error_context, parse_warning_context,
2748 java_accstring_lookup, redefinition_error, check_modifiers,
2749 parser_add_interface, create_interface, create_class, find_field,
2750 duplicate_declaration_error, register_fields, method_header,
2751 check_modifiers_consistency, check_abstract_method_header,
2752 method_declarator, parser_qualified_classname,
2753 parser_check_super_interface, parser_check_super,
2754 parser_chain_incomplete_item, java_check_circular_reference,
2755 layout_class_from_source, java_complete_class,
2756 complete_method_decl, resolve_class, complete_class_report_errors,
2757 java_check_final, check_method_redefinition,
2758 java_check_regular_methods, java_check_abstract_methods,
2759 java_check_methods, lookup_java_interface_method2,
2760 lookup_java_method2, lookup_cl, find_name_in_single_imports,
2761 process_imports, find_in_imports, read_import_entry,
2762 read_import_dir, find_in_imports_on_demand,
2763 check_pkg_class_access, not_builtin_p, declare_local_variables,
2764 source_start_java_method, java_generate_parsed_class): New
2765 functions.
2766 *typeck.c: (signature_include_return): New global variable.
2767 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
2768 to add the function returned type in the signature.
2769
2770 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
2771
2772 * jcf-io.c (open_in_zip): Use strncmp and LEN.
2773
2774 Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
2775
2776 * Make-lang.in (java.info): Added.
2777 (java.install-info): Added
2778
2779 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
2780
2781 * Makefile.in (clean): Also remove java/parse.c.
2782
2783 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
2784
2785 Add a pair of -fbounds-check/-fno-bounds-check options.
2786 * lang.c (lang_decode_option): Add code to grok arguments.
2787 (flag_bounds_check): Add decl.
2788 (lang_f_options): New array w/ the option in it.
2789 * java-tree.h (flag_bounds_check): Add decl.
2790 * lang-options.h: New file.
2791 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
2792 of a static macro value.
2793 (JAVA_ARRAY_EXCEPTION): Delete macro.
2794
2795 Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
2796
2797 * typeck.c (build_java_array_type): Fix two bugs in previous change.
2798 * expr.c (build_anewarray): Add missing promote_type.
2799
2800 Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
2801
2802 Add array types with known length to optimize bounds checking.
2803 * typeck.c (build_java_array_type): Take length parameter.
2804 (java_array_type_length, build_prim_array_type): New functions.
2805 * java-tree.h: Update for new functions.
2806 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
2807 * class.c: Use build_prim_array_type.
2808 * expr.c (can_widen_reference_to): Handle known-length array types.
2809 (verify_jvm_instructions): Keep track of integer push instructions
2810 followed by newarray/anewarray, so we can build known-length arrays.
2811 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
2812 (java_array_data_offset): New function.
2813 (build_java_array_length_access): New function. Optimize if constant.
2814 (build_java_arrayaccess): Constant fold bounds check.
2815 (expand_java_newarray, expand_java_anewarray): Replaced by ...
2816 (build_newarray, build_anewarray): New functions.
2817 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
2818 * verify.c (merge_types): Handle known-lengh array types.
2819
2820 Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
2821
2822 * expr.c (expand_byte_code): Fix performace bug, which caused
2823 searching linenumber_table to be linear rather than constant.
2824
2825 Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
2826
2827 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
2828
2829 * decl.c, java-tree.h (soft_fmod_node): New global.
2830 * decl.c (init_decl_processing): Define __builtin_fmod.
2831 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
2832 using __builtin_fmod.
2833
2834 Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2835
2836 * keyword.h: New file, output of keyword.gperf as processed by
2837 gperf.
2838 * lex.c (java_lex_init): Initialize java_error_flag.
2839 * parse.c (YYERROR_NOW): Uses java_error_flag.
2840 * parse.y: New static java_error_flag. Useless definition of
2841 buffer_error gone.
2842 * parse.y (java_error): Portable error recovery using
2843 java_error_flag (not yet completely tuned).
2844
2845 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
2846
2847 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
2848
2849 Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2850
2851 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
2852 (parse.c, lex.c, keyword.h): New rules for Java source code
2853 front-end.
2854 * parse.c: Renamed into jcf-parse.c.
2855 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
2856 * keyword.gperf: New file, Java keywords.
2857 * parse.y: New file, Java language grammar.
2858 * parse.h: New file, Java language grammar definitions.
2859 * lex.c: New file, Java language lexer.
2860 * lex.h: New file, Java language lexer definitions.
2861
2862 Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
2863
2864 * decl.c (clinit_identifier_node), java-tree.h: New global.
2865 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
2866 * verify.c (verify_jvm_instructions): Inline use of removed macros.
2867 * expr.c (expand_java_field_op): Check for invalid assignment
2868 to final field.
2869
2870 * jcf-reader.c (get_attribute): Test for wrong attribute length.
2871
2872 Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
2873
2874 * verify.c (verify_jvm_instructions): When processing a handler,
2875 attempt to set the current_subr to the right value.
2876 (More complicated code combines Sep 17 and Oct 22 versions.)
2877
2878 Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
2879
2880 * class.c (push_class): Figure out (guess) name of source file.
2881 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
2882 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
2883 (parse_class_file): Change return type from int to void.
2884 Call debug_start_source_file/debug_end_source_file.
2885
2886 * expr.c (build_java_binop): Fix masking 2nd operand.
2887 * decl.c (init_decl_processing): Set sizetype first.
2888
2889 Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
2890
2891 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
2892 (Revert Sep 17 change.)
2893
2894 Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2895
2896 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
2897 .class extension in their name and fix thing so we don't process
2898 them parse_zip_file_entries().
2899 (parse_zip_file_entries): Cleaned unused local variables.
2900
2901 Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
2902
2903 * expr.c (can_widen_reference_to): Allows equal array element types.
2904 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
2905 * jcf-dump.c (RET): Get (and print) index.
2906
2907 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
2908 Promote element type to POINTER_TYPE.
2909
2910 Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2911
2912 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
2913 find_in_current_zip, jcf_figure_file_type): Moved from
2914 jcf-reader.c to parse.c.
2915 * zextract.c: (read_zip_archive): takes file_comment_length possible
2916 field into account.
2917
2918 Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
2919
2920 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
2921
2922 * verify.c (merge_types): Handle array types even better ...
2923
2924 Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
2925
2926 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
2927
2928 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
2929 * class.c (make_class_data): Don't build fields_decl if no fields.
2930 When building fields_decl, skip if DECL_ARTIFICAL.
2931
2932 * expr.c (java_stack_swap): Update stack_type_map.
2933 * verify.c (merge_types): Handle array types better.
2934
2935 Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
2936
2937 * class.c (add_field): Don't promote short integral fields to
2938 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
2939 * expr.c (push_value): Promote and convert short integral values.
2940
2941 * decl.c, java-tree.h (integer_two_node): New constant node.
2942 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
2943
2944 Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2945
2946 * class.c (append_gpp_mangled_type): Use function argument
2947 unpromoted type to generate mangled name.
2948
2949 Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
2950
2951 * constants.c (build_constant_data_ref): Now uses current_class
2952 instead of main_class.
2953 (build_constants_constructor): Now uses current_class instead of
2954 main_class.
2955 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
2956 of the global variable SeepZipFiles done here.
2957 * zextract.c (read_zip_archive): extra_field optional field taken
2958 into account while computing the position of the class file in the
2959 archive.
2960 * verify.c (verify_jvm_instructions): Use current_jcf to search
2961 the constant pool.
2962 * parse.c (load_class): First search for the class to load in the
2963 current zip file. Saves current_jcf (restored before returning
2964 from that function). Don't call JCF_FINISH in the class was found
2965 in the current ZIP file.
2966 (jcf_parse): If the class was found in the current ZIP file, save
2967 its tree_constant_pool (for later reuse).
2968 (parse_class_file): New function. Process each method defined in
2969 the current class and record the class as to be later registered.
2970 (yyparse): Rewritten. Figure the type of the current file and switch
2971 accordingly.
2972 * lang.c: New global variable current_jcf.
2973 (lang_init): Removed compiling_from_source test (done later, in
2974 yyparse). Removed call the jcf_parse ().
2975 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
2976 (typedef struct JCF): New fields seen_in_zip (to mark a class found
2977 in the current ZIP file) and zip_offset (offset to the class data in
2978 the current zip file).
2979 * jcf-reader.c: zipfile.h included.
2980 localToFile: New ZipFileCache static global variable
2981 (parse_zip_file_entries): New function. Browse the current ZIP
2982 file directory and process each class found.
2983 (process_zip_dir): New function. Register each class found in the
2984 ZIP file directory. The class aren't parsed but a valid JCF is
2985 link to each of them.
2986 (find_in_current_zip): New function. Search for a class in the
2987 current ZIP file directory. If found, prepare the class so that it
2988 can be loaded.
2989 (jcf_figure_file_type): New function. Examine the file structure
2990 to figure a class file, a ZIP file. If none of these categories are
2991 matched, a source file is assumed.
2992 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
2993 SeenZipFile: New global variable.
2994 (open_in_zip): Use zipmember's length to accelerate the search for
2995 a member. If zipmember was NULL and zip file successfully read,
2996 return 0.
2997 * java-tree.h: New global variable current_jcf declared. Added
2998 declaration for current_constant_pool_tags, current_constant_pool_data,
2999 current_constant_pool_length, current_constant_pool_data_ref.
3000 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
3001 store the JCF of classes seen in a zip file) and tree *constant_pool
3002 (to save a loaded class constant pool). current_class declared here.
3003 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
3004 retrieve method_ref_constant.
3005 (PUSHC): java_push_constant_from_pool now uses current_jcf.
3006 (OBJECT): get_class_constant now uses current_jcf.
3007 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
3008 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
3009 (expand_invoke): Now uses current_class instead of main_class
3010 (build_class_init): Now uses current_class instead of main_class
3011 * class.c: New static global variable registered_class.
3012 (register_class): New function.
3013 (emit_register_class): Modified to use registered_class instead of
3014 main_class
3015 (is_compiled_class): Now take into account class seen in the archive.
3016
3017 Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
3018
3019 * except.h: Renamed to: java-except.h.
3020 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
3021 * except.c: Add semi-working (commented out) implementation.
3022
3023 * expr.c (expand_iinc): Add needed flush_quick_stack.
3024 * parse.c (set_source_filename): New function.
3025 (give_name_to_class): Set input_filename from package.classname.java.
3026
3027 * jcf-io.c (find_class): Don't look first in ".".
3028
3029 Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3030
3031 * zextract.c (read_zip_archive): Now takes into account the
3032 extra_field field.
3033 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
3034
3035 Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
3036
3037 * constants.c, java-tree.h (build_internal_class_name): New function.
3038 (alloc_class_constant): Re-implement using build_internal_class_name.
3039 * class.c (make_class_data): Likewise.
3040 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
3041
3042 Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
3043
3044 * verify.c (verify_jvm_instructions): Temporarily set current_subr
3045 to NULL before pushing an exception handler target.
3046
3047 * expr.c (flush_quick_stack): Save from low stack indexes to high.
3048 (java_stack_swap, java_stack_dup): Re-write to be safe from
3049 clobbering registers.
3050 (build_class_init): New function.
3051
3052 Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3053
3054 * typeck.c (build_java_array_type): Temporary use
3055 permanent_obstack to create the array 'length' field.
3056 * expr.c (lookup_label): Temporay use permanent_obstack to create
3057 label if not found.
3058 * class.c (push_super_field): Tempory use permanent_obstack.
3059
3060 Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3061
3062 * typeck.c (type_for_mode): Now handles double_type_node and
3063 float_type_node.
3064 * verify.c (verify_jvm_instructions): The instruction following
3065 the wide bytecode is checked. OPCODE_ret added to the list of
3066 wide.
3067
3068 Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3069
3070 * class.c (make_class): Temporary use permanent_obstack. Set the
3071 class CLASS_P field to 1.
3072 (push_class): Temporary use permanent_obstack.
3073 (set_super_info): Temporary use permanent_obstack.
3074 (add_method): Temporary use permanent_obstack, set
3075 METHOD_TRANSIENT().
3076 (add_field): Temporary use permanent_obstack. Sets
3077 FIELD_VOLATILE() and FIELD_TRANSIENT().
3078 (build_class_ref): Temporary use permanent_obstack if the class
3079 isn't compiled.
3080 (build_static_field_ref): Temporary use permanent_obstack when
3081 creating field's rtl.
3082 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
3083 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
3084 and fields. Function finalized, as far as flag handling.
3085 (push_class_static_dummy_field): Temporary use permanent_obstack.
3086 (emit_register_class): Force generation of class registration at
3087 -O3 or deeper.
3088 * decl.c (end_java_method): Call permanent_allocation() before
3089 returning.
3090 * expr.c (can_widen_reference_to): Added comment to interface
3091 handling, fixed typo.
3092 (lookup_field): Now uses CLASS_P() to correct FIXME
3093 (expand_invoke): Verification on public && !static &&
3094 !abstract moved into soft_lookupinterfacemethod (kaffe).
3095 Use Object class dtable if objectref is an array when expanding
3096 invokeinterface.
3097 (java_push_constant_from_pool): Temporary use permanent_obstack
3098 for CONSTANT_string
3099 * parse.c (get_ref_constant): Temporary use permanent_obstack to
3100 create constant references.
3101 (get_constant): Temporary use permanent_obstack to create constant.
3102 (load_class): Temporary use permanent_obstack to load class.
3103 (jcf_parse): Temporary use permanent_obstack to perform class
3104 layout.
3105 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
3106 (build_java_signature): Temporary use permanent_obstack.
3107 * verify.c: (verify_jvm_instruction): removed unecessary verification
3108 on ACC_SUPER flag.
3109 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
3110 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
3111 (CLASS_P): Defined
3112
3113 Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
3114
3115 * class.c (append_gpp_mangled_type): Fix typo.
3116 (emit_register_class): Use main_class to get class object, rather
3117 than looking for no-longer-existing static decl starting with _CL.
3118 * typeck.c (parse_signature_type): Promote array element type
3119 if it is a RECORD_TYPE.
3120
3121 Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
3122
3123 * class.c (push_class_static_dummy_field): New function.
3124 (mangle_static_field): New. Do G++-style mangling of static fields.
3125 (layout_class): Mandle static fields here, not in add_field.
3126 (build_class_ref): The class object is now a dummy static field.
3127 * decl.c (find_local_variable): Look for best, instead of first match.
3128 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
3129 (build_java_athrow): Don't check here if exception is Throwable.
3130 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
3131 (TYPE_USED): Removed. No longer used ...
3132 * parse.c (jcf_parse): Call push_class_static_dummy_field.
3133 * verify.c (push_pending_label): New function.
3134 (push_pending_block): Renamed to check_pending_block.
3135 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
3136 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
3137 re-checking possible handlers) after a store (less wasted work).
3138 Check for null handler (finally) before calling add_handler.
3139 Various changes to (finally?) correctly handle try/finally.
3140
3141 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
3142
3143 * class.c: Include stdio.h.
3144
3145 Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
3146
3147 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
3148 to make sure class is initialized before static/special invoke.
3149
3150 * verify.c (verify_jvm_instructions): On a store instruction,
3151 call find_local_variable to force pre-allocation of decl and rtx.
3152 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
3153
3154 Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
3155
3156 * class.c (build_class_ref): Strip off "promoted_" if need be.
3157 (make_field_value): Call build_java_signature when needed.
3158 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
3159 * expr.c (build_java_athrow): Don't push_value of exception.
3160 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
3161 match specification of [fd]cmp[lg] for NaNs.
3162 (expand_byte_code): Add support for exception handler ranges.
3163 * except.c: Add skeleton for EH code-generation.
3164 * verify.c (merge_types): Treat all promoted integral types as equal.
3165 * constants.c (build_constants_constructor): To force creation of
3166 current_constant_pool_data_ref, call build_constant_data_ref.
3167
3168 * javaop.def (lload): Fix typo.
3169 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
3170
3171 Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
3172
3173 * parse.c: Don't include function.h.
3174
3175 Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
3176
3177 * except.[ch]: New files.
3178 * Makefile.in (JAVA_OBJS): Add except.o
3179 * expr.c: Temporary warning about unimplemented exceptions.
3180 * verify.c: Verify exception handlers.
3181
3182 * jcf-dump.c (disassemble_method): Print exception table.
3183
3184 Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3185
3186 * expr.c (verify_jvm_instructions): Started a thorough
3187 verification of invoke* bytecodes.
3188 (expand_byte_code): flush quick stack if PC is the target of a
3189 branch. and undef RET (conflicting with config/i386/i386.h).
3190 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
3191 used.
3192 (expand_invoke): Now handles invokeinterface and do more
3193 verification according to the bytecode.
3194 (lookup_field): Don't try to load the class if processing
3195 dtable_type.
3196 (can_widen_reference_to): Now handles interfaces.
3197 * decl.c (init_decl_processing): New global variable
3198 soft_lookupinterfacemethod_node, declared in java-tree.h.
3199 Call set_super_info on string_type_node.
3200 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
3201 defined.
3202 * class.c (set_super_info): Fills the CLASS_* flags according to
3203 access_flags.
3204 (get_access_flags_from_decl): Handles all class flags.
3205
3206 Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
3207
3208 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
3209 * parse.c (yyparse): Check for abstract method, and missing code.
3210 * expr.c (expand_byte_code): Change interface.
3211 * lang.c (put_decl_node): Print promoted types prettier.
3212 * verify.c (verify_jvm_instruction): Change interface.
3213 Partial support for scanning exception table.
3214 For load instructions, handle promoted integral types.
3215
3216 Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
3217
3218 * verify.c: New file, with contents moved from expr.c.
3219 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
3220 * typeck.c (is_array_type_p): Moved here from expr.c.
3221 * java-tree.h: Add some now-needed function declarations.
3222 * Makefile.in (JAVA_OBJS): Added verify.o.
3223
3224 Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3225
3226 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
3227 METHOD_ABSTRACT flag.
3228
3229 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
3230 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
3231 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
3232
3233 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
3234 variables.
3235 (start_java_method): Hook for SYNCHRONIZED methods.
3236
3237 * expr.c (build_java_jsr, build_java_ret): New functions
3238 (JSR,PRE): New macros
3239 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
3240 (verify_jvm_instructions): tableswitch, lookupswitch,
3241 monitorenter, monitorexit, goto_w: verified.
3242 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
3243 (build_java_monitor): New function.
3244 (MONITOR_OPERATION): Modified to call build_java_monitor()
3245 (verify_jvm_instructions): Started a thorough verification of
3246 invoke* bytecodes.
3247
3248 Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
3249
3250 Support verification of jsr/ret subroutines (used for try/finally).
3251 * decl.c (return_address_type_node): New type node.
3252 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
3253 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
3254 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
3255 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
3256 TYPE_USED): New macros for special types in type_map.
3257
3258 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
3259 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
3260 BCODE_JUMP_TARGET.
3261 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
3262
3263 * expr.c (can_widen_reference_to): New function.
3264 (pop_type): Use it.
3265 (merge_type_state): Support handling start of subroutine.
3266 (push_pending_block): Return char* error message, instead of calling
3267 fatal on an error. Also handle subroutines.
3268 (verify_jvm_instructions): Handle errors from push_poending_block.
3269 Support jsr and ret instructions.
3270
3271 Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
3272
3273 * jcf-io.c (find_classfile): Fix thinko.
3274 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
3275
3276 Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
3277
3278 * Makefile.in (BISON): Remove.
3279
3280 Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
3281
3282 * Makefile.in: Convert to autoconf.
3283 * config-lang.in (outputs): Added java/Makefile.
3284
3285 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
3286 Rename cc1java to jc1.
3287
3288 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
3289 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
3290
3291 * class.c (class_depth): Do load_class if needed.
3292
3293 Mostly better verification.
3294 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
3295 (init_decl_processing): Change return type of soft_checkcast.
3296 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
3297 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
3298 lang_print_error): New functions.
3299 (lang_init): Set global hook print_error_function to lang_print_error.
3300 * expr.c: In the type_map ptr_type_node is only used for null now.
3301 (pop_type, merge_types): Hence ptr_type_node matches any reference.
3302 (merge_types): Dererence pointer to record types before comparing.
3303 (decode_newarray_type, merge_types): On error just return NULL.
3304 (build_java_binop): Add preliminary implementation (with warning)
3305 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
3306 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
3307 (expand_compare, expand_java_goto, expand_java_call): Don't
3308 push_pending_block, since that only makes sense when verifying.
3309 (merge_type_state): Different return codes.
3310 (push_pending_block): A block may need to be verified more than once.
3311 (expand_byte_code): Warn about unused code at code generation time.
3312 (verify_jvm_instruction): Changed logic, since code may need to be
3313 re-verified if type-state has changed. Also, better error handling.
3314 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
3315 Improve newarray, anewarray, ?aload, athrow,
3316 * java-tree.h (LABEL_CHANGED): New macro.
3317
3318 Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3319
3320 * decl.c (soft_athrow_node): New global variable initialized.
3321 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
3322 * typeck.c (convert): Added support for REAL_TYPE.
3323 (convert_to_char): New function.
3324 (convert): Handle CHAR_TYPE.
3325 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
3326 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
3327 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
3328 promoted type.
3329 (verify_jvm_instructions): Added break a the end of bogus unop: label.
3330 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
3331 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
3332 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
3333 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
3334 to Use The Right Things.
3335 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
3336 compatible with INT. BOOLEAN is made equivalent to BYTE.
3337 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
3338 OPCODE_ifnonnull): Now supported.
3339 (build_java_athrow): New function.
3340
3341 Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
3342
3343 Rename method name <init> to match G++ (and fix mangling).
3344 * class.c (layout_class): Replace method name of <init> by class name.
3345 (make_method_value): Do inverse renaming of constructor from <init>.
3346 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
3347 * typeck.c (lookup_java_constructor): New function.
3348 * expr.c (expand_invoke): If method_name is <init>, call
3349 lookup_java_constructor to find constructor.
3350
3351 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
3352
3353 Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
3354
3355 * parse.c (get_class_constant): Modified to handle array "classes"
3356 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
3357 wide type.
3358 (convert): Modified to handle real type.
3359 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
3360 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
3361 variables declared.
3362 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
3363 soft_multianewarray, soft_newarray_node, soft_throw_node): New
3364 global variables initialized.
3365 (find_local_variable): Handles the case of a pointer
3366 (end_java_method): Restore the use of one more scope
3367 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
3368 build_java_array_length_access, expand_java_arrayload,
3369 expand_java_arraystore, expand_java_array_length,
3370 expand_java_multianewarray, expand_java_anewarray,
3371 build_java_check_indexed_type, is_array_type_p,
3372 build_java_throw_out_of_bound_exception): New functions.
3373 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
3374 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
3375 OPCODE_<t>aload): Implemented code for verification.
3376 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
3377 ARRAY_NEW_MULTI): Macro defined.
3378 (CONVERT): Modified to invoke convert().
3379 (case OPCODE_aload2): Fixed index typo from 2 to 1.
3380
3381 Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
3382
3383 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
3384 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
3385 (make_class_data): Field name needs '/' as package prefix.
3386 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
3387
3388 Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
3389
3390 Implement debug information for local variables.
3391 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
3392 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
3393 DECL_LOCAL_SLOT_CHAIN): New macros.
3394 (struct lang_decl_var): New type.
3395 * parse.c (give_name_to_locals): Move to decl.c.
3396 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
3397 (start_java_method): Re-write parameter handling.
3398 (pending_local_decls): New global variable.
3399 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
3400 (find_local_variable): Accept pc so we can skips decls not in range.
3401 (struct binding_level): Add end_pc field.
3402 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
3403 (various): Change so current pc gets passed to find_local_variable.
3404
3405 * decl.c (init_decl_processing): Re-arrange fields in
3406 class_type_node and and method_type_node to match kaffe 0.9.1.
3407 * class.c (make_method_value, make_class_data): Update
3408 initializations to match.
3409
3410 Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
3411
3412 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
3413 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
3414 (push_super_field): New function.
3415 (make_class_data): Handle inheritance of class static initializer.
3416 (layout_class): New name mangling.
3417 * constants.c (build_constant_data_ref): Init type of data array
3418 to a one-element array.
3419 (build_constants_constructor): Set DECL_SIZE from complete array type.
3420 * decl.c: Rename class_type, object_type etc to class_type_node,
3421 object_type_node etc. Make former inherit from latter.
3422 * expr.c (expand_invoke): Add cast of function address.
3423 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
3424 * parse.c (yyparse): Don't call layout_class here.
3425 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
3426
3427 Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
3428
3429 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
3430 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
3431 (alloc_class_constant): New.
3432 * expr.c (expand_invoke): Make sure method's class is initialized.
3433 * class.c (interits_from_p, emit_register_class): New functions.
3434 * parse.c (yyparse): Call emit_register_class.
3435
3436 Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
3437
3438 * constants.c: New file, to handle constant pool.
3439 * Makefile.in (JAVA_OBJS): Add constants.o.
3440 * decl.c (init_decl_processing): Update, fix, finish various structs.
3441 (pushdecl_top_level): New.
3442 * parse.c (layout_class): Moved to class.c.
3443 * expr.c (java_push_constant_from_pool): New function.
3444 * class.c (build_class_ref): Make work fully
3445 (make_class_data): Emit super-class, constant pool, interface vector.
3446
3447 Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
3448
3449 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
3450 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
3451 * class.c (class_depth): New function.
3452 (lookup_named_class): Replaced by new function lookup_class.
3453 * decl.c (object_type_node, string_type_node): New.
3454 Remove various types that we no longer need.
3455 * expr.c (verify_jvm_instructions): New separate verifier pass.
3456 (push_type, pop_type): New functions for verifier.
3457 (type_stack_dup, pop_argument_types, merge_types): Likewise.
3458 (expand_byte_code): Simplify, since we assume already verified.
3459 (expand_invoke): Now mostly works.
3460 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
3461 * lang.c (main_class): Move to parse.c. Don't make_class yet.
3462 * parse.c: Wait to allocate class object until we know its name.
3463 (layout_class): Calculate DECL_VINDEX for each virtual method.
3464 * typeck.c (get_array_type): Rename to ...
3465 (build_java_array_type): ... and provide working implementation.
3466 (build_java_signature): New function - build Java signature of type.
3467 (set_java_signature): New function - cache signature with type.
3468 (lookup_java_method): New function.
3469
3470 Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
3471
3472 * class.c (ident_subst): Take extra SUFFIX parameter.
3473 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
3474 (set_constant_value, build_static_field_ref, is_compiled_class): New.
3475 (build_class_ref): Actually implement.
3476 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
3477 * decl.c (builtin_function): New.
3478 (init_decl_processing): Update for current Kaffe. Declare some
3479 builtin Kaffe functions.
3480 * expr.c (build_address_of): New.
3481 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
3482 Renamed (from expand_java_new etc), and added working implementations.
3483 (build_field_ref): Now also handle static fields.
3484 (expand_invoke): Implement invokestatic, and start implement rest.
3485 * java-opcodes.h: Use javaop.def to avoid duplicated list.
3486 * javaop.def: Rename invokevirt -> invokevirtual.
3487 * lang.c (use_handles): Removed.
3488 * parse.c: Add support for ConstantValue atribute.
3489 Handle nested loading of a class. (JPOOL_UTF): New.
3490
3491 Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
3492
3493 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
3494
3495 Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
3496
3497 * Make-lang.in (java.install-man): New empty rule.
3498 * typeck.c (set_local_type): New function.
3499 * expr.c (STORE_INTERNAL): Call find_local_variable,
3500 not find_stack_slot. Call set_local_type.
3501
3502 Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
3503
3504 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
3505 and building RECORD_TYPE CONSTRUCTORs.
3506 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
3507
3508 * lang.c (use_handles): Change the default to 0.
3509 * decl.c: Define and build class_type, field_type, utf8const_type.
3510 * class.c (make_class_data, make_field_value,
3511 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
3512 hashUtf8String, strLengthUtf8, mangled_classname:
3513 Functions to build reflective data structures.
3514 * parse.c (yyparse): Call make_class_data.
3515
3516 * jcf-io.c (open_class, find_classfile): New functions.
3517 * jcf-dump.c: Support reading classfile from explicitly-named
3518 class file (without CLASSPATH searching).
3519
3520 Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
3521
3522 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
3523 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
3524 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
3525 (get_constant): Now trivial for CONSTANT_Utf8.
3526
3527 * jcf.h: Make NEW_CPOOL the default.
3528 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
3529
3530 Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>
3531
3532 New directory.
This page took 0.19704 seconds and 5 git commands to generate.