1 2004-10-01 Jan Hubicka <jh@suse.cz>
3 * java.c (java_expand_body): Update call of tree_rest_of_compilation.
5 2004-10-01 Kazu Hirata <kazu@cs.umass.edu>
7 * lex.c: Fix a comment typo.
9 2004-10-01 Kazu Hirata <kazu@cs.umass.edu>
11 * java-tree.h: Fix a comment typo.
13 2004-09-30 Per Bothner <per@bothner.com>
15 Simplify lexer. Implement --enable-mapped-location support.
16 * jcf-parse.c (parse_class_file): Use linemap_line_start.
17 (parse_source_file_1): Pass filename as extra parameter, so we can call
18 linemap_add and set input_location here, rather than in both callers.
19 (read_class): Pass copied filename to parse_source_file_1.
20 Don't initialize wfl_operator - only needed for source compilation.
21 (read_class, jcf_parse): Call linemap_add with LC_LEAVE.
22 * lex.h: Remove a bunch of debugging macros.
23 * lex.h (struct_java_line, struct java_error): Remove types.
24 (JAVA_COLUMN_DELTA): Remove - use java_lexer.next_colums instead.
25 (struct java_lc_s): Remove prev_col field.
26 (struct java_lexer): New fields next_unicode, next_columns, and
27 avail_unicode. New position field, and maybe token_start field.
28 Don't need hit_eof field - use next_unicode == -1 instead.
29 (JAVA_INTEGERAL_RANGE_ERROR): Rename to JAVA_RANGE_ERROR.
30 (JAVA_RANGE_ERROR, JAVA_FLOAT_ANGE_ERROR): Update accordingly.
31 * parse.h: Various changes for USE_MAPPED_LOCATION.
32 (EXPR_WFL_EMIT_LINE_NOTE): XXX
33 (BUILD_EXPR_WFL, EXPR_WFL_ADD_COL): Remove no-longer-used macros.
34 (struct parser_ctxt): New file_start_location field.
35 Remove p_line, c_line fields since we no longer save lines.
36 Remove elc, lineno, and current_jcf fields - no longer used.
37 * parse.y: Updates for USE_MAPPED_LOCATION and new lexer.
38 Don't use EXPR_WFL_ADD_COL since that isn't trivial with
39 source_location and is probably not needed anymore anyway.
40 Use new expr_add_Location function.
41 (SET_EXPR_LOCATION_FROM_TOKEN): New convenience macro.
42 (java_pop_parser_context): Minor cleanup.
43 (java_parser_context_save_global, java_parser_context_restore_global,
44 java_pop_parser_context): Save/restore input_location as a unit.
45 (issue_warning_error_from_context): If USE_MAPPED_LOCATION take
46 a source_location instead of a wfl context node.
47 (check_class_interface_creation): input_filename is not addressable.
48 (create_artificial_method): Calling java_parser_context_save_global
49 and java_parser_context_restore_global is overkill. Instead,
50 temporarily set input_location from class decl.
51 (java_layout_seen_class_methods): Set input_location from method decl.
52 (fix_constructors): Make more robust if no EXPR_WITH_FILE_LOCATION.
53 (finish_loop_body): Likewise.
54 * lex.c: Updates for USE_MAPPED_LOCATION. Use build_unknwon_wfl.
55 (java_sprint_unicode): Take a character, not index in line.
56 (java_sneak_uncode): Replaced by java_peek_unicode.
57 (java_unget_unicode): No longer used.
58 (java_allocate_new_line. java_store_unicode): Removed, since we
59 no longer remember "lines".
60 (java_new_lexer): Update for new data structures.
61 (java_read_char): Move unget_value checking to java_read_unicode.
62 (java_get_unicode, java_peek_unicode, java_next_unicode): New more
63 efficient functions that are used directly when lexing.
64 (java_read_unicode_collapsing_terminators): No longer needed.
65 (java_parse_end_comment, java_parse_escape_sequence, do_java_lex):
66 Re-organize to use java_peek_unicode to avoid java_unget_unicode.
67 (java_parse_escape_sequence): Rewrite to be simpler / more efficient.
68 (do_java_lex): Lots of movings around to avoid java_unget_unicode,
69 combine switch branches, and test for common token kinds earlier.
70 (java_lex_error): Rewrite.
71 * jv-scan.c (expand_location): New function, copied from tree.c.
72 (main): Set ctxp->filename instead of setting input_filename directly.
74 2004-09-30 Per Bothner <per@bothner.com>
76 More cleanup for --enable-mapped-location.
77 * class.c (push_class): If USE_MAPPED_LOCATION don't set
78 input_location here. Instead do it in give_name_to_class.
79 (build_class_ref): Set DECL_ARTIFICIAL, for the sake of dwarf2out.
80 * expr.c (expand_byte_code): Call linemap_line_start.
81 * expr.c (build_expr_wfl): If USE_MAPPED_LOCATION, change final
82 parameters to a source_location. Don't need EXPR_WFL_FILENAME_NODE.
83 (expr_add_location): New function, if USE_MAPPED_LOCATION.
84 * class.c (maybe_layout_super_class): Adjust build_expr_wfl call
85 to USE_MAPPED_LOCATION case.
87 * java-tree.h (JAVA_FILE_P, ZIP_FILE_P): Remove unused macros.
88 * jcf-parse.c (java_parse_file): Don't set input_filename.
89 Use IS_A_COMMAND_LINE_FILENAME_P to check for duplicate filenames.
90 Create a list of TRANSLATION_UNIT_DECL.
91 (current_file_list): Is now a TRANSLATION_UNIT_DECL chain. The
92 reason is so we can set a DECL_SOURCE_LOCATION for each file.
93 (java_parse_file): Don't set unused ZIP_FILE_P, JAVA_FILE_P..
94 Create line-map LC_ENTER/LC_LEAVE entries for archive itself.
95 (file_start_location): New static.
96 (set_source_filename): Avoid extra access to input_filename macro.
97 Concatenate new name with class's package prefix.
98 (set_source_filename, give_name_to_class): Update.
99 (give_name_to_class): Set class's "line 0" input_location here.
100 (parse_class_file): Set input_location as a unit.
102 * jcf-parse.c (load_class): Sanity test if missing inner class file.
104 2004-09-29 Per Bothner <per@bothner.com>
106 * java-tree.h: Redefine some macros and add some declaration
107 to handle the USE_MAPPED_LOCATION case.
108 * parse.h (EXPR_WFL_QUALIFICATION): Use operand 1, not 2.
109 * java-tree.h (EXPR_WFL_FILENAME_NODE): Use operand 2, not 1.
110 * java-tree.def (EXPR_WITH_FILE_LOCATION): Only need two operands in
111 USE_MAPPED_LOCATION case, since EXPR_WFL_FILENAME_NODE is gone.
113 * check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
114 * decl.c (finish_method, java_add_stmt): Likewise.
115 * java-gimplify.c (java-gimplify.c): Likewise.
116 * jcf-write.c (generate_bytecode_insns): Likewise.
117 * lang.c (java_post_options): Likewise - call linemap_add.
119 2004-09-29 Andrew Haley <aph@redhat.com>
122 * parse.y (patch_binop): Don't mess with the TREE_SIDE_EFFECTS of the
123 result of TRUNC_MOD_EXPR.
124 (patch_unaryop): Likewise for CONVERT_EXPR, which may throw.
125 * decl.c (java_init_decl_processing): Mark
126 soft_lookupinterfacemethod_node and soft_instanceof_node pure.
128 2004-09-28 Tom Tromey <tromey@redhat.com>
131 * class.c (add_miranda_methods): Load superinterface if not
134 2004-09-28 Andrew Haley <aph@redhat.com>
137 * jcf-parse.c (load_class): Don't try to read a class that we've
140 2004-09-28 Andrew Haley <aph@redhat.com>
142 * jcf-parse.c (load_class): Back out previous broken patch.
144 2004-09-28 Andrew Haley <aph@redhat.com>
147 * jcf-parse.c (load_class): Don't try to read a class that we've
149 Check that we really did read the right class.
151 2004-09-25 Tom Tromey <tromey@redhat.com>
154 * parse.y (create_artificial_method): Use add_method_1.
156 2004-09-25 Kazu Hirata <kazu@cs.umass.edu>
158 * expr.c, jcf-dump.c, parse-scan.y, parse.y: Fix
160 * gcj.texi: Fix typos.
162 2004-09-24 Tom Tromey <tromey@redhat.com>
165 * parse.y (class_instance_creation_expression): Set `$$' to NULL
166 in error parts of rule.
167 (unary_expression): Don't call error_if_numeric_overflow when $1
170 2004-09-24 Tom Tromey <tromey@redhat.com>
173 * parse.y (resolve_qualified_expression_name): Set
174 CAN_COMPLETE_NORMALLY on first call when chaining static calls.
175 * expr.c (force_evaluation_order): Check for empty argument list
176 after stripping COMPOUND_EXPR.
178 2004-09-23 Andrew Haley <aph@redhat.com>
181 * parse.y (java_complete_lhs): Call patch_string() on Operand 1 of
184 2004-09-23 Tom Tromey <tromey@redhat.com>
187 * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
188 where operand is null.
190 2004-09-23 Tom Tromey <tromey@redhat.com>
193 * parse.y (not_accessible_p): Allow access to protected members
194 even when class is not static.
196 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
198 * Make-lang.in: Revert the gcc-none.o change.
200 2004-09-22 Nathan Sidwell <nathan@codesourcery.com>
202 * parse.y (patch_anonymous_class): VEC_space returns true if there
205 2004-09-21 Matt Austern <austern@apple.com>
208 * gjavah.c (free_method_name_list): Fix function definition so
209 it's a proper C prototype.
211 2004-09-21 Tom Tromey <tromey@redhat.com>
214 * gjavah.c (free_method_name_list): New method.
217 2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
218 Zack Weinberg <zack@codesourcery.com>
220 * java-tree.def: Use tree_code_class enumeration constants
221 instead of code letters.
222 * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for
223 new tree-class enumeration constants.
225 2004-09-13 Tom Tromey <tromey@redhat.com>
228 * class.c (layout_class_method): Put synthetic methods into the
231 2004-09-11 Andrew Pinski <apinski@apple.com>
233 * Make-lang.in (java/ggc-none.c): Change dependency
234 for ggc.h into $(GGC_H).
236 2004-09-11 Mohan Embar <gnustuff@thisiscool.com>
238 * Make-lang.in (java/win32-host.o): Add dependency on
240 * win32-host.c: Add includes for coretypes.h, jcf.h
242 2004-09-11 Mohan Embar <gnustuff@thisiscool.com>
244 * Make-lang.in (GCJH_OBJS): Change dependency from
245 ggc-none.o to java/ggc-none.o
246 (JCFDUMP_OBJS): Likewise.
247 (java/ggc-none.o): New target.
249 2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
251 * boehm.c (get_boehm_type_descriptor): Adjust build_int_cst calls.
252 * class.c (build_utf8_ref, build_static_field_ref,
253 make_field_value, make_method_value, get_dispatch_table,
254 make_class_data, emit_symbol_table, emit_catch_table): Likewise.
255 * constants.c (get_tag_node, build_ref_from_constant_pool,
256 build_constants_constructor): Likewise.
257 * decl.c (java_init_decl_processing): Likewise.
258 * expr.c (build_java_array_length_access, build_newarray,
259 expand_java_multianewarray, expand_java_pushc, expand_iinc,
260 build_java_binop, build_field_ref, expand_java_add_case,
261 expand_java_call, build_known_method_ref, build_invokevirtual,
262 build_invokeinterface, build_jni_stub): Likewise.
263 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
264 * jcf-parse.c (get_constant): Likewise.
265 * lex.c (do_java_lex): Likewise.
266 * parse.y (patch_binop, patch_unaryop, patch_cast,
267 build_newarray_node, patch_newarray): Likewise.
268 * resource.c (compile_resource_data): Likewise.
269 * typeck.c (build_prim_array_type): Likewise.
271 2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
273 * decl.c (java_init_decl_processing): Adjust
274 initialize_sizetypes call.
276 2004-08-23 Nathan Sidwell <nathan@codesourcery.com>
278 * jv-scan.c (fancy_abort): Add.
280 2004-08-20 Nathan Sidwell <nathan@codesourcery.com>
282 * expr.c (build_java_arrayaccess): Use convert to change
285 2004-08-19 Bryce McKinlay <mckinlay@redhat.com>
287 * class.c (make_local_function_alias): Allocate extra space for 'L'
288 in name buffer. Reported by Thomas Neumann.
290 2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
292 * parse.h (JAVA_RADIX10_FLAG): Rename to ...
293 (JAVA_NOT_RADIX10_FLAG): ... here. Invert meaning.
294 * lex.c (do_java_lex): Adjust.
295 (error_if_numeric_overflow): Likewise.
297 2004-08-18 Andrew Pinski <apinski@apple.com>
299 * class.c (make_local_function_alias): Only make a new decl if we
300 support alias attribute on all decls.
302 2004-08-18 Bryce McKinlay <mckinlay@redhat.com>
304 * class.c (make_local_function_alias): New function. Create local
305 alias for public method DECL.
306 (make_method_value): Use make_local_function_alias.
307 * parse.y (craft_constructor): Don't special-case anonymous classes.
308 Always set ctor_name to init_identifier_node.
309 (lookup_method_invoke): Call layout_class_method when creating
310 anonymous class constructor.
312 2004-08-18 Richard Henderson <rth@redhat.com>
314 * java-gimplify.c (java_gimplify_expr): Move '2' handling into
315 default case. Treat '<' similarly. Update for
316 is_gimple_formal_tmp_var name change.
318 2004-08-17 Andrew Haley <aph@redhat.com>
320 * lang.c (lang_printable_name): Obey verbose flag.
321 * parse.y (constructor_circularity_msg): Set VERBOSE arg for
322 lang_printable_name().
323 (verify_constructor_circularity, get_printable_method_name,
324 check_abstract_method_definitions, java_check_regular_methods,
325 java_check_abstract_methods, check_inner_class_access,
326 fix_constructors, patch_method_invocation, patch_return):
328 * expr.c (pop_type_0): Likewise.
330 * java-tree.h (lang_printable_name_wls): Delete.
332 2004-08-16 Tom Tromey <tromey@redhat.com>
335 * parse.y (primary): Changed for initialized and uninitialized
337 (array_access): Handle array_creation_initialized.
338 (array_creation_expression): Split into
339 array_creation_initialized and array_creation_uninitialized.
341 2004-08-16 Andrew Haley <aph@redhat.com>
343 * jcf-write.c (find_constant_index): Canonicalize NaNs when
346 2004-08-16 Elliot Lee <sopwith@redhat.com>
349 * jcf-parse.c (java_parse_file): Handle filenames with embedded
350 spaces, and quoted filelists.
352 2004-08-15 Nathan Sidwell <nathan@codesourcery.com>
354 * boehm.c (get_boehm_type_descriptor): Use build_int_cst.
355 * class.c (build_utf8_ref, build_static_field_ref,
356 make_field_value, make_method_value, get_dispatch_table,
357 make_class_data, emit_symbol_table, emit_catch_table): Likewise.
358 * constants.c (get_tag_node, build_ref_from_constant_pool,
359 build_constants_constructor): Likewise.
360 * decl.c (java_init_decl_processing): Likewise.
361 * expr.c (build_java_array_length_access, build_newarray,
362 expand_java_multianewarray, expand_java_pushc, expand_iinc,
363 build_java_binop, build_field_ref, expand_java_add_case,
364 expand_java_call, build_known_method_ref, build_invokevirtual,
365 build_invokeinterface, build_jni_stub): Likewise.
366 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
367 * jcf-parse.c (get_constant): Likewise.
368 * lex.c (do_java_lex): Likewise.
369 * parse.y (patch_binop, patch_unaryop, patch_cast,
370 build_null_of_type, patch_newarray): Likewise.
371 * resource.c (compile_resource_data): Likewise.
372 * typeck.c (build_prim_array_type): Likewise.
374 2004-08-10 Bryce McKinlay <mckinlay@redhat.com>
376 * java-gimplify.c (java_gimplify_new_array_init): Use create_tmp_var.
377 Don't create BLOCK here or call java_gimplify_block.
379 2004-08-09 H.J. Lu <hongjiu.lu@intel.com>
381 * java-tree.h (flag_deprecated): Removed.
382 * lang.opt (Wdeprecated): Use existing Var(warn_deprecated).
383 * parse.y (check_deprecation): Check warn_deprecated instead of
386 2004-08-06 Kelley Cook <kcook@gcc.gnu.org>
388 * lang.c (flag_emit_class_files, flag_filelist_file, flag_redundant,
389 flag_use_divide_subroutine, flag_use_boehm_gc, flag_store_check,
390 flag_hash_synchronization, flag_assert, flag_jni, flag_newer,
391 flag_check_references, flag_extraneous_semicolon, flag_deprecated,
392 flag_force_classes_archive_check, flag_optimize_sci,
393 flag_indirect_dispatch): Remove explicit declarations.
394 * lang.opt: Add implicit declare/define/assign. Remove obsolete
397 2004-08-05 Michael Chastain <mec.gnu@mindspring.com>
400 * Make-lang.in (java.install-man): Install from either build
401 tree or source tree, whichever has the file first.
403 2004-08-05 Nathan Sidwell <nathan@codesourcery.com>
405 * jcf-parse.c (get_constant): Adjust force_fit_type call.
406 * lex.h (SET_LVAL_NODE_TYPE): Remove.
407 * lex.c (java_perform_atof): Use SET_LVAL_NODE directly.
408 (do_java_lex): Likewise. Adjust force_fit_type call.
410 2004-08-04 Roger Sayle <roger@eyesopen.com>
411 Andrew Haley <aph@redhat.com>
413 * typeck.c (convert_ieee_real_to_integer): Call fold on the range
414 checking trees as they're being built.
415 (convert): Call convert_ieee_real_to_integer if we're
416 converting a constant, even if we're writing a class file.
418 2004-08-02 Bryce McKinlay <mckinlay@redhat.com>
421 * parse.y (fold_constant_for_init): Call resolve_field_access with
422 correct current_class context.
424 2004-08-01 Roger Sayle <roger@eyesopen.com>
426 * decl.c (update_aliases, initialize_local_variable): Replace calls
427 to build with calls to buildN.
428 * java-gimplify.c (java_gimplify_modify_expr): Likewise.
429 * java-tree.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Likewise.
430 * parse.h (BUILD_THROW): Likewise.
431 * parse.y (switch_expression, synchronized_statement,
432 catch_clause_parameter, array_creation_expression,
433 conditional_expression, make_qualified_name,
434 resolve_qualified_expression_name, patch_method_invocation,
435 patch_invoke, build_method_invocation, build_new_invocation,
436 build_assignment, patch_assignment, build_binop, patch_binop,
437 build_string_concatenation, build_incdec, patch_unaryop,
438 patch_cast, build_array_ref, build_newarray_node, patch_newarray,
439 patch_return, build_if_else_statement, build_labeled_block,
440 build_new_loop, build_loop_body, build_bc_statement,
441 build_assertion, encapsulate_with_try_catch, build_try_statement,
442 build_try_finally_statement, patch_synchronized_statement,
443 emit_test_initialization): Likewise, replace build with buildN.
445 2004-07-28 Eric Christopher <echristo@redhat.com>
447 * lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
448 (java_unsafe_for_reeval): Ditto.
450 2004-07-26 <hp@bitrange.com>
452 * parse.y (build_super_invocation): Adjust declaration order to
453 avoid declaration after statement.
455 2004-07-25 Bernardo Innocenti <bernie@develer.com>
457 * decl.c: Rename all identifiers named `class' to `cl'.
459 2004-07-25 Richard Henderson <rth@redhat.com>
461 * decl.c (build_result_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P.
463 2004-07-23 Mike Stump <mrs@apple.com>
465 * boehm.c (set_bit): Improve type safety wrt unsignedness.
466 * gjavah.c (throwable_p, decode_signature_piece,
467 print_full_cxx_name, print_include, add_namelet, add_class_decl,
468 process_file): Likewise.
469 * jcf-dump.c (main): Likewise.
470 * jcf-io.c (read_zip_member): Likewise.
471 * jcf-parse.c (HANDLE_CONSTANT_Utf8, get_constant,
472 give_name_to_class, get_class_constant): Likewise.
473 * jcf-write.c (find_constant_wide, push_long_const,
474 generate_classfile): Likewise.
475 * lex.c (java_new_lexer, java_read_char, cxx_keyword_p): Likewise.
476 * parse.y (read_import_dir): Likewise.
477 * typeck.c (parse_signature_type): Likewise.
478 * verify.c (verify_jvm_instructions): Likewise.
479 * zextract.c (find_zip_file_start, read_zip_archive): Likewise.
481 2004-07-23 Thomas Fitzsimmons <fitzsim@redhat.com>
483 * Make-lang.in: Replace rmic and rmiregistry references with
484 grmic and grmiregistry.
485 * gcj.texi: Likewise.
487 2004-07-20 Andrew Haley <aph@redhat.com>
490 * verify.c (verify_jvm_instructions): Comment change only.
492 * typeck.c (build_java_array_type): Add size field to array name.
494 * java-tree.h (LOCAL_SLOT_P): New.
495 (update_aliases): Add PC argument.
496 (pushdecl_function_level): New function.
498 * java-gimplify.c (java_gimplify_expr): Handle VAR_DECL,
499 MODIFY_EXPR, and SAVE_EXPR.
500 (java_gimplify_modify_expr): New function.
502 * expr.c (push_type_0): Call find_stack_slot() to create temporary.
503 (expand_iinc): Pass PC to update_aliases().
504 (STORE_INTERNAL): Likewise.
505 (process_jvm_instruction): Likewise.
507 * decl.c (base_decl_map): New variable.
508 (uniq): New variable.
509 (update_aliases): Rewrite with more thorough checking.
510 (debug_variable_p): New function.
511 (push_jvm_slot): Don't initialize local variable. Don't pushdecl.
512 (check_local_named_variable): Delete whole function.
513 (initialize_local_variable): New function.
514 (check_local_unnamed_variable): Add checks and comments.
515 (find_local_variable): Rewrite.
516 (java_replace_reference): New function.
517 (function_binding_level): New variable.
518 (pushdecl_function_level): New function.
519 (maybe_pushlevels): Set DECL_LOCAL_END_PC.
520 (maybe_pushlevels): Call pushdecl() on each of the new decls.
521 (start_java_method): Reset uniq. Create base_decl_map. Set
522 function_binding_level.
523 (end_java_method): Null unused fields to save memory.
525 2004-07-20 Nathan Sidwell <nathan@codesourcery.com>
527 * class.c (add_interface_do): Remove.
528 (set_super_info, interface_of_p, maybe_add_interface,
529 add_interface, make_class_data, layout_class,
530 add_miranda_methods): Adjust BINFO accessors and addition.
531 * expr.c (can_widen_reference_to, lookup_field): Adjust BINFO
533 * jcf-write.c (generate_classfile): Likewise.
534 * parse.y (patch_anonymous_class, check_inner_circular_reference,
535 check_circular_reference, java_complete_class,
536 check_abstract_method_definitions,
537 java_check_abstract_method_definitions,
538 check_interface_throws_clauses, java_check_abstract_methods,
539 lookup_java_interface_method2,
540 find_applicable_accessible_methods_list): Adjust BINFO accessors
542 * typeck.c (find_method_in_interfaces): Adjust BINFO accessors.
544 2004-07-18 Roger Sayle <roger@eyesopen.com>
546 * builtins.c (max_builtin, min_builtin,
547 java_build_function_call_expr): Replace calls to build with buildN.
548 * class.c (build_class_ref, build_static_field_ref,
549 get_dispatch_table, make_class_data, layout_class_method): Likewise.
550 * constants.c (build_ref_from_constant_pool): Likewise.
551 * decl.c (update_aliases, push_jvm_slot, poplevel, finish_method,
552 add_stmt_to_compound): Likewise.
553 * except.c (build_exception_object_ref, expand_end_java_handler):
555 * java-gimplify.c (java_gimplify_case_expr,
556 java_gimplify_default_expr, java_gimplify_block,
557 java_gimplify_new_array_init, java_gimplify_try_expr): Likewise.
558 * jcf-write.c (generate_bytecode_insns): Likewise.
559 * typeck.c (convert_ieee_real_to_integer): Likewise.
561 2004-07-17 Joseph S. Myers <jsm@polyomino.org.uk>
563 * java-tree.h (builtin_function): Declare.
565 2004-07-16 Steven Bosscher <stevenb@suse.de>
567 * parse.y (java_complete_expand_methods, java_expand_classes): Don't
568 abuse restore_line_number_status.
570 2004-07-15 Frank Ch. Eigler <fche@redhat.com>
573 * jcf-parse.c (java_emit_static_constructor): Specify default
576 2004-07-13 Per Bothner <per@bothner.com>
578 * java-tree.h (all_class_filename): Remove useless macro.
579 (enum java_tree_index): Remove JTI_ALL_CLASS_FILENAME constant.
580 (BUILD_FILENAME_IDENTIFIER_NODE): Remove useless macro.
581 * parse.y (java_parser_context_restore_global): Replace
582 BUILD_FILENAME_IDENTIFIER_NODE by plain get_identifier.
583 * jcf-parse.c (read_class, java_parse_file): Likewise.
585 2004-07-12 Bryce McKinlay <mckinlay@redhat.com>
588 gjavah.c (print_field_info): Emit constant only if field is static.
590 2004-07-11 Roger Sayle <roger@eyesopen.com>
592 * expr.c (java_truthvalue_conversion, flush_quick_stack,
593 java_stack_swap, java_stack_dup, build_java_athrow, build_java_jsr,
594 build_java_ret, build_java_throw_out_of_bounds_exception,
595 build_java_array_length_access, java_check_reference,
596 build_java_arrayaccess, build_java_arraystore_check, build_newarray,
597 build_anewarray, expand_java_multianewarray, expand_java_arraystore,
598 expand_java_arrayload, build_java_monitor, expand_java_return,
599 expand_load_internal, expand_java_NEW, build_get_class,
600 build_instanceof, expand_java_CHECKCAST, expand_iinc,
601 build_java_soft_divmod, build_java_binop, build_field_ref,
602 expand_compare, expand_java_goto, expand_java_switch,
603 expand_java_add_case, build_class_init, build_known_method_ref,
604 invoke_build_dtable, build_invokevirtual, build_invokeinterface,
605 expand_invoke, build_jni_stub, expand_java_field_op,
606 java_expand_expr, expand_byte_code, STORE_INTERNAL,
607 force_evaluation_order, emit_init_test_initialization): Convert
608 calls to "build" into calls to the prefered "buildN" functions.
610 2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk>
612 * java-tree.h (set_block): Remove.
613 * lang.c (java_clear_binding_stack): New.
614 (LANG_HOOKS_CLEAR_BINDING_STACK): Define.
615 * decl.c (struct binding_level): Remove this_block.
616 (clear_binding_level): Likewise.
617 (poplevel): Don't handle this_block.
620 2004-07-10 Bryce McKinlay <mckinlay@redhat.com>
622 * class.c (common_enclosing_context_p): Remove statement with no
625 2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
628 * parse.y (create_anonymous_class): Remove 'location' argument. Use
629 the WFL from TYPE_NAME to get line number for the decl. Fix comment.
630 (craft_constructor): Inherit access flags for implicit constructor
631 from the enclosing class.
632 (create_class): Fix comment typo.
633 (resolve_qualified_expression_name): Pass type of qualifier to
634 not_accessible_p, not the type in which target field was found.
635 (not_accessible_p): Handle inner classes. Expand protected
636 qualifier-subtype check to enclosing instances, but don't apply this
637 check to static members. Allow protected access to inner classes
638 of a subtype. Allow private access within common enclosing context.
639 (build_super_invocation): Get WFL line number info from current
641 (build_incomplete_class_ref): Update for new create_anonymous_class
643 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Use
644 common_enclosing_instance_p.
645 * class.c (common_enclosing_context_p): New. Determine if types
646 share a common enclosing context, even across static contexts.
647 (common_enclosing_instance_p): Renamed from
648 common_enclosing_context_p. Determines if types share a common
649 non-static enclosing instance.
650 * java-tree.h (common_enclosing_instance_p): Declare.
651 * jcf-write.c (get_method_access_flags): New. Surpress private flag
652 for inner class constructors.
653 (generate_classfile): Use get_method_access_flags.
655 2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
657 * class.c (interface_of_p): Check for null TYPE_BINFO.
659 2004-07-09 Nathan Sidwell <nathan@codesourcery.com>
661 * class.c (make_class): Do not create binfo here.
662 (set_super_info): Create it here.
663 * java-tree.h (CLASS_HAS_SUPER): Cope with lack of a binfo.
665 2004-07-08 Richard Henderson <rth@redhat.com>
667 * expr.c (case_identity, get_primitive_array_vtable,
668 java_expand_expr, emit_init_test_initialization): Remove.
669 * java-tree.h (java_expand_expr): Remove.
670 * lang.c (LANG_HOOKS_EXPAND_EXPR): Remove.
672 2004-07-07 Per Bothner <per@bothner.com>
674 * class.c (build_static_field_ref): Add a NOP_EXPR; otherwise we
675 get internal error due to mismatched types.
677 * gcj.texi (Invoking gij): Document new -verbose:class flag.
679 * gcj.texi (Linking): New node. Document -lgij usage.
681 2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
683 * java-tree.h (CLASSTYPE_SPUER): Adjust BINFO macros.
684 (TYPE_NVIRTUALS, TYPE_VTABLE): Likewise.
685 * java/class.c (set_super_info, class_depth, interface_of_p,
686 maybe_add_interface, add_interface, make_class_data,
687 layout_class, add_miranda_methods): Adjust BINFO macros.
688 * expr.c (can_widen_reference_to, lookup_field): Likewise.
689 * jcf-write.c (generate_classfile): Likewise.
690 * parse.y (patch_anonymous_class,
691 check_inner_circular_reference, check_circular_reference,
692 java_complete_class, check_abstract_method_definitions,
693 java_check_abstract_method_definitions,
694 check_interface_throws_clauses, java_check_abstract_methods,
695 lookup_java_interface_method2,
696 find_applicable_accessible_methods_list): Likewise.
697 * typeck.c (find_method_in_interface): Likewise.
698 * verify.c (merge_types): Likewise.
700 2004-07-06 Nathan Sidwell <nathan@codesourcery.com>
702 * java-tree.h (CLASS_HAS_SUPER_FLAG): Use BINFO_FLAG_1.
703 * class.c (add_interface_do): Use BINFO_VIRTUAL_P.
705 2004-07-05 Nathan Sidwell <nathan@codesourcery.com>
707 * class.c (make_class): Use make_tree_binfo.
708 (set_super_info, add_interface_do): Likewise.
709 * java-tree.h (CLASS_HAS_SUPER_FLAG): Expect a BINFO.
711 2004-07-04 Ranjit Mathew <rmathew@hotmail.com>
713 * verify.c: Correct array element access formatting thinko.
715 2004-07-04 Ranjit Mathew <rmathew@hotmail.com>
717 * verify.c: Insert a short blurb at the start referring to the JVMS.
718 (merge_type_state): Remove redundant nested if statement.
719 (verify_jvm_instructions): Ensure current_subr is initialised to
721 Minor formatting fixes all over the place.
723 2004-07-02 Richard Henderson <rth@redhat.com>
725 * jcf-write.c (generate_bytecode_insns <case SAVE_EXPR>): Rewrite.
727 2004-07-01 Richard Henderson <rth@redhat.com>
729 * class.c (registerClass_libfunc): Remove.
730 (init_class_processing): Don't set it.
731 (emit_register_classes): Take list_p parameter. Fill it in
732 with _Jv_RegisterClass calls.
733 * decl.c (java_init_decl_processing): Don't call
734 init_resource_processing.
735 * jcf-parse.c (java_emit_static_constructor): New.
736 (java_parse_file): Call it.
737 * resource.c (registerResource_libfunc): Remove.
738 (init_resource_processing): Remove.
739 (write_resource_constructor): Take list_p parameter. Fill it in
740 with _Jv_RegisterResource calls.
741 * java-tree.h: Update prototypes.
743 2004-06-29 Bryce McKinlay <mckinlay@redhat.com>
746 * class.c (layout_class_method): Do not override package-private
747 method if its in a different package.
748 (split_qualified_name): Move here from parse.y. Rename from
749 breakdown_qualified. Add comment.
750 (in_same_package): Move here from parse.y. Add comment.
751 * java-tree.h (break_down_qualified, in_same_package): Declare.
752 (in_same_package): Likewise.
753 * parse.y (breakdown_qualified, in_same_package): Moved to class.c.
756 2004-06-29 Andrew Haley <aph@redhat.com>
758 * except.c (expand_start_java_handler): Push a new binding level.
759 Don't build a TRY_CATCH_EXPR now, we'll do it later. Call
760 register_exception_range() to register where we'll do it.
761 (expand_end_java_handler): Remove old bogus code. Replace with
762 new logic that simply builds TRY_CATCH_EXPRs and inserts them at
763 the top of the expression we're curently building.
764 (maybe_end_try): Delete.
765 * decl.c (binding_level.exception_range): New field.
766 (clear_binding_level): Add field exception_range. Reformat.
767 (poplevel): Call expand_end_java_handler().
768 (poplevel): Call java_add_stmt only if functionbody is false.
769 (maybe_poplevels): Don't call maybe_end_try() from here.
770 (end_java_method): Clear no longer used trees in function decl.
771 (register_exception_range): New function.
772 * java-tree.h (register_exception_range, struct eh_range): Declare.
774 2004-06-28 Bryce McKinlay <mckinlay@redhat.com>
776 * jcf-write.c (get_classfile_modifiers): Formatting fixes.
778 2004-06-27 Ranjit Mathew <rmathew@hotmail.com>
781 * expr.c (class_has_finalize_method): Fix method name indentation.
782 (expand_java_call): Remove K&R style parameter declaration.
783 (expand_invoke): Fix statement indentation.
784 (expand_java_field_op): Likewise.
785 * parse-scan.y: Fix typo.
786 (reset_report): Fix method name indentation.
787 * parse.y (unresolved_type_p, build_expr_block): Remove extra blank
789 * verify.c (verify_jvm_instructions): Document parameters, insert
791 * lang.c (lang_init_source): Fix method name indentation.
792 * class.c (common_enclosing_context_p): Likewise.
793 (emit_symbol_table): Fix parameter list indentation.
794 * decl.c (add_stmt_to_compound, java_add_stmt): Remove K&R style
795 parameter declaration.
796 * constants.c: Fix copyright notice indentation.
797 * typeck.c (find_method_in_superclasses): Fix parameter list
799 (find_method_in_interfaces): Likewise.
800 * zextract.c (makelong): Fix method name indentation.
802 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
805 * parse.y (create_interface): Set correct access modifiers for
807 * jcf-write.c (get_classfile_modifiers): New function.
808 (generate_classfile): Use get_classfile_modifiers, not
811 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
813 * parse.y (register_incomplete_type): Set JDEP_ENCLOSING for "super"
814 dependency to current parser context, not NULL_TREE, for top-level
816 (jdep_resolve_class): Enable member access check for all inner
819 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
821 * parse.y (qualify_and_find): Pass type decl, not identifier, to
824 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
827 * expr.c (expand_java_field_op): Ensure that target class for static
828 field access has been loaded.
830 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
831 Ranjit Mathew <rmathew@hotmail.com>
833 PR java/1207, java/16178
834 * jcf-parse.c (load_class): Return immediately if passed a type decl
835 where CLASS_FROM_SOURCE_P is set. Remove FIXME.
836 * parse.y (do_resolve_class): Remove checks for CLASS_FROM_SOURCE_P
837 before calling load_class.
838 (qualify_and_find): Likewise.
839 (find_in_imports_on_demand): Likewise.
840 (find_applicable_accessible_methods_list): Likewise.
842 2004-06-24 Bryce McKinlay <mckinlay@redhat.com>
844 * parse.y (java_layout_seen_class_methods): Don't call load_class
845 on class defined by source parser.
847 2004-06-23 Bryce McKinlay <mckinlay@redhat.com>
849 * parse.y (set_nested_class_simple_name_value): Removed.
850 (java_complete_expand_class): Remove calls to
851 set_nested_class_simple_name_value.
853 2004-06-22 Andrew Haley <aph@redhat.com>
854 Ranjit Mathew <rmathew@hotmail.com>
857 * decl.c (force_poplevels): Remove call to expand_end_bindings.
859 2004-06-22 Ranjit Mathew <rmathew@hotmail.com>
861 * parse.y (create_class): Correct diagnostic message about
862 java.lang.Object extending anything else.
864 2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
866 * class.c (build_class_ref): Add new operand for COMPONENT_REF.
867 (build_static_field_ref): Likewise and add new operands for ARRAY_REF.
868 * constants.c (build_ref_from_constant_pool): Likewise.
869 * expr.c (build_java_array_length_access): Likewise.
870 (build_get_class, build_field_ref, build_known_method_ref): Likewise.
871 (invoke_build_dtable, build_invokevirtual): Likewise.
872 (build_invokeinterface, java_expand_expr): Likewise.
873 (emit_init_test_initialization): Likewise.
874 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
875 * parse.y (make_qualifed_name, build_array_ref): Likewise.
877 2004-06-21 Andrew Haley <aph@redhat.com>
879 * java-gimplify.c (java_gimplify_block): set TREE_USED on the new
882 2004-06-21 Joseph S. Myers <jsm@polyomino.org.uk>
884 * jcf.h (struct JCF): Change java_source, right_zip and finished
886 * lex.h (struct java_lexer): Change hit_eof, read_anything,
887 byte_swap and use_fallback to unsigned int.
888 * parse.h (struct _jdep): Change flag0 to unsigned int.
890 2004-06-17 Ranjit Mathew <rmathew@hotmail.com>
893 * parse.y (java_layout_seen_class_methods): Ensure class is loaded
894 before trying to lay out its methods.
895 * jcf-parse.c (read_class): Track parsed files using canonical paths
896 obtained via lrealpath from libiberty.
897 (java_parse_file): Likewise.
898 (parse_source_file_1): Rename formal parameter to reflect its
899 modified purpose. Minor formatting fix.
901 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
903 * class.c (emit_register_classes): Make the function uninlinable,
904 do not set current_function_cannot_inline.
905 * resource.c (write_resource_constructor): Do not reset
906 flag_inline_functions around rest_of_compilation.
908 2004-06-08 Andrew Pinski <pinskia@physics.uc.edu>
911 * expr.c (java_truthvalue_conversion): Handle
912 UNEQ_EXPR, UNLE_EXPR, UNGE_EXPR, UNLT_EXPR, UNGT_EXPR,
913 ORDERED_EXPR, and UNORDERED_EXPR as comparison operators,
914 i.e. return the expression.
916 2004-06-03 Mark G. Adams <mark.g.adams@sympatico.ca>
918 * gjavah.c: Include version.h
920 2004-05-31 Bryce McKinlay <mckinlay@redhat.com>
922 * jcf-write.c (generate_bytecode_conditional): Correct handling
923 of unordered conditionals. Add comment.
925 2004-05-29 Ranjit Mathew <rmathew@hotmail.com>
926 Per Bothner <per@bothner.com>
928 * java-tree.h (DECL_LOCAL_FINAL_IUD): New macro to test if a
929 local variable was initialised upon declaration.
930 * parse.y (declare_local_variables): Set DECL_LOCAL_FINAL_IUD if
931 variable was final and initialised upon declaration.
932 * check-init.c (check_final_reassigned): Give error only if a blank
933 final is not definitely unassigned or if an initialised final is
935 (check_bool_init): Respect JLS2 16.1.7 requirements for boolean
936 assignment expressions. Remove case MODIFY_EXPR, label do_default.
937 (check_init): Perform initialised-variable-removing-optimisation
938 only on non-final local variables.
940 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
942 * jcf-write.c (generate_bytecode_conditional): Handle binops
943 UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR,
945 (generate_bytecode_insns): Likewise.
947 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
949 * check-init.c (check_init): Handle binops UNLT_EXPR, UNLE_EXPR,
950 UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, and LTGT_EXPR.
952 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
954 * gcj.texi (Object allocation): Remove _Jv_AllocBytes.
955 (Mixing with C++): Document JvAllocBytes and RawDataManaged.
957 2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
959 * decl.c (struct binding_level): Add GTY marker. Compile
960 binding_depth unconditionally.
961 (current_binding_level, free_binding_level, global_binding_level):
963 (clear_binding_level): Unconditionally set binding_depth.
964 (make_binding_level): Use ggc_alloc_cleared, not xmalloc.
966 2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
968 * lex.c (java_new_lexer): Set 'encoding'.
969 (java_read_char): Improve error message for unrecognized characters.
970 * lex.h (struct java_lexer): New field 'encoding'.
972 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
974 * Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.
976 2004-05-21 Mark Wielaard <mark@klomp.org>
978 * gjavah.c (print_stub_or_jni): Mark functions only JNIEXPORT, not
981 2004-05-19 Paolo Bonzini <bonzini@gnu.org>
983 * typeck.c: Remove non-printable character 160.
985 2004-05-17 Ranjit Mathew <rmathew@hotmail.com>
987 * check-init.c: Correct minor typos.
989 2004-05-13 Diego Novillo <dnovillo@redhat.com>
991 * Make-lang.in, expr.c, java-gimplify.c: Rename
992 tree-simple.[ch] to tree-gimple.[ch].
994 2004-05-14 Ranjit Mathew <rmathew@hotmail.com>
996 * java-gimplify.c (java_gimplify_expr): Correct minor typos.
998 2004-05-13 Diego Novillo <dnovillo@redhat.com>
1000 Merge from tree-ssa-20020619-branch. See
1001 ChangeLog.tree-ssa for details.
1003 * Make-lang.in, builtins.c, check-init.c, class.c,
1004 constants.c, decl.c, except.c, expr.c, java-except.h,
1005 java-tree.def, java-tree.h, jcf-parse.c, jcf-write.c,
1006 lang.c, lang.opt, parse.y, resource.c: Merged.
1007 * java-gimplify.c: New file.
1009 2004-05-10 Andrew Haley <aph@redhat.com>
1011 * parse.y (create_class): Set TYPE_VFIELD.
1012 * decl.c (java_init_decl_processing): Likewise.
1014 * expr.c (build_invokevirtual): Remove DECL_VINDEX offset adjustment.
1015 * class.c (make_method_value): Replace DECL_VINDEX with call to
1017 (get_dispatch_vector): Likewise.
1018 (layout_class_method): Likewise.
1019 Replace set of DECL_VINDEX with call to set_method_index().
1020 (set_method_index): New function.
1021 (get_method_index): New function.
1022 * java-tree.h (set_method_index): New function decl.
1023 (get_method_index): New function decl.
1025 2004-05-10 Andrew Pinski <pinskia@physics.uc.edu>
1027 * parse.y (check_pkg_class_access): Add new argument
1028 and use it when cl is NULL to call lookup_cl on it.
1029 (parser_check_super_interface): Do not call lookup_cl.
1030 Pass this_decl to check_pkg_class_access and NULL
1031 instead of lookup_cl.
1032 (parser_check_super): Update for change in
1033 check_pkg_class_access.
1034 (do_resolve_class): Likewise.
1035 (process_imports): Likewise.
1036 (find_in_imports_on_demand): Likewise.
1037 (resolve_qualified_expression_name): Likewise.
1039 2004-05-06 Ranjit Mathew <rmathew@hotmail.com>
1041 Fixes PR java/9685, PR java/15073
1042 * parse.y (accessibility_string): New method.
1043 (not_accessible_field_error): Use accessibility_string()
1044 instead of java_accstring_lookup().
1045 (resolve_qualified_expression_name): Check with
1046 check_pkg_class_access() before allowing access using
1049 Use check_pkg_class_access() instead of not_accessible_p()
1050 for unqualified types.
1051 (not_accessible_p): Use DECL_CONTEXT (member) instead of
1052 REFERENCE for package-private access checking.
1053 (patch_method_invocation): Use accessibility_string() instead
1054 of java_accstring_lookup().
1056 2004-04-30 Ranjit Mathew <rmathew@hotmail.com>
1059 * gjavah.c (struct method_name): Add member is_native.
1060 (overloaded_jni_method_exists_p): Match candidate method only if
1062 (print_method_info): Initialise is_native flag from the method's
1065 2004-04-30 Roger Sayle <roger@eyesopen.com>
1067 * builtins.c (java_builtins): Add acos, asin, ceil and floor.
1068 (initialize_builtins): Likewise, define acos, asin, ceil and floor.
1070 2004-04-22 Roger Sayle <roger@eyesopen.com>
1072 * resource.c (write_resource_constructor): Guard call to possibly
1073 NULL targetm.asm_out.constructor with targetm.have_ctors_dtors.
1075 2004-04-19 Bryce McKinlay <mckinlay@redhat.com>
1077 * class.c (make_class_data): Add new field aux_info.
1078 * decl.c (java_init_decl_processing): Push type and decl for
1081 2004-04-15 Bryce McKinlay <mckinlay@redhat.com>
1083 * expr.c (expand_java_NEW): Don't use size argument for
1084 _Jv_AllocObject calls.
1085 * parse.y (patch_invoke): Likewise.
1087 2004-04-12 Bryce McKinlay <mckinlay@redhat.com>
1089 * expr.c (build_invokeinterface): Remove unused variables to
1092 2004-04-12 Bryce McKinlay <mckinlay@redhat.com>
1094 * class.c (get_interface_method_index): New function. Return dispatch
1095 index for interface method.
1096 (make_method_value): For interface methods, set index field to
1097 iface dispatch index, not DECL_VINDEX.
1098 * expr.c (build_invokeinterface): Use get_interface_method_index.
1100 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1102 * jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.
1104 2004-03-31 Andrew Haley <aph@redhat.com>
1107 * jcf-io.c (opendir_in_zip): Tidy up error handling.
1109 2004-03-30 Zack Weinberg <zack@codesourcery.com>
1111 * builtins.c, expr.c, jcf.h, parse.h: Use new shorter
1112 form of GTY markers.
1114 2004-03-25 Marcus Meissner <meissner@suse.de>
1117 * jcf-path.c (jcf_path_extdirs_arg): Add missing closedir.
1119 2004-03-23 Tom Tromey <tromey@redhat.com>
1122 * jcf-write.c (make_class_file_name): Don't report if mkdir
1125 2004-03-23 Tom Tromey <tromey@redhat.com>
1127 * gcj.texi (Extensions): Document GCJ_PROPERTIES.
1129 2004-03-20 Kazu Hirata <kazu@cs.umass.edu>
1131 * class.c, gjavah.c, lang.c: Fix comment typos.
1132 * gcj.texi: Fix typos.
1134 2004-03-19 Per Bothner <per@bothner.com>
1136 * gcj.texi (Code Generation): Document new flags and assert defaults.
1138 * class.c (assume_compiled_node_struct): Rename type to
1139 class_flag_node_struct, as it is now also used for enable_assertions.
1140 Rename assume_compiled_node typedef. Rename excludep field to value.
1141 (find_assume_compiled_node): Rename function to find_class_flag_node.
1142 Minor optimization - avoid needless strlen.
1143 (add_assume_compiled): Some tweaking and optimization.
1144 Rename and generalize to add_class_flag takem an extra parameter.
1145 (add_assume_compled): New just calls add_class_flag.
1146 (add_enable_assert, enable_assertions): New functions.
1147 (enable_assert_tree): New static.
1148 * java-tree.h (add_enable_assert, enable_assertions): New declarations.
1149 * lang.opt (fenable-assertions, fenable-assertions=,
1150 fdisable-assertions, fdisable-assertions=): New options.
1151 * lang.c (java_handle_option): Handle new options.
1152 * parse.y (build_incomplete_class_ref): Handle class$ in an inner
1153 class in an interface - create helper class nested in outer interface.
1154 (build_assertion): Short-circuit if enable_assertions is false.
1156 2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1158 * java-tree.h: Changes throughout to add checking to macros
1159 and numerous whitespace changes.
1160 (VAR_OR_FIELD_CHECK): New macro.
1161 * jcf-write.c (get_access_flags): Use FIELD_PUBLIC, METHOD_PUBLIC,
1162 FIELD_FINAL, and METHOD_FINAL instead of CLASS_PUBLIC and CLASS_FINAL.
1164 2004-03-16 Per Bothner <per@bothner.com>
1166 * jcf-jump.c (options): New --print-constants option.
1167 * gcj.texi (Invoking jcf-dump): Document --print-constants.
1169 * jcf-dump.c (flag_print_constant_pool): Default to off.
1170 (print_constant_terse_with_index): New helper function.
1171 (various places): Check flag_print_constant_pool where missing.
1172 (main): If verbose set flag_print_constant_pool.
1173 (HANDLE_INNERCLASSES_ATTRIBUTE): Null inner class name is anonymous.
1175 2004-03-15 Andrew Haley <aph@redhat.com>
1178 * parse.y (java_complete_lhs): Check that final variable has an
1181 2004-03-12 Andrew Haley <aph@redhat.com>
1184 * typeck.c (convert): Clear TREE_OVERFLOW after an integer
1187 2004-02-29 Roger Sayle <roger@eyesopen.com>
1189 * jcf-parse.c (java_parse_file): Handle the case that input_filename
1192 2004-02-27 Per Bothner <per@bothner.com>
1194 * parse.y (build_assertion): Re-do 02-25 change following Jeff Sturm
1195 suggestion: Use build_incomplete_class_ref.
1196 This fixes PR java/13508, java/11714.
1198 2004-02-27 Kazu Hirata <kazu@cs.umass.edu>
1200 * java/parse.h: Update copyright.
1202 2004-02-26 Andrew Haley <aph@redhat.com>
1205 * parse.y (check_interface_throws_clauses): Check for
1206 !METHOD_INVISIBLE (iface_method).
1207 * class.c (layout_class_methods): Check for CLASS_INTERFACE as
1208 well as CLASS_ABSTRACT.
1210 2004-02-25 Per Bothner <per@bothner.com>
1212 * parse.y (build_assertion): If we're in an inner class, create the
1213 class$ helper routine in the outer class.
1215 2004-02-19 Richard Henderson <rth@redhat.com>
1217 * parse.y (switch_label): Use make_node for DEFAULT_EXPR.
1219 2004-02-16 Geoffrey Keating <geoffk@apple.com>
1221 * Make-lang.in (java.install-man): Add extra dependencies.
1223 2004-02-13 Geoffrey Keating <geoffk@apple.com>
1225 * Make-lang.in: Install man pages under the same names
1226 (possibly transformed) as the program they document.
1228 2004-02-10 Joseph S. Myers <jsm@polyomino.org.uk>
1230 * gjavah.c: Include "intl.h".
1231 (error): New function.
1232 (main): Call gcc_init_libintl.
1233 (get_field_name, throwable_p, print_c_decl, print_full_cxx_name,
1234 print_stub_or_jni, process_file, main): Use error rather than
1236 (print_method_info, usage, help, version, main): Mark strings for
1237 translation with _. Avoid splitting up sentences. Send
1238 information messages to stdout.
1239 * jcf-dump.c: Include "intl.h".
1240 (main): Call gcc_init_libintl.
1241 (process_class, usage, help, version, main, CHECK_PC_IN_RANGE):
1242 Mark error, usage and version messages for translation with _.
1243 Avoid splitting up sentences.
1244 * jv-scan.c: Include "intl.h".
1245 (fatal_error, warning): Change parameter s to msgid. Translate
1247 (main): Call gcc_init_libintl.
1248 (usage, help, version): Mark error, usage and version messages for
1249 translation with _. Avoid splitting up sentences.
1250 * jvgenmain.c: Include "intl.h".
1251 (main): Call gcc_init_libintl.
1252 (usage, main): Mark error messages for translation with _.
1253 * Make-lang.in (GCJH_OBJS, JVSCAN_OBJS, JCFDUMP_OBJS,
1254 JVGENMAIN_OBJS): Add intl.o.
1255 (java/jcf-dump.o, java/gjavah.o, java/jv-scan.o,
1256 java/jvgenmain.o): Update dependencies.
1258 2004-02-08 Per Bothner <per@bothner.com>
1260 * parse.y (resolve_qualified_expression_name): In case of inaccessible
1261 class don't use not_accessible_field_error, which can get confused.
1263 2004-02-05 Kelley Cook <kcook@gcc.gnu.org>
1265 Make-lang.in (po-generated): Delete.
1267 2004-02-05 Kazu Hirata <kazu@cs.umass.edu>
1269 * Make-lang.in (java/decl.o, java/expr.o, java/parse.o):
1271 * decl.c: Include target.h.
1272 (start_java_method): Replace PROMOTE_PROTOTYPES with
1273 targetm.calls.promote_prototypes.
1274 * expr.c: Include target.h.
1275 (pop_arguments): Replace PROMOTE_PROTOTYPES with
1276 targetm.calls.promote_prototypes.
1277 * parse.y: Include target.h.
1278 (start_complete_expand_method): Replace PROMOTE_PROTOTYPES
1279 with targetm.calls.promote_prototypes.
1281 2004-02-04 Kazu Hirata <kazu@cs.umass.edu>
1283 * typeck.c: Update copyright.
1285 2004-02-02 Tom Tromey <tromey@redhat.com>
1287 * decl.c (java_init_decl_processing): Remove duplicate
1290 2004-01-30 Kelley Cook <kcook@gcc.gnu.org>
1292 * Make-lang.in (doc/gcj.dvi): Use $(abs_docdir).
1294 2004-01-28 Andrew Pinski <pinskia@physics.uc.edu>
1296 * expr.c (build_field_ref): Move variable
1299 2004-01-28 Andrew Haley <aph@redhat.com>
1301 * expr.c (build_field_ref): Widen field offset.
1303 2004-01-27 Andrew Haley <aph@redhat.com>
1306 * parse.y (check_interface_throws_clauses): Make sure class_decl
1309 2004-01-22 Jeff Sturm <jsturm@one-point.com>
1312 * parse.y (patch_assignment): Don't modify lhs_type for
1313 reference assignments.
1315 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
1317 * Make-lang.in: Replace $(docdir) with doc.
1318 (java.info, java.srcinfo, java.man, java.srcman): New rules.
1319 (java.install-man): Revamp rule.
1321 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
1323 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_TARGET_INSTALL_NAME,
1324 GCJH_TARGET_INSTALL_NAME): Define via a immediate $(shell)
1325 instead of deferred backquote.
1327 2004-01-16 Andrew Pinski <pinskia@physics.uc.edu>
1329 * typeck.c (find_method_in_interfaces): Move variable
1332 2004-01-16 Andrew Haley <aph@redhat.com>
1335 * typeck.c (shallow_find_method): New.
1336 (find_method_in_superclasses): New.
1337 (find_method_in_interfaces): New.
1338 (lookup_do): Rewrite.
1339 * java-tree.h (SEARCH_ONLY_INTERFACE): Delete.
1341 * jcf-parse.c (read_class): Save and restore output_class.
1342 * decl.c (java_expand_body): Set output_class from fndecl.
1344 2004-01-15 Michael Chastain <mec.gnu@mindspring.com>
1346 * class.c (gen_indirect_dispatch_tables): Fix string length
1349 2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
1351 * Make-lang.in (parse.c, parse-scan.c): Always build in doc directory.
1352 (java.srcextra): Copy above back to source directory if requested.
1353 (po-generated): Delete reference to $(parsedir).
1354 (java/parse.o, java/parse-scan.o): Delete reference to $(parsedir).
1357 2004-01-14 Jan Hubicka <jh@suse.cz>
1359 * lang.c (java_estimate_num_insns_1): Fix bug in MODIFY_EXPR cost
1362 2004-01-09 Mark Mitchell <mark@codesourcery.com>
1364 * java-tree.h (java_expand_expr): Change prototype.
1365 * expr.c (java_expand_expr): Add alt_rtl parameter.
1367 2004-01-09 Andrew Haley <aph@redhat.com>
1370 * parse.y (java_fix_constructors): Set output_class.
1371 (java_reorder_fields): Likewise.
1372 (java_layout_classes): Likewise.
1373 (java_expand_classes): Generate indirect dispatch tables.
1374 (java_expand_classes): Set output_class.
1375 (java_finish_classes): Likewise.
1376 * lang.c (java_init): Turn on always_initialize_class_p if we're
1377 using indirect dis[atch.
1378 (java_decl_ok_for_sibcall): Use output_class, not current_class.
1379 (java_get_callee_fndecl): Use class local atable.
1381 (always_initialize_class_p): Decl moved to java-tree.h.
1382 (HANDLE_CLASS_INFO): Set output_class.
1383 (read_class): Likewise.
1384 (parse_class_file): Call gen_indirect_dispatch_tables.
1385 (parse_zip_file_entries): Set output_class.
1386 (java_parse_file): Set output_class. Don't emit symbol tables.
1387 * java-tree.h (output_class): New.
1388 Remove global declarations for otable, atable, and ctable.
1389 (always_initialize_class_p): moved here from decl.c.
1391 (TYPE_ATABLE_METHODS, TYPE_ATABLE_SYMS_DECL, TYPE_ATABLE_DECL,
1392 TYPE_OTABLE_METHODS, TYPE_OTABLE_SYMS_DECL, TYPE_OTABLE_DECL,
1393 TYPE_CTABLE_DECL, TYPE_CATCH_CLASSES): New.
1394 (struct lang_type): Add otable_methods, otable_decl,
1395 otable_syms_decl, atable_methods, atable_decl, atable_syms_decl,
1396 ctable_decl, catch_classes, type_to_runtime_map.
1397 * expr.c (build_field_ref): Make otable, atable, and ctable class
1398 local rather than global.
1399 (build_known_method_ref): Likewise.
1400 (build_invokeinterface): Likewise.
1401 (java_expand_expr): Pass runtime type (rather than actual type) to
1403 * except.c (prepare_eh_table_type): Create TYPE_TO_RUNTIME_MAP for
1404 this class. Look up each class in that map to delete duplicates.
1405 (expand_end_java_handler): Pass runtime type (rather than actual
1406 type) to expand_start_catch.
1407 * decl.c: (always_initialize_class_p): Decl moved to java-tree.h.
1409 (java_init_decl_processing): Rearrange things. Remove global
1410 declarations of otable, atable, and ctable.
1411 (java_init_decl_processing): Make lang_eh_runtime_type do_nothing.
1412 (java_expand_body): Set output_class.
1413 * constants.c (build_constant_data_ref): Use output_class, not
1415 (alloc_name_constant): Likewise.
1416 * class.c (gen_indirect_dispatch_tables): New.
1417 (build_class_ref): Generate hard reference to superclass, even if
1418 using indirect dispatch.
1419 (build_static_field_ref): Use class local atable.
1420 (make_class_data): Generate hard reference to superclass, even if
1421 using indirect dispatch.
1422 Generate symbolic references to interfaces when using indirect
1424 (make_class_data): Emit otable, atable, and ctable.
1425 Make otable, atable, and ctable class local rather than global.
1426 (emit_catch_table): Make otable, atable, and ctable class local
1429 2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
1431 * parse.y (catch_clause_parameter): Fix typo.
1434 * parse.y: (catch_clause_parameter): Return early if $3, aka
1435 formal_parameter, is null.
1437 2003-12-20 Kazu Hirata <kazu@cs.umass.edu>
1439 * class.c: Remove uses of "register" specifier in
1440 declarations of arguments and local variables.
1443 * gjavah.c: Likewise.
1444 * jcf-dump.c: Likewise.
1445 * jcf-io.c: Likewise.
1446 * jcf-parse.c: Likewise.
1447 * jcf-write.c: Likewise.
1448 * keyword.h: Likewise.
1449 * parse.y: Likewise.
1450 * typeck.c: Likewise.
1451 * verify.c: Likewise.
1453 2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
1455 * Make-lang.in (GCJ_CROSS_NAME): Delete.
1456 (java.install_common, java.install-man): Adjust for above.
1457 (java.uninstall): Likewise.
1459 2003-12-03 Michael Koch <konqueror@gmx.de>
1461 * class.c (make_class_data):
1462 Push field value to 'hack_signers' instead of 'signers'.
1463 * decl.c (java_init_decl_processing):
1464 Push field 'hack_signers' instead of 'signers'.
1466 2003-12-03 Zack Weinberg <zack@codesourcery.com>
1468 * lex.h: Check both HAVE_ICONV and HAVE_ICONV_H before
1471 2003-12-03 Ralph Loader <rcl@ihug.co.nz>
1474 * parse.y (qualify_ambiguous_name): Remove lots of broken
1475 field access processing - there's no need to do that here,
1476 because we have resolve_field_access. Remove
1477 RESOLVE_EXPRESSION_NAME_P as it isn't used anywhere else.
1478 * java-tree.h: Remove RESOLVE_EXPRESSION_NAME_P as it isn't
1481 2003-12-01 Jeff Sturm <jsturm@one-point.com>
1484 * parse.y (java_complete_lhs): Save location prior to patching
1487 2003-11-25 Mohan Embar <gnustuff@thisiscool.com>
1490 * resource.c (write_resource_constructor): Append
1491 "_resource" to constructor identifier name.
1493 2003-11-25 Jeff Sturm <jsturm@one-point.com>
1496 * constants.c (cpool_for_class): New function.
1497 (outgoing_cpool): Remove global variable.
1498 (alloc_name_constant): Use cpool_for_class.
1499 (build_constants_constructor): Likewise.
1500 * decl.c (java_expand_body): Set current_class.
1501 * java-tree.h (outgoing_cpool) Remove declaration.
1502 (init_outgoing_cpool): Likewise.
1503 * jcf-parse.c (init_outgoing_cpool): Remove function.
1504 (parse_class_file): Don't call init_outgoing_cpool.
1505 * parse.y (java_complete_expand_methods): Don't call
1506 init_outgoing_cpool. Don't save outgoing_cpool.
1507 (java_expand_classes): Don't restore outgoing_cpool.
1508 (java_finish_classes): Likewise.
1510 2003-11-24 Mohan Embar <gnustuff@thisiscool.com>
1512 * Make-lang.in: (java.install-common) Add
1513 symlink for $(target_noncanonical)-gcjh for
1516 2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
1518 * Make-lang.in (java.extraclean): Delete.
1520 2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
1522 * Make-lang.in (check-java): Add.
1524 2003-11-19 Jeff Sturm <jsturm@one-point.com>
1527 * except.c (prepare_eh_table_type): Allocate variable-sized
1528 buffer `buf' with alloca.
1530 2003-11-17 Jeff Sturm <jsturm@one-point.com>
1534 decl.c (java_init_decl_processing): Don't initialize
1535 class_not_found_type_node, no_class_def_found_type_node.
1537 java-tree.h (JTI_CLASS_NOT_FOUND_TYPE_NODE,
1538 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE): Remove from java_tree_index.
1539 (class_not_found_type_node, no_class_def_found_type_node):
1542 parse.y (build_dot_class_method_invocation): Add this_class
1543 argument. Qualify method invocations to a different class.
1544 (create_new_parser_context): Initialize saved_data_ctx to 0.
1545 (java_parser_context_save_global): Initialize saved_data_ctx to 1.
1546 (build_dot_class_method): Don't load classes. Register
1548 (build_incomplete_class_ref): Special cases for interfaces
1549 and inner classes. Move build_dot_class_method call to here...
1550 (patch_incomplete_class_ref): ...from here. Pass current_class
1551 to build_dot_class_method_invocation.
1552 (build_assertion): Pass class_type to
1553 build_dot_class_method_invocation.
1554 (encapsulate_with_try_catch): Handle EXPR_WITH_FILE_LOCATION node.
1556 2003-11-17 Jeff Sturm <jsturm@one-point.com>
1559 * java-tree.h (BLOCK_EMPTY_P): Define.
1560 * parse.y (java_complete_lhs): Check for empty blocks
1561 in TRY_FINALLY_EXPR case.
1563 2003-11-17 Andrew Haley <aph@redhat.com>
1565 * java-tree.h (LOCAL_VAR_OUT_OF_SCOPE_P): New.
1566 (struct lang_decl_var:freed): New variable.
1567 * decl.c (poplevel): Mark local vars that have gone out of scope.
1568 (push_jvm_slot): Don't use the RTL of a var that has gone out of
1571 2003-11-16 Jason Merrill <jason@redhat.com>
1573 * Make-lang.in (java.tags): Create TAGS.sub files in each directory
1574 and TAGS files that include them for each front end.
1576 2003-11-15 Tom Tromey <tromey@redhat.com>
1578 * gjavah.c (print_stub_or_jni): Pass `env' to FatalError.
1580 2003-11-12 Jason Merrill <jason@redhat.com>
1582 PR optimization/12547
1583 * lang.c (java_tree_inlining_walk_subtrees): Just walk
1584 BLOCK_EXPR_BODY directly.
1586 2003-11-12 Andrew Haley <aph@redhat.com>
1589 * parse.y (fold_constant_for_init): Check that we really do have a
1593 * lang.c (merge_init_test_initialization): Clear DECL_INITIAL for
1594 init_test_decls being inlined.
1597 * parse.y (do_resolve_class): Check return value from
1598 breakdown_qualified().
1600 2003-11-11 Tom Tromey <tromey@redhat.com>
1603 * parse.y (merge_string_cste): Handle case where we have a
1604 pointer that happens to be zero, not null_pointer_node.
1606 2003-11-10 Tom Tromey <tromey@redhat.com>
1608 * jcf-parse.c (classify_zip_file): Correctly compare
1609 filename_length against length of manifest file's name.
1611 2003-11-08 Tom Tromey <tromey@redhat.com>
1614 * jcf-parse.c (classify_zip_file): Only skip MANIFEST.MF file.
1616 2003-11-06 Andrew Haley <aph@redhat.com>
1618 * expr.c (java_stack_swap): Make sure destination stack slots are
1619 of the correct type.
1621 2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
1623 * Make-lang.in (dvi): Move targets to $(docobjdir).
1624 (gcj.dvi): Simplify rule and adjust target.
1625 (gcj.info): Simplify rule.
1626 (gcj.pod): New intermediate rule.
1627 (gcjh.pod): Likewise.
1628 (jv-scan.pod): Likewise.
1629 (jcf-dump.pod): Likewise.
1630 (gij.pod): Likewise.
1631 (jv-convert.pod): Likewise.
1632 (rmic.pod): Likewise.
1633 (rmiregistry.pod): Likewise.
1636 (jv-scan.1): Delete.
1637 (jcf-dump.1): Delete.
1639 (jv-convert.1): Delete.
1641 (rmiregistry.1): Delete.
1643 2003-11-02 Jeff Sturm <jsturm@one-point.com>
1645 Fixes PR java/12866.
1646 * parse.y (resolve_qualified_expression_name): Move test
1647 for outer field access methods from here...
1648 (check_thrown_exceptions) ...to here.
1650 2003-11-01 Kelley Cook <kcook@gcc.gnu.org>
1652 * .cvsignore: Delete.
1654 2003-10-28 Frank Ch. Eigler <fche@redhat.com>
1656 * verify.c (verify_jvm_instructions): Don't warn about legal
1657 eh binding regions generated for example by jdk 1.4.1.
1659 2003-10-24 David S. Miller <davem@redhat.com>
1661 * jcf-parse.c (jcf_parse): Fix args to fatal_error().
1663 2003-10-22 Andrew Haley <aph@redhat.com>
1665 * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
1666 (java_get_callee_fndecl): New.
1668 * jcf-parse.c (java_parse_file): Call emit_catch_table().
1670 * java-tree.h (ctable_decl): New.
1671 (catch_classes): New.
1672 (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.
1674 * decl.c (java_init_decl_processing): Add catch_class_type.
1676 Add catch_classes field.
1678 * class.c (build_indirect_class_ref): Break out from
1680 (make_field_value): Check flag_indirect_dispatch.
1681 (make_class_data): Ditto.
1682 Tidy uses of PUSH_FIELD_VALUE.
1683 Add field catch_classes.
1684 (make_catch_class_record): New.
1686 * java-tree.h (PUSH_FIELD_VALUE): Tidy.
1688 2003-10-22 Kazu Hirata <kazu@cs.umass.edu>
1690 * jcf-write.c: Follow spelling conventions.
1691 * parse.y: Likewise.
1693 2003-10-22 Kazu Hirata <kazu@cs.umass.edu>
1695 * ChangeLog: Fix typos.
1696 * expr.c: Fix comment typos.
1697 * jcf-write.c: Likewise.
1700 * mangle.c: Likewise.
1701 * parse-scan.y: Likewise.
1702 * parse.y: Likewise.
1704 2003-10-22 Tom Tromey <tromey@redhat.com>
1706 * expr.c (expand_byte_code): Only warn about dead bytecode when
1707 extra_warnings is set.
1709 2003-10-22 Bryce McKinlay <bryce@mckinlay.net.nz>
1711 Fix for PR java/12586.
1712 * mangle.c (find_compression_record_match): Don't iterate through
1713 package namespace elements unless they all match compression_table
1716 2003-10-20 Kelley Cook <kcook@gcc.gnu.org>
1718 * Make-lang.in (info): Honor $(parsedir) and $(docobjdir).
1719 (generate-manpages): Likewise.
1720 (java.maintainer-clean): Likewise.
1721 (gcj.info): Likewise.
1724 (jv-scan.1): Likewise.
1725 (jcf-dump.1): Likewise.
1727 (jv-convert.1): Likewise.
1729 (rmiregistry.1): Likewise.
1730 (java.install-man): Likewise.
1731 (parse-scan.o): Move and define complete compile line.
1732 (parse.o): Likewise.
1733 (jcf-tree-inline.o): Move.
1735 2003-10-20 Mark Mitchell <mark@codesourcery.com>
1737 * Make-lang.in (info): Update dependencies.
1738 (java.install-info): Remove.
1739 ($(srcdir)/java/gcj.info): Replace with ...
1740 ($(docobjdir)/gcj.info): ... this.
1742 2003-10-14 Nathanael Nerode <neroden@gcc.gnu.org>
1744 * Make-lang.in: Replace uses of $(target_alias) with
1745 $(target_noncanonical).
1747 2003-10-09 Tom Tromey <tromey@redhat.com>
1749 * decl.c (java_init_decl_processing): Declare signers field.
1750 * class.c (make_class_data): Set signers field.
1752 2003-10-09 Jason Merrill <jason@redhat.com>
1754 * parse.y (patch_assignment): Use make_node to create a BLOCK.
1755 * parse.h (BUILD_PTR_FROM_NAME): Use make_node to create a
1758 2003-10-06 Mark Mitchell <mark@codesourcery.com>
1760 * Make-lang.in (java.info): Replace with ...
1762 (java.dvi): Replace with ...
1764 (java.generated-manpages): Replace with ...
1766 2003-10-03 Kelley Cook <kelleycook@wideopenwest.com>
1768 * builtins.c, jcf.h, jvspec.c: Remove PARAMS macros.
1770 2003-10-01 Andrew Haley <aph@redhat.com>
1772 * jcf-parse.c (java_parse_file): Write otable and atable.
1773 * java-tree.h (atable_methods): New.
1775 (atable_syms_decl): New.
1776 (enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL,
1777 JTI_ATABLE_SYMS_DECL. Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*.
1778 (symbol_*type): Rename method_symbol* to symbol*type.
1779 (emit_offset_symbol_table): Delete.
1780 (emit_symbol_table): New.
1781 (get_symbol_table_index): New.
1783 * expr.c (build_field_ref): Handle flag_indirect_dispatch.
1784 (build_known_method_ref): Likewise.
1785 (get_symbol_table_index): Rename from get_offset_table_index.
1786 Parameterize to allow re-use by differing types of symbol table.
1787 (build_invokevirtual): Pass table to get_offset_table_index.
1788 * decl.c (java_init_decl_processing): Push types and decls for
1789 atable and atable_syyms.
1790 * class.c (build_static_field_ref): Handle flag_indirect_dispatch.
1791 (make_class_data): Add new fields atable and atable_syms.
1792 (emit_symbol_table): Rename from emit_offset_symbol_table.
1793 Parameterize to allow re-use by different types of symbol table.
1794 (build_symbol_entry): Renamed from build_method_symbols_entry.
1796 2003-09-30 Roger Sayle <roger@eyesopen.com>
1798 * jcf-write.c (generate_bytecode_insns): Implement evaluate-once
1799 semantics for SAVE_EXPR, by caching the result in a temporary.
1801 2003-09-28 Richard Henderson <rth@redhat.com>
1803 * check-init.c (check_init): Save and restore input_location
1804 instead of file and line separately.
1805 * decl.c (java_expand_body): Likewise.
1806 * jcf-write.c (generate_bytecode_insns): Likewise.
1807 * parse.y (safe_layout_class): Likewise.
1808 * jcf-parse.c (read_class, parse_class_file): Likewise.
1809 (java_parse_file): Use %H for warning locator.
1811 2003-09-28 Roger Sayle <roger@eyesopen.com>
1813 * expr.c (java_check_reference): Use the semantics of COND_EXPRs
1814 with void-type branches instead of using a COMPOUND_EXPR.
1816 2003-09-28 Jeff Sturm <jsturm@one-point.com>
1818 * decl.c (java_optimize_inline, dump_function): Remove.
1819 * java-tree.h (java_optimize_inline): Remove declaration.
1820 * jcf-parse.c (java_parse_file): Assume flag_unit_at_a_time is set.
1821 * parse.y (source_end_java_method, java_expand_classes):
1822 Likewise. Remove dead code.
1824 2003-09-27 Roger Sayle <roger@eyesopen.com>
1826 * lang.c (java_init_options): Set flag_evaluation_order.
1827 * expr.c (force_evaluation_order): Don't attempt to force
1828 evaluation order of binary operations using save_expr.
1829 * parse.y (java_complete_lhs): No longer need to call
1830 force_evaluation_order when constructing binary operators.
1832 2003-09-27 Alexandre Petit-Bianco <apbianco@redhat.com>
1833 Bryce McKinlay <bryce@mckinlay.net.nz>
1836 * parse.y (not_accessible_field_error): New function.
1837 (resolve_expression_name): Check field access permissions.
1838 (resolve_qualified_expression_name): Use
1839 not_accessible_field_error.
1840 (resolve_qualified_expression_name): Likewise.
1842 2003-09-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1844 * class.c (build_utf8_ref): Test for HAVE_GAS_SHF_MERGE value.
1846 2003-09-23 Roger Sayle <roger@eyesopen.com>
1848 * jcf-write.c (generate_bytecode_insns): Optimize binary operations
1849 with equal operands without side-effects.
1851 2003-09-22 Jeff Sturm <jsturm@one-point.com>
1853 * decl.c (java_init_decl_processing): Don't emit otable decls
1854 if flag_indirect_dispatch is not set.
1856 2003-09-21 Richard Henderson <rth@redhat.com>
1858 * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
1861 2003-09-21 Richard Henderson <rth@redhat.com>
1863 * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
1864 resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.
1866 2003-09-20 Richard Henderson <rth@redhat.com>
1868 * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
1870 2003-09-18 Roger Sayle <roger@eyesopen.com>
1872 * expr.c (java_truthvalue_conversion): Remove FFS_EXPR case.
1873 * check-init.c (check_init): Likewise.
1875 2003-09-18 Roger Sayle <roger@eyesopen.com>
1877 * jcf-write.c (generate_bytecode_insns): Add support for fconst_2.
1879 2003-09-16 Andrew Haley <aph@redhat.com>
1881 * jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.
1883 2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
1886 * mangle.c (find_compression_record_match): Skip
1887 over a "6JArray" (the array template mangled string)
1889 (mangle_array_type): Correct minor typo.
1890 (atms): Move definition to the beginning.
1892 2003-09-16 Bryce McKinlay <bryce@mckinlay.net.nz>
1894 * class.c (add_miranda_methods): Ensure super-interfaces are laid
1895 out. Fix for PR java/12254.
1897 2003-09-11 Richard Henderson <rth@redhat.com>
1899 * parse.y (source_end_java_method): Update for new
1900 cgraph_finalize_function argument.
1902 2003-09-09 Richard Henderson <rth@redhat.com>
1904 * parse.y (source_end_java_method): Update call to
1905 cgraph_finalize_function.
1907 2003-09-03 Jeff Sturm <jsturm@one-point.com>
1909 * decl.c (java_expand_body): New function.
1910 * expr.c (build_class_init): Set DECL_IGNORED_P.
1911 * java-tree.h (start_complete_expand_method,
1912 java_expand_body): Declare.
1913 * jcf-parse.c (cgraph.h): Include.
1914 (java_parse_file): Handle flag_unit_at_a_time.
1915 * lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING,
1916 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
1917 (java_estimate_num_insns): Use walk_tree_without_duplicates.
1918 (java_start_inlining): New function.
1919 * parse.h (java_finish_classes): Declare.
1920 * parse.y: Include cgraph.h.
1921 (block): Don't special-case empty block production.
1922 (craft_constructor): Set DECL_INLINE.
1923 (source_end_java_method): Handle flag_unit_at_a_time.
1924 Replace inline code with call to java_expand_body.
1925 (start_complete_expand_method): Remove static modifier.
1926 (java_expand_method_bodies): Patch function tree for
1927 class initialization and/or synchronization as needed.
1928 Don't begin RTL expansion yet.
1929 (java_expand_classes): Check flag_unit_at_a_time before
1930 calling finish_class.
1931 (java_finish_classes): New function.
1932 (java_complete_lhs): Ensure COMPOUND_EXPR has non-NULL type.
1933 (patch_assignment): Set DECL_CONTEXT on temporary variable.
1934 (emit_test_initialization): Set DECL_IGNORED_P.
1936 2003-09-03 Roger Sayle <roger@eyesopen.com>
1938 * builtins.c (enum builtin_type): Delete unused enumeration.
1939 * Make-lang.in (java/builtins.o): Remove built-types.def dependency.
1941 2003-08-28 Tom Tromey <tromey@redhat.com>
1943 * gcj.texi (Extensions): Document gcjlib URLs.
1945 2003-08-20 Tom Tromey <tromey@redhat.com>
1947 * gcj.texi (Extensions): Added xref.
1948 (libgcj Runtime Properties): Document
1949 gnu.gcj.runtime.VMClassLoader.library_control.
1951 2003-08-20 Andrew Haley <aph@redhat.com>
1953 * except.c (prepare_eh_table_type): Use new encoding for exception
1954 handlers when using -fno-assume-compiled.
1956 2003-08-13 Tom Tromey <tromey@redhat.com>
1958 * gcj.texi (Invoking gij): Document -X and -?.
1960 2003-08-13 Mohan Embar <gnustuff@thisiscool.com>
1962 * Make-lang.in: Added missing win32-host.o to JAVA_OBJS,
1963 GCJH_OBJS, JCFDUMP_OBJS
1964 * win32-host.c: Removed the unnecessary and broken dependency
1967 2003-08-11 Tom Tromey <tromey@redhat.com>
1969 * parse.y (java_check_regular_methods): Typo fixes. Call
1970 check_interface_throws_clauses. Use
1971 check_concrete_throws_clauses.
1972 (check_interface_throws_clauses): New function.
1973 (check_concrete_throws_clauses): New function.
1974 (hack_is_accessible_p): New function.
1975 (find_most_specific_methods_list): Added FIXME.
1976 * typeck.c (lookup_do): Use `flags' argument to decide what to
1978 (lookup_argument_method_generic): New function.
1979 (lookup_argument_method2): Removed.
1980 * jcf.h (ACC_INVISIBLE): New define.
1981 * jcf-write.c (generate_classfile): Skip invisible methods.
1982 * class.c (add_miranda_methods): New function.
1983 (layout_class_methods): Use it.
1984 (get_access_flags_from_decl): Use ACC_INVISIBLE.
1985 * java-tree.h (METHOD_INVISIBLE): New define.
1986 (lang_decl_func) [invisible]: New field.
1987 (lookup_argument_method_generic): Declare.
1988 (SEARCH_INTERFACE): New define.
1989 (SEARCH_SUPER): Likewise.
1990 (SEARCH_ONLY_INTERFACE): Likewise.
1991 (SEARCH_VISIBLE): Likewise.
1992 (lookup_argument_method2): Removed declaration.
1994 2003-08-05 Tom Tromey <tromey@redhat.com>
1996 Fix for PR java/11600:
1997 * parse.y (java_complete_lhs): See whether we're calling a method
1999 (check_thrown_exceptions): Added `is_array_call' argument;
2000 fixed `clone' checking; updated all callers.
2002 2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
2004 * java-tree.h (DECL_ESTIMATED_INSNS): Remove (moved to tree.h).
2006 2003-08-03 Tom Tromey <tromey@redhat.com>
2008 * java-tree.h (METHOD_TRANSIENT): Removed.
2009 * decl.c (pushdecl): Removed some dead code.
2010 * class.c (get_access_flags_from_decl): Can't have transient
2012 (add_method_1): Can't have a transient method.
2014 2003-07-28 Andreas Jaeger <aj@suse.de>
2016 * jvspec.c: Convert to ISO C90 prototypes.
2018 2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
2020 * decl.c (force_poplevels): Fix warning call.
2022 2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
2024 * expr.c (expand_java_field_op): Don't use xxx_with_decl
2025 (expand_java_field_op): Likewise.
2026 * class.c (layout_class_method): Likewise
2027 (emit_register_classes): Likewise.
2028 * decl.c (pushdecl): Likewise.
2029 (poplevel): Likewise.
2030 (force_poplevels): Likewise.
2031 (give_name_to_locals): Likewise.
2032 * check-init.c (check_for_initialization): Likewise.
2034 2003-07-24 Jason Merrill <jason@redhat.com>
2036 * java-tree.h: Move boolean_type_node et al to the back end.
2038 2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2040 * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary
2043 2003-07-19 Neil Booth <neil@daikokuya.co.uk>
2045 * lang.opt: Don't show -MD_ and -MDD_.
2047 2003-07-18 Neil Booth <neil@daikokuya.co.uk>
2049 * lang-options.h: Remove.
2050 * lang.opt: Add help text.
2052 2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
2054 * expr.c: Remove the last argument to expand_assignment().
2056 2003-07-09 Jan Hubicka <jh@suse.cz>
2058 * java-tree.h (DECL_NUM_STMTS): Rename to...
2059 (DECL_ESTIMATED_INSNS): ... this.
2060 * lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
2061 New static functions.
2062 (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
2063 * parser.y (add_stmt_to_compound): Do not account statements.
2065 2003-07-08 Mark Wielaard <mark@klomp.org>
2067 * gcj.texi: CNI now expands to Compiled Native Interface.
2069 2003-07-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
2071 * Make-lang.in (java/gcj.dvi): Use PWD_COMMAND.
2073 2003-07-07 Nathan Sidwell <nathan@codesourcery.com>
2075 * expr.c (expand_byte_code): Adjist emit_line_note call.
2077 2003-07-06 Neil Booth <neil@daikokuya.co.uk>
2079 * lang.c (java_handle_option): Don't handle filenames.
2081 2003-07-02 Zack Weinberg <zack@codesourcery.com>
2083 * jcf-path.c: Don't default-define PATH_SEPARATOR nor
2086 * jcf-write.c: Don't default-define DIR_SEPARATOR.
2087 * jcf.h: Delete COMPARE_FILENAMES definition.
2089 2003-07-02 Neil Booth <neil@daikokuya.co.uk>
2091 * lang.c (java_init_options): Update prototype.
2093 2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
2095 * decl.c (poplevel): Adjust define_label call.
2097 2003-06-27 Zack Weinberg <zack@codesourcery.com>
2099 * gjavah.c (flag_jni): Make non-static.
2100 * parse-scan.y (ctxp): Make non-static.
2102 * class.c (build_method_symbols_entry)
2103 * expr.c (get_offset_table_index)
2104 * jcf-parse.c (jcf_parse):
2105 Mark the definition static, matching the forward declaration.
2107 2003-06-26 Neil Booth <neil@daikokuya.co.uk>
2109 * lang.c (java_handle_option): Don't check for missing arguments.
2111 2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
2113 * class.c (push_class): Use a location_t to save place.
2114 (emit_register_classes): Set input_location. Adjust
2115 expand_function_end call.
2116 * resource.c (write_resource_constructor): Likewise.
2117 * decl.c (end_java_method): Adjust expand_function_end call.
2118 * parse.y (source_end_java_method): Likewise.
2120 2003-06-17 Robert Abeles <rabeles@archaelogic.com>
2122 * lang.c (java_handle_option): Likewise.
2124 2003-06-16 Neil Booth <neil@daikokuya.co.uk>
2126 * lang.c (java_handle_option): Special-casing of optional
2127 joined arguments no longer needed.
2128 * lang.opt: Update switches that take optional argument.
2130 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
2132 * lang.opt: Declare Java.
2133 * lang.c (java_init_options): Update.
2135 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
2137 * lang.c (version_flag): Rename to v_flag to avoid clash w/ toplev.h.
2139 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
2141 * lang-specs.h: Rewrite -MD and -MMD to append an underscore.
2142 * lang.c (java_handle_option): -MD and -MMD have an underscore.
2143 * lang.opt: -MD and -MMD have an underscore.
2145 2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
2147 * class.c (emit_register_classes): Adjust init_function_start
2149 * decl.c (complete_start_java_method): Likewise.
2150 * resource.c (write_resource_constructor): Likewise.
2152 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
2154 * Make-lang.in: Update to use options.c and options.h.
2155 * lang.c: Include options.h not j-options.h.
2156 (java_handle_option): Abort on unrecognized option.
2157 (java_init_options): Request Java switches.
2159 2003-06-11 Neil Booth <neil@daikokuya.co.uk>
2161 * Make-lang.in: Handle mostlyclean.
2163 2003-06-11 Tom Tromey <tromey@redhat.com>
2165 * lang.c (java_handle_option): Update dependency_tracking for
2168 * lang.c (java_handle_option): OPT_fbootclasspath_ can take an
2171 2003-06-10 Andrew Haley <aph@redhat.com>
2173 * resource.c (write_resource_constructor): Use expand_expr to
2174 generate the address of the label attached to a resource.
2175 * Make-lang.in (java/resource.o): Add expr.h
2177 2003-06-10 Andrew Haley <aph@redhat.com>
2179 * lang.c (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
2180 (java_decl_ok_for_sibcall): New.
2182 2003-06-09 Neil Booth <neil@daikokuya.co.uk>
2184 * Make-lang.in (JAVA_OBJS, java/lang.o): Update.
2185 (java/j-options.c, java/j-options.h): New.
2186 * java-tree.h (resource_name, compile_resource_file,
2187 compile_resource_data): Constify.
2188 * jcf-write.c (jcf_write_base_directory): Similarly.
2189 * jcf.h (jcf_write_base_directory): Similarly.
2190 * lang.c: Include j-options.h.
2191 (cl_options_count, cl_options, string_option, java_decode_option,
2192 lang_f_options, lang_W_options, LANG_HOOKS_DECODE_OPTION,
2193 process_option_with_no): Remove.
2194 (resource_name): Constify.
2195 (LANG_HOOKS_HANDLE_OPTION): Override.
2196 (java_handle_option): New.
2197 (java_init): Don't call jcf_path_init.
2198 (java_init_options): Call jcf_path_init.
2200 * resource.c (compile_resource_data, compile_resource_file): Constify.
2202 2003-06-09 Nathan Sidwell <nathan@codesourcery.com>
2204 * java-tree.h (DECL_FUNCTION_LAST_LINE): New.
2205 (struct lang_decl_func): Add last_line field.
2206 * parse.h (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
2207 DECL_SOURCE_LINE_LAST): Remove.
2208 * parse.y (missing_return_error, finish_method_declaration,
2209 lookup_cl, start_artificial_method_body, source_end_java_method,
2210 start_complete_expand_method): Adjust.
2212 2003-06-08 Tom Tromey <tromey@redhat.com>
2214 * jvspec.c (jvgenmain_spec): Added `*' after fassume-compiled and
2215 fno-assume-compiled.
2217 2003-06-08 Roger Sayle <roger@eyesopen.com>
2219 * builtins.c (define_builtin_type, builtin_types): Delete.
2220 (define_builtin): Rewritten to take just the built-in code,
2221 the function's name, type and fallback library function name.
2222 All built-ins used by Java are implicit and BUILT_IN_NORMAL.
2223 (initialize_builtins): Overhaul to define the GCC builtins
2224 used by gcj manually, providing the Java run-time's
2225 implementations as the fallback library function.
2227 2003-06-08 Anthony Green <green@redhat.com>
2229 * parse.y (patch_cast): Fix conversions from floating-point to
2232 2003-06-08 Neil Booth <neil@daikokuya.co.uk>
2234 * Make-lang.in: Update.
2235 * lang.c: Include opts.h. Define cl_options_count and cl_options.
2237 2003-06-07 Neil Booth <neil@daikokuya.co.uk>
2239 * lang.c (java_init_options): Update.
2241 2003-06-05 Jan Hubicka <jh@suse.cz>
2243 * Make-lang.in: Add support for stageprofile and stagefeedback
2245 2003-05-31 Roger Sayle <roger@eyesopen.com>
2247 * lang.c (java_init_options): Prescribe wrap-around two's
2248 complement arithmetic overflow by setting flag_wrapv.
2250 2003-05-29 Roger Sayle <roger@eyesopen.com>
2252 * builtins.c (cos_builtin, sin_builtin, sqrt_builtin): Delete.
2253 (builtin_record): Add an additional builtin_code field to
2254 record which GCC built-in corresponds to the Java function.
2255 (java_builtins): Add new entries for atan, atan2, exp, log,
2257 (max_builtin, min_builtin, abs_builtin): Perform constant
2258 folding on the resulting tree.
2259 (java_build_function_call_expr): Likewise, perform constant
2260 folding on the resulting tree.
2261 (initialize_builtins): The NULL creators are now allowed in
2262 the java_builtins table, which is now terminated by an entry
2263 with builtin_code == END_BUILTINS.
2264 (check_for_builtin): Likewise. If the matching creator is
2265 NULL, construct the call using java_build_function_call_expr
2266 directly with the decl for the corresponding builtin_code.
2268 2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
2270 * win32-host.c: Normalize copyright boilerplate.
2272 2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2274 * parse.y (print_int_node): Use string concatentation on
2275 HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
2276 function calls into one.
2278 2003-05-13 Zack Weinberg <zack@codesourcery.com>
2280 * jcf-parse.c, jcf-write.c, lex.c: Replace all calls to
2281 fatal_io_error with calls to fatal_error; add ": %m" to the end of
2282 all the affected error messages.
2284 2003-05-13 Richard Henderson <rth@redhat.com>
2286 * class.c (layout_class_method): Set DECL_EXTERNAL.
2287 * decl.c (java_mark_decl_local, java_mark_class_local): New.
2288 * java-tree.h (java_mark_class_local): Declare.
2289 * jcf-parse.c (parse_class_file): Use it.
2290 * parse.y (java_expand_classes): Likewise.
2292 2003-05-04 Nathan Sidwell <nathan@codesourcery.com>
2294 * Make-lang.in (java/parse.o, java/parse-scan.o): Depend on input.h.
2295 * lex.h: #include input.h.
2296 * jv-scan.c (input_filename): Remove.
2298 2003-05-02 Tom Tromey <tromey@redhat.com>
2301 * gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
2302 (handle_inner_classes): New function.
2304 2003-05-01 Tom Tromey <tromey@redhat.com>
2307 * parse.y (finish_for_loop): Do nothing if update expression is a
2308 EXPR_WFL_NODE wrapping nothing.
2309 (java_complete_lhs) <COMPOUND_EXPR>: Likewise.
2311 2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
2313 * lex.h (input_lineno): Remove declaration.
2314 * parse-scan.y: #include input.h.
2315 (input_filename): Remove declaration.
2316 (input_location): Add definition.
2317 (input_line): Remove definition.
2319 2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
2321 * lex.h (lineno): Rename to ...
2322 (input_line): ... here
2323 * parse-scan.y (lineno): Rename to ...
2324 (input_line): ... here.
2325 (reset_report): Rename lineno to input_line.
2326 * check-init.c (check_init): Likewise.
2327 * class.c (push_class): Likewise.
2328 * decl.c (complete_start_java_method, end_java_method): Likewise.
2329 * expr.c (expand_byte_code): Likewise.
2330 * jcf-parse.c (give_name_to_class, parse_class_file): Likewise.
2331 * jcf-write.c (generate_bytecode_insns): Likewise.
2332 * lex.c (java_init_lex, java_allocate_new_line,
2333 do_java_lex): Likewise.
2334 * parse.h (YYNOT_TWICE): Likewise.
2335 * parse.y (empty_statement, expression_statement,
2336 java_pop_parser_context, java_parser_context_save_global,
2337 yyerror, register_fields, method_header, safe_layout_class,
2338 find_in_imports_on_demand, create_artificial_method,
2339 source_end_java_method, start_complete_expand_method,
2340 build_thisn_assign, java_complete_lhs,
2341 maybe_absorb_scoping_block): Likewise.
2343 2003-04-20 Mohan Embar <gnustuff@thisiscool.com>
2345 * jcf-io.c (find_class): use DIR_SEPARATOR instead of
2346 '/' when computing java source filename
2348 2003-04-13 Tom Tromey <tromey@redhat.com>
2350 * gjavah.c (print_c_decl): Indentation fix.
2352 2003-04-12 Zack Weinberg <zack@codesourcery.com>
2354 * class.c (make_field_value, make_method_value, get_dispatch_table)
2355 (make_class_data, emit_offset_symbol_table)
2356 * constants.c (build_constants_constructor)
2357 * java-tree.h (START_RECORD_CONSTRUCTOR)
2358 * parse.y (maybe_build_array_element_wfl):
2359 Use build_constructor.
2361 2003-04-10 Eric Blake <ebb9@email.byu.edu>
2364 * parse.y (string_convert_int_cst): Always use at least one digit
2365 in string conversion. Remove ASCII dependence.
2366 (merge_string_cste): Fix merging of 3-byte UTF-8 characters.
2368 2003-03-16 Mohan Embar <gnustuff@thisiscool.com>
2370 * Make-lang.in: added win32-host.c
2371 * jcf.h: defined macro JCF_OPEN_EXACT_CASE which
2372 resolves to open() on non-Win32 platforms and
2373 Win32-specific jcf_open_exact_case() on Win32
2374 * jcf-io.c (find_class): use JCF_OPEN_EXACT_CASE
2375 when trying .java and .class files
2376 * win32-host.c: added to repository. Defines
2377 Win32-specific jcf_open_exact_case()
2379 2003-04-10 Andrew Haley <aph@redhat.com>
2381 * jcf-write.c (struct jcf_partial): num_jsrs: new field.
2382 (maybe_free_localvar): Renamed from localvar_free.
2383 Add new arg, really.
2384 (generate_bytecode_insns): Set new variable, jsrs.
2385 Only free local vars if no jsr insns have been emittted.
2386 Call maybe_free_localvar, not localvar_free.
2388 2003-03-30 Joseph S. Myers <jsm@polyomino.org.uk>
2390 * gcj.texi: Remove @ at start of file.
2392 2003-03-25 Tom Tromey <tromey@redhat.com>
2394 * parse.y (create_interface): Call CHECK_DEPRECATED.
2396 2003-03-23 Zack Weinberg <zack@codesourcery.com>
2398 * Make-lang.in: Link jcf-dump against $(LDEXP_LIB).
2400 2003-03-21 Zack Weinberg <zack@codesourcery.com>
2402 * javaop.h (jfloat, jdouble): Make them structures mirroring
2403 the bit fields of IEEE float and double respectively.
2404 (JFLOAT_FINITE, JFLOAT_QNAN_MASK, JFLOAT_EXP_BIAS,
2405 JDOUBLE_FINITE, JDOUBLE_QNAN_MASK, JDOUBLE_EXP_BIAS): New.
2406 (union Word, union DWord): Delete.
2407 (WORD_TO_FLOAT, WORDS_TO_DOUBLE): Update to match.
2409 * gjavah.c (java_float_finite, java_double_finite, F_NAN_MASK,
2410 D_NAN_MASK): Delete.
2411 (jni_print_float, jni_print_double): New. Generate
2412 hexadecimal floating constants.
2413 (print_field_info): Use jni_print_float/double.
2415 * jcf-dump.c: Include math.h. Use ldexp/frexp to assemble
2416 finite floating point numbers for output; special case
2419 2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
2421 * lang.c (java_dump_tree): Change return type from 'int' to 'bool'.
2422 Replace 0 and 1 with true and false in return statements.
2424 2003-03-19 Tom Tromey <tromey@redhat.com>
2426 * lex.c (do_java_lex): Renamed from java_lex.
2427 (java_lex): New function.
2430 2003-03-13 Tom Tromey <tromey@redhat.com>
2432 * parse.y (resolve_inner_class): Error if qualifier is a primitive
2435 2003-03-04 Andrew Haley <aph@redhat.com>
2437 * gjavah.c (is_first_data_member): New global variable.
2438 (print_c_decl): If it's the first data member, align it as the
2440 (process_file): Set is_first_data_member.
2442 2003-03-11 Tom Tromey <tromey@redhat.com>
2444 * parse.y (resolve_field_access): Initialize class if field is
2445 found in another static field.
2446 * expr.c (build_class_init): Don't optimize out initialization of
2447 implemented interface.
2449 2003-03-11 Andrew Haley <aph@redhat.com>
2451 * jcf-io.c (caching_stat): Initialize origsep to remove compiler
2454 2003-03-10 Ranjit Mathew <rmathew@hotmail.com>
2456 * jcf-io.c (caching_stat): Account for both DIR_SEPARATOR
2457 and DIR_SEPARATOR_2 for a target.
2458 Correct minor typos.
2460 * jcf-write.c (make_class_file_name): Take both DIR_SEPARATOR
2461 and DIR_SEPARATOR_2 for a target into account.
2463 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
2465 * lang.c (java_init): Update prototype, move code to java_post_options.
2466 (java_post_options): Similarly.
2468 2003-03-05 Ranjit Mathew <rmathew@hotmail.com>
2470 * jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to
2471 compare file name components depending on the case-sensitivity
2472 or otherwise of the host file system.
2474 * jcf-path.c (add_entry): Use COMPARE_FILENAMES instead of
2475 "strcmp" to compare file name components.
2476 Use IS_DIR_SEPARATOR instead of comparing directly against
2478 (jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of
2479 comparing directly against DIR_SEPARATOR.
2481 2003-03-04 Tom Tromey <tromey@redhat.com>
2483 * Make-lang.in (java.tags): New target.
2485 2003-03-01 Roger Sayle <roger@eyesopen.com>
2487 * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3.
2488 (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3.
2490 2003-03-01 Tom Tromey <tromey@redhat.com>
2492 * parse.y (jdep_resolve_class): Only check deprecation if we found
2495 2003-02-28 Tom Tromey <tromey@redhat.com>
2498 * class.c (maybe_layout_super_class): Always pass a WFL to
2500 * parse.y (do_resolve_class): Updated comment to explain
2503 2003-02-26 Tom Tromey <tromey@redhat.com>
2505 * jcf-write.c (generate_classfile): Check whether class is
2506 deprecated before writing attribute count.
2508 2003-02-25 Roger Sayle <roger@eyesopen.com>
2510 * java/decl.c (java_init_decl_processing): Get soft_fmod_node from
2511 built_in_decls[BUILT_IN_FMOD] rather than define it ourselves.
2513 2003-02-23 Tom Tromey <tromey@redhat.com>
2515 * lang-options.h: Added -Wdeprecated.
2516 * gcj.texi (Warnings): Document -Wdeprecated.
2517 * java-tree.h (flag_deprecated): Declare.
2518 * lang.c (lang_W_options): Added deprecated.
2519 (flag_deprecated): New global.
2520 * chartables.h: Rebuilt.
2521 * gen-table.pl (process_one): Look at whitespace.
2522 (print_tables): Define LETTER_SPACE, LETTER_MASK.
2523 * parse.h (CLEAR_DEPRECATED): New macro.
2524 (CHECK_DEPRECATED_NO_RESET): New macro.
2525 * jcf-parse.c (handle_deprecated): New function.
2526 (HANDLE_DEPRECATED_ATTRIBUTE): New define.
2527 * jcf-reader.c (get_attribute): Handle Deprecated attribute.
2528 * parse.y (resolve_type_during_patch): Check deprecation.
2529 (jdep_resolve_class): Likewise.
2530 (process_imports): Likewise.
2531 (resolve_expression_name): Likewise.
2532 (check_deprecation): Strip arrays from decl. Check
2534 (patch_method_invocation): Also check the particular constructor
2536 (register_fields): Use CHECK_DEPRECATED_NO_RESET in loop.
2537 * jcf-write.c (append_deprecated_attribute): New function.
2538 (generate_classfile): Generate deprecated attribute when
2540 * lex.c (java_parse_doc_section): Return type now void. Rewrote.
2541 (java_lex) [case '*']: Simplify logic.
2542 (java_start_char_p): Use LETTER_MASK.
2543 (java_part_char_p): Likewise.
2544 (java_space_char_p): New function.
2546 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
2548 Change base class access representation.
2549 * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
2550 (add_interface_do): Likewise.
2552 2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
2554 * decl.c (java_init_decl_processing): Change
2555 soft_lookupjnimethod_node to reflect the change in
2556 signature of _Jv_LookupJNIMethod in libjava/jni.cc
2557 * expr.c (build_jni_stub): Calculate and pass the size
2558 on the stack of the arguments to a JNI function. Use
2559 new target macro MODIFY_JNI_METHOD_CALL to allow a
2560 target to modify the call to a JNI method.
2562 2003-02-08 Roger Sayle <roger@eyesopen.com>
2564 * jcf-io.c (java_or_class_file): Use libiberty's lbasename
2565 instead of basename to avoid compiler warnings on Tru64.
2567 2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
2569 * gcj.texi: Update to GFDL 1.2.
2571 2003-01-31 Andrew Haley <aph@redhat.com>
2573 * parse.y (java_expand_classes): Scan the whole class list looking
2574 for access methods that haven't yet been expanded.
2576 2003-01-31 Adrian Bunk <bunk@fs.tum.de>
2580 * jv-scan.c: Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
2581 to fix bootstrap on sparc-unknown-netbsdelf1.5.
2582 * jcf-parse.c: Likewise.
2584 2003-01-31 Mark Wielaard <mark@klomp.org>
2586 * gjavah.c (throwable_p): Allocate 1 more byte for string.
2588 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
2590 * class.c (make_class): Use BINFO_ELTS.
2591 (set_super_info): Likewse.
2592 (add_interface_do): Likewise.
2594 2003-01-30 Tom Tromey <tromey@redhat.com>
2596 * jcf-parse.c (read_class): Update identifier's class value if it
2597 changed during parsing.
2599 2003-01-30 Loren James Rittle <ljrittle@acm.org>
2601 * Make-lang.in (po-generated): Find the targets in $(parsedir).
2602 Propagate change to all other rules as required.
2603 (java/parse-scan.o): Add explicit dependency on
2604 $(parsedir)/java/parse-scan.c .
2606 2003-01-29 Tom Tromey <tromey@redhat.com>
2608 * parse.y (patch_assignment): Only transform the rhs of an
2609 assignment when compiling to native.
2611 2003-01-28 Tom Tromey <tromey@redhat.com>
2613 * jcf-write.c (generate_bytecode_conditional): Typo fixes.
2615 2003-01-28 Tom Tromey <tromey@redhat.com>
2617 * lex.c (java_lex): Don't include UEOF as part of token.
2618 (java_read_unicode): Error if \u sequence prematurely terminated.
2620 2003-01-27 Tom Tromey <tromey@redhat.com>
2622 * parse.y (java_check_regular_methods): Check for construct after
2623 checking types in throws clause.
2625 2003-01-24 Tom Tromey <tromey@redhat.com>
2627 * class.c (build_static_field_ref): Only a String or numeric field
2628 can fold to a constant.
2630 2003-01-23 Tom Tromey <tromey@redhat.com>
2632 * jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
2633 file name in resource buffer.
2635 2003-01-23 Tom Tromey <tromey@redhat.com>
2637 * expr.c (build_known_method_ref): Use method's context to find
2640 2003-01-23 Tom Tromey <tromey@redhat.com>
2642 * constants.c (set_constant_entry): Allocated cleared memory.
2644 2003-01-22 Tom Tromey <tromey@redhat.com>
2646 * java-tree.h: Don't use PARAMS.
2647 * resource.c: Add prototypes for all functions.
2648 (write_resource_constructor): Use `const char *' to avoid
2651 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
2653 * jcf-parse.c (process_zip_dir): Remove unused variable.
2655 2003-01-22 Tom Tromey <tromey@redhat.com>
2657 * expr.c (build_invokeinterface): Abort if method's context is not
2660 2003-01-22 Tom Tromey <tromey@redhat.com>
2662 * gcj.texi (Input and output files): Mention non-class entries.
2663 * decl.c (java_init_decl_processing): Call
2664 init_resource_processing.
2665 * java-tree.h (compile_resource_data, write_resource_constructor,
2666 compile_resource_file, init_resource_processing): Declare.
2667 * config-lang.in (gtfiles): Added resource.c.
2668 * Make-lang.in (gt-java-resource.h): New target.
2669 (JAVA_OBJS): Added resource.o.
2670 (java/resource.o): New target.
2671 * resource.c: New file.
2672 * class.c (compile_resource_file): Moved to resource.c.
2673 (registerResource_libfunc): Likewise.
2674 (utf8_decl_list): Mark with GTY; now static.
2675 * jcf-parse.c (classify_zip_file): New function.
2676 (parse_zip_file_entries): Use it; compile .properties files.
2677 (process_zip_dir): Use classify_zip_file and compute_class_name.
2678 Don't write class name into zip directory.
2679 (java_parse_file): Call write_resource_constructor.
2680 (compute_class_name): New function.
2681 * jcf-io.c (read_zip_member): Reindented.
2683 2003-01-21 Tom Tromey <tromey@redhat.com>
2685 * class.c (supers_all_compiled): New function.
2686 (make_class_data): Use it.
2688 2003-01-21 Tom Tromey <tromey@redhat.com>
2690 * parse.y (method_header): Native method can't be strictfp.
2691 No method can be transient or volatile.
2693 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2695 Make-lang.in (jvspec.o-warn): Add -Wno-error.
2697 2003-01-18 Kazu Hirata <kazu@cs.umass.edu>
2699 * check-init.c: Fix comment typos.
2700 * class.c: Likewise.
2701 * constants.c: Likewise.
2703 * except.c: Likewise.
2705 * java-except.h: Likewise.
2706 * java-tree.h: Likewise.
2707 * javaop.h: Likewise.
2708 * jcf-dump.c: Likewise.
2709 * jcf-io.c: Likewise.
2710 * jcf-parse.c: Likewise.
2711 * jcf-write.c: Likewise.
2713 * mangle.c: Likewise.
2714 * typeck.c: Likewise.
2715 * verify.c: Likewise.
2717 2003-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2719 * Make-lang.in (java/jcf-write.o): Depend on $(TM_P_H).
2720 * jcf-write.c: Include "tm_p.h".
2722 2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2724 * jcf-io.c (caching_stat): Cast the 3rd arg of scandir to void*.
2726 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2728 * builtins.c (java_build_function_call_expr): Renamed from
2729 build_function_call_expr. All callers changed.
2731 * Make-lang.in (java/jcf-parse.o): Depend on $(TM_P_H).
2732 * jcf-parse.c: Include tm_p.h.
2734 * jcf-write.c (generate_bytecode_insns): Avoid signed/unsigned
2737 2003-01-14 Tom Tromey <tromey@redhat.com>
2739 * class.c (make_class_data): Check that super is compiled before
2740 building class reference to it.
2742 2003-01-14 Andrew Haley <aph@redhat.com>
2744 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
2745 varargs function -- correct.
2747 2003-01-14 Andrew Haley <aph@redhat.com>
2749 * decl.c (java_init_decl_processing): Temporarily back out previous patch.
2751 2003-01-14 Andrew Haley <aph@redhat.com>
2753 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
2754 varargs function -- correct.
2756 * parse.y (patch_assignment): Copy the rhs of an assignment into a
2757 temporary if the RHS is a reference.
2759 2003-01-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2761 * Make-lang.in (keyword.h): Pass "-L ANSI-C" to gperf.
2762 * keyword.h: Regenerated.
2764 * All Files: Convert to ISO C style function definitions.
2766 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
2768 * parse.y (check_pkg_class_access): ANSIfy definition.
2770 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2772 * decl.c, parse-scan.y, parse.y: Don't cast return value of
2775 * class.c, gjavah.c, parse.y, verify.c: Don't use PTR.
2777 2003-01-09 Geoffrey Keating <geoffk@apple.com>
2779 Merge from pch-branch:
2781 2002-12-02 Geoffrey Keating <geoffk@apple.com>
2783 * Make-lang.in (java/gjavah.o): Update dependencies.
2784 * gjavah.c: Include ggc.h.
2786 2002-08-16 Geoffrey Keating <geoffk@redhat.com>
2788 * Make-lang.in (GCJH_OBJS): Add ggc-none.o.
2789 (JCFDUMP_OBJS): Add ggc-none.o.
2790 (java/jcf-dump.o): Depend on GGC_H.
2791 * jcf-reader.c (jcf_parse_constant_pool): Use ggc_alloc to allocate
2792 CPool substructures.
2793 * jcf-parse.c (process_zip_dir): Use ggc_alloc to allocate JCFs.
2794 * jcf-dump.c: Include ggc.h.
2796 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
2798 * jcf.h (union cpool_entry): New.
2799 (struct CPool): Use gengtype to mark. Change field 'data' to be
2801 (struct JCF): Use gengtype to mark.
2802 (CPOOL_UINT): Update for new cpool_entry type.
2803 (CPOOL_USHORT1): Likewise.
2804 (CPOOL_USHORT2): Likewise.
2805 (CPOOL_FINISH): Use GC to free cpool subfields.
2806 * parse.h (struct parser_ctxt): Mark field current_jcf.
2807 * lex.c (java_init_lex): Use GC to allocate struct JCF.
2808 * jcf-parse.c (HANDLE_CONSTANT_Utf8): Update for new cpool_entry type.
2809 (main_jcf): Use gengtype to mark.
2810 (ggc_mark_jcf): Delete.
2811 (get_constant): Update for new cpool_entry type.
2812 (give_name_to_class): Likewise.
2813 (get_class_constant): Likewise.
2814 (init_outgoing_cpool): Use GGC to allocate struct CPool.
2815 (java_parse_file): Use GGC to allocate struct JCF.
2816 (init_jcf_parse): Don't call ggc_add_root.
2817 * jcf-reader.c (jcf_parse_constant_pool): Update for new
2819 * java-tree.h (current_jcf): Use gengtype to mark.
2820 (CPOOL_UTF): Update for new cpool_entry type.
2821 (outgoing_cpool): Use gengtype to mark.
2822 (struct lang_type): GC struct JCF and struct CPool.
2823 * config-lang.in (gtfiles): Add jcf.h.
2824 * constants.c (find_tree_constant): New.
2825 (set_constant_entry): Allocate cpool subfields using GGC. Update
2826 for new cpool_entry type.
2827 (find_constant1): Update for new cpool_entry type.
2828 (find_constant2): Likewise.
2829 (find_utf8_constant): Use find_tree_constant.
2830 (find_class_or_string_constant): Remove unnecessary cast to jword.
2831 Update for new cpool_entry type.
2832 (count_constant_pool_bytes): Update for new cpool_entry type.
2833 (write_constant_pool): Likewise.
2834 (alloc_name_constant): Use find_tree_constant.
2835 (build_constants_constructor): Update for new cpool_entry type.
2837 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
2839 * parse.y (mark_parser_ctxt): Delete.
2840 (goal): Don't use ggc_add_root.
2841 (create_new_parser_context): Use GC to allocate struct parser_ctxt.
2842 (java_pop_parser_context): Let GC free parser_ctxt.
2843 (java_parser_context_resume): Likewise.
2844 * parse.h (struct parser_ctxt): Use gengtype to mark.
2846 (ctxp_for_generation): Likewise.
2847 * lex.h (struct java_lc_s): Mark for gengtype.
2848 (java_lexer): Rearrange for gengtype.
2849 * config-lang.in (gtfiles): Add lex.h, parse.h.
2851 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2853 * All Files: Remove PARAMS macro.
2855 * expr.c, gjavah.c, javaop.h, jcf-dump.c, jcf-io.c, jcf-reader.c,
2856 jcf-write.c, jcf.h, jv-scan.c: Don't rely on the `DEFUN', `AND' or
2859 * jv-scan.c, parse.y: Remove VPARAMS, VA_OPEN, VA_FIXEDARG and
2862 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
2864 * Make-lang.in (java.install-common, java.uninstall,
2865 java.install-info, java.install-man): Prepend $(DESTDIR)
2866 to destination paths in all (un)installation commands.
2867 (java.install-common): Rewrite $(LN) command to support
2868 DESTDIR with "ln" as well as with "ln -s".
2870 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
2872 * java-tree.h: Protect against multiple inclusion.
2874 2003-01-07 Tom Tromey <tromey@redhat.com>
2876 * class.c (add_assume_compiled): Don't adjust parent if we're
2877 already at the root of tree.
2879 2003-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2881 * lang.c (dump_compound_expr): Prototype.
2883 2003-01-03 Tom Tromey <tromey@redhat.com>
2885 Fix for PR java/8712:
2886 * expr.c (build_instanceof): Build an NE_EXPR, not a COND_EXPR,
2887 when simply checking against `null'.
2889 2003-01-03 Tom Tromey <tromey@redhat.com>
2891 * gcj.texi (Standard Properties): Document http.proxyHost and
2894 * gcj.texi (GNU Classpath Properties): Document new properties.
2896 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
2898 * java/jcf-reader.c, java/jvgenmain.c, java/keyword.gperf,
2899 java/lang-options.h, java/mangle.c, java/mangle_name.c,
2900 java/xref.c, java/zextract.c,java/zipfile.h: Fix copyright years.
2902 2003-01-01 Steven Bosscher <s.bosscher@student.tudelft.nl>
2904 * Make-lang.in, boehm.c, buffer.c,
2905 buffer.h, builtins.c, class.c,
2906 config-lang.in, constants.c,
2907 convert.h, decl.c, except.c,
2908 expr.c, java-except.h,
2909 java-tree.h, javaop.def,
2910 jcf-parse.c, jcf-write.c,
2911 jv-scan.c, jvgenmain.c,
2912 jvspec.c, keyword.gperf,
2913 keyword.h, lang-options.h,
2914 lang-specs.h, lang.c, lex.c,
2915 lex.h, mangle.c, mangle_name.c,
2916 parse-scan.y, parse.h, parse.y,
2917 typeck.c, verify.c, xref.c,
2918 xref.h: Replace "GNU CC" with
2919 "GCC" in the copyright header.
2921 * check-init.c, gjavah.c, javaop.h,
2922 jcf-depend.c, jcf-dump.c, jcf-io.c,
2923 jcf-path.c, jcf-reader.c, jcf.h,
2924 zextract.c, zipfile.h: These files are
2925 "part of GCC". Also say "GCC" not "GNU CC".
2927 2002-12-30 DJ Delorie <dj@redhat.com>
2929 * Make-lang.in: Protect against texi2pod/pod2man failing.
2931 2002-12-28 Joseph S. Myers <jsm@polyomino.org.uk>
2933 * gcj.texi: Use @copying.
2935 2002-12-27 Mark Mitchell <mark@codesourcery.com>
2937 * gjavah.c (print_name_for_stub_or_jni): Adjust call to
2938 print_cxx_classname.
2939 (print_cxx_classname): Add add_scope parameter.
2940 (print_class_decls): Do not emit a semicolon after the extern
2942 (process_file): Adjust calls to print_cxx_classname.
2944 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
2946 * gcj.texi: Include Cover Texts in man page.
2948 2002-12-23 Jeff Sturm <jsturm@one-point.com>
2950 * class.c (build_static_field_ref): Check FIELD_FINAL.
2952 * constants.c (alloc_class_constant): Use TYPE_CPOOL_DATA_REF
2953 instead of current_constant_pool_data_ref.
2954 * java-tree.h (current_constant_pool_data_ref): Undefine.
2955 (JTI_CURRENT_CONSTANT_POOL_DATA_REF): Remove.
2956 * jcf-parse.c (init_outgoing_cpool): Don't initialize
2957 current_constant_pool_data_ref.
2959 * except.c (prepare_eh_table_type ): Use DECL_NAME of class type,
2960 not build_internal_class_name.
2962 * parse.y (patch_incomplete_class_ref): Always emit `class$' method.
2963 Use it when class ref isn't certain to be compiled.
2965 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
2967 * gcj.texi: Include gcc-common.texi.
2968 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Depend on
2969 $(srcdir)/doc/include/gcc-common.texi.
2971 2002-12-22 Anthony Green <green@redhat.com>
2973 * gcj.texi (Limitations): Add note about org.xml.sax and
2976 2002-12-20 Tom Tromey <tromey@redhat.com>
2978 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Handle case
2979 where minimum case value is Integer.MIN_VALUE.
2982 2002-12-18 Andrew Haley <aph@redhat.com>
2984 * parse.y (patch_invoke): Force evaluation order when `check' is
2985 set. For PR libgcj/8945.
2987 2002-12-16 Mark Mitchell <mark@codesourcery.com>
2989 * gcj.texi: Change version number to 3.4.
2991 2002-12-05 Ranjit Mathew <rmathew@hotmail.com>
2992 Andrew Haley <aph@redhat.com>
2994 * parse.y (source_end_java_method): Remove custom encoding of line
2995 numbers for a function decl before passing it to the back end.
2997 2002-12-03 Andrew Haley <aph@redhat.com>
2999 * class.c (make_class_data): New field, "chain".
3000 * decl.c (java_init_decl_processing): Likewise.
3002 2002-12-02 Tom Tromey <tromey@redhat.com>
3005 * parse.y (do_resolve_class): Handle qualified name via
3008 2002-11-30 Zack Weinberg <zack@codesourcery.com>
3010 * boehm.c, buffer.c, builtins.c, check-init.c, class.c,
3011 constants.c, decl.c, except.c, expr.c, gjavah.c, jcf-depend.c,
3012 jcf-dump.c, jcf-io.c, jcf-parse.c, jcf-path.c, jcf-write.c,
3013 jv-scan.c, jvgenmain.c, jvspec.c, lang.c, mangle.c, mangle_name.c,
3014 parse-scan.y, parse.y, typeck.c, verify.c, xref.c, zextract.c:
3015 Include coretypes.h and tm.h.
3016 * Make-lang.in: Update dependencies.
3018 2002-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3020 * decl.c (java_init_decl_processing): Use `LL' on 64-bit constant.
3022 2002-11-25 Diego Novillo <dnovillo@redhat.com>
3024 * jcf-reader.c: Don't expand JCF_readu4 inside the
3025 expansion of JCF_SKIP.
3027 2002-11-25 Diego Novillo <dnovillo@redhat.com>
3029 * jcf-reader.c: Don't expand JCF_readu4 inside the
3030 expansion of JCF_SKIP.
3032 2002-11-22 Tom Tromey <tromey@redhat.com>
3034 * parse.y (patch_binop): Cast right hand side of shift expression
3035 to `int'. Fixes PR java/8676.
3037 2002-11-22 Ranjit Mathew <rmathew@hotmail.com>
3038 Andrew Haley <aph@redhat.com>
3040 * gcc/java/jcf-write.c (write_classfile): Remove target
3041 class file, if it exists, before renaming the temporary
3044 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
3046 * jvspec.c (lang_specific_spec_functions): New.
3048 2002-11-18 Tom Tromey <tromey@redhat.com>
3050 Fix for PR java/7912:
3051 * expr.c (can_widen_reference_to): Allow cast of array to
3052 Cloneable or Serializable.
3053 * java-tree.h (java_lang_cloneable_identifier_node): Declare.
3054 (java_io_serializable_identifier_node): Likewise.
3055 * parse.y (java_lang_cloneable, java_io_serializable): Removed.
3056 (valid_ref_assignconv_cast_p): Use new identifier nodes.
3057 * lex.c (java_init_lex): Don't initialize java_lang_cloneable and
3058 java_io_serializable.
3059 * decl.c (java_init_decl_processing): Initialize
3060 java_lang_cloneable_identifier_node and
3061 java_io_serializable_identifier_node.
3062 (java_lang_cloneable_identifier_node): New global.
3063 (java_io_serializable_identifier_node): Likewise.
3065 2002-11-14 Jens-Michael Hoffmann <jensmh@gmx.de>
3067 * buffer.c: Remove unnecessary casts.
3068 * check-init.c: Likewise.
3069 * class.c: Likewise.
3070 * constants.c: Likewise.
3072 * except.c: Likewise.
3073 * gjavah.c: Likewise.
3074 * jcf-io.c: Likewise.
3075 * jcf-parse.c: Likewise.
3076 * jcf-path.c: Likewise.
3077 * jvspec.c: Likewise.
3080 * verify.c: Likewise.
3082 2002-11-06 Tom Tromey <tromey@redhat.com>
3084 * gjavah.c (print_stub_or_jni): Include JNIEXPORT and JNICALL in
3087 2002-11-05 Tom Tromey <tromey@redhat.com>
3089 Fix for PR java/6388.
3090 * lex.h (JAVA_INTEGRAL_RANGE_ERROR): Wrap in do...while.
3091 * java-tree.h (enum java_tree_index): New values
3092 JTI_DECIMAL_INT_MAX_NODE, JTI_DECIMAL_LONG_MAX_NODE.
3093 (decimal_int_max, decimal_long_max): New defines.
3094 * lex.c (yylex): Rewrote range checking. Sign extend literals.
3095 (error_if_numeric_overflow): Rewrote range checking.
3096 * decl.c (java_init_decl_processing): Initialize decimal_int_max,
3099 2002-11-02 Tom Tromey <tromey@redhat.com>
3101 * java-tree.h: Move JV_STATE_ERROR before JV_STATE_DONE.
3103 * class.c (make_method_value): Put class name, not signature, into
3104 `throws' field. For PR java/8415.
3106 2002-10-24 Tom Tromey <tromey@redhat.com>
3108 * gcj.texi (Invoking gij): Document --showversion.
3109 (Standard Properties): java.library.path now set.
3111 2002-10-23 Tom Tromey <tromey@redhat.com>
3113 * gjavah.c (decode_signature_piece): In JNI mode, print
3114 `jobjectArray' when array depth is nonzero.
3117 2002-10-15 Andrew Haley <aph@redhat.com>
3119 * parse.y (patch_invoke): Call force_evaluation_order on a static
3121 (resolve_qualified_expression_name): Call force_evaluation_order
3122 on a arg list that is part of a Qualified Expression Name.
3124 * lang.c (dump_compound_expr): New.
3125 (java_dump_tree): New.
3127 2002-10-20 Ranjit Mathew <rmathew@hotmail.com>
3129 * gcj.texi: Added item describing the GCJ runtime property
3132 2002-10-15 Richard Henderson <rth@redhat.com>
3134 * jcf-parse.c (get_constant): Fix type warning.
3136 2002-10-15 Andrew Haley <aph@redhat.com>
3138 * java-tree.h (java_inlining_merge_static_initializers): Declare.
3139 (java_inlining_map_static_initializers): Declare.
3141 2002-10-14 Andrew Haley <aph@redhat.com>
3143 * tree-inline.c (remap_block): All local class initialization
3144 flags go in the outermost scope.
3145 (expand_call_inline): Call java_inlining_map_static_initializers.
3146 (expand_call_inline): Call java_inlining_merge_static_initializers.
3147 * java/lang.c (merge_init_test_initialization): New.
3148 (java_inlining_merge_static_initializers): New.
3149 (inline_init_test_initialization): New.
3150 (java_inlining_map_static_initializers): New.
3152 2002-10-11 Mark Wielaard <mark@klomp.org>
3154 * gcj.texi (Compatibility): Add Limitations and Extensions section.
3156 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3158 * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer.
3160 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3162 * parse.y (merge_string_cste): Add parentheses around & within |.
3164 2002-10-08 Tom Tromey <tromey@redhat.com>
3166 * parse.y (variable_declarator_id): Simplify error path for
3167 array declarator error. For PR java/8003.
3169 2002-10-08 Zack Weinberg <zack@codesourcery.com>
3171 * gjavah.c, jcf-dump.c, jv-scan.c: Globally replace GCCBUGURL with
3174 2002-10-08 Andrew Haley <aph@redhat.com>
3176 * parse.y (attach_init_test_initialization_flags): Check for
3179 2002-10-07 Anthony Green <green@redhat.com>
3181 * parse.y (merge_string_cste): Fix bug in string concatenation.
3183 2002-10-03 Michael Koch <konqueror@gmx.de>
3185 * gcj.texi (Standard properties):
3186 Change default of java.awt.toolkit to gnu.awt.gtk.GtkToolkit.
3188 2002-10-02 Roger Sayle <roger@eyesopen.com>
3190 PR optimization/6627
3191 * lang.c (java_init): If storing the vbit in function
3192 pointers, ensure that force_align_functions_log is atleast
3193 one to aid compatability with g++ vtables.
3195 2002-10-01 Nathan Sidwell <nathan@codesourcery.com>
3197 * jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
3198 foul of type-based aliasing.
3200 2002-09-30 Anthony Green <green@redhat.com>
3202 * gcj.texi (Invoking jv-scan): Fix texinfo.
3204 2002-09-28 Anthony Green <green@redhat.com>
3206 * gcj.texi (Invoking jv-scan): Add --no-assert documentation.
3207 (Code Generation): Add -fno-assert documentation.
3208 * jv-scan.c (flag_assert): New global.
3209 (options): Add assert option.
3210 (help): Add --no-assert documentation.
3211 * parse-scan.y (flag_assert): New global.
3212 * lang.c (lang_f_options): Add -fassert/-fno-assert support.
3213 (flag_assert): New global.
3214 * java-tree.h (flag_assert): New global.
3215 * lex.c (java_lex): Obey flag_assert.
3216 * jvspec.c (jvgenmain_spec): Strip -fassert/-fno-assert when
3219 2002-09-26 Andrew Haley <aph@redhat.com>
3221 * expr.c (build_java_array_length_access): Check for null pointer.
3222 * expr.c (expand_java_arrayload): Likewise.
3224 2002-09-21 Richard Henderson <rth@redhat.com>
3226 * jcf-parse.c (get_constant): Decode from IEEE no matter
3227 what the target format.
3229 2002-09-20 Kazu Hirata <kazu@cs.umass.edu>
3231 * ChangeLog: Follow spelling conventions.
3232 * class.c: Likewise.
3235 * gjavah.c: Likewise.
3236 * java-tree.h: Likewise.
3237 * jcf-dump.c: Likewise.
3238 * jcf-parse.c: Likewise.
3239 * jvspec.c: Likewise.
3241 * mangle.c: Likewise.
3242 * parse.y: Likewise.
3244 2002-09-17 Tom Tromey <tromey@redhat.com>
3246 * lex.c (java_read_unicode_collapsing_terminators): Handle case
3247 where \r appears at EOF. Fixes PR java/7950.
3249 2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3251 * jvspec.c (lang_specific_driver): Remove unused variable.
3253 2002-09-16 Geoffrey Keating <geoffk@apple.com>
3255 * java-tree.h (union lang_tree_node): Add chain_next option.
3257 2002-09-16 Richard Henderson <rth@redhat.com>
3259 * jcf-parse.c (get_constant): Runtime check for IEEE format;
3260 use new real.h interface.
3261 * jcf-write.c (find_constant_index): Use new real.h interface.
3262 * lex.c (IS_ZERO): Use REAL_VALUES_EQUAL.
3264 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
3266 * lang.c: Follow spelling conventions.
3268 2002-09-11 Per Bothner <per@bothner.com>
3270 * parse.y (fold_constant_for_init): If a VAR_DECL, convert numerical
3271 constant to the type of the field.
3272 (java_complete_tree): Remove now-redundant code.
3274 * parse.y (fold_constant_for_init): 'null' is not a constant expr.
3276 2002-09-03 Jesse Rosenstock <jmr@ugcs.caltech.edu>
3279 * verify.c (verify_jvm_instructions) [OPCODE_jsr]: Only push the
3280 return label if a ret instruction for the jsr has been reached.
3282 2002-09-09 Ranjit Mathew <rmathew@hotmail.com>
3284 * parse.y (DIR_SEPARATOR): Don't define.
3285 (check_class_interface_creation): Use IS_DIR_SEPARATOR.
3287 2002-08-28 Andrew Haley <aph@redhat.com>
3289 * verify.c (verify_jvm_instructions): Allow exception handler
3290 inside code that is being protected, but generate a warning.
3291 * except.c (link_handler): Initialize `expanded' in new eh_range.
3292 (binding_depth, is_class_level, current_pc): Declare extern.
3294 2002-09-01 Mark Wielaard <mark@klomp.org>
3296 * gcj.texi: Add chapter about system properties.
3299 2002-08-26 Tom Tromey <tromey@redhat.com>
3301 * parse.y (try_builtin_assignconv): Allow narrowing primitive
3302 conversion if RHS_TYPE is byte, short, or char.
3304 2002-08-22 Tom Tromey <tromey@redhat.com>
3306 * gcj.texi (Invoking gij): Document -cp and -classpath.
3308 2002-08-21 Tom Tromey <tromey@redhat.com>
3310 * Make-lang.in (java/jcf-path.o): Use $(datadir), not
3311 $(prefix)/share. For PR libgcj/7633.
3313 For PR java/6005 and PR java/7611:
3314 * lang.c (LANG_HOOKS_CAN_USE_BITFIELDS_P): New define.
3315 (java_can_use_bit_fields_p): New function.
3317 2002-08-16 Tom Tromey <tromey@redhat.com>
3319 * gcj.texi (Class Initialization): Mention class initialization of
3322 2002-07-30 Andrew Haley <aph@cambridge.redhat.com>
3324 * Make-lang.in (java-tree-inline.o): New.
3325 (JAVA_OBJS): Add java-tree-inline.o.
3326 * parse.y (source_end_java_method): Call java_optimize_inline.
3327 (java_expand_method_bodies): Save method's tree in
3329 (add_stmt_to_compound): Keep track of the number of statments.
3330 * lang.c (java_init): Enable flag_inline_trees.
3331 (java_post_options): If flag_inline_functions is on, enable
3332 flag_inline_trees instread.
3333 (decl_constant_value): New.
3334 (java_tree_inlining_walk_subtrees): New.
3335 * java-tree.h (DECL_NUM_STMTS): New macro.
3336 (java_optimize_inline): Declare.
3337 * expr.c (java_expand_expr): Allow a BLOCK to return a value.
3338 Handle a LABEL_EXPR.
3339 * decl.c (build_result_decl): If we already have a DECL_RESULT
3341 (dump_function): New.
3342 (java_optimize_inline): New.
3343 (dump_function): New.
3345 2002-08-13 Jesse Rosenstock <jmr@fulcrummicro.com>
3348 * parse.y (build_assertion): Invert return from
3349 desiredAssertionStatus.
3351 2002-08-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3353 * jcf-write.c (get_access_flags): Return correct access flags for
3354 private and protected inner classes.
3356 2002-08-08 Nathan Sidwell <nathan@codesourcery.com>
3358 * java/Make-lang.in (java.mostlyclean): Remove coverage files.
3360 2002-08-05 Geoffrey Keating <geoffk@redhat.com>
3362 * mangle_name.c: Don't include obstack.h twice.
3363 * xref.c: Don't include obstack.h.
3365 2002-08-04 Geoffrey Keating <geoffk@redhat.com>
3367 * class.c: (permanent_obstack): Delete declaration.
3368 * constants.c: (permanent_obstack): Delete declaration.
3369 * except.c: (permanent_obstack): Delete declaration.
3370 * expr.c: (permanent_obstack): Delete declaration.
3371 * jcf-parse.c: (permanent_obstack): Delete declaration.
3372 (saveable_obstack): Delete declaration.
3373 * parse.h: (permanent_obstack): Delete declaration.
3374 * typeck.c: (permanent_obstack): Delete declaration.
3376 2002-08-04 Joseph S. Myers <jsm@polyomino.org.uk>
3378 * gcj.texi (version-gcc): Increase to 3.3.
3380 2002-07-22 Tom Tromey <tromey@redhat.com>
3382 * lex.c (java_lex): Check for `e' or `E' after 0.
3384 2002-07-21 Richard Henderson <rth@redhat.com>
3386 * lang.c (java_unsafe_for_reeval): New.
3387 (LANG_HOOKS_UNSAFE_FOR_REEVAL): New.
3389 2002-07-21 Neil Booth <neil@daikokuya.co.uk>
3391 * jcf-path.c (GET_ENV_PATH_LIST): Remove.
3392 (jcf_path_init): Use GET_ENVIRONMENT.
3394 2002-07-10 Roger Sayle <roger@eyesopen.com>
3395 Zack Weinberg <zack@codesourcery.com>
3397 * builtins.c (initialize_builtins): Remove defines that
3398 handled C/C++ specific junk hereby removed from builtins.def.
3400 2002-07-07 Neil Booth <neil@daikokuya.co.uk>
3402 * lang.c (java_post_options): Update prototype.
3404 2002-07-05 Roger Sayle <roger@eyesopen.com>
3406 * builtins.c (initialize_builtins): Ignore the additional
3407 parameter to DEF_BUILTIN. Handle more C/C++ specific junk in
3408 the builtins.def file.
3410 2002-07-01 Tom Tromey <tromey@redhat.com>
3413 * parse.y (patch_incomplete_class_ref): Handle VOID_TYPE
3416 2002-07-01 Roger Sayle <roger@eyesopen.com>
3418 * java/decl.c (builtin_function): Accept additional parameter.
3419 (java_init_decl_processing): Pass an additional NULL_TREE
3420 argument to builtin_function.
3422 2002-06-29 T.J. Mather <tjmather@maxmind.com>
3424 * gcj.texi: Fixed gcj invocation example so that it compiles.
3426 2002-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3428 * lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
3429 * parse.y (mark_parser_ctxt): Likewise.
3430 (check_modifiers, declare_local_variables): Avoid incorrect
3431 hardcoded constant 10.
3433 * lex.c (java_read_char): Avoid "comparison is always true"
3436 2002-06-25 Andreas Schwab <schwab@suse.de>
3438 * expr.c (JSR): Avoid undefined operation on PC.
3440 2002-06-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3442 * decl.c (clear_binding_level): Const-ify.
3444 2002-06-13 Akim Demaille <akim@epita.fr>
3446 * parse.y (class_declaration, interface_declaration): Make sure
3447 all their rules have an action, in order to avoid meaningless `$$
3448 = $1' and their type clashes.
3450 2002-06-11 Tom Tromey <tromey@redhat.com>
3452 * jcf-write.c (generate_classfile): Use FIELD_SYNTHETIC.
3453 * parse-scan.y (statement_without_trailing_substatement): Added
3455 (assert_statement): New rule.
3456 * java-tree.h (struct lang_type) [assertions]: New field.
3457 (TYPE_USES_ASSERTIONS): New macro.
3458 (CLASS_USES_ASSERTIONS): Likewise.
3459 (FIELD_SYNTHETIC): New define.
3460 * lex.c (java_lval;): Added ASSERT_TK.
3461 * parse.y (ASSERT_TK): Added.
3462 (statement_without_trailing_substatement): Added assert_statement.
3463 (assert_statement): New rule.
3464 (build_assertion): New function.
3465 (maybe_generate_pre_expand_clinit): Create and initialize
3466 $assertionsDisabled.
3467 (lookup_package_type): Removed decl.
3468 * keyword.h: Rebuilt.
3469 * keyword.gperf (assert): New token.
3471 2002-06-10 Akim Demaille <akim@epita.fr>
3473 * parse.y (interface_type_list, class_member_declaration)
3474 (unary_expression_not_plus_minus): Remove duplicate %type.
3477 2002-06-09 Tom Tromey <tromey@redhat.com>
3479 * Make-lang.in (java/lang.o): Use LANGHOOKS_DEF_H.
3481 * parse.y (method_header): Give error message in all cases.
3484 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3486 Don't use RTL inlining. Fix for PR java/6820.
3487 * lang.c (LANG_HOOKS_POST_OPTIONS): Define.
3488 (flag_really_inline): New.
3489 (java_decode_option): Set flag_really_inline if -finline-functions
3491 (java_post_options): New function. Turn off inlining unless
3492 flag_really_inline is set.
3494 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3496 * gjavah.c (throwable_p): Accept argument as either a classname or
3497 signature fragment. Create null-terminated classname string for super
3498 when calling itself recursively.
3499 (decode_signature_piece): Skip first character from class name
3500 signature when calling throwable_p.
3502 2002-06-08 H.J. Lu (hjl@gnu.org)
3504 * jcf-path.c (jcf_path_init): Allocate 1 more byte for string.
3506 2002-06-04 Tom Tromey <tromey@redhat.com>
3508 * jcf-write.c (perform_relocations): Optmize a goto to a goto.
3510 2002-06-04 Michael Koch <konqueror@gmx.de>
3512 * gcj.texi (Input Options): Fixed typo.
3514 2002-06-04 Zack Weinberg <zack@codesourcery.com>
3516 * java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
3517 typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
3518 all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
3519 and all now-pointless local variables. Rename other local
3520 variables to reflect their not being handles.
3522 * java-tree.h, jcf-dump.c, jcf-io.c: Remove all
3523 #if JCF_USE_STDIO blocks.
3525 * parse.y: Add missing semicolon at end of rule.
3527 2002-06-03 Geoffrey Keating <geoffk@redhat.com>
3529 * check-init.c (attach_initialized_static_class): Delete, unused.
3530 * parse.y: Use htab_t instead of struct hashtable, update
3532 * java-tree.h: Include hashtab.h instead of hash.h.
3533 (struct lang_decl_func): Use htab_t, set up for gengtype.
3534 (struct init_test_hash_entry): Delete.
3535 (struct treetreehash_entry): New.
3536 (java_treetreehash_find): New
3537 (java_treetreehash_new): New prototype.
3538 (java_treetreehash_create): New prototype.
3539 (java_mark_tree): Delete prototype.
3540 (java_hash_hash_tree_node): Delete prototype.
3541 (java_hash_compare_tree_node): Delete prototype.
3542 (attach_initialized_static_class): Delete prototype.
3543 * expr.c (build_class_init): Update to use java_treetreehash
3545 (java_expand_expr): Update to use htab_t.
3546 (emit_init_test_initialization): Likewise.
3547 * decl.c (java_mark_tree): Delete.
3548 * class.c (init_test_hash_newfunc): Delete.
3549 (java_hash_hash_tree_node): Delete.
3550 (java_hash_compare_tree_node): Delete.
3551 (add_method_1): Update to use java_treetreehash functions.
3552 (JAVA_TREEHASHHASH_H): New macro.
3553 (java_treetreehash_hash): New function.
3554 (java_treetreehash_compare): New function.
3555 (java_treetreehash_find): New function.
3556 (java_treetreehash_new): New function.
3557 (java_treetreehash_create): New function.
3558 * Make-lang.in (JAVA_TREE_H): Replace hash.h by HASHTAB_H.
3560 * Make-lang.in (java/parse.o): Depend on debug.h.
3561 * java-tree.h (struct lang_identifier): Use gengtype.
3562 (union lang_tree_node): New.
3563 (struct lang_decl_func): Use gengtype.
3564 (struct lang_decl_var): Likewise.
3565 (struct lang_decl): Likewise.
3566 * parse.y: Include debug.h.
3567 * lang.c (LANG_HOOKS_MARK_TREE): Delete.
3569 * lang.c (struct language_function): New dummy structure.
3571 * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Set
3572 descriminator for DECL_LANG_SPECIFIC.
3573 (struct lang_decl_func): Rename from struct lang_decl.
3574 (enum lang_decl_desc): New.
3575 (struct lang_decl): Make it a union. Update all the accessor macros.
3576 (struct lang_type): Use gengtype.
3577 * class.c (add_method_1): Set descriminator for DECL_LANG_SPECIFIC.
3578 * decl.c (java_dup_lang_specific_decl): All lang_decl structures
3579 are now the same size.
3580 (lang_mark_tree): Use gengtype to mark TYPE_LANG_SPECIFIC;
3581 use discriminator to mark DECL_LANG_SPECIFIC.
3583 * Make-lang.in (gt-java-builtins.h): New rule.
3584 (java/builtins.o): Add dependency on gt-<filename>.h.
3585 * builtins.c: Use gengtype for roots.
3586 (union string_or_tree): Use gengtype.
3587 (struct builtin_record): Use gengtype.
3588 * config-lang.in (gtfiles): Add builtins.c.
3590 * Make-lang.in (gt-java-class.h, gt-java-constants.h,
3591 gt-java-decl.h, gt-java-expr.h, gt-java-jcf-parse.h,
3592 gt-java-jcf-write.h, gt-java-lang.h, gt-java-mangle.h,
3593 gt-java-parse.h, gtype-java.h): Add rules to generate.
3594 (parse.o): Add dependency on gt-java-parse.h, gt-java.h.
3595 (class.o): Add dependency on gt-*.h.
3596 (constants.o): Likewise.
3599 (jcf-parse.o): Likewise.
3600 (jcf-write.o): Likewise.
3602 * config-lang.in (gtfiles): New.
3603 * class.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
3604 * constants.c: Replace uses of ggc_add_* with GTY markers.
3606 * decl.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
3607 * expr.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
3608 * java-tree.h: Replace uses of ggc_add_* with GTY markers.
3609 * jcf-parse.c: Replace uses of ggc_add_* with GTY markers.
3611 * jcf-write.c: Replace uses of ggc_add_* with GTY markers.
3613 * lang.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
3614 * mangle.c: Replace uses of ggc_add_* with GTY markers. Include
3616 * parse.y: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
3617 Include gtype-java.h.
3619 2002-06-02 Tom Tromey <tromey@redhat.com>
3621 Fix for PR java/5913:
3622 * parse.y (patch_binop): Call patch_string on op1.
3624 2002-06-02 Tom Tromey <tromey@redhat.com>
3626 Fix for PR java/1343, PR java/6336:
3627 * parse.y (make_nested_class_name): Remove extraneous `else'; fix
3628 formatting. Changed return type.
3629 (anonymous_class_counter): Moved to top of file.
3630 (maybe_make_nested_class_name): Append number to class name for
3631 function-local classes.
3633 2002-05-28 Zack Weinberg <zack@codesourcery.com>
3635 * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h.
3636 * Make-lang.in: Update dependency lists.
3638 2002-05-18 Mark Mitchell <mark@codesourcery.com>
3640 * gjavah.c (throwable_p): Do not free the name of the class after
3641 passing it to find_class.
3642 * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition.
3643 * jcf-io.c (dirent.h): Include it.
3644 (fnmatch.h): Likewise.
3645 (compare_path): New function.
3646 (java_or_class_file): Likewise.
3647 (memoized_dirlist_entry): New type.
3648 (memoized_dirlist_lookup_eq): New function.
3649 (memoized_dirlists): New variable.
3650 (caching_stat): New function.
3651 (memoized_class_lookup_eq): New function.
3652 (memoized_class_lookups): Likewise.
3653 (find_class): Use memoized_class_lookups and caching_stat.
3654 * jcf.h (JCF_USE_SCANDIR): Define.
3655 * parse.y (java_expand_classes): Write the class files in reverse
3658 2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3660 * Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
3662 2002-05-13 Mark Mitchell <mark@codesourcery.com>
3664 * jcf-write.c (write_classfile): Unlink the temporary file if it
3665 cannot be renamed. Use concat to build up the name of the
3668 2002-05-08 Mark Mitchell <mark@codesourcery.com>
3670 * jcf-write.c (write_classfile): Write the file to a
3671 temporary file and then rename it.
3673 2002-05-07 Tom Tromey <tromey@redhat.com>
3675 * gjavah.c (throwable_p): Use xstrdup, not strdup.
3677 Fix for PR java/1200:
3678 * gjavah.c (throwable_p): New function.
3679 (decode_signature_piece): Use it. A `WeakReference' isn't the
3682 (gcjh_streq): New function.
3684 2002-05-07 Andreas Jaeger <aj@suse.de>
3686 * parse.y (finish_for_loop): Fix if statement.
3688 2002-05-06 Tom Tromey <tromey@redhat.com>
3690 Fix for PR java/5941:
3691 * parse.y (finish_for_loop): Set SUPPRESS_UNREACHABLE_ERROR for
3692 loop update expression.
3693 (java_complete_lhs): Use SUPPRESS_UNREACHABLE_ERROR.
3694 * java-tree.h (SUPPRESS_UNREACHABLE_ERROR): New macro.
3696 2002-05-04 Mark Wielaard <mark@klomp.org>
3699 * parse.y (build_string_concatenation): Return just op1 only when op2
3700 is null and op1 is a STRING_CST, otherwise always construct a
3703 2002-04-27 Tom Tromey <tromey@redhat.com>
3706 * parse.y (string_convert_int_cst): New function.
3707 (merge_string_cste): Use it.
3709 2002-04-25 Neil Booth <neil@daikokuya.demon.co.uk>
3711 * java-tree.h (java_parse_file): Update.
3712 (java_set_yydebug): Remove.
3713 * jcf-parse.c (yydebug): Remove.
3714 (java_set_yydebug): Die.
3715 (java_parse_file): Update.
3716 * lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
3718 2002-04-24 Tom Tromey <tromey@redhat.com>
3721 * parse.y (qualify_ambiguous_name) [case CALL_EXPR]: Always choose
3722 EXPR_WFL_QUALIFICATION of qual_wfl.
3724 2002-04-23 Per Bothner <per@bothner.com>
3726 * expr.c (PRE_JSR): Call NOTE_LABEL for return address.
3727 * java-tree.h (BCODE_RETURN_TARGET): Removed - never set.
3728 (BCODE_TARGET): Remove BCODE_RETURN_TARGET.
3730 2002-04-23 Tom Tromey <tromey@redhat.com>
3733 * jvspec.c (lang_specific_driver): Use --resource, not -R. Also
3734 recognize `-fcompile-resource='.
3735 * gcj.texi (Invoking gcj): Use --resource, not -R. Expanded text
3738 2002-04-22 Alexandre Petit-Bianco <apbianco@redhat.com>
3740 * jcf-parse.c: (yyparse): Don't prepend "./" to relative
3741 paths. Fixes PR java/2791.
3743 2002-04-19 Andrew Haley <aph@redhat.com>
3745 * jcf-write.c (push_long_const): lo, hi: New variables.
3746 Use rshift_double to extract the high part of a 64-bit long.
3747 Use WORD_TO_INT to extract the low part.
3749 * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
3750 HOST_WIDE_INT for num. Use JPOOL_UINT to get it.
3751 CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
3753 2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
3755 * typeck.c (incomplete_type_error): Remove.
3757 2002-04-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3759 * class.c (make_class_data): Set DECL_ALIGN on static class data,
3760 for hash synchronization.
3761 * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects.
3762 * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for
3765 2002-04-16 Mark Wielaard <mark@klomp.org>
3767 * jcf-write.c (generate_bytecode_insns): Only write const_0 if not
3770 2002-04-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3772 Fix for PR java/6294:
3773 * parse.h (INNER_INTERFACE_MODIFIERS): Allow ACC_PRIVATE for inner
3776 2002-04-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3778 Fix for PR java/6085:
3779 * parse.y (patch_method_invocation): Always use build_access_to_thisn
3780 to get enclosing "this" argument for inner-class constructor
3781 invocation. Pass correct arguments to build_access_to_thisn.
3783 2002-04-10 Andreas Jaeger <aj@suse.de>
3785 * gcj.texi (Input Options): Fix extdirs patch.
3787 2002-04-10 Anthony Green <green@redhat.com>
3789 * jcf-path.c (jcf_path_init) : Clean up local extdirs declaration.
3791 2002-04-09 Anthony Green <green@redhat.com>
3793 * gcj.texi (Input Options): Add --extdirs documentation.
3794 * jcf-dump.c (OPT_extdirs): New macro.
3795 (options): Add extdirs option.
3796 (help): Describe --extdirs.
3797 (main): Handle OPT_extdirs.
3798 * gjavah.c (OPT_extdirs): New macro.
3799 (options): Add extdirs option.
3800 (help): Describe --extdirs.
3801 (main): Handle OPT_extdirs.
3802 * jcf-path.c (jcf_path_init): Add extdirs support.
3803 (jcf_path_extdirs_arg): New function.
3804 (extensions): New variable to hold extensions path entries.
3805 * jvspec.c: Remove -fextdirs= when compiling main().
3806 * lang.c (java_decode_option): Handle -fextdirs=.
3807 * jcf.h (jcf_path_extdirs_arg): Declare new function.
3808 * Make-lang.in: Compile jcf-path with version info for use in
3809 identifying the appropriate libgcj.jar.
3811 2002-04-08 Tom Tromey <tromey@redhat.com>
3814 * .cvsignore: Added rmic.1 and rmiregistry.1.
3815 * gcj.texi (Top): Link to new nodes.
3816 (Invoking rmic): New node.
3817 (Invoking rmiregistry): Likewise.
3818 * Make-lang.in (java.generated-manpages): Added rmic.1 and
3820 (java.maintainer-clean): Likewise.
3821 ($(srcdir)/java/rmic.1): New target.
3822 ($(srcdir)/java/rmiregistry.1): Likewise.
3823 (java.install-man): Handle rmic.1 and rmiregistry.1.
3825 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3827 * gcj.texi (Invocation): Update JvAttachCurrentThread documentation.
3828 Add note about handling uncaught exceptions. Add an exception handler
3831 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3833 * parse.y (resolve_qualified_expression_name): Clear "from_super" flag
3834 after using it to patch CALL_EXPR.
3836 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3838 * gcj.texi (Invocation): Document CNI invocation API.
3840 2002-04-04 Neil Booth <neil@daikokuya.demon.co.uk>
3842 * expr.c (truthvalue_conversion): Rename. Update.
3843 (expand_compare): Update.
3844 * java-tree.h (java_truthvalue_conversion): New.
3845 * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
3847 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
3849 * java-tree.h (java_mark_addressable): New.
3850 * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
3851 * typeck.c (mark_addressable): Rename, update.
3853 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
3855 * expr.c (build_java_binop): Update.
3856 * java-tree.h (java_signed_type, java_unsigned_type,
3857 java_signed_or_unsigned_type): Update.
3858 * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
3859 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
3860 * parse.y (patch_binop): Update.
3861 * typeck.c (signed_or_unsigned_type, unsigned_type,
3862 signed_type): Update.
3864 2002-03-31 Neil Booth <neil@daikokuya.demon.co.uk>
3866 * lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
3867 (java_dummy_print): Remove.
3868 (lang_print_error): Rename. Exit early if inhibiting output.
3869 (inhibit_error_printing_function): New.
3870 (java_init): Don't set hook.
3871 (lang_init_source): Use new boolean.
3873 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
3875 * parse.y (do_resolve_class): Fix infinite recursion.
3877 2002-03-29 Tom Tromey <tromey@redhat.com>
3879 * parse.y (check_inner_circular_reference): Ignore incomplete
3882 2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
3884 * Make-lang.in (builtins.o): Update.
3885 * boehm.c (get_boehm_type_descriptor): Update.
3886 * builtins.c: Include langhooks.h.
3887 * decl.c (java_init_decl_processing): Update.
3888 * java-tree.h (java_type_for_mode, java_type_for_size): New.
3889 * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
3891 * typeck.c (type_for_mode, type_for_size): Update.
3893 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
3895 * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
3897 2002-03-28 Tom Tromey <tromey@redhat.com>
3899 * except.c (expand_end_java_handler): If the handler type is NULL,
3900 use java.lang.Throwable. Fixes PR java/5986.
3902 2002-03-28 Alexandre Petit-Bianco <apbianco@redhat.com>
3904 Fix for PR java/4715:
3905 * jcf-parse.c (parse_source_file_3): New function.
3906 (read_class): Call it.
3907 (java_parse_file): Likewise.
3909 2002-03-28 Jan Hubicka <jh@suse.cz>
3911 * java/lang.c (java_init_options): Set flag_trapping_math to 0.
3913 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3915 * parse.y (resolve_package): Initialize "decl".
3916 (lookup_package_type): Remove unused function.
3918 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3920 Fix for PR java/5993:
3921 * parse.y (resolve_package): Return the decl if resolution was
3922 successful. Don't special case "java.lang" and "java.lang.reflect"
3923 packages. Set type_name to the merged identifier.
3924 (resolved_qualified_expression_name): Print error using "name" if
3925 resolve_package returns NULL_TREE.
3927 2002-03-27 Tom Tromey <tromey@redhat.com>
3929 * expr.c (expand_invoke): Don't generate null pointer check if
3930 we're calling <init>.
3932 2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
3934 * expr.c (java_lang_expand_expr): Rename java_expand_expr,
3936 * java-tree.h (java_lang_expand_expr): Similarly.
3937 * lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
3938 (java_init): Don't set hook.
3940 2002-03-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3942 Fix for PR java/5850:
3943 * parse.y (lookup_field_wrapper): Call itself recursively for enclosing
3944 context if field was not found in the current scope.
3945 * expr.c (lookup_field): Don't look in enclosing contexts.
3947 2002-03-26 Tom Tromey <tromey@redhat.com>
3949 Fix for PR java/5942:
3950 * parse.y (init_src_parse): Added sanity check.
3951 * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
3954 2002-03-26 Neil Booth <neil@daikokuya.demon.co.uk>
3956 * decl.c (lang_mark_tree): Rename java_mark_tree.
3957 * java-tree.h (java_mark_tree): New.
3958 * java-lang.c (LANG_HOOKS_MARK_TREE): Redefine.
3960 2002-03-25 Zack Weinberg <zack@codesourcery.com>
3962 * lex.c: Change java_perform_atof to take normal parameters
3963 instead of a pointer to a parameter block. Call it directly
3966 2002-03-22 Mark Wielaard <mark@klomp.org>
3968 Fix for PR java/5368:
3969 * parse.y (resolve_qualified_expression_name): Use decl not field_decl
3970 when printing error message.
3972 2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
3974 * decl.c (maybe_build_cleanup): Remove.
3976 2002-03-22 Tom Tromey <tromey@redhat.com>
3978 Andrew Haley <aph@cambridge.redhat.com>
3980 * expr.c (build_field_ref): Don't build a check if the field is a
3983 2002-03-21 Eric Blake <ebb9@email.byu.edu>
3985 Fix for PR java/6026:
3986 * lex.c (java_lex): Fix parsing of consecutive floats.
3988 2002-03-21 Tom Tromey <tromey@redhat.com>
3990 * parse.y (build_access_to_thisn): Stop when FROM is not an inner
3993 2002-03-21 Neil Booth <neil@daikokuya.demon.co.uk>
3995 * cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
3996 insert_block, getdecls, kept_level_p, global_bindings_p): New.
3998 2002-03-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
4000 * gcj.texi: @code{gcj} becomes @command{gcj}.
4001 @code{gcc} becomes @command{gcc}.
4002 GcjRaw changed to gnu.gcc.RawData.
4004 2002-03-20 Neil Booth <neil@daikokuya.demon.co.uk>
4006 * decl.c (start_java_method): Use new hook.
4007 * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
4008 (java_init): Remove old hook.
4010 2002-03-18 Alexandre Petit-Bianco <apbianco@redhat.com>
4012 * builtins.c (define_builtin): Do nothing if `type' is null.
4015 2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4017 * parse.y (parser_check_super_interface): Fix error message
4020 2002-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4022 * jcf-parse.c (get_constant): Delete unused variables.
4024 2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
4026 * java-tree.h (java_parse_file): New.
4027 * jcf-parse.c (yyparse): Rename java_parse_file.
4028 * lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
4030 2002-03-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4032 * parse.y (craft_constructor): Return the constructor decl.
4033 (java_expand_classes): Update comments.
4034 (lookup_method_invoke): Call fix_constructors immediately for
4035 anonymous class. Fixes PR java/5935.
4037 2002-03-15 Anthony Green <green@redhat.com>
4039 * jcf-parse.c (yyparse): Don't emit class registration
4040 constructor when compiling resource files.
4042 2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4044 * lang.c (java_tree_code_type, java_tree_code_length,
4045 tree_code_name): Delete.
4046 (tree_code_type, tree_code_length, tree_code_name): Define.
4047 (java_init): Don't try to copy into the various tree_code
4050 2002-03-12 Tom Tromey <tromey@redhat.com>
4052 * jcf-parse.c (get_constant) [CONSTANT_String]: String values are
4053 UTF-8, not UCS-2. Fixes PR java/5923.
4055 * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is
4056 a call_expr wrapped in a convert. Fixes PR java/5848.
4058 2002-03-12 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4060 * jcf-write.c (write_classfile): Improve error strings.
4062 2002-03-11 Eric Blake <ebb9@email.byu.edu>
4064 * lex.c: Adjust comments to GNU standards.
4066 2002-03-11 Eric Blake <ebb9@email.byu.edu>
4068 Fix for PR java/5902:
4069 * lex.c (java_lex): Fix parsing of literals.
4071 2002-03-11 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4073 * parse.y (patch_assignment): Wrap the right-hand-side with a save_expr
4074 to prevent it getting evaluated twice in the store checking case.
4075 * expr.c (build_java_arraystore_check): Unwrap SAVE_EXPR's when
4078 2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4080 * decl.c (java_init_decl_processing): Make sure class_type_node
4081 alignment is not less than 64 bits if hash synchronization is enabled.
4083 2002-03-08 Per Bothner <per@bothner.com>
4085 * parse.y (java_complete_lhs): Check if patch_assignment
4086 returned an error-mark.
4088 * parse.y (try_builtin_assignconv): Don't special-case zero.
4090 2002-03-08 Per Bothner <per@bothner.com>
4092 Fix for PR java/5812.
4093 * expr.c (build_java_jsr): Take pc arguments, and do lookup_label
4094 here instead of in JSR macro. Likewise with load_type_state call.
4095 Do the latter on if the return_pc has been verified (the jsr returns).
4096 (JSR): Now just call build_java_jsr.
4098 2002-03-07 Jeff Sturm <jsturm@one-point.com>
4100 * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define.
4101 (java.install-common): Link native driver to
4102 JAVA_TARGET_INSTALL_NAME.
4104 2002-03-05 David Billinghurst <David.Billinghurst@riotinto.com>
4106 * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED
4107 * builtins.c(sin_builtin): Likewise
4108 * builtins.c(sqrt_builtin): Likewise
4110 2002-03-03 Zack Weinberg <zack@codesourcery.com>
4112 * java/expr.c, java/jcf-parse.c, java/lex.c:
4113 Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
4114 REAL_ARITHMETIC blocks unconditional. Delete some further
4115 #ifdef blocks predicated on REAL_ARITHMETIC.
4117 2002-03-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4119 * class.c (init_class_processing): Use ARRAY_SIZE in lieu of
4120 explicit sizeof/sizeof.
4121 * decl.c (java_init_decl_processing): Likewise.
4122 * jcf-parse.c (init_jcf_parse): Likewise.
4123 * parse.y (init_src_parse): Likewise.
4125 2002-03-02 Per Bothner <per@bothner.com>
4127 Make --CLASSPATH by a synonym for --classpath and -classpath.
4128 Implement --bootclasspath.
4129 * jcf-path.c (classpath_u): Rename static variable to classpath_user.
4130 (classpath_l): Remove.
4131 (jcf_path_CLASSPATH_arg): Remove.
4132 (jcf_path_bootclasspath_arg): New function.
4133 (jcf_path_seal): Simplify accordingly.
4135 * jcf.h (jcf_path_bootclasspath_arg): New declarations.
4136 (jcf_path_CLASSPATH): Remove declaration.
4137 * jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*.
4138 (lang_specific_driver): Translate -bootclasspath.
4139 * lang-options.h: Add --bootclasspath. Update --CLASSPATH.
4140 * lang.c (decode_lang_options): Do jcf_path_init first.
4141 Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath.
4142 * gjavah.c: Also handle --bootclasspath.
4143 Handle --CLASSPATH as a synonum for --classpath.
4144 * jcf-dump.c: Likewise.
4146 "." is not part of system path, but is the default for --classpath.
4147 * jcf-path.c (jcf_path_init): Don't add "." to sys_dirs.
4148 (jcf_path_seal): Add "." if no CLASSPATH specified.
4150 * gcj.texi: Document changes.
4152 2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4154 * expr.c (build_java_arraystore_check): Fix formatting.
4156 2002-02-28 Alexandre Petit-Bianco <apbianco@redhat.com>
4158 Fix for PR java/5758, java/5632:
4159 * jcf-parse.c (load_class): Renamed local variable, consider `.' an
4160 inner-class separator too.
4161 * parse.y (do_resolve_class): New local `decl_result.'
4162 Progressively build a name for what can have been loaded.
4164 2002-02-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4166 * expr.c (java_array_data_offset): Removed function.
4167 (JAVA_ARRAY_LENGTH_OFFSET): Removed macro.
4168 (build_java_array_length_access): Obtain "length" value using a
4169 COMPONENT_REF, instead of INDIRECT_REF and arithmetic.
4170 (build_java_arrayaccess): Correct comment. Access "data" using a
4171 COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF.
4172 (build_java_arraystore_check): New function.
4173 (expand_java_arraystore): Use build_java_arraystore_check.
4174 * parse.y (patch_assignment): Simplify code to insert a store check
4175 when lvalue is an ARRAY_REF. Use build_java_arraystore_check.
4176 * check-init.c (check_init): Update to reflect that an array length
4177 access is now a COMPONENT_REF.
4178 * gcj.texi (Code Generation): Improve documentation of
4179 -fno-bounds-check. Add documentation for -fno-store-check.
4180 * java-tree.h (flag_store_check): Declare.
4181 (build_java_arraystore_check): Declare.
4182 * lang.c (flag_store_check): Initialize to 1.
4183 (lang_f_options): Add store-check option.
4184 * jvspec.c: Don't pass store-check option to jvgenmain.
4185 * lang-options.h: Add help string for -fno-store-check.
4187 2002-02-28 Neil Booth <neil@daikokuya.demon.co.uk>
4189 * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
4190 * java-tree.h (java_dup_lang_specific_decl): New.
4191 * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
4193 2002-02-27 Zack Weinberg <zack@codesourcery.com>
4195 * builtins.c, decl.c: Delete traditional-mode-related code
4196 copied from the C front end but not used, or used only to
4197 permit the compiler to link.
4199 2002-02-22 Tom Tromey <tromey@redhat.com>
4201 Fix for PR java/2369:
4202 * jvspec.c (verify_class_name): New function.
4203 (lang_specific_driver): Call it.
4204 (JAVA_START_CHAR_P): New macro.
4205 (JAVA_PART_CHAR_P): Likewise.
4207 2002-02-22 Per Bothner <per@bothner.com>
4209 * class.c: Change vtable to be more compatible with g++ v3 abi.
4210 (get_dispatch_table): Prepend offset-to-top (always 0) and
4211 type_info pointer (currently unimplemented hence NULL) to vtable.
4212 Specifically, prepend offset-to-top and typeinfo ptr (currently null).
4213 (make_class_data): Variable dtable_start_offset is sizeof 2 pointers.
4214 Adjust vtable pointers by dtable_start_offse - i.e. skip new words.
4215 (build_dtable_decl): Add declarations for new fields.
4217 2002-02-20 Per Bothner <per@bothner.com>
4219 * parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
4220 to finit$ (otherwise generate_bytecode_insns drops it). However, we
4221 don't need to set it on the COMPOUND_EXPR - the caller does that.
4223 2002-02-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
4225 * gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option
4226 `--CLASSPATH' becomes `--classpath.'
4227 * gjavah.c: Likewise.
4228 * jcf-dump.c: Likewise.
4229 * lang-options.h: Likewise.
4231 * jcf-path.c: Updated comment.
4232 (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.'
4233 (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.'
4234 * jcf.h (jcf_path_CLASSPATH_arg): Ditto.
4235 (jcf_path_CLASSPATH_arg): Ditto.
4236 (classpath_u): Updated leading comment.
4238 2002-02-20 Per Bothner <per@bothner.com>
4240 * builtins.c (check_for_builtin): New function.
4241 (build_call_or_builtin): Remove.
4242 * java-tree.h: Update accordingly.
4243 * expr.c (expand_invoke): Use build + check_for_builtin instead
4244 of build_call_or_builtin.
4245 * parse.y (patch_invoke): Likewise. This avoids needlessly creating
4246 a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER
4247 flag (which had caused jcf-write to incorrectly emit invokevirtual).
4249 2002-02-17 Tom Tromey <tromey@redhat.com>
4251 * java-tree.h (TYPE_STRICTFP): New macro.
4252 (struct lang_type) [strictfp]: New field.
4253 (CLASS_STRICTFP): New macro.
4254 (METHOD_STRICTFP): New macro.
4255 (struct lang_decl) [strictfp]: New field.
4256 * parse.y (method_header): Disallow strictfp constructor or
4258 (STRICT_TK): Move before MODIFIER_TK.
4259 * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
4260 (METHOD_MODIFIERS): Likewise.
4261 (INTERFACE_MODIFIERS): Likewise.
4262 * jcf-write.c (get_access_flags): Likewise.
4263 * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
4264 (add_method_1): Likewise.
4265 (get_access_flags_from_decl): Likewise.
4266 * jcf-dump.c (print_access_flags): Print in standard order. Also,
4267 recognize strictfp flag.
4268 * jcf.h (ACC_STRICT): New define.
4270 2002-02-12 David Billinghurst <Davod.Billinghurst@riotinto.com>
4272 * class.c(build_utf8_ref): Move declaration of decl_size
4274 2002-02-07 Tom Tromey <tromey@redhat.com>
4276 * gcj.texi (Input Options): --CLASSPATH does not suppress system
4279 2002-02-04 Anthony Green <green@redhat.com>
4281 * class.c (build_utf8_ref): Put UTF-8 constants into merged
4282 sections if available.
4284 2002-02-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4286 * parse.y (java_expand_classes): Fix typo in static field loop.
4288 2002-02-02 Richard Henderson <rth@redhat.com>
4290 * class.c (add_field): Mark static fields external.
4291 (build_class_ref): Remove redundant set.
4292 * parse.y (java_expand_classes): Mark static fields of classes
4293 to be compiled as local.
4294 * jcf-parse.c (parse_class_file): Likewise.
4296 2002-02-02 Nic Ferrier <nferrier@tapsellferrier.co.uk>
4298 * gcj.texi (About CNI): New node.
4300 2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
4303 * jcf-parse.c : Check for HAVE_LOCALE_H before using
4304 setlocale() with LC_CTYPE as a parameter.
4307 2002-01-31 Joseph S. Myers <jsm28@cam.ac.uk>
4309 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
4310 Follow GNU Coding Standards for --version.
4312 2002-01-28 Tom Tromey <tromey@redhat.com>
4314 * expr.c (build_jni_stub): Ensure storage for `meth' is
4316 * parse.y (java_complete_expand_methods): Set
4317 current_function_decl before building JNI stub.
4319 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
4321 * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not
4324 2002-01-22 Tom Tromey <tromey@redhat.com>
4326 * decl.c (java_init_decl_processing): Use add_predefined_file.
4327 Predefine RawData.java.
4328 (predef_filenames): Removed.
4329 (java_init_decl_processing): Don't register predef_filenames.
4330 * jcf-parse.c (add_predefined_file): New function.
4331 (predefined_filename_p): Rewrote.
4332 (predefined_filename_p): No longer static.
4333 * decl.c (java_init_decl_processing): Call initialize_builtins.
4334 * Make-lang.in (JAVA_OBJS): Added builtins.o.
4335 (java/builtins.o): New target.
4336 * builtins.c: New file.
4337 * parse.y (patch_invoke): Use build_call_or_builtin.
4338 * java-tree.h (build_call_or_builtin): Declare.
4339 (initialize_builtins): Declare.
4340 (java_set_exception_lang_code): Removed unused declaration.
4341 (PREDEF_FILENAMES_SIZE): Removed.
4342 (java_tree_index): Added JTI_PREDEF_FILENAMES.
4343 (predef_filenames): New define.
4344 (add_predefined_file): Declare.
4345 (predefined_filename_p): Declare.
4346 * expr.c (expand_invoke): Use build_call_or_builtin.
4348 2002-01-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4350 * parse.y (patch_switch_statement): Fix format specifier.
4352 2002-01-16 Tom Tromey <tromey@redhat.com>
4354 More for PR java/5365:
4355 * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
4357 (process_file): Generate include for
4358 java.lang.UnsupportedOperationExceptions.
4360 2002-01-15 Andreas Jaeger <aj@suse.de>
4362 * .cvsignore: Add man pages.
4364 2002-01-15 Tom Tromey <tromey@redhat.com>
4366 Fix for PR java/5365:
4367 * gjavah.c (process_file): Turn class name into a file name.
4369 2002-01-14 Matthias Klose <doko@debian.org>
4371 * gcj.texi: Fix whitespace and formatting errors in the
4372 synopsis of the man pages. Update copyright.
4374 2002-01-14 Tom Tromey <tromey@redhat.com>
4377 * Make-lang.in (java.install-man): Handle jv-convert man page.
4378 (java.generated-manpages): Added jv-convert.1.
4379 (java.uninstall): Remove jv-convert.1.
4380 (java.maintainer-clean): Likewise.
4381 ($(srcdir)/java/jv-convert.1): New target.
4382 * gcj.texi (Top): Link to jv-convert node.
4383 (Individual utilities): Likewise.
4384 (Invoking jv-convert): New node.
4386 2001-01-10 Jeff Sturm <jsturm@one-point.com>
4387 Martin Kahlert <martin.kahlert@infineon.com>
4389 * jcf-parse.c (get_constant): Don't swap lo/hi for big
4390 endian targets when HOST_BITS_PER_WIDE_INT >= 64.
4392 2002-01-03 Graham Stott <grahams@redhat.com>
4394 * class.c (compile_resource_file): Update copyright date.
4395 Constify filename parameter.
4396 (java-tree.h): Update copyright date.
4397 (compile_resource_file): Constify filename parameter.
4399 2002-01-03 Graham Stott <grahams@redhat.com>
4401 * gcc/jcf-parse.c: Update copyright date.
4402 (yyparse): Constify resource_filename.
4404 2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4406 * parse.y (src_parse_roots): Don't needlessly zero init.
4408 2001-12-31 Tom Tromey <tromey@redhat.com>
4410 * parse.y (dump_java_tree): New function.
4411 (source_end_java_method): Call it.
4412 (end_class_declaration): Likewise.
4413 * lang.c (java_decode_option): Call dump_switch_p.
4415 2001-12-28 Tom Tromey <tromey@redhat.com>
4417 * gen-table.pl: Don't process characters after \uffff. Added
4418 comment pointing to input file.
4420 2001-12-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4422 * gen-table.pl: Const-ify output. Document the location of a
4423 suitable unicode input file.
4425 * chartables.h: Regenerate.
4427 2001-12-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4429 * chartables.h: Const-ify.
4430 * gjavah.c (options): Likewise.
4431 * jcf-dump.c (options): Likewise.
4432 * jv-scan.c (options): Likewise.
4433 * lex.c (java_start_char_p, java_part_char_p): Likewise.
4434 * parse.y (binop_lookup): Likewise.
4436 2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4438 * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
4439 the static arrays that are output.
4440 * jvspec.c (jvgenmain_spec): Make static.
4441 * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
4442 * keyword.h: Regenerate.
4443 * lang.c (string_option, process_option_with_no, lang_f_options,
4444 lang_W_options): Const-ify.
4445 * lex.c (java_lex): Likewise.
4447 2001-12-21 Richard Henderson <rth@redhat.com>
4449 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
4450 (get_boehm_type_descriptor): ... here. Arrange for the
4451 TREE_TYPE to get set properly.
4453 2001-12-21 Richard Henderson <rth@redhat.com>
4455 * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
4456 only if the target requires collect2.
4458 * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
4460 2001-12-20 Tom Tromey <tromey@redhat.com>
4463 * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
4464 CAN_COMPLETE_NORMALLY for the node.
4465 * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
4466 generate code for second branch if first branch can't complete
4468 (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
4469 the loop head if the loop body can't complete normally.
4471 2001-12-20 Tom Tromey <tromey@redhat.com>
4474 * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
4475 case where `finally' clause can't complete normally.
4477 2001-12-20 Tom Tromey <tromey@redhat.com>
4480 * parse.y (analyze_clinit_body): Added this_class parameter.
4481 Check for more cases where we must keep <clinit>.
4482 (maybe_yank_clinit): Cleaned up flow control.
4484 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4486 * decl.c (java_init_decl_processing): Don't initialize
4487 finit_leg_identifier_node.
4488 * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
4489 (finit_leg_identifier_node): Remove.
4490 (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
4492 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4494 * mangle.c (mangle_member_name): Don't special-case for
4496 * mangle_name.c (unicode_mangling_length): Likewise.
4497 (append_unicode_mangled_name): Likewise.
4498 * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
4501 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4503 * expr.c (build_java_array_length_access): Don't force null pointer
4504 check unless flag_check_references is set.
4506 2001-12-20 Tom Tromey <tromey@redhat.com>
4508 Fix for PR java/3417:
4509 * parse.y (patch_assignment): Added special processing for
4511 (patch_return): Don't convert booleans to integers, and don't
4512 special-case `null'.
4514 2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
4516 * config-lang.in (diff_excludes): Remove.
4518 2001-12-17 Joseph S. Myers <jsm28@cam.ac.uk>
4520 * gcj.texi: Update link to GCC manual.
4522 2001-12-17 Tom Tromey <tromey@redhat.com>
4524 * parse.y (link_nested_class_to_enclosing): Removed useless
4527 2001-12-16 Tom Tromey <tromey@redhat.com>
4529 * mangle.c (mangle_method_decl): Never emit `C2' constructor.
4532 2001-12-16 Joseph S. Myers <jsm28@cam.ac.uk>
4534 * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
4535 jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
4538 2001-12-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4540 * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
4542 2001-12-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4544 * decl.c (java_init_decl_processing): Build otable_type correctly.
4545 otable_decl is an otable_type.
4547 2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4549 * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
4550 otable_type, otable_ptr_type, method_symbol_type,
4551 method_symbols_array_type, method_symbols_array_ptr_type): New
4552 field/global tree definitions.
4553 (flag_indirect_dispatch): New flag.
4554 * decl.c (java_init_decl_processing): Initialize new otable and
4555 otable_syms type nodes and decls. Add new field "index" to
4557 * class.c (build_method_symbols_entry): New function.
4558 (make_method_value): Set "index" to to method's vtable index for
4559 virtual methods when indirect-dispatch is not used.
4560 (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
4561 and set vtable_method_count to -1. Set otable and otable_syms field
4562 if indirect-dispatch is used and there was something to put in them.
4563 (build_method_symbols_entry): New function.
4564 (emit_offset_symbol_table): New function.
4565 * expr.c (get_offset_table_index): New function.
4566 (build_invokevirtual): Build array reference to otable at the index
4567 returned by get_offset_table_index, and use the result as the vtable
4569 (build_invokeinterface): Similar.
4570 * jcf-parse.c (yyparse): If indirect-dispatch, call
4571 emit_offset_symbol_table at the end of compilation, after all classes
4572 have been generated.
4573 * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
4574 * lang.c (flag_indirect_dispatch): Define.
4575 (lang_f_options): Add indirect-dispatch flag.
4577 2001-12-14 Matthias Klose <doko@debian.org>
4579 * gcj.texi: Markup for man page generation. Document missing
4580 options printed by <tool> --help.
4581 Terminate description of gij's -ms option with a dot.
4582 * Make-lang.in ($(srcdir)/java/*.1): New targets.
4583 (java.generated-manpages java.install-man, java.uninstall,
4584 java-maintainer-clean) Updated.
4586 2001-12-14 Hans Boehm <Hans_Boehm@hp.com>
4588 * class.c (get_dispatch_table): Fix java vtable layout
4589 for TARGET_VTABLE_USES_DESCRIPTORS.
4590 * decl.c (java_init_decl_processing): Initialize
4591 alloc_no_finalizer_node, finalize_identifier_node.
4592 * expr.c (class_has_finalize_method): New function.
4593 (expand_java_NEW): Generate calls for finalizer-free allocation.
4594 (build_invokevirtual): Fix java vtable layout for
4595 TARGET_VTABLE_USES_DESCRIPTORS.
4596 * java-tree.h (enum java_tree_index): New entries:
4597 JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
4598 (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
4599 (class_has_finalize_method): declare.
4600 (HAS_FINALIZER_P): New macro.
4601 * parse.y (patch_invoke): Generate calls for finalizer-free
4604 2001-12-12 Matthias Klose <doko@debian.org>
4606 * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
4607 whitespace at end of line.
4609 2001-12-11 Tom Tromey <tromey@redhat.com>
4611 * lex.c (java_init_lex): Define wfl_to_string as
4612 gnu.gcj.runtime.StringBuffer unless generating bytecode.
4614 2001-12-11 Jeff Sturm <jsturm@one-point.com>
4616 * class.c (make_method_value): Use null_pointer_node to
4617 represent empty exception table.
4619 2001-12-10 Tom Tromey <tromey@redhat.com>
4621 * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
4623 2001-12-10 Douglas B. Rupp <rupp@gnat.com>
4625 * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
4627 2001-12-09 Per Bothner <per@bothner.com>
4629 * check-init.c (current_switch_has_default): New static field.
4630 (check_init): Case DEFAULT_EXPR: Set current_switch_has_default.
4631 Case SWITCH_EXPR: Save/restore current_switch_has_default. If no
4632 DEFAULT_EXPR seen, simulate a default alternative that copies state.
4634 2001-12-09 Tom Tromey <tromey@redhat.com>
4636 * check-init.c (check_init): Don't allow pre- or post- increment
4637 or decrement of final variable.
4638 (final_assign_error): Minor error message rewording.
4640 2001-12-08 Tom Tromey <tromey@redhat.com>
4642 * java-tree.h: Fixed typo.
4644 * gjavah.c (decompile_method): Don't decompile to `return this'
4647 * gjavah.c (cxx_keywords): Re-sorted.
4648 * lex.c (cxx_keywords): Re-sorted.
4650 * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
4653 * gjavah.c (print_namelet): Clear subnamelets.
4654 (HANDLE_METHOD): Set `method_printed' earlier.
4656 2001-12-07 Tom Tromey <tromey@redhat.com>
4658 * lang.c (lang_f_options): Added
4659 optimize-static-class-initialization.
4660 (java_decode_option): Removed special case.
4662 2001-12-07 Per Bothner <per@bothner.com>
4664 * check-init.c (check_init): Fix typo freeing memory twice.
4666 2001-12-05 Per Bothner <per@bothner.com>
4668 Restore support for static class initialization optimization.
4669 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
4670 * check-init.c (check_int): At end of BLOCK handle initialization
4671 blocks, which used to be done in java_complete_expand_method but did
4672 not handle the case where check_for_initialization might allocate
4673 more than a word of bits.
4674 * decl.c (lang_make_tree): The smic field is now a tree.
4675 * expr.c (build_class_init): Set DECL_FUNCTION_INIT_TEST_CLASS field.
4676 * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE): New macro.
4678 * parse.y (emit_test_initialization): Combine hash_lookup calls.
4680 * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
4681 Change from a hash table to a list.
4682 (struct_lang_decl): Change field 'smic' to match.
4683 * class.c (add_method_1): Initialize
4684 DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
4685 * parse.y (adjust_init_test_initialization): Removed - inlined into -
4686 (java_expand_method_bodies): -here, since 'smic' is now a list.
4687 (patch_invoke): Add to 'smic' list, instead of hash_lookup.
4689 * check-init.c (WORD_SIZE): Use BITS_PER_UNIT.
4691 * class.c (java_hash_compare_tree_node): Fix casts.
4693 2001-12-04 Per Bothner <per@bothner.com>
4695 * check-init.c: Handle definite unassignment to finals in addition
4696 to definite assignment.
4697 (loop_current_locals): New field.
4698 (num_current_locals, int start_current_locals, num_current_words):
4700 (SET_P, CLEAR_P, SET_BIT): Add needed but missing parentheses.
4701 (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
4702 CLEAR_ASSIGNED, CLEAR_UNASSIGNED): New macros.
4703 (get_variable_decl, check_final_reassigned): New functions.
4704 (check_init, check_bool_init): Modify as needed for checking finals.
4705 (check_for_initialization): Take extra parameter and return void.
4706 Do extra start-up logic to check final fields for assignment.
4707 * parse.y (check_static_final_variable_assignment_flag,
4708 reset_static_final_variable_assignment_flag, check_final_assignment,
4709 check_final_variable_local_assignment_flag,
4710 reset_final_variable_indirect_assignment_flag,
4711 reset_final_variable_global_assignment_flag): Remove functions.
4712 (java_complete_expand_methods, outer_field_access_fix,
4713 patch_assignment): Remove no-longer used logic.
4714 * java-tree.h (DECL_FIELD_FINAL_IUD): Change usage and comments.
4715 * parse.y (register_fields, java_complete_tree): Update accordingly.
4717 * check-init.c (ALLOC_WORDS/FREE_WORDS): Use xmalloc/free, not alloca.
4718 (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER): New.
4719 (check_cond_init, check_bool2_init): Use DECLARE_BUFFERS.
4721 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Temporarily turn off.
4723 * java-tree.h (DECL FINAL): New bit-field.
4724 (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL): Define as DECL_FINAL.
4725 (LOCAL_FINAL_P): Use DECL_FINAL rather than old LOCAL_FINAL.
4726 (DECL_INIT_CALLS_THIS): New macro.
4727 (struct lang_decl): New bit-field init_calls_this.
4728 (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
4729 DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
4730 (DECL_BIT_INDEX): Change to use pointer_alias_set since we now
4731 use it for both local variables and final fields.
4732 (struct lang_decl_var): Remove bit-fields final_liic, final_ierr,
4734 (struct lang_type): Remove hfv bit-field.
4735 (check_for_initialization): Change to return void.
4737 * java-tree.h (IS_ARRAY_LENGTH_ACCESS): New macros.
4738 * expr.c (build_java_array_length_access): Set IS_ARRAY_LENGTH_ACCESS.
4739 * check-init.c (final_assign_error): New helper function.
4740 (check_final_reassigned, check_init): Use it.
4741 (check_init): Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
4743 * java-tree.h (struct lang_decl, struct lang_decl_var): Change all
4744 bit-fields to unsigned.
4746 2001-12-03 Per Bothner <per@bothner.com>
4748 * parse.y (patch_binop): Minor constant folding.
4750 * parse.y (build_current_thisn): Shorter 'buffer'.
4752 2001-12-03 Per Bothner <per@bothner.com>
4754 * decl.c (complete_start_java_method): Now generate TRY_FINALLY_EXPR
4755 instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
4756 * jcf-write.c (generate_bytecode_insns): Remove support for
4757 CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
4758 * check-init.c (check_init): Likewise.
4760 2001-12-03 Per Bothner <per@bothner.com>
4762 * verify.c (subroutine_nesting): New function.
4763 (verify_jvm_instructions): Use it to fix logic for checking that
4764 we're done with the current subroutine.
4766 * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
4767 OPCODE_instanceof use POP_TYPE macro for better diagnostics.
4769 2001-12-03 Per Bothner <per@bothner.com>
4771 * jcf.h: Fix obvious typo in comment.
4772 * typeck.c (build_null_signature): Add comment.
4774 2001-12-03 Neil Booth <neil@daikokuya.demon.co.uk>
4776 * expr.c: Remove leading capital from diagnostic messages, as
4777 per GNU coding standards.
4778 * jcf-io.c: Similarly.
4779 * jcf-parse.c: Similarly.
4780 * jv-scan.c: Similarly.
4781 * jvspec.c: Similarly.
4782 * mangle.c: Similarly.
4784 2001-12-02 Tang Ching-Hui <nicholas@cs.nthu.edu.tw>
4785 Alexandre Petit-Bianco <apbianco@redhat.com>
4787 * expr.c (build_java_arrayaccess): Call save_expr on array for
4788 correct evaluation order, modified comment, fixed indentation.
4789 * parse.y: (patch_assignment): Correctly extract the array base
4790 from the tree generate by build_java_arrayaccess, added comments.
4791 (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
4792 Fixes PR java/3096, PR java/3803, PR java/3965.
4794 2001-12-01 Neil Booth <neil@daikokuya.demon.co.uk>
4796 * expr.c (expand_byte_code): Remove trailing periods from messages.
4797 * jcf-parse.c (load_class, jcf_parse): Similarly.
4798 * jcf-write.c (generate_classfile): Similarly.
4799 * lex.c (java_lex): Similarly.
4801 2001-11-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4803 * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
4805 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk>
4807 * Make-lang.in (java.generated-manpages): New dummy target.
4809 2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
4811 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
4813 (lang_specific_pre_link): Use set_input to set input_filename.
4815 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
4816 (main): Fix definition.
4817 Strip `main' from classname.
4820 2001-11-18 Roger Sayle <roger@eyesopen.com>
4822 * parse.h (java_expand_switch): Remove old prototype.
4824 2001-11-18 Tom Tromey <tromey@redhat.com>
4826 Fix for PR java/1401:
4827 * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
4829 (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
4832 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk>
4834 * lang.c (finish_parse): Rename to java_finish.
4835 (LANG_HOOKS_FINISH, java_finish): New.
4837 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk>
4839 * decl.c (init_decl_processing): Rename java_init_decl_processing.
4840 * java-tree.h: New prototype.
4841 * lang.c (java_init): Update prototype. Combine with old init_parse.
4843 2001-11-13 Tom Tromey <tromey@redhat.com>
4845 * gjavah.c (method_signature): New global.
4846 (HANDLE_METHOD): Set it.
4847 (decompile_return_statement): New function.
4848 (decompile_method): Use it.
4849 (print_method_info): Removed `synth' argument.
4851 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
4853 * java-tree.h (java_set_yydebug): New.
4854 * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
4855 * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
4856 (print_lang_decl, print_lang_type, print_lang_identifier,
4857 print_lang_statistics, lang_print_xnode): Remove.
4859 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
4861 * jcf-parse.c (init_lex): Remove.
4862 * lang.c (language_string, lang_identify): Remove.
4863 (struct lang_hooks): Constify.
4864 (LANG_HOOKS_NAME): Override.
4865 (init_parse): Update.
4867 2001-11-08 Andreas Franck <afranck@gmx.de>
4869 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
4870 program_transform_name the way suggested by autoconf.
4871 (java.install-common): Also transform auxiliary program names with
4872 program_transform_name.
4874 2001-11-08 Tom Tromey <tromey@cygnus.com>
4876 * parse.y (trap_overflow_corner_case): New rule.
4877 (unary_expression): Use it.
4878 * lex.c (java_init_lex): Don't set minus_seen.
4879 (yylex): Don't use minus_seen. Communicate overflow to parser for
4881 (error_if_numeric_overflow): New function.
4882 * parse.h (minus_seen): Removed field.
4883 (JAVA_RADIX10_FLAG): New define.
4885 2001-11-07 Tom Tromey <tromey@redhat.com>
4887 Patch for PR java/1414:
4888 * parse.y (case_label_list): New global.
4889 (goal): Register case_label_list with GC.
4890 (java_complete_lhs): Save new case on case_label_list.
4891 (patch_switch_statement): Check for duplicate case labels.
4893 2001-11-07 Alexandre Petit-Bianco <apbianco@redhat.com>
4895 * parse.y (patch_assignment): Removed unused third argument.
4896 (java_complete_lhs): Removed unused third argument to patch_assignment.
4898 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk>
4900 * lang.c: Include langhooks-def.h.
4901 * Make-lang.in: Update.
4903 2001-10-31 Zack Weinberg <zack@codesourcery.com>
4905 * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
4907 2001-10-29 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4909 * mangle.c (find_compression_record_match): Don't match compression
4910 records for package name elements unless they occur at the start of
4911 the name. Fix for PR java/4717.
4913 2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4915 * expr.c (expand_java_field_op): Don't special-case references to
4916 java.lang.PRIMTYPE.TYPE.
4917 (build_primtype_type_ref): Removed.
4918 * java-tree.h (build_primtype_type_ref): Remove prototype.
4919 * parse.y (maybe_build_primttype_type_ref): Removed.
4920 (complete_function_arguments): Don't special-case references to
4921 java.lang.PRIMTYPE.TYPE.
4922 (patch_assignment): Likewise.
4923 (array_constructor_check_entry): Likewise.
4925 2001-10-24 Alexandre Petit-Bianco <apbianco@redhat.com>
4927 * mangle.c (static tree compression_table): Fixed leading comment.
4928 * parse.h (struct parser_ctxt): Fixed field comment.
4929 * parse.y (check_pkg_class_access): New prototype, fixed leading
4930 comment, new parameter used to emit error only if passed as true.
4931 (parse_check_super): Pass extra argument to check_pkg_class_access.
4932 (do_resolve_class): Likewise.
4933 (process_imports): Likewise.
4934 (read_import_dir): Fixed indentation.
4935 (find_in_imports_on_demand): New local class_type_name. Local
4936 node_to_use deleted. while loop changed into for loop. Report
4937 multiple definition only for accessible classes. Improved error
4939 (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
4940 assigned to parameter list, fixed indentation. while loop changed
4941 into for loop, restore TREE_CHAIN on local `tem' before the next
4944 2001-10-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4946 * lang.c (lang_get_alias_set): Deleted.
4948 2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4950 * gjavah.c (jni_print_char): Fix thinko in last change.
4952 * gjavah.c (jni_print_char, decode_signature_piece): Use
4953 safe-ctype macros and/or fold extra calls into fewer ones.
4954 * lex.c (java_read_unicode, java_lex): Likewise.
4955 * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
4956 JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
4957 * mangle_name.c (append_unicode_mangled_name,
4958 unicode_mangling_length): Likewise.
4960 2001-10-17 Richard Henderson <rth@redhat.com>
4962 * Make-lang.in (java/lang.o): Depend on langhooks.h.
4964 2001-10-15 Alexandre Petit-Bianco <apbianco@redhat.com>
4966 * lang.c (langhooks.h): Included.
4967 (LANG_HOOKS_INIT): Redefined.
4968 (LANG_HOOKS_INIT_OPTIONS): Likewise.
4969 (LANG_HOOKS_DECODE_OPTION): Likewise.
4970 (struct lang_hooks lang_hooks): New initialization.
4972 2001-10-11 Per Bothner <per@bothner.com>
4974 * parse.y (patch_synchronized_statement): Use a TRY_FINALLY_EXPR
4975 rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
4976 The former is simpler, and jcf-write.c handles it better.
4977 (java_complete_lhs): No longer need to handle CLEANUP_POINT_EXPR
4978 or WITH_CLEANUP_EXPR.
4979 * jcf-write.c: Revert Alex's change from 2000-10-18. It is no
4980 longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
4982 * parse.y (patch_if_else_statement): If the condition is constant,
4983 optimize away the test.
4985 2001-10-09 Alexandre Petit-Bianco <apbianco@redhat.com>
4987 * parse.y (patch_cast): Call patch_string on the first operand of
4988 the incoming node, update it if necessary. Fixes PR java/4510.
4990 2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4992 * parse.y (find_as_inner_class): Don't disregard the enclosing scope
4993 when name qualifier matches a package name.
4995 2001-10-08 Tom Tromey <tromey@redhat.com>
4997 Fix for PR java/4489:
4998 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
4999 force a new label when computing `body_block'.
5001 2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5003 * jcf-io.c (format_uint): Const-ify.
5004 * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
5005 * lex.c (java_get_line_col): Likewise.
5006 * parse.y (build_incdec): Likewise.
5008 2001-10-05 Alexandre Petit-Bianco <apbianco@redhat.com>
5010 * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
5011 a NULL enclosing context if appropriate. Fixes PR java/4466.
5013 2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
5015 * parse.y (patch_assignment): Use lvalue's original TYPE when
5016 building the final COMPOUND_EXPR.
5017 (try_reference_assignconv): Fixed leading comment.
5019 2001-09-26 Alexandre Petit-Bianco <apbianco@redhat.com>
5021 * parse.y (check_final_variable_indirect_assignment): For
5022 COMPOUND_EXPR, return only if finals were found initialized
5023 properly, if not, keep on checking.
5024 (check_final_variable_global_assignment_flag): New local
5025 error_found, set when appropriate and used to decide whether to
5026 report uninitialized finals. Fixed typo in comment.
5028 2001-09-22 Alexandre Petit-Bianco <apbianco@redhat.com>
5030 * decl.c (init_decl_processing): Fixed typo in predef_filenames
5031 last three initializations. Fixes PR java/4360.
5033 2001-09-21 Richard Henderson <rth@redhat.com>
5035 * class.c (get_dispatch_table): Handle function descriptors.
5036 (build_dtable_decl): Likewise.
5037 * expr.c (build_invokevirtual): Likewise.
5039 2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
5041 * parse.y (patch_method_invocation): Build class initialization
5042 when static finals are used to qualify method invocation.
5045 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
5047 * parse.h: (WFL_STRIP_BRACKET): Re-written using
5048 build_type_name_from_array_name.
5049 (STRING_STRIP_BRACKETS): New macro.
5050 * parse.y (build_type_name_from_array_name): New function.
5051 (array_creation_expression:): Accumulate []s instead of [s.
5052 (cast_expression:): Accumulate []s instead of [s after cast type
5054 (build_array_from_name): Local string deleted, use
5055 build_type_name_from_array_name.
5056 (build_unresolved_array_type): Accumulate []s instead of [s after
5058 (register_fields): Fixed comment.
5059 (resolve_class): Local name, base deleted, new locals tname and
5060 array_dims. Use build_type_name_from_array_name. Use array_dims to
5062 (purify_type_name): Use STRING_STRIP_BRACKETS.
5064 2001-09-18 Andreas Jaeger <aj@suse.de>
5066 * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
5067 * jv-scan.c: Likewise.
5069 2001-09-17 Alexandre Petit-Bianco <apbianco@redhat.com>
5071 * parse.y (patch_method_invocation): Inner class creation context
5072 check not enforced within constructors. Fixes PR java/1873.
5074 2001-09-16 Tom Tromey <tromey@redhat.com>
5076 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
5077 NOTE_PUSH for single-case push. Fixes PR java/4189.
5079 2001-09-13 Alexandre Petit-Bianco <apbianco@redhat.com>
5081 * java-tree.h (TYPE_IMPORT_LIST): New macro.
5082 (TYPE_IMPORT_DEMAND_LIST): Likewise.
5083 (struct lang_type): New fields import_list and import_demand_list.
5084 * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
5085 TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
5086 (do_resolve_class): New local saved_enclosing_type, initialized,
5087 passed as parameter to find_in_imports and find_in_imports_on_demand.
5088 (find_in_imports): Added paramater enclosing_type, use its
5089 TYPE_IMPORT_LIST when applicable.
5090 (find_in_imports_on_demand): Added parameter enclosing_type, use
5091 its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
5092 declaration and initialization.
5093 (fold_constant_for_init): Switch/restore current_class to the
5094 appropriate context.
5096 2001-09-13 Mark Mitchell <mark@codesourcery.com>
5098 * verify.c (verify_jvm_instructions): Fix typo.
5100 2001-09-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5102 * expr.c (expand_invoke): Const-ification.
5103 * parse.y (patch_method_invocation): Likewise.
5105 2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5107 * gjavah.c (cxx_keywords): Const-ification.
5108 * keyword.gperf (java_keyword): Likewise.
5109 * lang.c (java_tree_code_name): Likewise.
5110 * lex.c (cxx_keywords): Likewise.
5111 * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
5113 2001-09-11 Richard Henderson <rth@redhat.com>
5115 * parse.h (ctxp_for_generation): Mark extern.
5117 2001-09-10 Richard Henderson <rth@redhat.com>
5119 * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
5121 2001-09-07 Matt Kraai <kraai@alumni.carnegiemellon.edu>
5123 * typeck.c (java_array_type_length, build_prim_array_type):
5124 Represent empty arrays by NULL index.
5126 2001-09-06 Alexandre Petit-Bianco <apbianco@redhat.com>
5128 * java-tree.h (compile_resource_file): Grouped with other prototypes.
5129 * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
5131 2001-09-06 Anthony Green <green@redhat.com>
5133 * class.c (O_BINARY): Define if necessary.
5134 (registerResource_libfunc): Declare.
5135 (init_class_processing): Initilize registerResource_libfunc.
5136 (compile_resource_file): New function.
5137 * java-tree.h (resource_name): Declare.
5138 (compile_resource_file): Declare.
5139 * jcf-parse.c (yyparse): Handle compiling java resource files.
5140 * lang.c (java_decode_option): Handle -fcompile-resource option.
5141 * jvspec.c (lang_specific_driver): Handle -R flag for compiling
5143 * gcj.texi (Code Generation): Add documentation for -R flag.
5145 2001-09-05 Alexandre Petit-Bianco <apbianco@redhat.com>
5147 * jcf-write.c (generate_classfile): Issue an error in case of
5148 field/initial value mismatch.
5149 * parse.y (analyze_clinit_body): Keep <clinit> if an array is
5150 being initialized and we're generating bytecode.
5151 (java_complete_lhs): In MODIFY_EXPR section: added comments,
5152 set DECL_INITIAL properly when appropriate.
5156 2001-09-01 Per Bothner <per@bothner.com>
5158 * parse.y (maybe_yank_clinit): A field without an initializer is not
5159 relevant. All initializers except static final and constant require
5160 <clinit>, regardless of flag_emit_class_files.
5162 2001-08-31 Per Bothner <per@bothner.com>
5164 * class.c (set_constant_value): When not emitting class files, then a
5165 String ConstantValue is a utf8const_ptr_type.
5167 2001-08-30 Per Bothner <per@bothner.com>
5169 * jcf-write.c (generate_classfile): Check that field is primitive
5170 or string before emitting ConstantValue attribute.
5172 2001-08-30 Per Bothner <per@bothner.com>
5174 * parse.y (resolve_qualified_expression_name): If creating a
5175 COMPOUND_EXPR, set it's type correctly.
5177 2001-08-30 Per Bothner <per@bothner.com>
5179 * jcf-io.c (open_class): Set filename field.
5181 * jcf-parse,c (parse_class_file): Set current_function_decl
5182 for better error message when Code attribute is missing.
5184 * lang.c (put_decl_node, lang_print_error): Re-arrange for
5185 better diagnostics, especially for constructors.
5187 2001-08-30 Per Bothner <per@bothner.com>
5189 * jcf-write.c (generate_classfile): Don't write ConstantValue
5190 attribute if field is not final, for compatibility with jdk.
5192 * jcf-write.c (generate_classfile): Convert ConstantValue values
5193 to correct type. Work-around for front-end bug.
5194 * class.c (set_constant_value): Error if constant has wrong type.
5196 2001-08-30 Per Bothner <per@bothner.com>
5198 * jcf-dump.c (print_constant): Fix fencepost error so "Float" and
5199 "Double" are printed at verbosity 1.
5201 * jcf-dump.c (main): Disable flag_print_attributes if --javap.
5203 * jcf-dump.c (SPECIAL_IINC): Remove unneeded casts to long.
5205 2001-08-30 Alexandre Petit-Bianco <apbianco@redhat.com>
5207 * parse.y (patch_assignment): Don't verify final re-assignment here.
5208 (java_complete_lhs): Verify assignments to finals calling
5209 patch_assignment. Verify re-assignments to finals before calling
5212 2001-08-29 Alexandre Petit-Bianco <apbianco@redhat.com>
5214 * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
5217 2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
5219 * lex.c (java_lex): new local found_hex_digits. Set and then used
5220 in test to reject invalid hexadecimal numbers.
5221 * parse.y (java_complete_tree): Prevent unwanted cast with
5222 initialized floating point finals.
5223 (patch_binop): Emit a warning when detecting a division by zero,
5224 mark result not constant, don't simplify non integer division.
5226 2001-08-28 Per Bothner <per@bothner.com>
5228 * jcf-write.c (generate_bytecode_insns): For increments and
5229 decrements just recurse to push constant. Improvement on Mark's patch.
5231 2001-08-28 Mark Mitchell <mark@codesourcery.com>
5233 * jcf-write.c (generate_bytecode_insns): Generate an integer to
5234 real conversion for increments and decrements of reals.
5236 2001-08-27 Alexandre Petit-Bianco <apbianco@redhat.com>
5238 * parse.y (resolve_qualified_expression_name): Handle unresolved
5239 qualified expressions, prevent numerical qualifiers, fixed typo.
5242 2001-08-24 Alexandre Petit-Bianco <apbianco@redhat.com>
5244 * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
5245 don't report anything but deprecated class when marked so. Handle
5247 (patch_method_invocation): Check deprecation on methods and types.
5248 (patch_binop): code becomes an enum tree_code, added default: to
5249 switch to handle that. Detect division by zero, try to fold and
5250 return before using a subroutine.
5252 2001-08-23 Alexandre Petit-Bianco <apbianco@redhat.com>
5254 * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
5255 file smaller than 4 bytes.
5256 * parse.y (check_inner_circular_reference): New function.
5257 (check_circular_reference): Likewise.
5258 (array_initializer:): Accept {,}.
5259 (java_check_circular_reference): Rewritten using
5260 check_circular_reference and check_inner_circular_reference.
5261 (java_complete_expand_method): Unconditionally save and restore
5262 the unpurged exception list.
5263 (build_dot_class_method_invocation): Unmangle signature parameter.
5265 2001-08-21 Tom Tromey <tromey@redhat.com>
5267 * decl.c (init_decl_processing): Add `throws' field to method
5269 * class.c (make_method_value): Compute `throws' field for method.
5271 2001-08-22 Alexandre Petit-Bianco <apbianco@redhat.com>
5273 * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
5274 circularity is detected.
5275 (ctors_unchecked_throws_clause_p): Fixed leading comment.
5277 2001-08-17 Richard Henderson <rth@redhat.com>
5279 * class.c (emit_register_classes): Add align parameter to
5280 call to assemble_integer.
5282 2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com>
5284 * jcf-parse.c (load_class): New locals saved and class_loaded. If
5285 loading a class_or_name fails, try considering an innerclass name
5286 and load the enclosing context.
5287 * parse.y (resolve_inner_class): New function.
5288 (find_as_inner_class): Added leading comment.
5289 (register_incomplete_type): Keep the current context as enclosing
5290 context for JDEP_FIELD dependencies.
5291 (do_resolve_class): Locals new_class_decl and super initialized to
5292 NULL. Call resolve_inner_class, explore the enclosing context
5293 superclass if necessary.
5296 2001-08-16 Tom Tromey <tromey@redhat.com>
5298 * jcf-dump.c (main): Updated for change to jcf_path_seal.
5299 * gjavah.c (main): Updated for change to jcf_path_seal.
5300 * lang.c (version_flag): New global.
5301 (java_decode_option): Recognize `-version'.
5302 (java_init): Update for change to jcf_path_seal.
5303 * jcf.h (jcf_path_seal): Added `print' argument.
5304 * jcf-path.c (jcf_path_seal): Added `print' argument.
5306 2001-08-13 Zack Weinberg <zackw@panix.com>
5308 * Make-lang.in (java/decl.o): Update dependencies.
5309 * decl.c: Include libfuncs.h, don't include toplev.h.
5311 2001-08-12 Alexandre Petit-Bianco <apbianco@redhat.com>
5313 * decl.c (init_decl_processing): exception_type_node,
5314 class_not_found_type_node, and no_class_def_found_type_node
5315 initialized. predef_filenames augmented accordingly.
5316 instinit_identifier_node initialized.
5317 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
5318 * java-tree.h (enum java_tree_index): New entries
5319 JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
5320 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
5321 (exception_type_node): New macro.
5322 (class_not_found_type_node): Likewise.
5323 (no_class_def_found_type_node): Likewise.
5324 (instinit_identifier_node): Likewise.
5325 (PREDEF_FILENAMES_SIZE): Adjusted.
5326 (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
5327 (struct lang_type): Fixed typo in bitfield name.
5328 (DECL_INSTINIT_P): New macro.
5329 (ID_INSTINIT_P): Likewise.
5330 * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
5332 * parse.y (encapsulate_with_try_catch): New function.
5333 (generate_instinit): Likewise.
5334 (build_instinit_invocation): Likewise.
5335 (ctors_unchecked_throws_clause_p): Likewise.
5336 (add_instance_initializer): Deleted.
5337 (build_instance_initializer): Likewise.
5338 (in_instance_initializer): Likewise.
5339 (check_method_redefinition): instinit$ not to be verified.
5340 (java_complete_expand_methods): Generate instinit$, simplified code.
5341 (build_dot_class_method): Eliminated unnecessary locals. Use
5342 encapsulate_with_try_catch, removed unnecessary code.
5343 (fix_constructors): New local iii. Use build_instinit_invocation.
5344 (patch_method_invocation): Added comment.
5345 (maybe_use_access_method): Don't consider instinit$.
5346 (find_applicable_accessible_methods_list): Shorten the search for
5348 (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
5349 (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
5350 (patch_throw_statement): Likewise. Fixed typo.
5352 2001-08-12 David Edelsohn <edelsohn@gnu.org>
5355 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
5356 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
5358 (lang_specific_pre_link): Use set_input to set input_filename.
5360 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
5361 (main): Fix definition.
5362 Strip `main' from classname.
5365 2001-08-11 Zack Weinberg <zackw@panix.com>
5367 * lex.h: Don't include setjmp.h. Don't define
5368 SET_FLOAT_HANDLER or prototype set_float_handler.
5370 2001-08-09 Alexandre Petit-Bianco <apbianco@redhat.com>
5372 * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
5373 `poplevel' in the right order.
5375 2001-08-09 Richard Henderson <rth@redhat.com>
5377 * Make-lang.in (class.o): Depend on TARGET_H.
5378 * class.c (emit_register_classes): Use target hooks instead of
5379 assemble_constructor and assemble_destructor.
5381 2001-08-08 Alexandre Petit-Bianco <apbianco@redhat.com>
5383 * check-init.c (flags.h): Include
5384 (check_init): Don't report uninitialized static class
5385 initialization flags, don't free bit index when doing static class
5386 initialization optimization.
5387 (check_for_initialization): Return type changed to `unsigned int.'
5388 (attach_initialized_static_class): New function.
5389 * class.c (add_method_1): Create the initialized static class
5391 (finish_class): Always emit deferred inline methods.
5392 * decl.c (emit_init_test_initialization): Moved to expr.c
5393 (complete_start_java_method): Don't traverse
5394 DECL_FUNCTION_INIT_TEST_TABLE.
5395 (lang_mark_tree): Mark hash tables in function decls.
5396 * expr.c (emit_init_test_initialization): Moved from decl.c.
5397 (build_class_init): Create LAG_DECL_SPECIFIC for the static class
5398 initialization flag, set DECL_CONTEXT and
5399 LOCAL_CLASS_INITIALIZATION_FLAG.
5400 (java_lang_expand_expr): Emit initialization code for static class
5401 initialized flags when entering block, if necessary.
5402 * gcj.texi (-fno-optimize-static-class-initialization): Documented.
5403 * java-tree.h (flag_optimize_sci): New global variable declaration.
5404 (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
5405 (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
5406 (LOCAL_FINAL_P): Fixed typo in comment.
5407 (FINAL_VARIABLE_P): Likewise.
5408 (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
5409 (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
5410 (struct lang_decl): New fields `ict', `smic' and `cif.'
5411 (check_for_initialization): New returned value for global.
5412 (attach_initialized_static_class): New global function.
5413 (STATIC_CLASS_INIT_OPT_P): New macro.
5414 * lang-options.h (-fno-optimize-static-class-initialization): New flag.
5415 * lang.c (java_decode_option): Handle
5416 `-fno-optimize-static-class-initialization'
5417 * parse.y (start_complete_expand_method): New function.
5418 (java_expand_method_bodies): Likewise.
5419 (attach_init_test_initialization_flags): Likewise.
5420 (adjust_init_test_initialization): Likewise.
5421 (emit_test_initialization): Likewise.
5422 (java_complete_expand_methods): Nullify abstract and native method
5424 (java_complete_expand_method): New locals `fbody', `block_body'
5425 and `exception_copy.' Reorganized: directly return on empty method
5426 bodies, call `start_complete_expand_method', remember definitely
5427 initialized static class in function, don't expand method bodies.
5428 (java_expand_classes): Call `java_expand_method_bodies' before
5429 `finish_class' when compiling to native.
5430 (resolve_expression_name): Use `orig' after building outer class
5432 (patch_invoke): Remember static method invocations.
5434 2001-08-06 Richard Henderson <rth@redhat.com>
5436 * class.c (emit_register_classes): Pass a symbol_ref and priority
5437 to assemble_constructor.
5439 2001-08-02 Alexandre Petit-Bianco <apbianco@redhat.com>
5441 * java-tree.h (all_class_filename): New macro.
5442 (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
5443 (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
5444 newly created IDENTIFIER_NODE to `all_class_filename.'
5446 2001-08-01 Jeff Sturm <jsturm@one-point.com>
5448 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
5449 Use ggc_add_tree_root to register roots.
5451 2001-07-31 Alexandre Petit-Bianco <apbianco@redhat.com>
5453 * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
5454 second operand calling check_init.
5455 * decl.c (complete_start_java_method): Swaped second and third
5456 arguments while creating WITH_CLEANUP_EXPR node.
5457 * jcf-write.c (generate_bytecode_insns): Use second operand
5458 instead of third when handling WITH_CLEANUP_EXPR.
5459 * parse.y (java_complete_lhs): Expand second operand of
5460 WITH_CLEANUP_EXPR nodes.
5461 (patch_synchronized_statement): Swaped second and third arguments
5462 while creating WITH_CLEANUP_EXPR node.
5464 2001-07-18 Alexandre Petit-Bianco <apbianco@redhat.com>
5466 * parse.y (create_interface): Avoid cyclic inheritance report when
5467 syntax error encountered during class definition.
5470 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
5472 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
5474 (lang_specific_pre_link): Use set_input to set input_filename.
5476 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
5477 (main): Fix definition.
5478 Strip `main' from classname.
5481 2001-07-18 Tom Tromey <tromey@redhat.com>
5484 * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
5485 * lex.c (java_new_lexer): Use ICONV_CONST.
5486 (java_read_char): Likewise.
5487 * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
5488 (jv-scan$(exeext)): Likewise.
5490 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
5492 * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
5493 * parse.y (check_class_interface_creation): Allow `private' if the
5494 enclosing is not an interface.
5495 (create_interface): Interface tagged public if the enclosing
5496 context is an interface.
5497 (create_class): Class tagged public if the enclosing context
5501 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
5503 * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
5506 2001-07-14 Tim Josling <tej@melbpc.org.au>
5508 * check-init.c (check_init): Remove references to EXPON_EXPR.
5510 2001-07-13 Alexandre Petit-Bianco <apbianco@redhat.com>
5512 * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
5513 TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
5516 2001-07-13 Tom Tromey <tromey@redhat.com>
5518 * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
5521 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
5523 * parse.y (patch_method_invocation): Don't override primary if one
5524 is already provided, but let this$<n> be built. Fixed comment.
5526 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
5528 * parse.y (empty_statement:): Report empty statement error only
5529 when found at class declaration level.
5532 2001-07-12 Tom Tromey <tromey@redhat.com>
5534 * expr.c (expand_load_internal): New function.
5535 (LOAD_INTERNAL): Use it.
5537 2001-07-11 Alexandre Petit-Bianco <apbianco@redhat.com>
5539 * parse.y (verify_constructor_super): Compare anonymous class ctor
5540 args with `valid_method_invocation_conversion_p.'
5543 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
5545 * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
5546 `-fsyntax-only.' Fixes PR java/3248
5548 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
5550 * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
5552 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
5554 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
5555 current function is static. Fixes PR java/1970
5557 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
5559 * parse.y (patch_method_invocation): Add enclosing context to ctor
5560 calls if necessary. Fixes PR java/2953
5562 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
5564 * parse.y (resolve_package): Abort if qualified expression member
5566 (qualify_ambiguous_name): Don't qualify as type if `this' in use.
5569 2001-07-07 Zack Weinberg <zackw@stanford.edu>
5571 * verify.c: Don't use // comments.
5573 2001-07-05 Tom Tromey <tromey@redhat.com>
5575 * lang.c (flag_assume_compiled): Removed.
5576 * java-tree.h (flag_assume_compiled): Removed.
5577 * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
5578 -fhash-synchronization, -fuse-divide-subroutine,
5579 -fcheck-references, -femit-class-file, -femit-class-files,
5580 -fassume-compiled. Updated --encoding information. Changed
5581 -foutput-class-dir to `-d'.
5583 2001-07-04 Daniel Berlin <dan@cgsoftware.com>
5585 * jcf-parse.c (parse_class_file): Add lineno parameter to
5586 debug_start_source_file call.
5588 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
5590 * gcj.texi: Use gpl.texi.
5591 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
5592 dependencies and use doc/include in search path.
5594 2001-07-03 Jeff Sturm <jsturm@one-point.com>
5596 * parse.y (fix_constructors): Test if a CALL_EXPR invokes
5597 `this'. If so, don't build instance initializers.
5599 2001-07-03 Alexandre Petit-Bianco <apbianco@redhat.com>
5601 * parse.y (resolve_expression_name): Improved error message for
5602 inner class cases. Fixes PR java/1958
5604 2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
5606 * lang.c: #include diagnostic.h
5607 (lang_print_error): Add a `diagnostic_context *' parameter.
5608 (java_dummy_print): Likewise.
5609 * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
5611 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
5613 * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
5614 * jcf.h (typedef struct JCF): New bitfield `finished.'
5615 (JCF_FINISH): Set `finished.'
5616 (JCF_ZERO): Reset `finished.'
5619 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
5621 * parse.y (class_body_declaration:): Don't install empty instance
5625 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
5627 * class.c (set_super_info): Call `set_class_decl_access_flags.'
5628 (set_class_decl_access_flags): New function.
5629 * java-tree.h (set_class_decl_access_flags): New prototype.
5630 * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
5631 (parse_class_file): New local `decl_max_locals.' Take wide types
5632 into account to compute DECL_MAX_LOCALS.
5633 * parse.y (type_import_on_demand_declaration:): Ignore duplicate
5636 2001-06-22 Jan van Male <jan.vanmale@fenk.wau.nl>
5638 * zipfile.h: Use GCC_JCF_H instead of JCF_H.
5640 2001-06-20 Alexandre Petit-Bianco <apbianco@redhat.com>
5642 * class.c (java_hash_tree_node): Fixed indentation in leading comment.
5643 * parse.y (do_resolve_class): Moved comments out to leading comment
5644 section. Removed local `start', New local `_ht' and
5645 `circularity_hash.' Record `enclosing' in hash table and search
5646 it to detect circularity. Use `enclosing' as an argument to
5647 `lookup_cl.' Free the hash table when done.
5649 2001-06-19 Tom Tromey <tromey@redhat.com>
5651 * lex.c (java_read_char): Disallow invalid and overlong
5652 sequences. Fixes PR java/2319.
5654 2001-06-05 Jeff Sturm <jsturm@one-point.com>
5656 * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
5658 2001-06-04 Alexandre Petit-Bianco <apbianco@redhat.com>
5660 * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
5661 arguments accordingly.
5663 2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
5665 * gcj.texi: Move contents to just after title page.
5667 2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
5669 * parse.y (type_literals:): Use `build_incomplete_class_ref' with
5671 (patch_incomplete_class_ref): Build the class ref, build the class
5672 init if necessary, complete the tree.
5675 2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com>
5677 * parse.y (lookup_field_wrapper): Test `name' code.
5678 (resolve_qualified_expression_name): Test `qual_wfl' code.
5679 (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
5680 handle `qual_wfl' by code.
5681 (maybe_build_primttype_type_ref): Test `wfl' code.
5683 2001-05-23 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
5685 * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
5687 (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls. Create
5688 the dvi file in the java directory.
5690 2001-05-25 Sam TH <sam@uchicago.edu>
5692 * gen-table.pl javaop.h jcf.h lex.h,
5693 parse.h: Fix header include guards.
5695 2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
5697 * jv-scan.c (version): Update copyright year.
5699 2001-05-21 Per Bothner <per@bothner.com>
5701 * jcf-parse.c (read_class): If class is from .class or .zip file
5702 and it's already been read, don't push/pop parser context.
5704 2001-05-18 Per Bothner <per@bothner.com>
5706 * jvspec.c (lang_specific_pre_link): Re-arrange the linker
5707 command line so the jvgenmain-generated main program comes first.
5709 2001-05-15 Tom Tromey <tromey@redhat.com>
5711 * class.c (build_utf8_ref): Don't generate identifier based on
5714 2001-05-12 Richard Henderson <rth@redhat.com>
5716 * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
5717 * expr.c (java_lang_expand_expr): Expand it.
5718 (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
5719 calling build_exception_object_ref.
5720 * parse.y (catch_clause_parameter): Likewise.
5721 (build_dot_class_method): Likewise.
5722 (try_reference_assignconv): Likewise.
5723 * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
5724 * jcf-write.c (generate_bytecode_insns): Likewise.
5726 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
5728 * parse.y (build_unresolved_array_type): Set
5729 EXPR_WFL_QUALIFICATION on the newly created wfl.
5730 Fixes PR java/2538. Fixes PR java/2535.
5732 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
5734 * parse.y (fix_constructors): Removed unnecessary assignment to
5735 local. Moved assignment to `this$<n>', fixed comments and
5737 (build_wfl_wrap): Fixed indentation.
5738 Fixes PR java/2598, java/2579 and java/2658.
5740 2001-05-03 Mo DeJong <mdejong@redhat.com>
5742 * lex.c (java_new_lexer): Call iconv_close on temp handle used to
5743 check for byte swap.
5745 2000-05-02 Jeff Sturm <jsturm@one-point.com>
5747 * expr.c (build_class_init): Move MODIFY_EXPR
5748 outside of COND_EXPR. Remove variable `call'.
5750 2001-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5752 * decl.c: NULL_PTR -> NULL.
5753 * jcf-write.c: Likewise.
5755 2001-05-01 Tom Tromey <tromey@redhat.com>
5757 * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
5758 (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
5759 * gcj.texi: Updated copyright text. Include fdl.texi.
5760 (Top): Link to new node.
5762 2001-05-01 Per Bothner <per@bothner.com>
5764 * parse.h (REGISTER_IMPORT): Use tree_cons instead of chainon.
5766 2001-05-01 Per Bothner <per@bothner.com>
5768 * parse.y (java_pop_parser_context): The TREE_VALUE of a link in the
5769 import_list contains the name, not the TREE_PURPOSE.
5771 2001-04-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5773 * jcf-io.c (read_zip_member): Cast to long in comparison with
5776 * jvspec.c (lang_specific_driver): Initialize variables.
5778 * mangle.c (find_compression_record_match): Likewise.
5780 * typeck.c (build_null_signature): Provide static prototype. Mark
5781 parameter with ATTRIBUTE_UNUSED.
5783 * verify.c (verify_jvm_instructions): Initialize variable.
5785 2001-04-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5787 * parse.y (do_resolve_class): Check for cyclic inheritance during
5788 inner class resolution.
5790 2001-04-27 Per Bothner <per@bothner.com>
5792 * parse.y (java_expand_classes): Don't change ctxp_for_generation
5793 while iterating, since that could cause gc to lose stuff.
5795 2001-04-26 Per Bothner <per@bothner.com>
5797 Fix method search wrt scope of inner classes to match JLS2.
5798 * typeck.c (build_null_signature): New static function.
5799 (has_method): New function. Uses build_null_signature and lookup_do.
5800 * java-tree.h (has_method): New declaration.
5801 * parse.y (find_applicable_accessible_methods_list): Do not search
5802 context of inner classes here.
5803 (patch_method_invocation): Search scope, ie. current and outer clases,
5804 for method matching simple name, to find class.
5806 2001-04-26 Per Bothner <per@bothner.com>
5808 * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
5809 Fix thinko: If a single case, use if_icmpeq, not ifeq.
5811 * constants.c (find_methodref_with_class_index): New function.
5812 (find_methodref_index): Use find_methodref_with_class_index.
5813 * java-tree.h (find_methodref_with_class_index): New declaration.
5814 * jcf-write.c (generate_bytecode_insns case CALL_EXPR): Don't change
5815 DECL_CONTEXT, instead use new find_methodref_with_class_index function.
5816 If context changed from interface to class, don't use invokeinterface.
5818 2001-04-25 Per Bothner <per@bothner.com>
5820 * verify.c (verify_jvm_instructions): For field instructions,
5821 check that field index is valid. For invoke instructions, check that
5822 method index is valid.
5824 2001-04-25 Alexandre Oliva <aoliva@redhat.com>
5826 * config-lang.in (target_libs): Copy from $libgcj_saved.
5828 2001-04-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5830 * decl.c (init_decl_processing): Add new class "protectionDomain"
5832 * class.c (make_class_data): Set initial value for "protectionDomain".
5834 2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5836 * jvspec.c (lang_specific_driver): Fix memory allocation
5837 deficit, by using concat in lieu of xmalloc/sprintf.
5839 2001-04-20 Per Bothner <per@bothner.com>
5841 Fixes to compile multiple .class files at once.
5842 * decl.c (init_decl_processing): Don't set CLASS_LOADED_P.
5843 * java-tree.h (CLASS_PARSED_P): New macro.
5844 (CLASS_LOADED_P): Re-define to use TYPE_SIZE and CLASS_PARSED_P.
5845 * jcf-parse.c (jcf_parse_source): Inline into read_class.
5846 (read_class): Avoid some code duplication.
5847 Don't call JCF_FINISH for a .class file - might be needed later.
5848 (jcf_parse): Don't call layout_class here. Check/set CLASS_PARSED_P
5849 rather than CLASS_LOADED_P, since latter implies class laid out.
5850 (yyparse): Do layout_class and JCF_FINISh here instead, in pass 2.
5851 * parse.y: Don't need to set CLASS_LOADED_P for array types.
5853 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5855 * Make-lang.in (java/boehm.o): Depend on toplev.h.
5857 * boehm.c: Include toplev.h.
5859 2001-04-06 Tom Tromey <tromey@redhat.com>
5860 Alexandre Petit-Bianco <apbianco@redhat.com>
5862 Fix for PR gcj/1404 and PR gcj/2332:
5863 * parse.y (build_array_from_name): If we use the type_wfl then
5864 accumulate dimensions from the original type as well.
5865 (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
5867 2001-04-06 Tom Tromey <tromey@redhat.com>
5869 * parse.y (analyze_clinit_body): Return true if the second operand
5870 of a METHOD_EXPR is nonzero.
5872 2001-04-06 Tom Tromey <tromey@redhat.com>
5874 * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
5876 ($(srcdir)/java/parse.c): Likewise.
5878 2001-04-05 Alexandre Petit-Bianco <apbianco@redhat.com>
5880 * gcj.texi: Use `which-gcj' instead of `which-g77.'
5881 (version-gcc): Initialized.
5882 (which-gcj): Likewise.
5884 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
5886 * java-tree.h (struct lang_decl): New macro
5887 `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
5888 * parse.y (build_instance_initializer): New function.
5889 (add_instance_initializer): Use it.
5890 (java_fix_constructors): Set `current_class' before fix pass.
5891 (fix_constructors): Just return if already fixed. Move `super()'
5892 invocation ahead. Use `build_instance_initializer.'
5895 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
5897 * parse.y (resolve_qualified_expression_name): Pass field's
5898 DECL_CONTEXT to `not_accessible_p.'
5899 (not_accessible_p): Changed parameters order in `inherits_from_p'
5902 2001-03-27 Andrew Haley <aph@cambridge.redhat.com>
5904 * lang-options.h: Add flag_check_references.
5906 2001-04-04 Per Bothner <per@bothner.com>
5908 * java-tree.h (CONSTANT_VALUE_P): New macro.
5909 * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P.
5910 * parse.y (maybe_build_class_init_for_field): New static function.
5911 (resolve_expression_name, resolve_field_access): Use
5912 maybe_build_class_init_for_field instead of build_class_init
5913 This does not do the init if the field is compile-time-constant.
5914 (resolve_field_access): Simplify.
5916 * parse.y (fold_constant_for_init): Merge test into switch.
5918 2001-04-03 Zack Weinberg <zackw@stanford.edu>
5920 * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
5922 * buffer.c, jvgenmain.c: Don't include gansidecl.h.
5924 2001-04-02 Zack Weinberg <zackw@stanford.edu>
5926 * expr.c (pop_type_0): Save the result of the first
5927 lang_printable_name call in a scratch buffer, so it
5928 won't be clobbered by the second call.
5930 2001-03-30 Alexandre Petit-Bianco <apbianco@redhat.com>
5932 * parse-scan.y (array_type:): Rewritten.
5933 (type_declaration:): `empty_statement' replaces `SC_TK.'
5934 (class_member_declaration:): `empty statement' added.
5935 (method_body:): Simplified.
5936 (static_initializer:): Likewise.
5937 (primary_no_new_array:): Use `type_literals.'
5938 (type_literals:): New rule.
5939 (dims:): Set and update `bracket_count.'
5940 Fixes PR java/1074. Fixes PR java/2412.
5942 2001-03-28 Hans Boehm <boehm@acm.org>
5944 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
5945 (get_boehm_type_descriptor): Set type on returned value to be a
5946 pointer length integer.
5948 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5950 * expr.c (pop_type_0): Call `concat' rather than building the
5952 (pop_type): Add format specifier in call to `error'.
5954 * parse.y (patch_method_invocation): Avoid casting away
5957 2001-03-28 Jeffrey Oldham <oldham@codesourcery.com>
5959 * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
5961 2001-03-28 Richard Henderson <rth@redhat.com>
5963 IA-64 ABI Exception Handling:
5964 * Make-lang.in (except.o): Don't depend on eh-common.h.
5965 * check-init.c (check_init): Handle EXC_PTR_EXPR.
5966 * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
5967 [soft_exceptioninfo_call_node]: Remove.
5968 [eh_personality_libfunc, lang_eh_runtime_type]: New.
5969 (end_java_method): No emit_handlers.
5970 * except.c (java_set_exception_lang_code): Remove.
5971 (method_init_exceptions): Don't call it.
5972 (prepare_eh_table_type): No CATCH_ALL_TYPE.
5973 (build_exception_object_ref): New.
5974 (expand_end_java_handler): Update for except.h name changes.
5975 (emit_handlers, expand_resume_after_catch): Remove.
5976 * expr.c (java_lang_expand_expr): Update for except.h name changes.
5977 (process_jvm_instruction): Use build_exception_object_ref.
5978 * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
5979 (soft_exceptioninfo_call_node): Remove.
5980 (build_exception_object_ref): Declare.
5981 * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
5982 soft_exceptioninfo_call_node. Move processing ...
5983 [EXC_PTR_EXPR]: ... here.
5984 * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
5985 * parse.y (catch_clause_parameter): Use build_exception_object_ref.
5986 (source_end_java_method): No java_set_exception_lang_code or
5988 (build_dot_class_method): Use build_exception_object_ref.
5989 (try_reference_assignconv): Check EXC_PTR_EXPR not
5990 soft_exceptioninfo_call_node.
5992 2001-03-28 Richard Henderson <rth@redhat.com>
5994 * java-tree.h (throw_node): Define as a single member of
5995 java_global_trees instead of a separate array.
5996 (JTI_THROW_NODE): New.
5997 * decl.c (throw_node): Don't declare.
5998 (init_decl_processing): Init a scalar throw_node.
5999 Don't register it for gc.
6000 * check-init.c (check_init): Reference scalar throw_node.
6001 * expr.c (build_java_athrow): Likewise.
6002 * jcf-write.c (generate_bytecode_insns): Likewise.
6003 * parse.h (BUILD_THROW): Likewise.
6005 2001-03-28 Richard Henderson <rth@redhat.com>
6007 * decl.c (end_java_method): Do not save and restore
6008 flag_non_call_exceptions.
6009 * parse.y (source_end_java_method): Likewise.
6010 * lang.c (flag_exceptions): Don't declare.
6011 (java_init_options): Set flag_non_call_exceptions. Set
6012 flag_exceptions here ...
6013 (java_init): ... not here.
6015 2001-03-27 Richard Henderson <rth@redhat.com>
6017 * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
6018 exceptions_via_longjmp.
6020 * lang.c (flag_new_exceptions): Don't declare it.
6021 (java_init_options): Or set it.
6023 2001-03-27 Richard Henderson <rth@redhat.com>
6025 * decl.c (end_java_method): Rename asynchronous_exceptions to
6026 flag_non_call_exceptions.
6027 * parse.y (source_end_java_method): Likewise.
6029 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6031 * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
6033 2001-03-26 Mark Mitchell <mark@codesourcery.com>
6035 * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
6037 2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com>
6039 * parse.y (find_as_inner_class): Follow current package
6040 indications not to mistakingly load an unrelated class.
6042 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6044 * constants.c (PUTN): Use memcpy, not bcopy.
6046 * lex.c (java_read_char): Use memmove, not bcopy.
6048 * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
6050 2001-03-23 Per Bothner <per@bothner.com>
6052 * verify.c (verify_jvm_instructions): Replace 3 pop_type by POP_TYPE
6053 macro for better error pin-pointing.
6054 * java-tree.h: Fix typo in comment.
6056 * jcf-write.c (generate_bytecode_insns): Changes to TRY_FINALLY_EXPR.
6057 Don't include jsr/goto in exception range.
6058 Check if start and end of exception range are the same (also TRY_EXPR).
6059 Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
6060 However, do emit the following goto even if try_block is empty.
6061 Defer freeing exception_decl until after the finalizer, to make
6062 sure the local isn't reused in the finalizer. Fixes PR java/1208.
6064 * parse.y (java_complete_lhs): If the try-clause is empty, just
6065 return the finally-clause and vice versa.
6067 2001-03-23 Alexandre Petit-Bianco <apbianco@redhat.com>
6069 * gcj.texi (Input Options): documented the check for attribute
6070 `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
6071 * java-tree.h (flag_force_classes_archive_check): Declared extern.
6072 * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
6073 (jcf_parse): Check for the right classes archive if necessary.
6074 * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
6075 (jcf_parse_fields): Fixed indentation.
6076 * jcf-write.c (append_gcj_attribute): New function.
6077 (generate_classfile): Compute the attribute count, invoke
6078 `append_gcj_attribute'.
6079 * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
6080 turned into bit-fields. New bit-field `right_zip.'
6081 (JCF_ZERO): Set `right_zip' to zero.
6082 * lang-options.h (-fforce-classes-archive-check): Added flag.
6083 * lang.c (flag_force_classes_archive_check): New flag.
6084 (lang_f_options): New entry `force-classes-archive-check.'
6087 2001-02-07 Andrew Haley <aph@redhat.com>
6089 * gcj.texi (Configure-time Options): Add -fcheck-references.
6090 * expr.c (build_java_indirect_ref): New function.
6091 (java_check_reference): New function.
6092 (build_java_array_length_access): Use build_java_indirect_ref to
6093 check for null references.
6094 (build_java_arrayaccess): Likewise.
6095 (build_get_class): Likewise.
6096 (build_field_ref): Likewise.
6097 (invoke_build_dtable): Likewise.
6098 (build_invokeinterface): Likewise.
6099 * lang.c (lang_f_options): Add flag_check_references.
6100 * jvspec.c (jvgenmain_spec): Add flag_check_references.
6101 * java-tree.h (flag_check_references): New variable.
6102 * lang.c (flag_check_references): Likewise.
6103 * parse.y (patch_invoke): Use java_check_reference.
6104 (patch_assignment): Allow for extra nesting in
6105 _Jv_CheckArrayStore.
6107 2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
6109 * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
6110 * lex.c (cxx_keywords): Likewise.
6112 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
6114 * parse.y (qualify_ambiguous_name): Broaden `length'
6115 recognition. Help MODIFY_EXPR be resolved as expression names.
6116 Fixes PR java/2066. Fixes PR java/2400.
6118 2001-03-21 Bryce McKinlay <bryce@albatross.co.nz>
6120 * gjavah.c (process_file): Mark interface definitions with
6121 "__attribute__ ((java_interface))".
6123 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
6125 * class.c (layout_class): Fixed push_super_field's second
6126 argument. Fixes PR java/2333.
6127 (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
6128 too early to lay innerclasses out.
6130 2001-03-20 Tom Tromey <tromey@redhat.com>
6131 Alexandre Petit-Bianco <apbianco@redhat.com>
6133 * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
6134 inside an array reference. Insertion of the array store check
6135 rewritten. Fixes PR java/2299.
6137 2001-03-20 Tom Tromey <tromey@redhat.com>
6139 * lex.c (java_read_unicode): Only accept leading `u's.
6141 2001-03-20 Tom Tromey <tromey@redhat.com>
6143 * jcf-parse.c (read_class): Initialize `class'.
6145 2001-03-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
6147 * jcf_parse.c (jcf_parse): Eliminate unused variable.
6149 2001-03-19 Mark Mitchell <mark@codesourcery.com>
6151 * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
6152 (layout_class): Likewise.
6153 (layout_class_method): Likewise.
6154 (emit_register_classes): Likewise.
6155 * decl.c (builtin_function): Likewise.
6156 (give_name_to_locals): Likewise.
6158 2001-03-19 Per Bothner <per@bothner.com>
6160 * jcf-parse.c (load_inner_classes): Check CLASS_LOADED_P
6161 before trying to load an inner class.
6163 Fixes to process to command-line .class files in two passes.
6164 * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P): New flags.
6165 (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P): Rename to ..
6166 (CLASS_FROM_CURRENTLY_COMPILED_P): ... because it is more general now.
6167 * class.c (is_compiled_class): Fix for renamed flag.
6168 * parse.y (maybe_create_class_interface_decl): Likewise.
6169 * jcf-parse.c (yyparse): Also set if compiling .class files.
6170 * jcf-parse.c (read_class); Read current_class.
6171 (jcf_parse): Make static.
6172 (load_inner_classes): New function, with code moved from jcf_parse,
6173 because we need to inner classes after the command-line files are read.
6174 (yyparse): Set finput to NULL when it doesn't need to be closed.
6175 Reduce use of main_jcf (basically only for archive) and
6176 use finput instead of main_jcf->read_state.
6177 Inline jcf_figure_file_type into yyparse.
6178 Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
6179 Defer load_inner_classes and parse_class_file to a second pass,
6180 after we've correctly mapped command-line .clas fiels to classes.
6181 (jcf_figure_file_type): Removed.
6182 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): Removed flags.
6183 (JCF_ZERO): Also clear zipd field.
6184 * zipfile.h: Conditionalize on JCF_H insread of JCF_ZIP.
6186 2001-03-18 Matt Kraai <kraai@alumni.carnegiemellon.edu>
6188 * jcf-parse.c (yyparse): Change ch from char * to char.
6190 2001-03-19 Per Bothner <per@bothner.com>
6192 * jvspec.c (lang_specific_driver): Check for .zip and .jar files.
6193 Add constructed filelist-file at end, following -xjava. Thus any .o
6194 and library files are not affected by the -xjava. Also wrap
6195 explicit @FILE with -xjava and -xnone.
6197 2001-03-19 Andrew Haley <aph@cambridge.redhat.com>
6199 * class.c (build_static_field_ref): Call make_decl_rtl() after
6200 setting the DECL_EXTERNAL flag.
6202 2001-03-17 Per Bothner <per@bothner.com>
6204 * decl.c (clear_binding_level): Fix initializer (broke 03-15).
6206 * jcf-write.c (generate_bytecode_insns): Handle emitting iinc
6207 when result is is needed (target is STACK_TARGET).
6209 * parse.h (JDEP_SOLV): Removed.
6210 * parse.y (register_incomplete_type): Use JDEP_TO_RESOLVE instead.
6212 * parse.y (incomplete_class_list): Removed.
6213 (obtain_incomplete_type): Don't use or set incomplete_class_list.
6214 It doesn't work if resolve_class changes the name of an array type
6215 that is on the list and then someone else looks for the modified name.
6216 Also, seems liable to break when compiling multiple source files at
6217 once. So the simplest is to just remove incomplete_class_list -
6218 it is only a minor space win and it is not even clear it saves time.
6220 * parse.y (resolve_class): Remove unneeded promote_type.
6222 2001-03-15 Per Bothner <per@bothner.com>
6224 * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
6225 * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
6226 * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
6227 Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
6229 * jcf-parse.c (yyparse): Set/reset input_filename for source file.
6230 * parse.y (java_expand_classes): Likewise.
6232 * parse.y (expand_start_java_method): Was only called once and had a
6233 misleading name, so inline in caller java_complete_expand_method.
6234 (enter_a_block): Likewise inline in enter_block and remove.
6236 Remove junk from when gcc/java was created (by copying from C/C++).
6237 * decl.c (keep_next_level_flag, keep_next_if_subblocks): Remove.
6238 (struct binding_level): Remove fields keep, keep_if_subblocks,
6239 more_cleanups_ok, have_cleanups (which have never been used).
6240 (pushlevel, poplevel): Remove related useless code.
6242 * class.c (make_class_data): The class_dtable_decl (i.e. the
6243 vtable for Class) should be external, except when compiling Class.
6245 * jvspec.c (lang_specific_driver): Fix -C handling.
6246 Check -save-temps to see if temp @FILE should be deleted.
6247 Follow-up to/fix for February 16 patch.
6249 * verify.c (verify_jvm_instructions): Better error msgs for dup.
6250 (type_stack_dup): Remove no-longer neded error check.
6252 2001-03-15 Bryce McKinlay <bryce@albatross.co.nz>
6254 * mangle.c (mangle_record_type): Rename 'from_pointer' argument
6255 to 'for_pointer'. If this type is for a pointer (argument) mangling,
6256 don't surround the element with 'N..E' if the type name is
6259 2001-03-14 Mark Mitchell <mark@codesourcery.com>
6261 * class.c (build_static_field_ref): Use COPY_DECL_RTL,
6262 DECL_RTL_SET_P, etc.
6263 (make_method_value): Likewise.
6264 (get_dispatch_table): Likewise.
6266 * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
6268 2001-03-07 Tom Tromey <tromey@redhat.com>
6270 * config-lang.in (lang_requires): Define.
6272 2001-03-07 Brad Lucier <lucier@math.purdue.edu>
6274 * typeck.c (convert): Check flag_unsafe_math_optimizations,
6277 2001-03-05 Per Bothner <per@bothner.com>
6279 Fix a problem where rest_of_decl_compilation applied to
6280 class_dtable_decl causes problems because it was done too early,
6281 before output file was opened.
6282 * decl.c (init_decl_processing): Remove init of class_dtable_decl.
6283 * class.c (class_dtable_decl): Add macro - element of class_roots.
6284 (make_class_data): Define class_dtable_decl.
6285 * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl): Removed.
6287 2001-03-01 Zack Weinberg <zackw@stanford.edu>
6289 * java/class.c, java/decl.c, java/java-tree.h: Replace all
6290 uses of 'boolean' with 'bool'.
6292 2001-03-01 Zack Weinberg <zackw@stanford.edu>
6294 * lang-specs.h: Add zero initializer for cpp_spec field to all
6297 2001-02-16 Per Bothner <per@bothner.com>
6299 Handle compiling multiple input files at once, and @FILE syntax.
6300 * gcj.texi: Updated documentation to match.
6301 * java-tree.h (flag_filelist_file, init_src_parse): New declarations.
6302 * jcf-parse.c (parse_source_file): Split into ...
6303 (parse_source_file_1): New function - and:
6304 (parse_source_file_2): New function.
6305 (yyparse): On -ffilelist-file, open and scan named file.
6306 On first pass over files, only do parse_source_file_1.
6307 A new second pass calls parse_source_file_2 for each file to compile.
6308 (init_jcf_parse): Call init_src_parse.
6309 * jvspec.c (INDIRECT_FILE_ARG): New flag.
6310 (lang_specific_driver): Support @FILELIST-FILE syntax, as well
6311 as multiple input file combined in one compilation.
6312 * lang-options.h: Add -ffilelist-file
6313 * lang.c (flag_filelist_file): New flag variable.
6314 (lang_f_options): Handle -ffilelist-file.
6315 * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
6316 * parse.h (struct parse_ctxt): Remove fields incomplete_class and
6317 gclass_list - use global fields of src_parse_roots instead.
6318 * parse.y (src_parse_roots): New array.
6319 (incomplete_class_list, gclass_list): New macros.
6320 (push_parser_context, java_pop_parser_context,
6321 java_parser_context_resume): Don't fiddle with deleted fields.
6322 (various): Use incomplete_class gclass_list and global macros
6323 instead of parse_ctxt fields - the lists are global.
6324 (init_src_parse): New function.
6326 2001-02-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6328 * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
6330 2001-02-20 Alexandre Petit-Bianco <apbianco@redhat.com>
6332 * parse.y (check_inner_class_access): Moved declaration of local
6333 `enclosing_decl_type' to the right location.
6335 2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
6337 * parse.y (parser_check_super_interface): Don't call
6338 check_pkg_class_access for an inner interface.
6339 (parser_check_super): Don't call check_pkg_class_access for inner
6341 (do_resolve_class): Simplify enclosing type loop. Don't call
6342 check_pkg_class_access if CL and DECL are not set.
6343 (find_in_imports_on_demand): Set DECL if class_type needed to be
6344 loaded. Don't call check_pkg_class_access for an inner class.
6345 (check_inner_class_access): Rewritten to implement member access
6346 rules as per spec 6.6.1.
6347 (check_pkg_class_access): Handle the empty package correctly.
6348 (in_same_package): New function. Determine if two classes are in the
6351 2001-02-18 Bryce McKinlay <bryce@albatross.co.nz>
6353 * typeck.c (build_java_array_type): Don't try to poke a public `clone'
6354 method into array types.
6355 * parse.y (patch_method_invocation): Bypass access check on clone call
6358 2001-02-15 Alexandre Petit-Bianco <apbianco@redhat.com>
6360 * expr.c (build_instanceof): Check for arrays when trying fold to
6363 2001-02-15 Jim Meyering <meyering@lucent.com>
6365 * Make-lang.in (java.install-common): Depend on `installdirs'.
6366 (java.install-info): Likewise.
6368 2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
6370 * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
6372 2001-02-14 Tom Tromey <tromey@redhat.com>
6373 Alexandre Petit-Bianco <apbianco@cygnus.com>
6375 Fix for PR java/1261.
6376 * typeck.c (build_java_array_type): Add public `clone' method to
6378 * parse.y (resolve_qualified_expression_name): Use current_class
6379 when checking for inaccessibility.
6380 (patch_method_invocation): Fixed error message when accessibility
6381 denied. Added `from_super' argument.
6383 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
6385 * parse.y (resolve_class): Don't build a fake decl. Use the one
6387 * typeck.c (build_java_array_type): Build and assign decl to array
6390 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
6392 * parse.y (not_accessible_p): Changed leading comment. Added extra
6393 `where' argument. Use it to enforce protected access rules.
6394 (resolve_qualified_expression_name): Added extra argument to
6396 (patch_method_invocation): Use argument `primary' to provide
6397 not_accessible_p with an extra argument.
6398 (lookup_method_invoke): Added extra argument to not_accessible_p.
6399 (search_applicable_method_list): Likewise.
6401 2001-02-13 Alexandre Petit-Bianco <apbianco@redhat.com>
6403 * parse.y (resolve_qualified_expression_name): Try to resolve as
6404 an inner class access only if `decl' is a TYPE_DECL.
6406 2001-02-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6408 * decl.c (classdollar_identifier_node): Initialize.
6409 * java-tree.h (enum java_tree_index): New entry
6410 `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
6411 (classdollar_identifier_node): New macro.
6412 (ID_CLASSDOLLAR_P): Likewise.
6413 * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
6414 (build_dot_class_method_invocation): Likewise.
6415 (find_applicable_accessible_methods_list): `class$' can't be
6418 2001-02-09 Raja R Harinath <harinath@cs.umn.edu>
6420 * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
6422 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6424 * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
6425 * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
6428 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6430 * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
6431 outside of the `__U' sequence too.
6432 (unicode_mangling_length): Count `_' or `U' outside of the `__U'
6435 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6437 * jvgenmain.c (error): Reversed 2001-02-01 deletion.
6439 2001-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
6441 * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
6442 (JVGENMAIN_OBJS): Likewise.
6443 * java-tree.h (append_gpp_mangled_name): New prototype.
6444 * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
6445 Removed cast calling `gcc_add_root.'
6446 * jvgenmain.c (mangle_obstack): New global, initialized.
6448 (do_mangle_class): Constify local `ptr.'
6449 Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
6450 append_gpp_mangle_name and update `count' if necessary.
6451 Use `mangle_obstack.'
6452 * mangle.c (append_unicode_mangled_name): Removed.
6453 (append_gpp_mangled_name): Likewise.
6454 (unicode_mangling_length): Likewise.
6455 (mangle_member_name): Return type set to `void.'
6456 (mangle_field_decl): Don't append `U' in escaped names.
6457 (mangle_method_decl): Likewise.
6458 (mangle_member_name): Just use `append_gpp_mangled_name.'
6459 * mangle_name.c: New file.
6461 2001-02-07 Per Bothner <per@bothner.com>
6463 * check-init.c (check_init): Fix TRY_FINALLY_EXPR logic.
6465 * check-init.c (check_init): Don't call done_alternative after
6466 processing loop code, as a LOOP_EXPR never terminates normally.
6468 2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
6470 * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
6472 2001-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
6474 * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
6477 2001-02-06 Tom Tromey <tromey@redhat.com>
6479 * lex.c (java_new_lexer): Longer error message.
6481 2001-02-05 Jeff Sturm <jeff.sturm@commerceone.com>
6482 Alexandre Petit-Bianco <apbianco@cygnus.com>
6484 * typeck.c (build_prim_array_type): Added leading comment.
6485 (build_java_array_type): Moved locals out of
6486 block. Always create the `data' field, fixed alignment to match
6489 2001-02-04 Tom Tromey <tromey@redhat.com>
6491 * expr.c (java_lang_expand_expr): Don't bother recomputing
6492 `length'. Use rest_of_decl_compilation, not make_decl_rtl.
6495 2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6497 * parse.y (process_imports): Save the original name of the import
6498 for better error report.
6500 2001-02-04 Bryce McKinlay <bryce@albatross.co.nz>
6502 * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
6503 of macros used when compiling jvspec.c.
6504 * jvspec.c (lang_specific_driver): Link with the shared
6507 2001-02-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6509 * check-init.c (check_init): Call internal_error instead of fatal.
6510 * expr.c (java_lang_expand_expr): Likewise.
6511 * jcf-parse.c (get_constant): Likewise.
6512 * mangle.c (java_mangle_decl): Likewise.
6513 * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
6514 (operator_string): Likewise.
6515 * check-init.c (check_init): Call abort instead of fatal.
6516 * class.c (build_class_ref): Likewise.
6517 * constants.c (write_constant_pool): Likewise.
6518 * decl.c (start_java_method): Likewise.
6519 * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
6520 (java_stack_dup, encode_newarray_type): Likewise.
6521 (build_java_array_length_access): Likewise.
6522 (build_java_check_indexed_type, expand_java_pushc): Likewise.
6523 (build_java_soft_divmod, build_invokeinterface): Likewise.
6524 * java-tree.h (INNER_CLASS_P): Likewise.
6525 * jcf-parse.c (parse_signature, get_name_constant): Likewise.
6526 (give_name_to_class, get_class_constant): Likewise.
6527 * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
6528 (find_constant_index, generate_bytecode_conditional): Likewise.
6529 (generate_bytecode_insns, perform_relocations): Likewise.
6530 * lex.c (java_unget_unicode, java_lex): Likewise.
6531 * mangle.c (mangle_type, mangle_record_type): Likewise.
6532 (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
6533 (finish_mangling): Likewise.
6534 * parse.h (MARK_FINAL_PARMS): Likewise.
6535 * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
6536 (obtain_incomplete_type, java_complete_class): Likewise.
6537 (java_check_regular_methods, java_complete_expand_method): Likewise.
6538 (cut_identifier_in_qualified, check_deprecation): Likewise.
6539 (patch_invoke, find_applicable_accessible_methods_list): Likewise.
6540 (java_complete_lhs, lookup_name_in_blocks): Likewise.
6541 (check_final_variable_indirect_assignment, build_unaryop): Likewise.
6542 * typeck.c (set_local_type, parse_signature_type): Likewise.
6543 (parse_signature_string, build_java_signature): Likewise;
6544 (set_java_signature): Likewise.
6545 * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
6546 * class.c (add_method): Call fatal_error instead of fatal.
6547 (build_static_field_ref): Likewise.
6548 * expr.c (build_known_method_ref, expand_invoke): Likewise.
6549 * jcf-parse.c (get_constant, jcf_parse): Likewise.
6550 * lex.c (java_new_new_lexer): Likewise.
6551 * jv-scan.c (main): Likewise.
6552 (fatal_error): Renamed from fatal.
6553 * jcf-parse.c (yyparse): Call fatal_io_error instead of
6555 * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
6556 (yyparse): Likewise.
6557 * jcf-write.c (make_class_file_name, write_classfile): Likewise.
6558 * lex.c (java_get_line_col): Likewise.
6559 * jcf-parse.c (load_class): Make errors non-fatal.
6560 * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
6562 2001-02-01 Bryce McKinlay <bryce@albatross.co.nz>
6564 * jvgenmain.c (class_mangling_suffix): Remove unused string.
6565 (error): Remove unused function.
6566 (main): Don't use "__attribute__ alias" on generated class symbol.
6568 2001-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
6570 * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
6572 * parse.y (finish_method_declaration): Code accounting for WFLed
6573 method DECL_NAMEs deleted.
6574 (check_abstract_method_definitions): Likewise.
6575 (resolve_type_during_patch): Layout resolved type.
6576 * typeck.c (lookup_do): Removed unused local.
6578 2001-01-30 Bryce McKinlay <bryce@albatross.co.nz>
6580 * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
6581 * decl.c (init_decl_processing): Use integer_minus_one_node, not
6582 integer_negative_one_node.
6583 * expr.c (build_java_binop): Likewise.
6585 2001-01-24 Jeff Sturm <jeff.sturm@commerceone.com>
6587 * zextract.c (read_zip_archive): Read file_offset before writing
6588 zipd and consequently clobbering the header contents.
6590 2001-01-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6592 * Make-lang.in: Remove all dependencies on defaults.h.
6593 * decl.c: Don't include defaults.h.
6595 * parse.y: Likewise.
6597 2001-01-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
6599 * ChangeLog (2001-01-21): Fixed typo.
6600 * class.c (layout_class_method): Code accounting for WFLed
6601 method DECL_NAMEs deleted.
6602 * constant.c (find_methodref_index): Likewise.
6603 * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
6604 * java-tree.h (DECL_FUNCTION_WFL): New macro.
6605 (struct lang_decl): New field `wfl'.
6606 (java_get_real_method_name): Prototype deleted.
6607 * mangle.c (mangle_method_decl): Code accounting for WFLed
6608 method DECL_NAMEs deleted.
6609 * parse.h (GET_METHOD_NAME): Macro deleted.
6610 * parse.y (reset_method_name): Deleted.
6611 (method_header): Set DECL_FUNCTION_WFL.
6612 (check_abstract_method_header): Code accounting for WFLed method
6614 (java_get_real_method_name): Deleted.
6615 (check_method_redefinition): Code accounting for WFLed method
6616 DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
6617 (java_check_regular_methods): Likewise.
6618 (java_check_abstract_methods): Likewise.
6619 (java_expand_classes): Don't call `reset_method_name.'
6620 (search_applicable_method_list): Use DECL_NAMEs instead of
6622 * typeck.c (lookup_do): Code accounting for WFLed method
6625 2001-01-25 Richard Earnshaw <rearnsha@arm.com>
6627 * lex.c (java_read_char): Check for EOF from getc first.
6629 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
6631 * class.c (layout_class): Don't lay the superclass out if it's
6632 already being laid out.
6633 * jcf-parse.c (handle_innerclass_attribute): New function.
6634 (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
6635 handle_innerclasses_attribute.
6636 (jcf_parse): Don't load an innerclasses if it's already being
6638 * jcf-write.c (append_innerclass_attribute_entry): Static
6639 `anonymous_name' and its initialization deleted. `ocii' and `ini'
6640 to be zero for anonymous classes.
6642 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
6644 * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
6646 * jcf-parse.c (set_source_filename): Use
6647 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
6649 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
6651 * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
6652 gets a unique asm name.
6654 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
6656 * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
6657 (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
6659 (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
6660 * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
6661 * parse.y (lookup_package_type_and_set_next): Deleted.
6662 (resolve_package): Removed unnecessary code.
6663 (find_applicable_accessible_methods_list): `finit$' can't be
6665 * verify.c (pop_argument_types): Added missing prototype.
6667 2001-01-23 Bryce McKinlay <bryce@albatross.co.nz>
6669 * config-lang.in: Disable java by default.
6671 2001-01-23 Tom Tromey <tromey@redhat.com>
6673 * gcj.texi (Copying): New node.
6674 Added copyright information.
6676 2001-01-21 Per Bothner <per@bothner.com>
6678 Various fixes to allow compiling a compressed .jar/.zip archive.
6679 * zipfile.h (struct ZipFileCache): Replace by struct ZipFile.
6680 (struct ZipFile): Add fields name and next (from ZipFileCache).
6681 (struct ZipDirectory): New field zipf points to owning ZipFile.
6682 * jcf.h (struct ZipDirectory): Add forward declaration.
6683 (struct JCF): Declare zipd field to have type struct ZipDirectory.
6684 Remove seen_in_zip and zip_offset fields.
6685 (JCF_SEEN_IN_ZIP): New macro.
6686 * zextract.c (read_zip_archive): Set ZipDirectory's zipf field.
6687 * jcf-io.c: Change all ZipFileCache to ZipFile.
6688 (read_zip_member): New function.
6689 (open_in_zip): Call read_zip_member.
6690 * jcf-parse.c (find_in_current_zip): Remove function.
6691 (read_class): Merge in find_in_current_zip functionality.
6692 Call read_zip_member if needed.
6693 (parse_zip_file_entries): Use read_zip_member.
6694 (process_zip_dir): Update for removed and added JCF fields.
6695 (jcf_figure_file_type): Re-use, don't copy initial ZipFile struct.
6697 2001-01-21 Per Bothner <per@bothner.com>
6699 Minor optimization of static ggc roots.
6700 * jcf-parse.c (parse_roots): New static field.
6701 (current_field, current_method, current_file_list): Replace by macros
6702 naming fields of parse_roots.
6703 (init_jcf_parse): Combine 3 ggc_add_tree_root calls to 1.
6704 * class.c (class_roots): New static field.
6705 (registered_class, fields_ident, info_ident, class_list):
6706 New macros naming fields of parse_roots.
6707 (build_static_field_ref): Don't register roots here.
6708 (layout_class): Static field list replaced by macro class_list.
6709 (init_class_processing): Call ggc_add_tree_root for 4 roots.
6710 Initialize fields_ident and info_ident here.
6712 2001-01-21 Per Bothner <per@bothner.com>
6714 * jcf-parse.c (ggc_mark_jcf): New function.
6715 (init_jcf_parse): Register current_jcf as ggc root.
6717 2001-01-21 Per Bothner <per@bothner.com>
6719 * lang.c (put_decl_node): Print method's name.
6721 2001-01-21 Per Bothner <per@bothner.com>
6723 * verify.c (VERIFICATION_ERROR_WITH_INDEX): New macro.
6724 (verify_jvm_instructions): Use it, for better error messages on loads.
6726 2001-01-21 Per Bothner <per@bothner.com>
6728 * verify.c (merge_type_state): Still may have to merge even if
6729 LABEL_VERIFIED (label).
6731 2001-01-21 Per Bothner <per@bothner.com>
6733 * parse.y (method_header): Don't set the DECL_NAME of a FUNCTION_DECL
6734 to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
6736 2001-01-19 Per Bothner <per@bothner.com>
6738 * expr.c (pop_type_0): Only return object_ptr_type_node on mismatch
6739 if expeting an interface type. Refines Tom's change of 2000-09-12.
6741 2001-01-18 Per Bothner <per@bothner.com>
6743 * gcj.texi (Input Options): Mention .java files.
6745 2001-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
6747 * lang-options.h (-Wunsupported-jdk11): Removed.
6748 * lang.c (flag_not_overriding): Deleted.
6749 (flag_static_local_jdk1_1): Likewise.
6750 (lang_W_options): Removed "unsupported-jdk11" entry.
6751 * parse.y (java_check_methods): Removed dead code.
6753 2001-01-17 Tom Tromey <tromey@redhat.com>
6755 Changes suggested by Per Bothner:
6756 * gcj.texi (Input Options): Don't mention input files.
6757 (Code Generation): Updated --main information.
6758 (Invoking jcf-dump): Mention that --javap is incomplete.
6759 From Alexandre Petit-Bianco:
6760 (Warnings): Don't mention -Wunsupported-jdk11.
6762 (Compatibility): Mention JDK 1.2-ness of libraries.
6763 (Resources): Mention resources used when writing gcj.
6765 2001-01-17 Tom Tromey <tromey@redhat.com>
6767 * gcj.texi: New file.
6768 * Make-lang.in ($(srcdir)/java/gcj.info): New target.
6769 (java.info): Depend on gcj.info.
6770 (java/gcj.dvi): New target.
6771 (java.dvi): Depend on gcj.dvi.
6772 (java.install-info): Wrote.
6774 2001-01-16 Jeff Sturm <jeff.sturm@appnet.com>
6776 * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
6777 having called make_decl_rtl.
6779 2001-01-14 Per Bothner <per@bothner.com>
6781 Various patches to emit better messages on verification errors.
6782 * expr.c (push_type_0): Return error indication on stack overflow,
6783 instead of callinfg fatal.
6784 (push_type): Now just call push_type_0 (nd fatal on overflow).
6785 (pop_type_0): Return detailed error message (in a char** argument).
6786 (pop_type): If pop_type_0 fails, print error message.
6787 (pop_argument_types): Moved to verify.c.
6788 * verify.c (pop_argument_types): Moved from expr.c.
6789 Return a (possible) error message, rather than void.
6790 (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING): New macros.
6791 (verify_jvm_instruction): Use new macros, improving error messages.
6792 For case OPCODE_astore use object_ptr_type_node.
6793 * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED): New macros.
6794 (pop_type_0, push_type_0, pop_argument_types): Update accordingly.
6796 * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
6797 constant, return body without wrapper. (Improves constant folding.)
6798 * lex.c (build_wfl_node): Clear TREE_TYPE from returned node.
6800 2001-01-13 Per Bothner <per@bothner.com>
6802 * expr.c (expand_java_field_op): Assigning to a final field outside
6803 an initializer does not violate JVM spec, so should be warning, not
6804 error. (Sun's verifier does not complain - though MicroSoft's does.)
6806 2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk>
6808 * gjavah.c (version), jcf-dump.c (version): Update copyright year
6811 2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
6813 * parse.y (resolve_expression_name): Permit instance variables from
6814 enclosing context in super constructor call.
6815 (resolve_qualified_expression_name): Permit enclosing class's qualified
6816 "this" in super constructor call.
6818 2001-01-10 Mark Mitchell <mark@codesourcery.com>
6820 * class.c (build_utf8_ref): Remove last argument in call to
6821 make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
6822 (build_class_ref): Likewise.
6823 (build_static_field_ref): Likewise.
6824 (get_dispatch_table): Likewise.
6825 (layout_class_method): Likewise.
6826 (emit_register_classes): Likewise.
6827 * constants.c (build_constant_data_ref): Likewise.
6828 * decl.c (builtin_function): Likewise.
6829 (create_primitive_vtable): Likewise.
6830 * expr.c (build_known_method_def): Likewise.
6831 (build_jni_stub): Likewise.
6832 (java_lang_expand_expr): Likewise.
6834 2001-01-10 Tom Tromey <tromey@redhat.com>
6836 * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
6838 2001-01-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
6840 * java-tree.h (lang_printable_name_wls): New prototype.
6841 * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
6842 rather than `current_class' to print type name. Don't prepend type
6843 names when printing constructor names.
6844 (lang_printable_name_wls): New function.
6845 * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
6846 `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
6847 * parse.y (patch_method_invocation): Message tuned for constructors.
6848 (not_accessible_p): Grant `private' access from within
6851 2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
6853 All files with updated copyright when applicable.
6854 * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
6855 * class.c (mangle_class_field): Function removed.
6856 (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
6857 (utf8_cmp, cxx_keyword_p): Moved to lex.c.
6858 (build_class_ref): Call `java_mangle_class_field' instead of
6859 `mangle_class_field.'
6860 (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
6861 (layout_class): Call `java_mangle_decl' instead of
6862 `mangle_static_field.'
6863 (cxx_keywords): Initialized static array moved to `lex.c.'
6864 (layout_class_method): Changed leading comment. Simplified to
6865 call `java_mangle_decl.' Local `ptr' moved in for loop body.
6866 * decl.c (lang_mark_tree): Mark field `package_list.'
6867 * java-tree.h (TYPE_PACKAGE_LIST): New macro.
6868 (struct lang_type): New field `package_list.'
6869 (unicode_mangling_length): Prototype removed.
6870 (append_gpp_mangled_name, append_gpp_mangled_classtype,
6871 emit_unicode_mangled_name): Likewise.
6872 (cxx_keyword_p): New prototype.
6873 (java_mangle_decl, java_mangle_class_field,
6874 java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
6875 * jcf-parse.c (jcf_parse_source): Constify `file' argument to
6877 * jvgenmain.c (main_method_prefix): Global variable removed.
6878 (main_method_suffix): Likewise.
6879 (do_mangle_classname): New function.
6880 (main): Call it. Format changed to accommodate new mangling scheme.
6881 * lex.c: (utf8_cmp): Conditionally prototyped.
6882 (cxx_keywords): Moved from class.c, conditionally defined.
6883 (utf8_cmp, cxx_keyword_p): Likewise.
6884 * mangle.c (obstack.h, ggc.h): Included.
6885 (mangle_field_decl): New function.
6886 (mangle_method_decl, mangle_type, mangle_pointer_type,
6887 mangle_array_type, mangle_record_type,
6888 find_compression_pointer_match, find_compression_array_match,
6889 find_compression_record_match,
6890 find_compression_array_template_match, set_type_package_list,
6891 entry_match_pointer_p, emit_compression_string, init_mangling,
6892 finish_mangling, compression_table_add, mangle_member_name): Likewise.
6893 (mangle_obstack): New global.
6894 (MANGLE_RAW_STRING): New macro.
6895 (unicode_mangling_length): Turned static.
6896 (append_unicode_mangled_name): Renamed from
6897 `emit_unicode_mangled_name.' Turned static. `mangle_obstack'
6898 replaces `obstack', removed from the parameter list.
6899 (append_gpp_mangled_name): Turned static. `mangle_obstack'
6900 replaces parameter `obstack', removed from the parameter list. Call
6901 `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
6902 (append_gpp_mangled_classtype): Removed.
6903 (compression_table, compression_next): New static variables.
6904 * parse.y (temporary_obstack): Extern declaration removed.
6906 2001-01-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6908 * parse.y (patch_binop): Compute missing type in error situations.
6910 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
6912 * class.c (make_class_data): Push initial value for "arrayclass".
6913 * decl.c (init_decl_processing): Add new class field "arrayclass".
6915 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
6917 From patha@softlab.ericsson.se:
6918 * parse.y (switch_label): Use build, not build1, to construct
6921 2001-01-04 Neil Booth <neil@daikokuya.demon.co.uk>
6923 * lang.c (lang_decode_option): Change -MA to -MP.
6924 * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
6925 Update to new prototype; do quote targets.
6926 (jcf_dependency_write): Update.
6928 2000-12-22 Bryce McKinlay <bryce@albatross.co.nz>
6930 Shorten primitive array allocation path:
6931 * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
6932 to create new primitive arrays.
6933 * expr.c (build_newarray): If generating native code, call
6934 soft_newarray_node with a reference to the primitive TYPE identifier
6935 instead of type_value.
6937 2000-12-17 Bryce McKinlay <bryce@albatross.co.nz>
6939 Fix for PRs gcj/312 and gcj/253:
6940 * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
6941 dest if they arn't already.
6942 * class.c (layout_class): Call maybe_layout_super_class on
6943 superinterfaces also, but only if compiling from bytecode.
6946 * parse.y (create_class): Set ACC_STATIC if class is declared in an
6949 2000-12-15 Tom Tromey <tromey@redhat.com>
6951 * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
6954 2000-12-14 Andrew Haley <aph@redhat.com>
6956 * boehm.c (mark_reference_fields): Change test to correctly detect
6959 2000-12-15 Andreas Jaeger <aj@suse.de>
6961 * config-lang.in (lang_dirs): Added.
6963 2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
6965 * parse.y (end_artificial_method_body): Fixed undefined behavior.
6966 Credits go to rth for finding it.
6968 2000-12-13 Mike Stump <mrs@wrs.com>
6970 * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
6972 2000-11-07 Tom Tromey <tromey@cygnus.com>
6974 * Make-lang.in (JAVA_LEX_C): Added chartables.h.
6975 * lex.c (java_ignorable_control_p): Removed.
6976 (java_letter_or_digit_p): Removed.
6977 (java_start_char_p): New function.
6978 (java_read_char): Return `int', not `unicode_t'. Changed
6980 (java_read_unicode): Likewise.
6981 (java_read_unicode_collapsing_terminators): Likewise.
6982 (java_get_unicode): Likewise.
6983 (java_new_lexer): Initialize hit_eof.
6984 (java_parse_end_comment): Take `int' argument.
6985 (java_parse_doc_section): Likewise.
6986 (java_parse_escape_sequence): Don't allow backlash-newline.
6988 * lex.h (JAVA_DIGIT_P): Removed.
6989 (_JAVA_LETTER_OR_DIGIT_P): Removed.
6990 (_JAVA_IDENTIFIER_IGNORABLE): Removed.
6991 (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
6992 (JAVA_PART_CHAR_P): New macro.
6994 (JAVA_CHAR_ERROR): Now -2.
6995 (java_lexer): New field `hit_eof'.
6996 * chartables.h: New file.
6997 * gen-table.pl: new file.
6999 2000-11-20 Tom Tromey <tromey@cygnus.com>
7000 Alexandre Petit-Bianco <apbianco@cygnus.com>
7002 * parse.y (java_complete_lhs): Only allow compound assignment of
7003 reference type if type is String.
7005 2000-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
7007 * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
7008 jcf-path.c: Likewise.
7010 2000-12-09 Anthony Green <green@redhat.com>
7012 * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
7013 filestart and filename_length as int values.
7015 2000-12-07 Mo DeJong <mdejong@redhat.com>
7017 * jcf-io.c (find_class): Correct the logic that tests to see if a
7018 .java file is newer than its .class file. The compiler was
7019 incorrectly printing a warning when file mod times were equal.
7021 2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
7023 * jvgenmain.c: Use ISPRINT not isascii.
7025 2000-12-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
7027 * parse.y (end_artificial_method_body): Fixed typo.
7029 2000-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
7031 * parse.y (patch_method_invocation): Pick the correct enclosing
7032 context when creating inner class instances.
7035 2000-11-26 Joseph S. Myers <jsm28@cam.ac.uk>
7037 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
7038 Update copyright year to 2000.
7040 2000-11-23 Anthony Green <green@redhat.com>
7042 * jcf-parse.c (init_jcf_parse): Register current_file_list root.
7043 Move current_file_list out of yyparse and make it static.
7045 * expr.c: Declare quick_stack and tree_list_free_list as static
7046 (init_expr_processing): Register quick_stack and
7047 tree_list_free_list roots.
7049 2000-11-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
7051 * parse.y (build_outer_field_access): New local `decl_ctx', use
7052 it. Check for field's context and current class immediate outer
7053 context inheritance.
7054 (outer_field_access_p): Consider fields inherited from the last
7056 (build_access_to_thisn): Stop at the last enclosing context if
7060 2000-11-23 J"orn Rennecke <amylaar@redhat.com>
7062 * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
7064 2000-11-22 Bryce McKinlay <bryce@albatross.co.nz>
7066 * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
7069 2000-11-20 Tom Tromey <tromey@cygnus.com>
7071 * jv-scan.c (help): Document --complexity.
7072 (options): Added --complexity.
7073 (flag_complexity): New global.
7074 (main): Call `report'.
7075 * parse-scan.y (complexity): New global.
7076 (if_then_statement, if_then_else_statement,
7077 if_then_else_statement_nsi, switch_block_statement_group,
7078 while_expression, do_statement, for_begin, continue_statement,
7079 throw_statement, catch_clause, finally, method_invocation,
7080 conditional_and_expression, conditional_or_expression,
7081 conditional_expression): Update complexity.
7082 (reset_report): Reset complexity.
7083 (report): New function.
7085 2000-11-20 Tom Tromey <tromey@cygnus.com>
7087 * lex.c (yylex): Added STRICT_TK case.
7088 * parse.y (STRICT_TK): Added.
7089 * parse-scan.y (STRICT_TK): Added.
7090 * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
7091 `;'. Use 4, not 3, with -k option. Correctly rename resulting
7093 * keyword.h: Rebuilt.
7094 * keyword.gperf (strictfp): Added.
7096 2000-11-20 Tom Tromey <tromey@cygnus.com>
7098 * lex.c (yylex): Recognize floating point constants with leading
7101 2000-11-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7103 * java-tree.h (cyclic_inheritance_report): Constify.
7104 * parse.y (cyclic_inheritance_report): Likewise.
7106 2000-11-17 Zack Weinberg <zack@wolery.stanford.edu>
7108 * parse.y (goal): Remove call to ggc_add_string_root.
7110 2000-11-16 Zack Weinberg <zack@wolery.stanford.edu>
7112 * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
7113 Create string in scratch buffer, then pass to build_string.
7115 2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
7117 * parse.y (issue_warning_error_from_context): Add
7120 2000-11-11 Anthony Green <green@redhat.com>
7122 * jcf-parse.c (process_zip_dir): Add finput parameter.
7123 (jcf_figure_file_type): Call process_zip_dir with appropriate
7126 2000-11-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7128 * decl.c (copy_lang_decl): Use memcpy, not bcopy.
7129 * jcf-parse.c (jcf_figure_file_type): Likewise.
7131 2000-11-09 Joseph S. Myers <jsm28@cam.ac.uk>
7133 * parse.y (create_new_parser_context): Use memset () instead of
7136 2000-11-08 Tom Tromey <tromey@cygnus.com>
7138 * gjavah.c (process_file): Only include gcj/cni.h when generating
7141 2000-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
7143 * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
7144 (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
7145 instead of bzero ().
7147 2000-11-05 Tom Tromey <tromey@cygnus.com>
7149 * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
7150 * lex.c (IS_ZERO): New define.
7151 (java_perform_atof): Error on floating point underflow.
7153 2000-11-04 Tom Tromey <tromey@cygnus.com>
7155 * lex.c (java_parse_escape_sequence): Only read two octal
7156 characters if the first one is greater than 3. Don't allow
7157 "octal" numbers to include the digits 8 or 9.
7159 2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
7161 * Make-lang.in (java.distdir): Remove.
7163 2000-11-03 Tom Tromey <tromey@cygnus.com>
7165 * Make-lang.in (java.dvi): New target.
7166 Partial fix for PR other/567.
7168 * lang-options.h: Mention -Wout-of-date.
7169 * jcf-dump.c (flag_newer): New global.
7170 * gjavah.c (flag_newer): New global.
7171 * jcf-io.c (find_class): Only warn when flag_newer set.
7172 * lang.c (flag_newer): New global.
7173 (struct string_option): New declaration.
7174 (lang_W_options): New global.
7175 (process_option_with_no): New function.
7176 (lang_decode_option): Use it.
7178 * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
7179 * gjavah.c (cxx_keyword_subst): Handle any number of trailing
7182 * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
7183 (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
7184 * lex.c (java_read_unicode): Removed `term_context' argument.
7185 Recognize any number of `u' in `\u'.
7186 (java_read_unicode_collapsing_terminators): New function.
7187 (java_get_unicode): Use it.
7188 (java_lineterminator): Removed.
7189 (yylex): Produce error if character literal is newline or single
7190 quote. Return if eof found in middle of `//' comment. EOF in
7191 `//' comment is only an error if pedantic.
7192 (java_ignorable_control_p): New function.
7193 (java_parse_end_comment): Return if eof found in middle of
7196 * jv-scan.c (pedantic): New global.
7198 2000-10-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
7200 * parse.y (outer_field_access_p): Inherited fields aren't
7201 consider outer fields.
7202 (maybe_build_thisn_access_method): Use
7203 PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
7204 (resolve_expression_name): Trigger an error if a static field
7205 is being accessed as an outer field.
7207 2000-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
7209 * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
7212 2000-10-27 Zack Weinberg <zack@wolery.stanford.edu>
7214 * Make-lang.in: Move all build rules here from Makefile.in,
7215 adapt to new context. Wrap all rules that change the current
7216 directory in parentheses. Expunge all references to $(P).
7217 When one command depends on another and they're run all at
7218 once, use && to separate them, not ;. Add OUTPUT_OPTION to
7219 all object-file generation rules. Delete obsolete variables.
7221 * Makefile.in: Delete.
7222 * config-lang.in: Delete outputs= line.
7224 2000-10-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
7226 * parse.y (patch_method_invocation): NULLify this_arg when already
7228 (maybe_use_access_method): Handle call to methods unrelated to the
7229 current class. Fixed comment.
7232 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
7234 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
7237 2000-10-24 Tom Tromey <tromey@cygnus.com>
7239 * lex.c (java_new_lexer): Initialize new fields. Work around
7240 broken iconv() implementations.
7241 (java_read_char): Swap bytes if required. Use fallback decoder if
7243 (byteswap_init, need_byteswap): New globals.
7244 (java_destroy_lexer): Only close iconv handle if it is in use.
7245 * lex.h (java_lexer): New fields read_anything, byte_swap,
7247 Made out_buffer unsigned.
7249 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
7251 * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
7252 where an enclosing context can be set on the jdep.
7253 (do_resolve_class): Fixed identation.
7255 2000-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7257 * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
7259 * jcf-reader.c (peek_attribute, skip_attribute): Only define
7262 * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
7264 * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
7266 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
7268 * jcf-write.c (OP1): Update `last_bc'.
7269 (struct jcf_block): Fixed indentation and typo in comments. New
7271 (generate_bytecode_insns): Insert `nop' if `jsr' immediately
7272 follows `monitorenter'.
7273 * parse.y (patch_synchronized_statement): New local `tmp'. Call
7277 2000-10-16 Tom Tromey <tromey@cygnus.com>
7279 * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
7280 * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
7281 * lang-options.h: Added -MA, -MT, -MF..
7282 * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
7283 (DEPEND_TARGET_SET): New macro.
7284 (DEPEND_FILE_ALREADY_SET): Likewise.
7285 (init_parse): Handle new flags.
7286 * jcf.h (jcf_dependency_print_dummies): Declare.
7287 * Make-lang.in (s-java): Added mkdeps.o.
7288 * Makefile.in (BACKEND): Added mkdeps.o.
7289 (../gcjh$(exeext)): Added mkdeps.o.
7290 (../jcf-dump$(exeext)): Added mkdeps.o.
7291 * jcf-depend.c: Include mkdeps.h.
7292 (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
7293 add_entry): Removed.
7294 (jcf_dependency_reset): Rewrote.
7295 (dependencies): New global.
7296 (jcf_dependency_set_target): Rewrote.
7297 (jcf_dependency_add_target): Likewise.
7298 (jcf_dependency_add_file): Likewise.
7300 (print_ents): Removed.
7301 (jcf_dependency_write): Rewrote.
7302 (print_dummies): New global.
7303 (jcf_dependency_print_dummies): New function
7304 (jcf_dependency_write): Call deps_dummy_targets if required.
7306 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
7308 * gjavah.c (add_class_decl): Removed unused variables `tname',
7309 `tlen' and `name_index'.
7310 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
7311 * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
7312 in `wfl_operator' with value.
7313 (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
7314 (jcf_figure_file_type): Fixed identation.
7315 * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
7316 * parse.y (analyze_clinit_body): New function.
7317 (static_initializer:): Reset `current_static_block'.
7318 (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
7319 `wfl_operator' with new value.
7320 (lookup_cl): Use EXPR_WFL_FILENAME.
7321 (maybe_yank_clinit): Handle bogus <clinit> bodies, call
7322 analyze_clinit_body.
7323 (build_outer_field_access): Access to this$<n> built from
7324 current_class, not its outer context.
7325 (build_access_to_thisn): Fixed leading comment. Tidied things up.
7326 (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
7327 (patch_method_invocation): Use `is_static_flag' when already
7329 (patch_newarray): Removed assignment in ternary operator.
7331 2000-10-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
7333 * except.c (free_eh_ranges): Don't free `whole_range'.
7335 2000-10-15 Anthony Green <green@redhat.com>
7337 * decl.c (init_decl_processing): Call init_class_processing before
7340 2000-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
7342 * check-init.c (check_init): Fixed leading comment. Use
7344 * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
7345 (give_name_to_locals): Likewise.
7346 (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
7347 fields in lang_decl_var.
7348 * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
7349 DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
7350 (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
7351 (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
7352 DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
7353 (LOCAL_FINAL): Rewritten.
7354 (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
7355 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
7356 (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
7357 `init_final' fields.
7358 (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
7359 `final_uid', `final_liic', `final_ierr' and `local_final' fields.
7360 (TYPE_HAS_FINAL_VARIABLE): New macro.
7361 (struct lang_type): Added `afv' field.
7362 * parse.y (check_static_final_variable_assignment_flag): New function.
7363 (reset_static_final_variable_assignment_flag): Likewise.
7364 (check_final_variable_local_assignment_flag): Likewise.
7365 (reset_final_variable_local_assignment_flag): Likewise.
7366 (check_final_variable_indirect_assignment): Likewise.
7367 (check_final_variable_global_assignment_flag): Likewise.
7368 (add_inner_class_fields): Use LOCAL_FINAL_P.
7369 (register_fields): Handle local finals and final variables.
7370 (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
7371 (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
7372 (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
7374 (java_complete_expand_methods): Loop to set
7375 TYPE_HAS_FINAL_VARIABLE. Call
7376 `reset_final_variable_local_assignment_flag' and
7377 `check_final_variable_local_assignment_flag' accordingly before
7378 and after constructor expansion. Call
7379 `reset_static_final_variable_assignment_flag'
7380 before expanding <clinit> and after call
7381 `check_static_final_variable_assignment_flag' if the
7382 current_class isn't an interface. After all methods have been
7383 expanded, call `check_final_variable_global_assignment_flag' and
7384 `check_static_final_variable_assignment_flag' if the current class
7386 (maybe_yank_clinit): Fixed typo in comment.
7387 (build_outer_field_access_methods): Removed old sanity check. Use
7388 FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
7389 Don't create access methods for finals.
7390 (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
7391 (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
7392 existing DECL_INIT has been processed.
7393 (java_complete_lhs): Likewise.
7394 (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
7395 Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
7397 (patch_assignment): Use LOCAL_FINAL_P.
7398 (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
7399 DECL_INITIAL is nullified.
7402 2000-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7404 * Make-lang.in (parse.c, parse-scan.c): Create atomically.
7406 * Makefile.in (parse.c, parse-scan.c): Likewise.
7408 2000-10-12 Mark Mitchell <mark@codesourcery.com>
7410 * class.c (temporary_obstack): Remove.
7411 (make_class): Don't mess with obstascks.
7412 (push_class): Likewise.
7413 (set_super_info): Likewise.
7414 (add_method_1): Likewise.
7415 (add_method): Likewise.
7416 (add_field): Likewise.
7417 (build_utf8_ref): Likewise.
7418 (build_class_ref): Likewise.
7419 (build_static_field_ref): Likewise.
7420 (finish_class): Likewise.
7421 (push_super_field): Likewise.
7422 (layout_class): Likewise.
7423 (layout_class_methods): Likewise.
7424 (init_class_processing): Likewise.
7425 * constants.c (get_tag_node): Likewise.
7426 (build_constant_data_ref): Likewise.
7427 * decl.c (ggc_p): Remove.
7428 (copy_lang_decl): Use ggc_alloc.
7429 (complete_start_java_method): Don't mess with obstacks.
7430 (start_java_method): Likewise.
7431 (end_java_method): Likewise.
7432 * except.c (link_handler): Use xmalloc.
7433 (free_eh_ranges): New function.
7434 (method_init_exceptions): Use it.
7435 (add_handler): Use xmalloc.
7436 (expand_start_java_handler): Don't mess with obstacks.
7437 (prepare_eh_table_type): Likewise.
7438 (expand_end_java_handler): Likewise.
7439 * expr.c (push_value): Likewise.
7440 (create_label_decl): Likewise.
7441 (build_jni_stub): Likewise.
7442 (java_lang_expand_expr): Likewise.
7443 (note_instructions): Use xrealloc.
7444 (java_push_constant_from_pool): Don't mess with obstacks.
7445 (process_jvm_instruction): Likewise.
7446 * java-tree.h (cyclic_inheritance_report): Remove duplicate
7448 * jcf-parse.c (get_constant): Don't mess with obstacks.
7449 (read_class): Likewise.
7450 (jcf_parse): Likewise.
7451 * lex.c (expression_obstack): Remove.
7452 (java_lex): Don't use obstack_free.
7453 * parse.h (exit_java_complete_class): Don't mess with obstacks.
7454 (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
7455 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
7456 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
7457 * parse.y (gaol): Add more GC roots.
7458 (add_inner_class_fields): Adjust calls to MANGLE_* macros.
7459 (lookup_field_wrapper): Likewise.
7460 (obtain_incomplete_type): Don't mess with obstacks.
7461 (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
7463 (craft_constructor): Don't mess with obstacks.
7464 (safe_layout_class): Likewise.
7465 (java_complete_class): Likewise.
7466 (source_end_java_method): Likewise.
7467 (build_outer_field_access_methods): Likewise.
7468 (build_outer_method_access_method): Likewise.
7469 (maybe_build_thisn_access_method): Likewise.
7470 (build_dot_class_method_invocation): Likewise.
7471 (java_complete_tree): Likewise.
7472 (java_complete_lhs): Likewise.
7473 (do_merge_string_cste): Likewise.
7474 (patch_string_cst): Likewise.
7475 (array_constructor_check_entry): Likewise.
7476 * typeck.c (build_java_array_type): Likewise.
7477 (parse_signature_string): Likewise.
7478 (build_java_signature): Likewise.
7480 2000-10-12 Tom Tromey <tromey@cygnus.com>
7483 * gjavah.c (add_class_decl): Don't special-case inner classes.
7484 (add_namelet): Likewise.
7486 2000-10-11 Rodney Brown <RodneyBrown@mynd.com>
7488 * java-tree.h: Constify current_encoding.
7489 * lang.c: Constify current_encoding.
7491 2000-10-10 Jeff Sturm <jeff.sturm@appnet.com>
7493 * jvgenmain.c (class_mangling_suffix): Omit `.'.
7494 (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
7496 2000-10-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7498 * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
7499 patch. Fixes gcj/340.
7501 2000-10-10 Tom Tromey <tromey@cygnus.com>
7503 * lex.c (java_new_lexer): Initialize out_first and out_last
7505 * lex.h (java_lexer): Added out_buffer, out_first, out_last.
7507 2000-10-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
7509 * parse.y (pop_current_osb): New function.
7510 (array_type:): Use `dims:', changed actions
7511 accordingly. Suggested by Anthony Green.
7512 (array_creation_expression:): Used pop_current_osb.
7513 (cast_expression:): Likewise.
7514 (search_applicable_method_list): Fixed indentation.
7516 2000-10-08 Anthony Green <green@redhat.com>
7518 * parse.y (array_type_literal): Remove production.
7519 (type_literals): Refer to array_type, not array_type_literal.
7521 2000-10-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7523 Patch contributed by Corey Minyard.
7524 * decl.c (check_local_named_variable): New function.
7525 (tree check_local_unnamed_variable): Likewise.
7526 (find_local_variable): Splitted. Call check_local_{un}named_variable.
7528 2000-10-07 Anthony Green <green@redhat.com>
7530 * class.c (layout_class): Handle case where superclass can't be
7533 2000-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
7535 * Makefile.in (keyword.h): Refer to GNU FTP site for updated
7538 2000-10-05 Tom Tromey <tromey@cygnus.com>
7540 * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
7541 * jvgenmain.c (class_mangling_prefix): Removed.
7542 (class_mangling_suffix): New global.
7544 * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
7546 (print_method_info): Handle overrides for static and final
7548 (process_file): Generate declaration for class object field.
7549 * class.c (cxx_keywords): New array.
7550 (utf8_cmp): New function.
7551 (cxx_keyword_p): New function.
7552 (layout_class_method): Mangle C++ keywords by appending `$'.
7553 (mangle_field): New function.
7554 (mangle_class_field): Use mangle_field. Mangle class name as
7556 (mangle_static_field): Use mangle_field.
7558 2000-10-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
7560 * decl.c (find_local_variable): Removed uncessary type check and
7561 fixed range check typo. From Corey Minyard.
7563 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
7565 * decl.c (give_name_to_locals): New local `code_offset'. Call
7566 `maybe_adjust_start_pc'.
7567 * expr.c (note_instructions): New function.
7568 (expand_byte_code): Don't collect insn starts here.
7569 (peek_opcode_at_pc): New function.
7570 (maybe_adjust_start_pc): Likewise.
7571 * java-tree.h (maybe_adjust_start_pc): Declare.
7572 (note_instructions): Likewise.
7573 * jcf-parse.c (parse_class_file): Call `note_instructions'.
7575 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
7577 * parse.y (field_access:): Fixed indentation.
7578 (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
7580 2000-09-07 Tom Tromey <tromey@cygnus.com>
7583 * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
7584 JPRIMITIVE_TYPE_P, for arithmetic operators.
7585 (patch_method_invocation): Indentation fix.
7586 (try_builtin_assignconv): Handle boolean specially. Fixed typo.
7587 (valid_builtin_assignconv_identity_widening_p): Handle boolean.
7588 (do_unary_numeric_promotion): Cleaned up code.
7589 (valid_cast_to_p): Handle boolean correctly.
7591 2000-09-27 Tom Tromey <tromey@cygnus.com>
7593 * lex.c (java_read_unicode): Reset bs_count when finished with
7596 2000-10-01 Mark Mitchell <mark@codesourcery.com>
7599 * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
7600 * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
7601 (typeck.o): Depend on ggc.h.
7602 * class.c (add_method_1): Use GC functions for allocation.
7603 (init_class_processing): Register roots.
7604 * decl.c (ggc_p): Set to 1.
7605 (pending_local_decls): Make it static.
7606 (push_jvm_slot): Use GC functions for allocation.
7607 (init_decl_processing): Register roots.
7608 (give_name_to_locals): Use GC functions for allocation.
7609 (lang_mark_tree): New function.
7610 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
7611 functions for allocation.
7612 * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
7613 * lex.c (java_lex): Use build_string, rather than replicating it
7615 * parse.y (goal): Add more roots.
7616 (mark_parser_ctxt): New function.
7617 * typeck.c: Include ggc.h.
7619 2000-09-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
7621 * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
7622 contains something else than MODIFY_EXPR.
7624 2000-09-23 Mark Mitchell <mark@codesourcery.com>
7626 * Make-lang.in (JAVA_SRCS): Include java-tree.h.
7627 * Makefile.in (parse.o): Depend on ggc.h.
7628 (class.o): Likewise.
7629 (constants.o): Likewise.
7632 (jcf-parse.o): Likewise.
7633 (jcf-write.o): Likewise.
7634 (mangle.o): Likewise.
7635 * class.c: Include ggc.h.
7636 (build_static_field_ref): Register GC roots.
7637 (layout_class): Likewise.
7638 (init_class_processing): Likewise.
7639 * constants.c: Include ggc.h.
7640 (current_constant_pool_data_ref): Remove.
7641 (tag_nodes): Move it to ...
7642 (get_tag_node): ... here. Register GC roots.
7643 * decl.c: Include ggc.h. Remove many global tree definitions.
7644 (throw_node): Define.
7645 (java_global_trees): Likewise.
7646 (predef_filenames): Make the size a constant.
7647 (init_decl_processing): Adjust accordingly.
7648 (init_decl_processing): Call init_jcf_parse. Register GC roots.
7649 * expr.c: Include ggc.h.
7650 (init_expr_processing): Register GC roots.
7651 (build_invokeinterface): Likewise.
7652 * java-tree.h: Replace extern tree declarations with macros.
7653 (java_global_trees): New variable.
7654 (java_tree_index): New enumeration.
7655 (init_jcf_parse): Declare.
7656 * jcf-parse.c: Include ggc.h.
7657 (current_class): Remove declaration.
7658 (main_class): Likewise.
7659 (all_class_list): Likewise.
7660 (predefined_filename_p): Adjust for constant size of
7662 (init_jcf_parse): New function.
7663 * jcf-write.c: Include ggc.h.
7664 (generate_classfile): Register GC roots.
7665 (append_synthetic_attribute): Likewise.
7666 (append_innerclass_attribute_entry): Likewise.
7667 * lang.c: Include ggc.h.
7668 (lang_print_error): Register GC roots.
7669 * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
7671 * parse.y: Include ggc.h.
7672 (wfl_operator): Remove.
7673 (goal): Register GC roots.
7674 (java_pop_parser_context): Adjust for new field names.
7675 (java_parser_context_save_global): Likewse.
7676 (java_parser_context_restore_global): Likewise.
7677 (java_parser_context_suspend): Likewise.
7678 (java_parser_context_resume): Likewise.
7679 (verify_constructor_circularity): Register GC roots.
7680 (lookup_cl): Likewise.
7681 (java_reorder_fields): Likewise.
7682 (build_current_this): Likewise.
7683 (class_in_current_package): Likewise.
7684 (argument_types_convertible): Likewise.
7685 (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
7687 2000-09-14 Tom Tromey <tromey@cygnus.com>
7689 * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
7691 2000-09-13 Tom Tromey <tromey@cygnus.com>
7693 * jcf-parse.c: Include <locale.h>.
7694 * jv-scan.c: Include <locale.h>.
7696 2000-09-12 Tom Tromey <tromey@cygnus.com>
7698 * expr.c (pop_type_0): Return `Object' if trying to merge two
7700 * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
7701 interface types; `Object' is always a valid supertype.
7703 2000-09-12 Tom Tromey <tromey@cygnus.com>
7706 * jv-scan.c (help): Document --encoding.
7707 (options): Added `encoding' entry.
7708 (OPT_ENCODING): New define.
7709 (main): Handle --encoding.
7710 Include <langinfo.h> if nl_langinfo exists.
7711 * lang-options.h: Document --classpath, --CLASSPATH, --main, and
7713 * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
7714 (parse_source_file): Correctly call java_init_lex. Added `finput'
7715 argument. Use nl_langinfo to determine default encoding.
7716 * java-tree.h (current_encoding): Declare.
7717 * parse.y (java_parser_context_restore_global): Don't restore
7719 (java_parser_context_save_global): Don't set `finput' field.
7720 (java_pop_parser_context): Don't restore `finput'. Free old lexer
7722 * lang.c (current_encoding): New global.
7723 (lang_decode_option): Recognize `-fencoding='.
7724 (finish_parse): Don't close finput.
7725 * parse.h (struct parser_ctxt): Removed `finput' and
7726 `unget_utf8_value' fields. Added `lexer' field.
7727 (java_init_lex): Fixed declaration.
7728 * lex.c (java_new_lexer): New function.
7729 (java_destroy_lexer): Likewise.
7730 (java_read_char): Added `lex' argument. Handle iconv case.
7731 (java_read_unicode): Added `lex' argument. Count backslashes in
7733 (java_init_lex): Added `finput' and `encoding' arguments. Set
7734 `lexer' field in ctxp.
7735 (BAD_UTF8_VALUE): Removed.
7736 (java_lex): Handle seeing UEOF in the middle of a string literal.
7737 * lex.h: Include <iconv.h> if HAVE_ICONV defined.
7738 (java_lexer): New structure.
7741 (DEFAULT_ENCODING): New define.
7742 (java_destroy_lexer): Declare.
7744 2000-09-12 Tom Tromey <tromey@cygnus.com>
7747 * lex.c (java_init_lex): Initialize java_io_serializable.
7748 * parse.y (java_io_serializable): New global.
7749 (valid_ref_assignconv_cast_p): An array can be cast to
7752 2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
7754 * decl.c, expr.c: Include defaults.h if not already included.
7755 Don't define the *_TYPE_SIZE macros.
7757 2000-09-09 Geoffrey Keating <geoffk@cygnus.com>
7759 * typeck.c (build_java_array_type): Correct first parameter
7760 in ADJUST_FIELD_ALIGN invocation.
7762 2000-09-06 Tom Tromey <tromey@cygnus.com>
7764 * lang-specs.h: Also recognize `-femit-class-files'.
7766 2000-09-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
7768 * verify.c (merge_types): Load the types to merge if necessary.
7770 2000-09-02 Anthony Green <green@redhat.com>
7772 * jcf-io.c: Include zlib.h.
7773 (open_in_zip): Read compressed class file archives.
7774 * zipfile.h (ZipDirectory): Add uncompressed_size and
7775 compression_method fields.
7776 * zextract.c (read_zip_archive): Collect file compression info.
7778 2000-08-15 Bryce McKinlay <bryce@albatross.co.nz>
7780 * parse.y (do_resolve_class): Also explore superclasses of
7781 intermediate enclosing contexts when searching for inner classes.
7783 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
7785 * parse.y (variable_declarator_id:): Better error message.
7786 (expression_statement:): Use YYNOT_TWICE.
7787 (cast_expression:): Likewise.
7788 (assignment:): Likewise.
7790 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
7792 * parse.y (do_merge_string_cste): New locals. Create new
7793 STRING_CSTs each time, use memcpy. Fixes gcj/311.
7795 2000-08-07 Hans Boehm <boehm@acm.org>
7797 * boehm.c (mark_reference_fields): Set marking bits for all words in
7798 a multiple-word record.
7799 (get_boehm_type_descriptor): Use the procedure marking descriptor for
7802 2000-08-31 Mike Stump <mrs@wrs.com>
7804 * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
7805 jcf-dump$(exeext)): Make parallel safe.
7807 2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
7809 * jcf-parse.c (set_source_filename): Constify a char *.
7810 * jcf-write.c (append_innerclasses_attribute,
7811 make_class_file_name): Constify a char *. Don't recycle a
7812 variable for an unrelated purpose.
7813 * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
7814 (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
7816 2000-08-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
7818 * expr.c (can_widen_reference_to): Fixed indentation.
7819 * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
7820 * parse.y: `finit$' replaces `$finit$' in comments.
7821 (try_builtin_assignconv): Fixed leading comment.
7823 2000-08-25 Greg McGary <greg@mcgary.org>
7825 * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
7827 2000-08-24 Greg McGary <greg@mcgary.org>
7829 * lang.c (lang_decode_option): Use ARRAY_SIZE.
7830 * parse.y (BINOP_LOOKUP): Likewise.
7832 2000-08-22 Andrew Haley <aph@cygnus.com>
7834 * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
7835 sign extending. Fixes gcj/321.
7836 * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
7837 combining to make a jlong. Fixes gcj/321.
7839 2000-08-21 Nix <nix@esperi.demon.co.uk>
7841 * lang-specs.h: Do not process -o or run the assembler if
7844 2000-08-16 Andrew Haley <aph@cygnus.com>
7846 * typeck.c (build_java_array_type): Rewrite code to do array
7847 alignment. Take into account back-end macros when aligning array
7848 data. Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
7849 user to set alignment. Fixes gcj/252 and 160.
7851 2000-08-09 Tom Tromey <tromey@cygnus.com>
7853 * parse.y (check_abstract_method_definitions): Now return `int'.
7854 Check implemented interfaces. Fixes PR gcj/305.
7856 * parse.y (patch_switch_statement): Disallow `long' in switch
7857 expressions. Fixes PR gcj/310.
7859 2000-08-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
7861 * decl.c (finit_leg_identifier_node): New global.
7862 (init_decl_processing): Use `finit$' to initialize
7863 finit_identifier_node. Use `$finit$' to initialize
7864 finit_leg_identifier_node.
7865 * expr.c (expand_java_field_op): Use ID_FINIT_P.
7866 * java-tree.h (finit_identifier_node): Changed attached comment.
7867 (finit_leg_identifier_node): New declaration.
7868 (ID_FINIT_P): Take finit_identifier_node and
7869 finit_leg_identifier_node into account. This is a backward
7872 2000-08-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
7874 * jcf-write.c (generate_bytecode_conditional): Re-installed lost
7876 (generate_bytecode_insns): Check `nargs' before emitting it.
7877 * verify.c (merge_type_state): Fixed typo.
7878 * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
7879 generate_bytecode_{conditional,insns}.
7881 2000-08-13 Anthony Green <green@redhat.com>
7883 * check-init.c (check_init): Add case for BIT_FIELD_REF (required
7886 2000-08-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7888 * class.c (maybe_layout_super_class): Fixed indentation.
7889 * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
7890 (java_check_methods): New function declaration.
7891 * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
7892 instead of `str_ptr'.
7893 * jcf-write.c (generate_bytecode_insns): Emit number the of args
7894 of a `invokeinterface' at the right time.
7895 * parse.h (WFL_STRIP_BRACKET): New macro.
7896 (SET_TYPE_FOR_RESOLUTION): Use it.
7897 * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
7898 (check_class_interface_creation): Don't check for cross package
7899 innerclass name clashes.
7900 (method_header): Behave properly if MDECL is `error_mark_node'.
7901 (method_declarator): Return `error_mark_node' if bogus current
7903 (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
7904 (resolve_and_layout): New local `decl_type', set and used. Call
7906 (java_check_methods): New method.
7907 (java_layout_classes): Use it.
7908 (resolve_qualified_expression_name): No EH check necessary in
7910 (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
7912 (patch_assignment): Set DECL_INITIAL on integral final local.
7914 2000-08-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
7916 * java-tree.h (flag_extraneous_semicolon): New extern.
7917 * lang-options.h: (-Wextraneous-semicolon): New option.
7918 * lang.c (flag_redundant): Fixed typo in leading comment.
7919 (flag_extraneous_semicolon): New global.
7920 (lang_decode_option): Set `flag_extraneous_semicolon' when
7921 -Wall. Decode `-Wextraneous-semicolon'.
7922 * parse.y (type_declaration:): Removed `SC_TK' hack, added
7923 `empty_statement' rule.
7924 (class_body_declaration): Likewise.
7925 (method_body:): Accept `;' as a method body.
7926 (static_initializer:): Removed `SC_TK' hack.
7927 (constructor_block_end:): Likewise.
7928 (empty_statement:): Report deprecated empty declaration. Fixes
7931 2000-08-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7933 * parse.y (build_dot_class_method_invocation): Changed parameter
7934 name to `type'. Build signature from `type' and convert it to a
7935 STRING_CST if it's an array.
7936 (patch_incomplete_class_ref): `build_dot_class_method_invocation'
7937 to use `ref_type' directly.
7939 2000-08-06 Ovidiu Predescu <ovidiu@cup.hp.com>
7941 * lang-options.h: Added a comma after the last element to avoid
7942 syntax errors when other languages define additional options.
7944 2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
7946 * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
7947 * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
7948 (jc1): Link with $(BACKEND).
7949 (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
7951 2000-08-02 Zack Weinberg <zack@wolery.cumb.org>
7953 * jvspec.c: Adjust type of second argument to
7954 lang_specific_driver, and update code as necessary.
7956 * class.c (build_dtable_decl): Initialize dummy.
7958 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7960 * parse.y (maybe_yank_clinit): When generating bytecode: non empty
7961 method bodies not to rule out discarding `<clinit>'; don't use
7962 <clinit> to initialize static fields with constant initializers.
7964 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7966 * gjavah.c (print_method_info): Added `synth' parameter. Skip
7968 (method_synthetic): New global.
7969 (HANDLE_METHOD): Recognize synthetic method and tell
7970 `print_method_info' about it.
7971 (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
7972 processing a synthetic method.
7973 * jcf-reader.c (skip_attribute): New function.
7974 ( skip_attribute): Likewise.
7976 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7978 * parse.y (build_outer_field_access): Fixed comments.
7979 (fix_constructors): Emit the initialization of this$<n> before
7981 (resolve_qualified_expression_name): Build an access to `decl' if
7984 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
7986 * parse-scan.y (curent_class): Non longer const.
7987 (inner_qualifier, inner_qualifier_length): Deleted.
7988 (current_class_length): New global.
7989 (bracket_count): Fixed typo in leading comment.
7990 (anonymous_count): New global.
7991 (class_instance_creation_expression:): Handle anonymous classes.
7992 (anonymous_class_creation:): New rule.
7993 (push_class_context): Rewritten.
7994 (pop_class_context): Likewise.
7995 (INNER_QUALIFIER): Macro deleted.
7996 (report_class_declaration): call `push_class_context' when
7997 entering the function. `fprintf' format modified not to use
7999 (report_class_declaration): Assign `package_name' and
8000 `current_class' to NULL separately.
8002 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
8004 * expr.c (build_invokeinterface): Call layout_class_methods on
8007 2000-07-27 Tom Tromey <tromey@cygnus.com>
8008 Anthony Green <green@cygnus.com>
8009 Alexandre Petit-Bianco <apbianco@cygnus.com>
8011 * class.c (make_class_data): Create vtable for abstract classes.
8012 (get_dispatch_table): Changed to cope with abstract classes.
8014 2000-07-27 Tom Tromey <tromey@cygnus.com>
8016 * parse.y (patch_method_invocation): Don't reverse the argument
8017 list when dealing with anonymous class constructors. Fixed typo in
8020 2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
8022 * parse.y (build_alias_initializer_parameter_list): Reverse
8023 crafted list when building aliases for anonymous class
8026 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
8028 * parse.y (jdep_resolve_class): Don't bother checking potential
8029 innerclass access if `decl' is NULL.
8030 (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
8033 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
8035 * parse.c: Remove (again.)
8037 2000-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8039 * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
8040 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
8041 outside the `if' statement, alias to innerclass removed, `decl'
8042 used to mark the class complete.
8044 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
8046 * parse.y (simple_name:): Fixed typo in error message.
8048 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
8050 * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
8051 or its first operand can be error marks.
8053 2000-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
8055 * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
8056 * parse.y (method_header): Likewise.
8058 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8060 * parse.y (process_imports): Consider that one might be trying to
8061 import an innerclass. Fixes gcj/254
8063 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8065 * parse.y (find_as_inner_class): Handle the case where the
8066 enclosing context of an innerclass has been loaded as bytecode.
8068 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8070 * parse.y (simple_name:): Reject `$' in type names.
8071 (resolve_type_during_patch): Use `type' as a second
8072 argument to resolve_no_layout. Fixes gcj/257.
8074 2000-07-18 Bryce McKinlay <bryce@albatross.co.nz>
8076 * parse.y (find_most_specific_methods_list): Select the only
8077 non-abstract method even if max has been set.
8078 Fixes gcj/285, gcj/298.
8080 2000-07-18 Jeff Sturm <jeff.sturm@appnet.com>
8082 * lang-specs.h: Added %(jc1) to java compiler options.
8084 2000-07-14 Zack Weinberg <zack@wolery.cumb.org>
8086 * .cvsignore: New file.
8088 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8090 * parse.y (not_accessible_p): Access granted to innerclasses
8091 (indirectly) extending the reference type. Fixes gcj/249.
8093 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8095 * parse.y (patch_method_invocation): Fixed comment.
8096 (maybe_use_access_method): Build this$<n>s to the context of the
8097 target method, or a type that extends it. Fixes gcj/242.
8099 2000-07-13 Mark Mitchell <mark@codesourcery.com>
8103 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8105 * parse.y (fold_constant_for_init): Avoid bullish conversion.
8107 2000-07-13 Tom Tromey <tromey@cygnus.com>
8109 * lang-specs.h: Added %{I*}.
8111 2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
8113 * lang-specs.h: Use the new named specs. Remove unnecessary braces.
8115 2000-07-12 Mark Mitchell <mark@codesourcery.com>
8117 * parse-scan.c: Remove.
8119 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8121 * class.c (set_super_info): Handled protected inner classes.
8122 (common_enclosing_context_p): Bail early if arguments aren't both
8124 (get_access_flags_from_decl): Handle private and protected inner
8126 * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
8127 (CLASS_PROTECTED): Likewise.
8128 (struct lang_type): New bitfield `poic'.
8129 * parse.y (jdep_resolve_class): Call check_inner_class_access on
8131 (check_inner_class_access): Renamed arguments, added
8132 comments. Handles protected inner classes (fixes gcj/225)
8133 (not_accessible_p): Fixed comments. Avoid handling inner classes.
8135 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8137 * parse.y (resolve_qualified_expression_name): Verify qualified
8138 access to `this'. Fixes gcj/239.
8140 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8142 * jcf-write.c (generate_classfile): Don't install ConstantValue
8145 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
8147 * parse.y (resolve_qualified_expression_name): Handle inner class
8148 access. Fixes gcj/256.
8150 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
8152 * jcf-write.c (generate_classfile): Properly install the
8153 ConstantValue attribute and the initial value constant pool index
8154 on string constants.
8155 * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
8158 2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
8160 * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
8162 * parse.y (find_as_inner_class): Fixed typo.
8163 (do_resolve_class): Explore enclosing contexts when searching for
8164 innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
8165 (check_inner_class_access): Check `decl' which can be null in case
8168 2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8170 * java-tree.h (java_debug_context): Declared `extern'.
8171 (safe_layout_class): Likewise.
8172 * parse.y (resolve_field_access): Field must be `static' in order
8173 to be replaced by its initial value. Added comments.
8174 (find_applicable_accessible_methods_list): Fixed typo.
8175 (find_most_specific_methods_list): Methods found in innerclasses
8176 take over methods founds in the enclosing contexts.
8177 (java_complete_tree): Loosen restrictions on the type of DECLs
8178 that can be replaced by their initialization values.
8179 (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
8181 2000-07-05 Tom Tromey <tromey@cygnus.com>
8183 * Make-lang.in (PARSE_DIR): New macro.
8184 (PARSE_RELDIR): Likewise.
8185 (PARSE_C): Likewise.
8186 (PARSE_SCAN_C): Likewise.
8187 ($(PARSE_C)): New target.
8188 ($(PARSE_SCAN_C)): Likewise.
8189 (SET_BISON): New macro.
8190 (BISONFLAGS): Likewise.
8191 (JAVABISONFLAGS): Likewise.
8193 2000-07-02 Bryce McKinlay <bryce@albatross.co.nz>
8195 * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
8196 argument on the first pass for CNI as well as JNI.
8197 (print_method_info): Set up method name on the first pass only.
8199 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8201 * parse.y (parser_qualified_classname): Removed parameter
8203 (create_interface): Removed first passed parameter to
8204 parser_qualified_classname.
8205 (create_class): Likewise. Don't install alias on static
8206 innerclasses. Fixes gcj/275.
8208 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8210 * parse.y (maybe_generate_pre_expand_clinit): Don't build a
8211 debugable statement with empty_stmt_node. Fixes gcj/272
8213 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8215 * expr.c (build_instanceof): Layout type after it's loaded. Fixes
8218 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8220 * jcf-write.c (push_long_const): Appropriately cast short negative
8223 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8225 * parse.y (verify_constructor_super): Use loop variable
8226 `m_arg_type' initialized with `mdecl_arg_type'.
8228 2000-06-29 Tom Tromey <tromey@cygnus.com>
8230 * parse.y (resolve_field_access): Handle case where `type_found'
8233 2000-06-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
8235 * expr.c (lookup_field): The same field can be found through two
8236 different interface. Don't declare it ambiguous in that case.
8238 2000-06-27 Tom Tromey <tromey@cygnus.com>
8240 * lex.c (java_lineterminator): Don't recognize \r after \n. If \r
8241 follows \r, then unget it at a lower level.
8243 2000-06-26 Tom Tromey <tromey@cygnus.com>
8245 * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
8248 2000-06-25 Tom Tromey <tromey@cygnus.com>
8250 * parse.y (for_statement): Wrap expression in a WFL if it is a
8251 constant. For PR gcj/268.
8253 2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
8255 * parse.y (do_resolve_class): Minor optimiztion in the package
8256 list search. Removed unnecessary test and return statement.
8257 (valid_ref_assignconv_cast_p): Order of arguments to
8258 enclosing_context_p fixed.
8260 2000-06-24 Tom Tromey <tromey@cygnus.com>
8262 * expr.c (lookup_field): Print error and return error_mark_node if
8263 field reference is ambiguous.
8265 * parse.y (check_abstract_method_definitions): Also check if
8266 `other_method' is abstract.
8268 2000-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
8270 * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
8272 * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
8273 (struct lang_type): New field `pic'.
8274 (CLASS_PRIVATE): New macro.
8275 * parse.y (check_inner_class_access): New function.
8276 (jdep_resolve_class): Call it.
8278 2000-06-23 Tom Tromey <tromey@cygnus.com>
8280 * parse.y (patch_incomplete_class_ref): Initialize the returned
8281 class. For PR gcj/260.
8283 2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
8285 * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
8287 2000-06-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
8289 * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
8290 Java specific checks.
8291 * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
8293 * java-tree.def (CASE_EXPR): Marked 'e'.
8294 (DEFAULT_EXPR): Likewise.
8295 * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
8297 * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
8298 Java specific checks.
8299 (generate_bytecode_insns): Test try_block for BLOCK before using
8301 * parse.y (build_wfl_wrap): Added `location' argument. Set
8302 EXPR_WFL_LINECOL accordingly.
8303 (dim_expr:): Wrap constants with WFLs.
8304 (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
8305 (resolve_package): Check for `stmt' not being a BLOCK before
8306 building a debuggable statement with it.
8307 (make_qualified_primary): Added extra parameter to build_wfl_wrap
8309 (resolve_field_access): Make sure `decl' is a DECL before treating
8311 (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
8312 IDENTIFIER_NODE before treating it as such.
8313 (patch_new_array_init): Make sure `elt' is a TREE_LIST before
8314 treating it as such.
8315 (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
8316 to be applied only on non array types.
8318 2000-06-16 Per Bothner <per@bothner.com>
8320 * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN): Don't
8321 define in terms of DECL_RESULT, as that fails when --enable-checking.
8323 2000-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8325 * jcf-write.c (CHECK_PUT): Add static prototype. Make pointer
8326 types the same in comparison.
8327 (CHECK_OP): Add static prototype.
8329 2000-06-13 Jakub Jelinek <jakub@redhat.com>
8331 * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
8332 * parse.y (java_complete_class): Set DECL_USER_ALIGN.
8335 2000-06-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8337 * decl.c (create_primitive_vtable): Prototype.
8339 * jcf-write.c (generate_bytecode_insns): Initialize variable
8342 * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
8344 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
8346 * parse.y (find_applicable_accessible_methods_list): Use a hashtable
8347 to track searched classes, and do not search the same class more than
8348 once. Call find_applicable_accessible_methods_list on immediate
8349 superclass, instead of search_applicable_method_list on all ancestors.
8352 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
8354 * parse.y (register_fields): Permit static fields in inner classes
8355 if they are final. Fix for PR gcj/255.
8357 2000-06-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
8359 * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
8360 * parse.y (find_in_imports): Returned type changed to void,
8361 leading comment fixed.
8362 (register_package): New function.
8363 (qualify_and_find): Likewise.
8364 (package_declaration:): Use `register_package'.
8365 (single_type_import_declaration:): Removed local variable
8366 `node'. Added missing `;' for consistency.
8367 (type_import_on_demand_declaration:): Use `chainon' to link new
8369 (lookup_field_wrapper): Lookup local variables defined in outer
8371 (java_complete_class): Don't reverse the list of imported on demand.
8372 (do_resolve_class): Reorganized. Removed local variable
8373 `original_name'. Call `qualify_and_find' with the current package
8374 name, invoke `find_in_imports_on_demand' right after. Call
8375 `qualify_and_find' with the packages we've seen so far. Fixed
8376 operations numbering in comments.
8377 (java_expand_class): Don't reverse `package_list'.
8378 (find_most_specific_methods_list): New local variables `abstract'
8379 and `candidates'. Use them to pick the right method.
8381 2000-06-06 Tom Tromey <tromey@ferrule.cygnus.com>
8383 * parse.y (check_modifiers_consistency): Don't subtract out
8384 `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
8386 2000-06-04 Philipp Thomas <pthomas@suse.de>
8388 * Makefile.in (INTLLIBS): New.
8392 2000-06-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
8394 * class.c (get_dispatch_table): Build the vtable dummy entry list
8395 element with a null purpose. Fixed leading comment.
8396 (build_dtable_decl): Build an accurate dtable type when appropriate
8399 2000-06-02 Richard Henderson <rth@cygnus.com>
8401 * lang.c (lang_get_alias_set): New.
8403 2000-05-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
8405 * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
8406 before using it as the accessed field.
8408 2000-05-31 Tom Tromey <tromey@cygnus.com>
8410 * java-tree.h (boolean_array_vtable, byte_array_vtable,
8411 char_array_vtable, short_array_vtable, int_array_vtable,
8412 long_array_vtable, float_array_vtable, double_array_vtable):
8414 * expr.c (get_primitive_array_vtable): New function.
8415 (create_primitive_vtable): New function.
8416 (java_lang_expand_expr): Enable code to statically generate
8418 * decl.c (init_decl_processing): Create primitive vtables.
8419 (boolean_array_vtable, byte_array_vtable, char_array_vtable,
8420 short_array_vtable, int_array_vtable, long_array_vtable,
8421 float_array_vtable, double_array_vtable): Define.
8423 2000-05-26 Zack Weinberg <zack@wolery.cumb.org>
8425 * java/parse.y (find_applicable_accessible_methods_list):
8426 Don't add an uninitialized value to the list.
8428 2000-05-25 Tom Tromey <tromey@cygnus.com>
8430 * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
8431 when trying to see if field's class should be initialized. Always
8432 initialize field's declaring class, not qualified class.
8435 * parse.y (array_constructor_check_entry): Pass `wfl_value', not
8436 `wfl_operator', to maybe_build_primttype_type_ref.
8439 2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
8441 * parse.y (patch_method_invocation): Don't try to lookup methods
8444 2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
8446 * parse.y (resolve_field_access): Call the appropriate <clinit>
8447 before accessing the length of a static array. Craft a decl for
8448 the field while its time. Fixes PR gcj/129.
8450 2000-05-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8452 * parse.y (resolve_package): Correctly set `*next' (was off by
8454 (resolve_qualified_expression_name): Fixed comment.
8456 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
8458 * jcf-parse.c (jcf_parse_source): Reset current_class and
8459 current_function_decl to NULL before parsing a new file.
8461 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
8463 * parse.y (block_end:): If the collected block doesn't feature a
8464 statement, insert an empty statement.
8466 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8468 * parse.y (maybe_yank_clinit): New function.
8469 (maybe_generate_pre_expand_clinit): Always link <clinit> at the
8470 end of the list of methods belonging to a class.
8471 (java_complete_expand_method): Check whether <clinit> is really
8472 necessary and expand it accordingly.
8474 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8476 * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
8477 processed by the method's switch statement.
8479 2000-05-19 Tom Tromey <tromey@cygnus.com>
8481 * java-tree.h: Added init state enum.
8482 * decl.c (emit_init_test_initialization): Initialize class
8483 initialization check variable by looking at class' state.
8485 2000-05-19 Tom Tromey <tromey@cygnus.com>
8487 * java-tree.h (build_instanceof): Declare.
8488 (build_get_class): Declare.
8489 * parse.y (patch_binop): Use build_instanceof.
8490 * expr.c (build_instanceof): New function. If class is final,
8491 don't make a function call.
8492 (expand_java_INSTANCEOF): Use it.
8493 (build_get_class): New function.
8495 2000-05-18 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
8497 * jcf-write.c (generate_classfile): Scan the source_file for
8498 slashes with the right pointer variable.
8500 2000-05-17 Andrew Cagney <cagney@b1.cygnus.com>
8502 * lang.c (lang_decode_option): Update -Wunused flags by calling
8504 * decl.c (poplevel): Replace warn_unused with warn_unused_label.
8506 2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
8508 * check_init.c (check_init): Constify local char *.
8509 * class.c (push_class): Constify local char *.
8510 * java_tree.h: Update prototypes.
8511 * jcf-io.c (open_class): Constify filename parameter and
8513 (find_class): Remove redundant string copy. Cast return from
8515 * jcf-parse.c (read_class, parse_class_file, yyparse):
8516 Constify local char *.
8517 * jcf-write.c (generate_bytecode_insns, generate_classfile):
8518 Constify local char *.
8519 * jcf.h (JCF): Constify filename and classname.
8520 (JCF_FINISH): Cast args to FREE to char * when appropriate.
8521 * lang.c (init_parse): Constify parameter and return value.
8522 * lex.c (java_get_line_col): Constify filename parameter.
8523 * parse.h: Constify parser_ctxt.filename. Update prototypes.
8524 * parse.y (java_parser_context_suspend,
8525 issue_warning_error_from_context, safe_layout_class): Constify
8527 * parse.c: Regenerate.
8529 2000-05-08 Tom Tromey <tromey@cygnus.com>
8531 * expr.c (build_jni_stub): Cache the result of
8532 _Jv_LookupJNIMethod.
8534 2000-05-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8536 * decl.c (predef_filenames_size): Now 7.
8537 (predef_filenames): New seventh entry.
8539 2000-05-04 Tom Tromey <tromey@cygnus.com>
8541 * boehm.c (mark_reference_fields): Don't mark RawData fields.
8542 Keep track of when we've seen a reference field after a
8543 non-reference field.
8544 (get_boehm_type_descriptor): Handle case where we see
8545 non-reference fields but no trailing reference field.
8546 * decl.c (rawdata_ptr_type_node): Define.
8547 (init_decl_processing): Initialize rawdata_ptr_type_node.
8548 * java-tree.h (rawdata_ptr_type_node): Declare.
8550 2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8552 * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
8553 specifiers in calls to fprintf.
8555 2000-05-03 Andrew Haley <aph@cygnus.com>
8557 * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
8559 * javaop.h (WORD_TO_INT): New function.
8560 (IMMEDIATE_s4): Use WORD_TO_INT.
8561 * jcf.h (JPOOL_INT): Ditto.
8563 * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
8566 2000-04-19 Tom Tromey <tromey@cygnus.com>
8568 * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
8570 * jcf-parse.c (parse_class_file): Call build_jni_stub for native
8572 * expr.c (build_jni_stub): New function.
8573 * lang-specs.h: -fjni and -femit-class-file are incompatible.
8575 * parse.y (java_complete_expand_methods): Expand a native method
8576 and call build_jni_stub if -fjni given.
8577 * lang-options.h: Document -fjni.
8578 * lang.c (flag_jni): New global.
8579 (lang_f_options): Added `jni' entry.
8580 * java-tree.h (soft_lookupjnimethod_node,
8581 soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
8583 (flag_jni): Declare.
8584 (build_jni_stub): Declare.
8585 (struct lang_decl): Added `native' flag.
8586 (METHOD_NATIVE): Redefined to use `native' field of lang specific
8588 * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
8589 soft_jnipopsystemframe_node): New globals.
8590 (init_decl_processing): Set them. _Jv_InitClass only takes one
8593 * java-tree.def: Put into `C' mode.
8595 2000-04-27 Tom Tromey <tromey@cygnus.com>
8598 * expr.c (expand_invoke): Generate check to see if object pointer
8599 is null in nonvirtual invocation case.
8600 * java-tree.h (soft_nullpointer_node): Declare.
8601 * decl.c (soft_nullpointer_node): New global.
8602 (init_decl_processing): Initialize soft_nullpointer_node.
8603 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
8604 or `private' methods.
8605 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
8607 2000-04-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
8609 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
8612 2000-04-26 Tom Tromey <tromey@cygnus.com>
8614 * zextract.c (find_zip_file_start): New function.
8615 (read_zip_archive): Use it.
8617 2000-04-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
8619 * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
8621 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8623 * class.c (common_enclosing_context_p): New function.
8624 * java-tree.h (common_enclosing_context_p): Added prototype.
8625 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
8626 classes sharing an outer context with the current instance.
8627 * parse.y (build_access_to_thisn): Fixed leading comment.
8628 (verify_constructor_super): New local `supper_inner'. Skip
8629 enclosing context argument in the case of inner class constructors.
8630 (patch_method_invocation): Insert proper context as second
8631 parameter to pure inner class constructor super invocations.
8633 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8635 * parse.y (end_class_declaration): Reset the interface number
8638 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8640 * parse.y (source_start_java_method): Deleted unnecessary code.
8641 (patch_method_invocation): Fixed comment.
8643 2000-04-24 Robert Lipe <robertlipe@usa.net>
8645 * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
8647 2000-04-23 Tom Tromey <tromey@cygnus.com>
8649 * boehm.c (mark_reference_fields): Use int_byte_position.
8651 2000-04-22 Tom Tromey <tromey@cygnus.com>
8653 * boehm.c (mark_reference_fields): Only call byte_position on
8656 2000-04-22 Tom Tromey <tromey@cygnus.com>
8658 * boehm.c (mark_reference_fields): Added `last_view_index'
8659 argument. Use DECL_FIELD_OFFSET to determine field's offset.
8661 2000-04-20 Mo DeJong <mdejong@cygnus.com>
8663 * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
8664 * parse.y (check_class_interface_creation): Fixed comments. Select
8665 permitted modifiers for (inner) interfaces. Changed error message
8666 to report rejected modifiers used with local classes.
8668 2000-04-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
8670 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
8671 of directly inherited type considered in scope.
8672 * parse.y (do_resolve_class): Search inherited classes for inner
8675 2000-04-20 Tom Tromey <tromey@cygnus.com>
8677 * parse.y (not_accessible_p): Use member's class, not current
8678 class, when doing inheritance check for protected reference.
8681 2000-04-20 Jason Schroeder <shrode@subnature.com>
8683 * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
8685 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8687 * parse.y (lookup_field_wrapper): Search for final local aliases.
8688 (resolve_expression_name): Let lookup_field_wrapper search for
8689 final local aliases. Force the value of `name' if one is found.
8690 (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
8691 an expression name. Fixed comments.
8693 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8695 * parse.y (yyerror): `msg' can be null, don't use it in that case.
8697 2000-04-19 Tom Tromey <tromey@cygnus.com>
8699 * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
8701 2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
8703 * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
8705 2000-04-18 Tom Tromey <tromey@cygnus.com>
8708 * gjavah.c (utf8_cmp): Changed return value.
8709 (cxx_keyword_subst): Handle all C++ keywords. Allocate new return
8711 (cxx_keywords): New global.
8712 (get_field_name): Handle new result of cxx_keyword_subst.
8713 (print_method_info): Likewise.
8715 2000-04-17 Bryce McKinlay <bryce@albatross.co.nz>
8717 * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
8718 with a newline, for CNI.
8719 (print_stub_or_jni): Print a space or newline before method name for
8721 (print_cxx_classname): Don't write leading "::" in CNI stub method.
8722 (process_file): Include gcj/cni.h if generating CNI stubs.
8724 2000-04-16 Tom Tromey <tromey@cygnus.com>
8726 * gjavah.c (decompile_method): Use print_field_name.
8729 2000-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
8731 * parse.y (java_expand_classes): Reverse the package list once.
8732 (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
8734 (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
8735 the `==' and `!=' operators.
8737 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8739 * jcf-write.c (generate_bytecode_insns): At invocation time,
8740 always relate an interface method to the type of its selector.
8742 2000-04-05 Tom Tromey <tromey@cygnus.com>
8745 * expr.c (expand_invoke): Generate check to see if object pointer
8746 is null in nonvirtual invocation case.
8747 * java-tree.h (soft_nullpointer_node): Declare.
8748 * decl.c (soft_nullpointer_node): New global.
8749 (init_decl_processing): Initialize soft_nullpointer_node.
8750 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
8751 or `private' methods.
8752 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
8754 2000-04-05 Tom Tromey <tromey@cygnus.com>
8757 * parse.y (check_final_assignment): Recognize assignments to the
8758 `length' field of an array when generating class files.
8760 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8762 * class.c (decl_hash): Prototype removed.
8763 (decl_compare): Likewise.
8765 2000-04-05 Tom Tromey <tromey@cygnus.com>
8767 * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
8768 * parse.y (check_modifiers_consistency): Check for final/volatile
8769 clash. Fixes PR gcj/164.
8771 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8773 * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
8775 (java_hash_compare_tree_node): Renamed from `decl_compare, made
8777 (add_method_1): Use `java_hash_hash_tree_node' and
8778 `java_hash_compare_tree_node'.
8779 * java-tree.h: (java_hash_hash_tree_node): Prototyped.
8780 (java_hash_compare_tree_node): Likewise.
8781 * parse.y (find_applicable_accessible_methods_list): Create,
8782 delete and use a hash table to remember already searched interfaces.
8784 2000-04-03 Matt Welsh <mdw@cs.berkeley.edu>
8786 * jcf-depend.c (add_entry): Fixed bug where list was always replaced
8789 2000-04-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8791 * boehm.c (mark_reference_fields, set_bit): Prototype.
8792 (set_bit): Un-ANSI-fy definition.
8794 * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
8797 * decl.c (emit_init_test_initialization): Likewise.
8799 * gjavah.c (jni_print_char): Likewise.
8801 * parse.y (create_new_parser_context): Likewise.
8803 2000-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
8805 * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
8806 patch missing hunk. Fixed indentation.
8808 2000-03-30 Tom Tromey <tromey@cygnus.com>
8810 * gjavah.c (D_NAN_MASK): Only define as word-reversed when
8811 HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
8813 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
8815 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
8816 when negative *before* using it as an array index.
8817 * ChangeLog: Fixed typo.
8819 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
8821 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
8822 to 0 when it reaches -1.
8824 2000-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
8826 * jcf-parse.c (get_constant): Properly cast `num' during the
8827 invocation of `add_double'.
8828 * jcf-write.c (push_long_const): Properly cast `lo' before
8829 comparing it to short bounds.
8830 * parse-scan.y (interface_declaration:): Rule re-arrange so that
8831 `interface_body:' is reduced after the current interface is
8834 2000-03-26 Tom Tromey <tromey@cygnus.com>
8836 * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
8837 Java-specific `-f' option.
8839 2000-03-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
8841 * decl.c (init_decl_processing): Only call initialize_sizetypes once.
8842 Adjust order of making types.
8843 Make bitsize_*_node values.
8845 2000-03-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
8847 * class.c (make_field_value): Use byte_position.
8848 * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
8849 (java_array_data_offset): Likewise.
8850 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
8853 2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
8855 * parse.y (check_abstract_method_definitions): New local
8856 `end_type_reached'. Make sure we also consider `end_type'.
8857 (java_check_abstract_method_definitions): Make sure we eventually
8858 consider `java.lang.Object'.
8859 (maybe_use_access_method): Don't use access method if not in the
8860 context of a pure inner class or if the method's context is right.
8861 (find_applicable_accessible_methods_list): New static flag
8862 `object_done'. Don't search abstract classes as interfaces. Fixed
8863 indentation. Fixed the `java.lang.Object' only search. Search
8864 class interface(s) first, then fully search enclosing contexts.
8865 (find_most_specific_methods_list): Pick the closest candidate when
8866 they're all abstract.
8868 2000-03-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
8870 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
8871 properly initialize `finished_label'. Don't emit gotos for empty
8874 2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
8876 * except.c (emit_handlers): Clear catch_clauses_last.
8878 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8880 * parse.y (check_method_types_complete): New function.
8881 (create_class): Reset anonymous class counter only when seeing an
8883 (java_complete_class): JDEP_METHOD: Don't recompute signature
8886 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8888 * class.c (build_static_ref): Fixed indentation in comment.
8889 * java-tree.def (TRY_EXPR): Fixed typo in name.
8890 (CLASS_LITERAL): Likewise.
8891 * java-tree.h: (TYPE_DOT_CLASS): New macro.
8892 (struct lang_type): New field `dot_class'.
8893 * jcf-write.c (generate_bytecode_insns): Fixed error message.
8894 (generate_classfile): Method `class$' is synthetic.
8895 * parse.y (build_do_class_method): New function.
8896 (build_dot_class_method_invocation): Likewise.
8897 (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
8898 (resolve_qualified_expression_name): Handle CLASS_LITERAL.
8899 (qualify_ambiguous_name): Likewise.
8900 (patch_incomplete_class_ref): Invoke synthetic method if necessary.
8901 (build_try_statement): Fixed leading comment.
8903 2000-03-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
8905 * class.c (make_field_value): Properly handle sizes.
8906 (get_dispatch_vector): Use tree_low_cst and host_integerp.
8907 (layout_class_method): Count using trees.
8908 * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
8909 * expr.c (java_array_data_offset): Use int_bit_position.
8910 (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
8911 (build_invokevirtual): Use tree_low_cst and do computations with trees.
8913 2000-03-16 Tom Tromey <tromey@cygnus.com>
8915 * lang.c (flag_hash_synchronization): New global.
8916 (lang_f_options): Added `hash-synchronization'.
8917 * lang-options.h: Mention -fhash-synchronization.
8918 * java-tree.h (flag_hash_synchronization): Declare.
8919 * expr.c (java_lang_expand_expr): Only push `sync_info' value when
8920 hash table synchronization is disabled.
8921 * decl.c (init_decl_processing): Only push `sync_info' value when
8922 hash table synchronization is disabled.
8923 * class.c (make_class_data): Only push `sync_info' field when hash
8924 table synchronization is disabled. Removed dead code.
8926 2000-03-16 Tom Tromey <tromey@cygnus.com>
8928 * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
8930 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
8932 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
8934 * parse.y (patch_method_invocation): Handle anonymous classes
8935 creation in static context.
8937 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
8939 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
8940 * parse.y (resolve_qualified_expression_name): Use it.
8941 (patch_method_invocation): Likewise.
8943 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
8945 * parse.y (register_incomplete_type): JDEP_ENCLOSING set
8946 depending on the type of dependency which dictates what the
8948 (unresolved_type_p): Resolved types limited to the current class.
8950 2000-03-15 Tom Tromey <tromey@cygnus.com>
8952 * decl.c (init_decl_processing): Set type of `sync_info' to be
8955 * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
8956 Correctly compute bit number for current slot. Zero `high' and
8957 `low' in DS_LENGTH case. Don't skip inherited fields. Use
8958 mark_reference_fields.
8959 (mark_reference_fields): New function.
8961 2000-03-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
8963 * parse.y (register_incomplete_type): Fixed initialization of
8966 2000-02-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
8968 * parse-scan.y (inner_qualifier, inner_qualifier_length): New
8970 (push_class_context, pop_class_context): New function.
8971 (class_body:): Call pop_class_context.
8972 (interface_body:): Likewise.
8973 (INNER_QUALIFIER): New macro.
8974 (report_class_declaration): Changed output format and use
8975 INNER_QUALIFIER. Call push_class_context.
8977 2000-02-14 Andrew Haley <aph@cygnus.com>
8979 * check-init.c (check_init): Add new cases for unary and binary
8982 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8984 * parse.y (resolve_package): Set `next' once a type name has been
8985 progressively discovered.
8986 (resolve_qualified_expression_name): Propagate resolution only if
8987 there are remaining qualifiers. Take into account `q' might have
8988 been cleared after re-qualification.
8989 * parse.y (patch_method_invocation): New local `resolved'.
8990 Section dealing with qualified expression rewritten to use
8991 resolve_field_access.
8993 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8995 * parse.h (PUSH_CPC): Fixed indentation.
8996 (DEBUG_CPC): New macro.
8997 (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
8998 SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
8999 * parse.y (class_body_declaration:): Use
9000 SET_CPC_INSTANCE_INITIALIZER_STMT.
9001 (method_declaration:): Check for null current_function_decl.
9002 (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
9003 (java_parser_context_pop_initialized_field): Better handling of
9005 (maybe_make_nested_class_name): Mark nested class name as
9006 qualified when necessary.
9007 (end_class_declaration): Don't call java_parse_context_resume when
9008 one or more error occurred.
9009 (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
9010 (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
9011 SET_CPC_INITIALIZER_STMT.
9012 (method_header): Check for inner classes declaring static methods.
9013 (resolve_qualified_expression_name): Handle situation where `this'
9016 2000-03-13 Hans Boehm <boehm@acm.org>
9018 * typeck.c (build_prim_array_type): Correctly set the high word too.
9020 2000-03-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
9022 * parse.y (java_complete_expand_methods): Leave <clinit> out of
9024 (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
9025 list of methods for interfaces.
9027 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9029 * parse.y (qualify_ambiguous_name): Properly handle expressions
9032 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9034 * parse.y (check_final_assignment): Extended to process
9036 (patch_assignment): Have check_final_assignment called only once.
9038 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9040 * java-tree.h (IS_INIT_CHECKED): New flag.
9041 * check-init.c (check_init): Test and set IS_INIT_CHECKED.
9042 * parse.y (patch_string): Call force_evaluation_order on the
9043 completed string concatenation tree.
9044 * expr.c (force_evaluation_order): Call force_evaluation_order on
9045 function's arguments too.
9047 2000-03-06 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
9049 * decl.c (emit_init_test_initialization): Mark KEY as unused.
9050 * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
9051 (build_anewarray): Likewise.
9052 * parse.y (patch_newarray): Likewise.
9053 * parse.c: Regenerated.
9055 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
9057 * decl.c (init_decl_processing): Added new class fields `depth',
9058 `ancestors', and `idt' to class_type_node. Use
9059 _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
9060 * class.c (make_class_data): Push initial values for new fields.
9061 * java-tree.h: Updated prototype for `build_invokeinterface'.
9062 * expr.c (build_invokeinterface): Changed parameters to accept
9063 `method' tree. Calculate index of `method' in its declaring
9064 interface. Build call to _Jv_LookupInterfaceMethodIdx.
9065 (expand_invoke): Call `build_invokeinterface' with new parameters.
9066 * parse.y (patch_invoke): Call `build_invokeinterface' with new
9069 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
9071 * typeck.c (lookup_do): Search superinterfaces first
9072 when looking up an interface method. From Godmar Back
9075 2000-03-06 Tom Tromey <tromey@cygnus.com>
9077 * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
9079 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9081 * java-tree.h (lookup_argument_method2): Declared.
9082 (safe_layout_class): Prototype moved from parse.h.
9083 * parse.h (safe_layout_class): Prototype moved to java-tree.h.
9084 * parse.y (java_check_regular_methods): Local `super_class' gone.
9085 Call lookup_argument_method2 instead of lookup_argument_method.
9086 Perform modifier match for methods found declared in implemented
9087 interfaces. Fixed indentation problem. Overriding/hiding error
9088 report to take place only for methods found in classes.
9089 * typeck.c (lookup_argument_method): Changed leading
9090 comment. Re-written by calling lookup_do.
9091 (lookup_argument_method2): New function.
9092 (lookup_java_method): Re-written by calling lookup_do.
9093 (lookup_do): New function.
9095 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9097 * check-init.c (check_init): Removed dead code. Handle (blank)
9099 * parse.y (declare_local_variables): New local `final_p', set it
9100 and use it to initialize LOCAL_FINAL.
9101 (check_final_assignment): Only check FIELD_DECLs.
9103 2000-02-17 Tom Tromey <tromey@cygnus.com>
9105 * Makefile.in (JAVA_OBJS): Added boehm.o.
9106 (boehm.o): New target.
9107 * Make-lang.in (JAVA_SRCS): Added boehm.c.
9108 * java-tree.h (flag_use_boehm_gc): Declare.
9109 (get_boehm_type_descriptor): Declare.
9110 * lang.c (lang_f_options): Added `use-boehm-gc'.
9111 (flag_use_boehm_gc): New global.
9112 * lang-options.h: Added -fuse-boehm-gc.
9113 * boehm.c: New file.
9114 * class.c (get_dispatch_table): If class uses a Boehm type
9115 descriptor, put it in the vtable.
9116 (make_class_data): Removed dead code.
9118 2000-03-03 Per Bothner <per@bothner.com>
9120 * decl.c (init_decl_processing): Initialize sizetype properly.
9122 2000-03-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9124 * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
9125 (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
9126 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
9127 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
9128 (jcf_parse): New local `current'. Load innerclasses seen in outer
9129 context being processed.
9130 * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
9131 * jcf-write.c (append_innerclasses_attribute): New function.
9132 (append_innerclasses_attribute_entry): Likewise.
9133 (get_access_flags): Handle static classes. Set anonymous and local
9134 classes to be private.
9135 (generate_classfile): Attribute count adjusted. Call
9136 append_innerclasses_attribute.
9137 * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
9138 PURE_INNER_CLASS_TYPE_P.
9139 * parse.y (parser_qualified_classname): New parameter `is_static',
9140 produce non qualified name accordingly.
9141 (block_statement:): Set LOCAL_CLASS_P when declaring local class.
9142 (create_interface): Added argument to parser_qualified_classname.
9143 (create_class): Added argument to parser_qualified_classname. Setup
9144 alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
9145 (add_inner_class_fields): Fixed indentation.
9146 (method_declarator): Use PURE_INNER_CLASS_DECP_P.
9147 (method_declarator): Fixed typo in comment.
9148 (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
9149 (build_current_thisn): Likewise.
9150 (patch_method_invocation): Likewise.
9152 2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
9154 * decl.c (current_function_decl): Move to toplev.c.
9156 2000-02-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
9158 * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
9159 (DECL_BIT_INDEX): Use underlying representation.
9160 * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
9162 2000-02-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
9164 * expr.c (build_java_ret): Pass proper type to size_binop.
9166 2000-02-25 Anthony Green <green@cygnus.com>
9168 * expr.c (build_class_init): Mark the decl to be ignored by
9170 * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
9171 * check-init.c: Move DECL_BIT_INDEX to java-tree.h
9172 * class.c (init_test_hash_newfunc): New function.
9173 (decl_hash): New function.
9174 (decl_compare): New function.
9175 * decl.c (emit_init_test_initialization): New function.
9176 (complete_start_java_method): Traverse the init test hashtable,
9177 calling emit_init_test_initialization.
9178 (always_initialize_class_p): Define.
9179 * expr.c (build_class_init): Use initialization tests when
9180 emitting class initialization code.
9181 (always_initialize_class_p): Declare.
9182 * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
9184 * java-tree.h: Include hash.h.
9185 (DECL_FUNCTION_INIT_TEST_TABLE): Define.
9186 (struct lang_decl): Add init_test_table field.
9187 (init_test_hash_entry): Define.
9189 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9191 * gjavah.c (main): Avoid using `argi' to report unimplemented
9194 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9196 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
9197 initialize locals to avoid warnings. Local `exception_type' moved
9200 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9202 * parse.y (resolve_expression_name): Use `orig' as a second
9203 argument to resolve_field_access.
9204 (resolve_field_access): Removed unnecessary code when dealing with
9207 2000-02-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
9209 * class.c (push_super_field): Don't push the field twice.
9210 * jcf-parse.c (parse_source_file): Call java_reorder_fields.
9211 * parse.h (java_reorder_fields): Prototyped.
9212 * parse.y (java_reorder_fields): New function.
9213 (java_layout_class): Simplified not to worry about re-ordering.
9215 2000-02-23 Tom Tromey <tromey@cygnus.com>
9217 * gjavah.c (print_name): In JNI case, correctly quote string.
9218 (print_method_info): Don't handle overrides in JNI mode.
9220 2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9222 * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
9223 value type set to `boolean_type_node'.
9225 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
9227 * jcf-dump.c (main): Test for correct condition after
9228 output file creation.
9230 2000-02-19 Anthony Green <green@cygnus.com>
9232 * jcf-depend.c (add_entry): Fix test for first list entry.
9234 2000-02-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
9236 * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
9237 * constants.c (build_constants_constructor): Likewise.
9239 2000-02-19 Anthony Green <green@cygnus.com>
9241 * jcf-depend.c (add_entry): Add entries to the end of the list.
9243 1999-11-03 Pekka Nikander <pekka.nikander@hut.fi>
9245 * decl.c (INT_TYPE_SIZE): Define if necessary.
9246 (expand_java_return): Handle the case of a native integer smaller
9249 2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
9251 * gjavah.c (help): Use GCCBUGURL.
9252 * jv-scan.c (help): Likewise.
9253 * jcf-dump.c (help): Likewise.
9255 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9257 * jcf-write.c (generate_bytecode_insns): Don't generate empty
9260 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9262 * jcf-parse.c (load_class): Call `fatal' if no file containing
9263 the target class are found.
9265 2000-02-16 Zack Weinberg <zack@wolery.cumb.org>
9267 * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
9268 lex.c, lex.h, and PARSE_H to...
9269 (parse.o, parse-scan.o): ...here, respectively.
9271 * lex.c: Split out code that may trigger SIGFPE from yylex()
9272 to its own function.
9273 * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
9275 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9277 * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
9279 2000-02-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
9281 * parse.y (outer_field_access_p): Stop in time when outer contexts
9283 (resolve_qualified_expression_name): Properly qualify *everything*
9284 after a package.type to be resoled as expression names.
9285 (find_applicable_accessible_methods_list): Save/restore `class' to
9286 isolate it from a possible outer context search.
9288 2000-02-15 Tom Tromey <tromey@cygnus.com>
9290 * gjavah.c (jni_print_char): New function.
9291 (print_full_cxx_name): Use it.
9292 (decode_signature_piece): Likewise.
9293 (print_cxx_classname): Likewise.
9295 2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9297 * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
9299 (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
9301 * gjavah.c: Include version.h.
9303 * jcf-dump.c: Likewise.
9305 * jv-scan.c: Likewise.
9307 2000-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
9309 * parse.y (outer_field_access_fix): First parameter now a tree
9310 node. Check for assignment to final. First argument to
9311 build_outer_field_access_fix modified to accommodate prototype.
9312 (build_outer_field_access): Don't check for assignment to final
9314 (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
9315 possibly returned by outer_field_access_fix. Changed
9316 outer_field_access_fix's first argument.
9317 (check_final_assignment): $finit$'s context is OK.
9318 (patch_unaryop): Use node instead of its line/column value when
9319 calling outer_field_access_fix.
9321 2000-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
9323 * parse.y (interface_declaration:): No longer tagged
9324 <node>. Re-installed default action.
9325 (class_member_declaration:): Handle inner interfaces.
9326 (interface_member_declaration): Handle inner interfaces and
9328 (create_interface): Push error if one seen. Suspend parsing
9329 context when processing an inner interface.
9330 (register_fields): Inner class static field limitations not to
9331 apply to inner interfaces.
9333 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9335 * jcf-parse.c (load_class): Update `java_error_count' when a
9336 class' file can't be found.
9337 (parse.y): Avoid (byte)code generation when errors seen.
9339 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9341 * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
9342 decodes a valid node.
9343 (patch_binop): Handle TRUNC_DIV_EXPR.
9345 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9347 * parse.y (resolve_package): New local `acc'. Try to progressively
9348 build and guess a package and type name.
9350 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9352 * parse.y (find_applicable_accessible_methods_list): Load and
9353 layout the search class if necessary.
9354 (java_complete_tree): Keep to original type of the folded initial
9357 2000-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
9359 * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
9360 Generate error message if circularity is detected. New static
9362 * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro. *
9363 * jcf-write.c (generate_bytecode_insns): Very simply handle
9365 * parse.y (java_check_circular_reference): Use
9366 `cyclic_inheritance_report' during report, if necessary.
9367 (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
9368 walking NEW_ARRAY_INIT twice.
9370 2000-02-09 Tom Tromey <tromey@cygnus.com>
9372 * parse.y (check_class_interface_creation): Allow inner classes to
9373 be `private' or `protected', check modifiers' consistency. Prevent
9374 block local classes from bearing any modifiers.
9376 2000-02-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9378 * except.c (check_start_handlers): Re-add prototype lost in last
9380 (maybe_start_try): Remove excess argument to `check_start_handlers'.
9382 2000-02-09 Andrew Haley <aph@cygnus.com>
9384 * decl.c (clear_binding_level): Remove excess initializer.
9385 (maybe_poplevels): Remove unused variable.
9386 (force_poplevels): Ditto.
9387 (struct binding_level): Add comment.
9389 2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9391 * jcf-write.c (generate_classfile): Don't consider
9392 pre-initialization with reference value (use <clinit> instead.)
9393 * parse.y (java_fix_constructors): No generated constructor for
9395 (build_outer_field_access): Removed debug message.
9396 (outer_field_expanded_access_p): Adapted to bytecode generation.
9397 (build_outer_field_access_method): Use fix_method_argument_names.
9398 (build_outer_method_access_method): Fixed indentation. Added
9399 comment. Handle access method generation for static and also void
9401 (build_access_to_thisn): Inserted debug message.
9402 (maybe_build_thisn_access_method): Use fix_method_argument_names.
9403 (resolve_qualified_expression_name): Fixed comment.
9404 (not_accessible_p): Adapted to bytecode generation. Added comment.
9405 (patch_method_invocation): Added comment.
9406 (maybe_use_access_method): Fixed leading comment. Handle static
9408 (java_complete_lhs): Don't shortcut handling of initialized upon
9409 declaration String type static fields when generating bytecode.
9410 (patch_unaryop): Handle outer field access when generating
9413 2000-02-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
9415 * java-tree.h (FIELD_THISN): New macro.
9416 * jcf-write.c (append_synthetic_attribute): New function.
9417 (generate_classfile): Set "Synthetic" attribute on this$<n>,
9418 val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
9419 * parse.y (add_inner_class_fields): Set FIELD_THISN for created
9421 (build_outer_field_access): Turned on access functions usage and
9422 generation when compiling to bytecode.
9423 (maybe_use_access_method): Likewise.
9425 2000-01-25 Andrew Haley <aph@cygnus.com>
9427 * java-except.h (struct eh_range): Add `expanded' field.
9428 (maybe_start_try): Add end_pc arg.
9429 (maybe_end_try): Ditto.
9430 * java-tree.h (force_poplevels): new function.
9431 * expr.c (expand_byte_code): Don't call maybe_start_try or
9433 * except.c (add_handler): Reset expanded.
9434 (expand_start_java_handler): Set expanded.
9435 (check_start_handlers): Don't expand a start handler that's
9436 already been expanded.
9437 (maybe_start_try): Add end_pc arg. Only expand a handler which
9439 (expand_end_java_handler): call force_poplevels.
9440 (force_poplevels): new function.
9441 * decl.c (binding_level): Add start_pc of binding level.
9442 (maybe_pushlevels): Call maybe_start_try when pushing binding
9444 (maybe_poplevels): Call maybe_end_try when popping binding levels.
9445 (LARGEST_PC): Define.
9446 (clear_binding_level): Use LARGEST_PC.
9448 * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
9449 * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
9450 (binding_depth, is_class_level, current_pc): new variables.
9451 (struct binding_level): ditto.
9452 (indent): new function.
9453 (push_jvm_slot): add debugging info.
9454 (maybe_pushlevels): ditto.
9455 (maybe_poplevels): ditto.
9458 (start_java_method): ditto.
9459 (give_name_to_locals): comment only.
9460 * except.c (binding_depth, is_class_level, current_pc):
9462 (expand_start_java_handler): add debugging info.
9463 (expand_end_java_handler): ditto.
9465 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9467 * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
9468 (print_name_for_stub_or_jni, process_file): Constify a char*.
9470 2000-02-03 Tom Tromey <tromey@cygnus.com>
9472 * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
9474 2000-01-31 Scott Bambrough <scottb@netwinder.org>
9476 * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
9477 assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
9480 2000-02-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9482 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
9483 * java-tree.h (TYPE_II_STMT_LIST): New macro.
9484 (struct lang_type): New field `ii_block'.
9485 * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
9486 CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
9487 * parse.h (struct parser_ctxt): New field `instance_initializers'.
9488 (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
9489 CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
9490 CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
9492 * parse.y (add_instance_initializer): New function.
9493 (in_instance_initializer): New static global.
9494 (class_body_declaration:): Link instance initializer block.
9495 (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
9496 (array_creation_expression:): Remove unused local.
9497 (java_parser_context_push_initialized_field): Fixed leading
9498 comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
9499 CPC_INSTANCE_INITIALIZER_LIST.
9500 (java_parser_context_pop_initialized_field): Likewise.
9501 (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
9502 (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
9503 CPC_INITIALIZER_STMT.
9504 (fix_constructors): New local `class_type'. Use it. Call
9505 add_instance_initializer.
9506 (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
9507 (patch_return): Forbid return in instance initializers.
9508 (patch_throw_statement): Enforce exception handling in the context
9509 of instance initializers.
9511 2000-02-03 Tom Tromey <tromey@cygnus.com>
9513 * Make-lang.in (java.mostlyclean): Remove executables in
9516 2000-01-31 Scott Bambrough <scottb@netwinder.org>
9518 * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
9519 HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
9520 (java_float_finite): Convert to use union Word from javaop.h.
9521 (java_double_finite): Convert to use union DWord from javaop.h.
9523 2000-02-02 Tom Tromey <tromey@cygnus.com>
9525 * gjavah.c (options): Added `jni' entry.
9526 (help): Document -jni.
9527 (flag_jni): New global.
9528 (process_file): Handle JNI output. Don't print text from
9529 -prepend, -add, etc, when generating stubs. Only remove `.class'
9530 suffix if it actually exists.
9531 (main): Create a `.c' file when run with `--jni --stubs'. Create
9532 correct output file name with `--jni'.
9533 (print_include): Mangle header name differently in JNI case.
9534 (HANDLE_METHOD): In JNI mode, call print_method_info to generate
9536 (print_method_info): Handle JNI case. Put signature info into
9537 method name. Handle case when STREAM is NULL.
9538 (print_name_for_stub_or_jni): New function.
9539 (print_stub_or_jni): Renamed from `print_stub'. Handle JNI.
9540 (print_cxx_classname): Handle JNI.
9541 (print_full_cxx_name): Likewise.
9542 (decode_signature_piece): Likewise.
9543 (overloaded_jni_method_exists_p): New function.
9544 (struct method_name): Added `signature' and `sig_length' fields.
9545 (HANDLE_END_FIELD): Do nothing in JNI mode.
9547 2000-02-02 Tom Tromey <tromey@cygnus.com>
9549 * jv-scan.c: Include version.c, <getopt.h>.
9550 (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
9551 (options): New array.
9552 (usage): New function.
9553 (version): New function.
9554 (main): Use getopt_long to parse command line.
9555 * jcf-dump.c: Include version.c, <getopt.h>.
9556 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
9557 OPT_JAVAP): New macros.
9558 (options): New array.
9559 (usage): Return `void'. Changed message.
9560 (help): New function.
9561 (version): New function.
9562 (main): Use getopt_long_only to parse command line.
9563 * gjavah.c: Include <getopt.h>.
9564 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
9565 OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
9566 OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
9567 (options): New array.
9568 (java_no_argument): Removed.
9569 (help): Updated with missing options.
9570 (main): Use getopt_long_only to parse command line.
9571 (usage): Changed message.
9573 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9575 * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
9576 * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
9577 ANONYMOUS_ARRAY_INITIALIZER): New access macros.
9578 * parse.y (array_creation_expression:): Handle anonymous arrays.
9579 (build_array_from_name): Don't set `ret_name' if null.
9580 (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
9581 (qualify_ambiguous_name): Likewise.
9582 (java_complete_expand_class): Likewise.
9584 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9586 * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
9587 * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
9588 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
9589 (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
9590 (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
9591 AIPL_FUNCTION_COMPLETED_INVOCATION.
9592 (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
9593 AIPL_FUNCTION_INVOCATION_READY.
9594 (AIPL_FUNCTION_DECLARATION): New enum entry.
9595 * parse.y (reorder_static_initialized): New function.
9596 (java_parser_context_pop_initialized_field): Use it.
9597 (add_inner_class_fields): Use
9598 MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
9599 augmented. Install marker after last alias initializer, if any.
9600 (generate_finit): Fixed typo. Don't try to retain only the used
9602 (method_header): Compute and set DECL_FUNCTION_NAP.
9603 (method_declarator): Fixed comment. Insert alias initializer in
9605 (build_alias_initializer_parameter_list): Fixed leading
9606 comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
9607 replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
9608 (java_complete_expand_class): Code to retain only used aliases
9610 (java_complete_expand_methods): New local `first_decl'. Generate
9611 $finit$ first, then expand the constructors, regular methods and
9613 (java_complete_expand_method): Don't report error on missing
9614 return statement if previously detected bogus.
9615 (fix_constructors): Don't patch constructor parameters list.
9616 (patch_method_invocation): Use new AIPL enum values. Reverse
9617 alias initializer list for anonymous classes.
9619 2000-01-30 Anthony Green <green@redhat.com>
9621 * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
9622 determine how many stack slots to pop.
9624 2000-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
9626 * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
9627 error handling/recovery.
9628 * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
9630 2000-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
9632 * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
9633 FIELD_LOCAL_ALIAS_USED): New macros.
9634 (DECL_FUNCTION_NAP): New macro.
9635 (struct lang_decl): New field `nap'.
9636 (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
9637 (struct lang_type): New fields `finit_stmt_list' and
9639 (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
9640 * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
9641 (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
9642 UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
9643 (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
9644 AIPL_FUNCTION_INVOCATION_READY): New enum fields.
9645 (BUILD_THROW): Macro line separator re-indented.
9646 * parse.y (end_class_declaration): New function.
9647 (maybe_generate_pre_expand_clinit): New name for
9648 java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
9649 pre-expand static fields.
9650 (maybe_generate_clinit): Function deleted.
9651 (check_for_static_method_reference): Prototype's parameter list
9653 (generate_finit): New name for maybe_generate_finit. Changed
9654 leading comment. Function rewritten to use
9655 TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
9656 (build_alias_initializer_parameter_list): New function.
9657 (java_parser_context_pop_initialized_field): Likewise.
9658 (add_inner_class_fields): Likewise.
9659 (type_declaration:): Call end_class_declaration.
9660 (class_member_declaration:): Likewise.
9661 (formal_parameter_list:): Fixed typos.
9662 (formal_parameter:): Use ARG_FINAL_P to mark created tree list
9663 element. Improved error handling.
9664 (block_statement:): Call end_class_declaration.
9665 (anonymous_class_creation:): Likewise.
9666 (create_anonymous_class): Fixed comments.
9667 (create_class): Call add_inner_class_fields.
9668 (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
9669 (method_header): Use MARK_FINAL_PARMS.
9670 (finish_method_declaration): Use UNMARK_FINAL_PARMS.
9671 (method_declarator): Propagate final argument flag.
9672 (craft_constructor): New local `artificial'. Call
9673 build_alias_initializer_parameter_list. Use
9674 CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
9675 (source_start_java_method): Mark parm decls with LOCAL_FINAL if
9677 (complete_expand_class): Get rid of unused outer context local
9679 (java_complete_expand_methods): Fixed leading
9680 comment. Generate/pre-expand <clinit> first. Changed method
9681 expansion order to regular, $finit$, constructors, <clinit>.
9682 (java_complete_expand_method): Set current_function_decl.
9683 (fix_constructors): Fix constructor parameter list to account for
9684 outer context local alias initializers.
9685 (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
9686 (resolve_expression_name): Lookup outer context local aliases. New
9687 local `access', use it.
9688 (patch_method_invocation): Patch inner class ctor invocation with
9689 outer context local aliases initialization values. $finit$
9690 invocation patching now includes things generated with
9691 build_alias_initializer_parameter_list.
9692 (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
9693 (build_super_invocation): Likewise.
9694 (patch_assignment): Changed comment.
9696 2000-01-27 Andrew Haley <aph@cygnus.com>
9698 * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
9702 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9704 * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
9706 (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
9708 * parse.y (register_fields): Don't pass a format specifier to
9709 OBSOLETE_MODIFIER_WARNING.
9710 (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
9711 instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
9713 (check_modifiers): Change function into a macro.
9714 (check_class_interface_creation): Pass a literal format string.
9716 2000-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9718 * buffer.h: PROTO -> PARAMS.
9719 * check-init.c: Likewise.
9720 * class.c: Likewise.
9721 * constants.c: Likewise.
9722 * convert.h: Likewise.
9724 * except.c: Likewise.
9726 * gjavah.c: Likewise.
9727 * java-except.h: Likewise.
9728 * java-tree.h: Likewise.
9729 * jcf-depend.c: Likewise.
9730 * jcf-dump.c: Likewise.
9731 * jcf-parse.c: Likewise.
9732 * jcf-path.c: Likewise.
9733 * jcf-reader.c: Likewise.
9734 * jcf-write.c: Likewise.
9736 * jv-scan.c: Likewise.
9737 * jvgenmain.c: Likewise.
9738 * jvspec.c: Likewise.
9742 * parse-scan.y: Likewise.
9743 * parse.h: Likewise.
9744 * parse.y: Likewise.
9745 * typeck.c: Likewise.
9746 * verify.c: Likewise.
9749 * zextract.c: Likewise.
9750 * zipfile.h: Likewise.
9752 2000-01-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
9754 * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
9755 (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
9756 * constants.c (build_constant_data_ref): Check for cached
9757 current_constant_pool_data_ref. Cache current_constant_pool_data_ref
9758 in TYPE_CPOOL_DATE_REF.
9759 * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
9760 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
9761 (struct lang_type): New fields `cpool' and `cpool_data_ref'.
9762 (LOCAL_FINAL): New macro.
9763 * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
9764 constant pool -- don't try to reuse.
9765 (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
9767 (find_in_current_zip): Use TYPE_JCF.
9768 * parse.h (java_check_final): Prototype removed.
9769 * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
9770 (maybe_create_class_interface_decl,
9771 check_class_interface_creation): Likewise.
9772 (java_expand_finals): Function removed.
9773 (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
9774 (block_statement:): Fixed comment.
9775 (anonymous_class_creation:): Likewise.
9776 (check_class_interface_creation): Reversed Jan 12, 2000 extra
9778 (check_class_interface_creation): Loosened error report on (inner)
9779 public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
9780 (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
9781 (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
9783 (create_interface): Likewise.
9784 (anonymous_class_counter): New static global.
9785 (create_anonymous_class): Reversed Jan 12, 2000 extra argument
9786 patch. Fixed comments.
9787 (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
9788 anonymous_class_counter when declaring a toplevel class.
9789 (craft_constructor): Fixed constructor name when handling
9790 anonymous classes. Anonymous class constructors to feature hidden
9792 (java_fix_constructors): Added comment.
9793 (java_check_final): Function removed.
9794 (java_complete_expand_methods): Fixed comment. Don't generate
9795 class data, save its outgoing constant pool instead.
9796 (verify_constructor_super): Skip anonymous class constructor
9797 hidden this$<n> parameter.
9798 (java_expand_classes): New local `saved_ctxp'. Removed call to
9799 java_expand_finals and java_check_final. Expand anonymous class
9800 constructors. Generate class data.
9801 (build_super_invocation): Skip anonymous class hidden this$<n>
9803 * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
9804 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
9805 (set_java_signature): Likewise.
9807 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
9809 * gjavah.c: Delete ACC_VISIBILITY define.
9810 * jcf.h: Add ACC_VISIBILITY define.
9811 * parse.y: final: rule tagged <value>.
9812 (java_check_regular_methods): Use ACC_VISIBILITY define for
9813 default package access check.
9814 (local_variable_declaration_statement): Use final: rule.
9816 2000-01-17 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
9818 * parse.y (format_parameter:): Use final: rule instead of modifiers:.
9821 2000-01-17 Tom Tromey <tromey@cygnus.com>
9823 * gjavah.c (print_field_info): Allow non-static final fields.
9825 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9827 * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
9828 * parse.y (patch_anonymous_class): New function.
9829 (create_anonymous_class): Register incomplete type when the
9830 class/interface to extends/implement isn't known yet.
9831 (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
9832 (verify_constructor_super): Tuned error message.
9834 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9836 * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
9837 (ANONYMOUS_CLASS_P): New macro.
9838 (TYPE_SIGNATURE, TYPE_JCF): New macros.
9839 (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
9840 * parse.y (create_class): Added leading argument.
9841 (maybe_create_class_interface_decl,
9842 check_class_interface_creation): Likewise.
9843 (craft_constructor): New function.
9844 (verify_constructor_super): Added argument in prototype.
9845 (class_declaration:): Inserted leading argument.
9846 (for_begin:): Use FOR_LOOP_P.
9847 (anonymous_class_creation): Create WFL of the anonymous class to
9848 instantiate. Call build_new_invocation. Added comments.
9849 (check_class_interface_creation): Handle parameter `anonymous' in
9850 verbose mode class creation announce.
9851 (link_nested_class_to_enclosing): Exclude anonymous classes.
9852 (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
9853 anonymous class, even though they appear to have an enclosing
9855 (create_interface): Pass extra argument to
9856 check_class_interface_creation.
9857 (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
9858 (create_class): Call check_class_interface_creation and
9859 maybe_create_class_interface_decl with extra new argument. Don't
9860 add private this$<n> to anonymous classes.
9861 (method_declarator): Insert hidden this$<n> to anonymous class
9863 (java_fix_constructors): Deleted code creating default
9864 constructor. Call craft_constructor instead.
9865 (java_check_regular_methods): Set `saw_constructor' to 1 for
9867 (fix_constructors): Pass extra argument to verify_constructor_super.
9868 (verify_constructor_super): New local `sdecl', use it. Search for
9869 matching constructor (possibly featuring arguments) in super
9871 (lookup_method_invoke): Craft constructor according to arguments
9872 list when dealing with anonymous class constructors.
9873 (build_super_invocation): Pass arguments to anonymous class super
9875 (search_loop): Use FOR_LOOP_P.
9876 (labeled_block_contains_loop_p): Likewise.
9878 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
9880 * class.c (set_super_info): Set CLASS_STATIC when appropriate.
9881 (enclosing_context_p): New function.
9882 (get_access_flags_from_decl): Handle CLASS_STATIC.
9883 (maybe_layout_super_class): Extra first argument passed to
9885 (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
9887 * decl.c (access0_identifier_node): New global.
9888 (init_decl_processing): access0_identifier_node initialized.
9889 (pushdecl): Set DECL_CONTEXT only on non type decls.
9890 * expr.c (lookup_field): Lookup inner class fields in enclosing
9892 (expand_invoke): Use ID_INIT_P.
9893 (expand_java_field_op): Use DECL_CLINIT_P.
9894 * java-tree.def (CLASS_LITERAL): New tree code.
9895 * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
9896 DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
9897 (struct lang_decl): New field `inner_access'.
9898 (enclosing_context_p): Prototyped.
9899 (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
9900 ID_CLINIT_P): New macros.
9901 (CLASS_STATIC): New macro.
9902 (CLASS_ACCESS0_GENERATED_P): New macro.
9903 (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
9904 TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
9905 INNER_CLASS_P): New macros.
9906 (DECL_INNER_CLASS_LIST): New macro.
9907 * jcf-parse.c (yyparse): Avoid the use of ANSI string
9909 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
9910 the shift value to int. Fixed typo in comment.
9911 * lex.c (inst_id, wpv_id): Initialize.
9912 * mangle.c (unicode_mangling_length): Take `$' into account.
9913 * parse.h (DRECOVER, RECOVER): Terminate properly.
9914 (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
9915 (typedef struct _jdep): New field `enclosing'.
9916 (JDEP_ENCLOSING): New macro.
9917 (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
9918 (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
9919 (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
9920 GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
9921 GET_ENCLOSING_CPC_CONTEXT): New macros.
9922 (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
9923 (do_resolve_class): Added extra argument in prototype.
9924 * parse.y (resolve_class): Added extra argument in prototype.
9925 (maybe_create_class_interface_decl): Likewise.
9926 (maybe_use_access_method, build_wfl_wrap): New functions.
9927 (java_complete_expand_classes, java_complete_expand_class):
9929 (java_parser_context_push_initialized_field,
9930 java_parser_context_suspend, java_parser_context_resume):
9932 (maybe_make_nested_class_name, make_nested_class_name,
9933 set_nested_class_simple_name_value,
9934 link_nested_class_to_enclosing, find_as_inner_class,
9935 find_as_inner_class_do, check_inner_class_redefinition,
9936 build_thisn_assign, build_current_thisn, build_access_to_thisn,
9937 maybe_build_thisn_access_method, build_outer_field_access,
9938 build_outer_field_access_methods, build_outer_field_access_expr,
9939 build_outer_method_access_method, build_new_access_id,
9940 build_outer_field_access_method, outer_field_access_p,
9941 outer_field_expanded_access_p, outer_field_access_fix,
9942 build_incomplete_class_ref, patch_incomplete_class_ref,
9943 create_anonymous_class): Likewise.
9944 (inst_id, wpv_id): New static global variables.
9945 (synchronized:): New rule, tagged <node>.
9946 (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
9948 (anonymous_class_creation:): New rule, tagged <node>.
9949 (NEW_TK): Tagged <node>.
9950 (type_literals, array_type_literal): New rules, tagged <node>.
9951 (class_declaration:): Removed action when reducing by class_body:
9952 (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
9953 using GET_CPC in sub-rules.
9954 (class_member_declaration): Handle inner classes.
9955 (method_declaration): When reducing method_header:, reset
9956 current_function_decl when appropriate.
9957 (method_declarator:): Set the number of formal parameter to 0 for
9958 method declared without arguments.
9959 (constructor_declarator:): Likewise.
9960 (static_initializer:): List of elements kept in a list.
9961 (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
9962 use of the keyword `static' for type declarations.
9963 (block_statement:): Handle inner class declarations.
9964 (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
9965 type qualified `this'.
9966 (class_instance_creation_expression): Use anonymous_class_creation:
9967 to handle inner class instances creation. Handle qualified `new'.
9968 (something_dot_new): Added appropriate actions.
9969 (create_new_parser_context): New function.
9970 (java_push_parser_context, java_parser_context_save_global,
9971 java_parser_context_suspend): Use create_new_parser_context.
9972 (check_modifiers): Changed leading comment.
9973 (check_class_interface_creation): Handle interclasses.
9974 (add_superinterfaces): Fixed comment.
9975 (create_interface): Build qualified name from the raw_name instead
9976 of its matching WFL. Push the initialized fields list. raw_name added
9977 as an extra argument to maybe_create_class_interface_decl.
9978 (create_class): Build qualified name from the raw_name instead of
9979 its matching WFL. Removed assignment to current_parsed_class_un.
9980 Call PUSH_ERROR before returning an error. Suspend the current
9981 parser context when processing an inner class. Push the
9982 initialized fields list. raw_name added as an extra argument to
9983 maybe_create_class_interface_decl. Add the private this$<n>
9985 (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
9986 (register_fields): Get the class type from GET_CPC and handle
9987 previous errors. Added code to handle the creation of static
9988 fields in inner classes. Initialized fields initialization
9989 statements kept in a list of lists.
9990 (maybe_generate_finit): Initialized fields initialization
9991 statements kept in a list of lists. Use GET_CPC.
9992 (maybe_generate_clinit): Likewise.
9993 (method_header): Use GET_CPC and GET_CPC_UN.
9994 (parser_qualified_classname): Handle inner classes.
9995 (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
9996 (java_fix_constructors): Hide pointer to enclosing context
9997 instance in constructor list when dealing with inner classes.
9998 (jdep_resolve_class): Call resolve_class with extra first argument
10000 (resolve_class): Add enclosing context as a first extra argument
10001 to do_resolve_class.
10002 (do_resolve_class): Call find_as_inner_class. Handle WFLs
10004 (resolve_no_layout): Extra argument added to resolve_class
10006 (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
10007 (java_get_real_method_name): Use GET_CPC_UN.
10008 (check_abstract_method_definitions): Use DECL_CLINIT_P.
10009 (java_check_abstract_methods): Handle static method declared in
10010 inner classes by an error.
10011 (java_check_regular_methods): Use DECL_CLINIT_P.
10012 (source_start_java_method): Also set DECL_MAX_LOCALS.
10013 (create_artificial_method): Call java_parser_context_save_global
10014 and java_parser_context_restore_global instead of saving/restoring
10015 the context by hand.
10016 (expand_start_java_method): Improved verbose mode message.
10017 (java_complete_expand_methods): Fixed leading comment. Use
10019 (fix_constructors): Added assignment to this$<n> if necessary.
10020 (java_expand_classes): Call java_complete_expand_classes instead
10021 of java_complete_expand_methods.
10022 (make_qualified_primary): Simplified.
10023 (merge_qualified_name): Optimized for missing left or right parts.
10024 (resolve_expression_name): Handle access to outer class fields from
10026 (resolve_qualified_expression_name): New macro
10027 RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
10028 classes. Report error on non appropriate qualification of
10029 `new'. Handle qualified `this'.
10030 (not_accessible_p): Allow access to outer class private fields from
10032 (patch_method_invocation): Handle method invocations through
10033 access methods and inner class constructor invocations.
10034 (find_applicable_accessible_methods_list): Search enclosing
10035 contexts of an inner class.
10036 (search_applicable_methods_list): Fixed typo.
10037 (argument_types_convertible): Handle inner class constructors'
10038 hidden outer context reference argument.
10039 (qualify_ambiguous_name): Handle qualified `this'.
10040 (java_complete_lhs): Handle use of field accessed through
10041 artificial access methods in various cases of assignments. Handle
10042 CLASS_LITERAL node.
10043 (check_final_assignment): Use DECL_CLINIT_P.
10044 (valid_ref_assignconv_cast_p): Handle the destination being an
10045 enclosing context of the source.
10046 (patch_unaryop): Handle use of field accessed through artificial
10048 (patch_return): Use DECL_CLINIT_P.
10049 (patch_throw_statement): Use DECL_CLINIT_P.
10050 (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
10051 * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
10054 2000-01-16 Anthony Green <green@cygnus.com>
10056 * parse.y (build_string_concatenation): Only use
10057 StringBuffer(String) shortcut if String arg is constant.
10059 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
10061 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
10062 the shift value to int. Fixed typo in comment.
10064 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
10066 * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
10067 * jcf-write.c: Likewise.
10068 * parse.y: Likewise.
10069 * parse.c: Regenerate.
10071 2000-01-09 Anthony Green <green@cygnus.com>
10073 * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
10074 bytecodes in the correct order.
10076 2000-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10078 * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
10080 2000-01-06 Anthony Green <green@cygnus.com>
10082 * expr.c (java_lang_expand_expr): Switch to permanent obstack
10083 before building constant array decl.
10085 2000-01-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
10087 * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
10088 method invocation and typo in conditional expression.
10089 (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
10090 the appropriate NOTE_POP.
10091 * parse.y (patch_binop): Shift value mask to feature the right
10094 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10096 * class.c (assume_compiled, assume_compiled_node): Add static
10098 (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
10100 * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
10102 * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
10104 * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
10105 to `__modifier' to avoid stringifying it.
10107 * parse.y (verify_constructor_circularity): Don't call a variadic
10108 function with a non-literal format string.
10109 (java_check_abstract_methods): Move unreachable code inside
10110 `continue' statement.
10111 (lookup_method_invoke): Call xstrdup, not strdup.
10113 * expr.c (expand_java_field_op): Avoid the use of ANSI string
10116 * jcf-parse.c (yyparse): Likewise.
10118 * jv-scan.c (main): Likewise.
10120 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10122 * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
10123 ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
10124 ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
10127 * parse.y (synchronized, variable_redefinition_error,
10128 check_class_interface_creation, create_interface, create_class,
10129 method_header, finish_method_declaration,
10130 check_modifiers_consistency, method_declarator,
10131 complete_class_report_errors, check_abstract_method_definitions,
10132 java_check_regular_methods, check_throws_clauses,
10133 java_check_abstract_methods, read_import_dir,
10134 check_pkg_class_access, declare_local_variables, fix_constructors,
10135 cut_identifier_in_qualified, resolve_expression_name,
10136 resolve_qualified_expression_name, patch_method_invocation,
10137 java_complete_lhs, patch_assignment, try_builtin_assignconv,
10138 patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
10139 patch_exit_expr, patch_exit_expr, patch_switch_statement,
10140 patch_try_statement, patch_synchronized_statement,
10141 patch_throw_statement, check_thrown_exceptions,
10142 patch_conditional_expr): Likewise.
10144 1999-12-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
10146 * Makefile.in (LIBDEPS): Added gcc's errors.o
10147 (../jcf-dump$(exeext):): Link with gcc's errors.o
10148 (../gcjh$(exeext):): Likewise.
10149 * expr.c (expand_java_NEW): Layout the entire target type instead of
10150 laying out its methods only.
10151 (lookup_field): Layout the class after having loaded it.
10152 * java-tree.h (java_debug_context): Declared.
10153 * jcf-io.c (toplev.h): Included.
10154 (find_class): Removed assignment to jcf's outofsynch
10155 field. Force source file to be read if newer than its matching
10156 class file. Tweaked debug messages.
10157 * jcf-parse.c (jcf_out_of_synch): Deleted.
10158 (read_class): Call to jcf_out_of_synch removed.
10159 * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
10160 (jcf_out_of_synch): Prototype deleted.
10161 * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
10162 `deprecated' and `class_err': integer turned into bit-fields.
10163 New bit-fields `saved_data_ctx' and `saved_data'. Fixed comments.
10164 * parse.y (package_list): New global.
10165 (package_declaration:): Record newly parsed package name.
10166 (extra_ctxp_pushed_p): Static global deleted.
10167 (java_parser_context_save_global): Create buffer context for the
10168 purpose of saving globals, if necessary.
10169 (java_parser_context_restore_global): Pop context pushed for the
10170 purpose of saving globals, if necessary.
10171 (java_debug_context_do): New prototype and function.
10172 (java_debug_context): Likewise.
10173 (do_resolve_class): Use already parsed package names to qualify
10174 and lookup class candidate.
10175 (java_pre_expand_clinit): Removed unnecessary local variable.
10177 1999-12-17 Tom Tromey <tromey@cygnus.com>
10179 * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
10181 (process_file): Use `\n\' at end of each line in string.
10183 1999-12-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
10185 * expr.c (expand_invoke): Layout the loaded class before
10186 attempting to use it.
10187 (expand_java_field_op): Allow final field assignments to take
10189 * typeck.c (convert): Return error_mark_node if expr is null.
10191 1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
10193 * class.c (class_depth): Return -1 if the class doesn't load
10195 * expr.c (can_widen_reference_to): Check for errors during depth
10196 computation and return 0 accordingly.
10197 * jcf-parse.c (parse_source_file): Call java_fix_constructors to
10198 create default constructors and add an other error check.
10199 * parse.h (java_fix_constructors): Prototyped.
10200 * parse.y (java_pre_expand_clinit): Likewise.
10201 (build_super_invocation): Re-prototyped to feature one argument.
10202 (java_check_circular_reference): Directly use `current'.
10203 (java_fix_constructors): New function.
10204 (java_check_regular_methods): Don't create default constructors
10205 here, but abort if none were found.
10206 (java_complete_expand_methods): Pre-process <clinit> calling
10207 java_pre_expand_clinit.
10208 (java_pre_expand_clinit): New function.
10209 (fix_constructors): build_super_invocation invoked with the
10210 current method declaration as an argument.
10211 (build_super_invocation): Use the context of the processed method
10212 decl argument instead of current_class.
10213 * typeck.c (lookup_java_method): Take WFLs in method names into
10216 1999-12-14 Per Bothner <per@bothner.com>
10218 * class.c (make_class_data): flag_keep_inline_functions to keep
10219 private methods in the method array.
10221 1999-12-15 Anthony Green <green@cygnus.com>
10223 * check-init.c (check_init): Take into account both types of
10224 `throw's when checking for uninitialized variables.
10226 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10228 * parse.y (java_complete_lhs): Force conversion of array
10229 dimensions to int_type_node, that's what runtime's ABI expects.
10231 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10233 * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
10234 operand of a WFL, until the Java front-end gets fixed with regard
10235 to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
10237 1999-12-10 Andrew Haley <aph@cygnus.com>
10239 * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
10240 decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
10241 expr.c (build_java_athrow): Add support for sjlj-exceptions.
10242 java-tree.h: Ditto.
10243 jcf-write.c: Ditto.
10245 1999-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
10247 * expr.c (java_lang_expand_expr): Switch to permanent obstack
10248 before calling expand_eh_region_start and expand_start_all_catch.
10249 * except.c (expand_start_java_handler): Switch to permanent
10250 obstack before calling expand_eh_region_start.
10251 (expand_end_java_handler): Switch to permanent obstack before
10252 calling expand_start_all_catch.
10254 1999-12-5 Anthony Green <green@cygnus.com>
10256 * decl.c (init_decl_processing): Mark throw_node as a noreturn
10257 function with side effects.
10258 (init_decl_processing): Mark all memory allocating DECLs with
10261 1999-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10263 * except.c (expand_end_java_handler): Call
10264 expand_resume_after_catch and end_catch_handler.
10266 1999-11-30 Anthony Green <green@cygnus.com>
10268 * verify.c (verify_jvm_instructions): Create new return label
10269 chain if non existent (don't rely on the verified state of the jsr
10272 1999-11-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
10274 * jcf-write.c (generate_bytecode_insns): Fixed indentation for
10275 COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
10277 * parse.y (patch_assignment): Removed bogus final class test on
10278 lhs when checking on whether to emit an ArrayStoreException runtime
10280 * expr.c (expand_java_arraystore): Likewise.
10282 1999-11-28 Anthony Green <green@cygnus.com>
10284 * decl.c (find_local_variable): Reuse single slot decls when
10287 1999-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
10289 * jcf-parse.c (saw_java_source): Global variable removed.
10290 (read_class): Don't use `saw_java_source'. Added extra braces.
10291 (yyparse): Code setting `saw_java_source' removed.
10293 1999-11-24 Mark Mitchell <mark@codesourcery.com>
10295 * except.c (emit_handlers): Zero catch_clauses after emitting them.
10297 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
10299 * verify.c (merge_type_state): Non verified subroutines being
10300 considered more than once to trigger passive type merge.
10302 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
10304 * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
10305 in case of error. Error message tuned.
10307 1999-11-21 Anthony Green <green@cygnus.com>
10309 * constants.c (find_methodref_index): Unwrap method names before
10310 inserting them in the constant pool.
10312 * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
10314 * class.c (assume_compiled_node): New typedef.
10315 (assume_compiled_tree): New static data.
10316 (find_assume_compiled_node): New function.
10317 (add_assume_compiled): New function.
10318 (assume_compiled): New function.
10319 * class.c (make_class_data): Use assume_compiled.
10320 (is_compiled_class): Use assume_compiled.
10322 * java-tree.h (add_assume_compiled): Declare.
10324 * lang.c (lang_decode_option): Parse new options.
10326 1999-11-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10328 * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
10329 int_type_node: that's what `_Jv_AllocObject' expects.
10331 1999-11-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
10333 * parse.y (lookup_method_invoke): Use lang_printable_name to
10334 reliably build the type name during error report. Fixes PR gcj/97.
10336 1999-11-09 Tom Tromey <tromey@cygnus.com>
10338 * jcf-path.c: Include <sys/stat.h>.
10339 (jcf_path_init): Search for libjava.zip. Fixes PR gcj/84.
10340 (DIR_UP): New macro.
10342 1999-11-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10344 * parse.y (source_end_java_method): Resume permanent allocation,
10345 reversing Apr 27 1998 patch.
10346 (patch_string_cst): Pop obstacks after having pushed the permanent
10349 1999-11-05 Tom Tromey <tromey@cygnus.com>
10351 * class.c (finish_class): Emit inlined methods if any native
10352 methods exist in the class. Fixes PR gcj/85.
10354 1999-11-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
10356 * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
10357 (qualify_ambiguous_name): Likewise.
10359 1999-11-03 Godmar Back <gback@cs.utah.edu>
10361 * typeck.c: (lookup_java_method): search all inherited
10362 interfaces when looking up interface method.
10364 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10366 * parse.y (method_header:): Issue error message for rule `type
10368 (synchronized:): Error report when not using synchronized.
10370 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10372 * parse.y (resolve_qualified_expression_name): Prevent `this' from
10373 being used before the superclass constructor has been called.
10374 (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
10375 instead of `CALL_THIS_CONSTRUCTOR_P'.
10377 1999-10-30 Todd T. Fries <todd@lighthouse.fries.net>
10379 * check-init.c: Fix typo in comment.
10381 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
10383 * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
10386 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
10388 * parse.y (expression_statement:): Call function to report
10389 improper invocation of a constructor.
10390 (parse_ctor_invocation_error): New function.
10392 1999-10-26 Mark Mitchell <mark@codesourcery.com>
10394 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
10397 1999-10-21 Tom Tromey <tromey@cygnus.com>
10399 * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
10400 in generated `main'.
10402 1999-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
10404 * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
10405 (qualify_ambiguous_name): Likewise.
10407 1999-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
10409 * parse.y (java_complete_tree): fold_constant_for_init to work on
10411 (java_complete_lhs): Likewise.
10412 (array_constructor_check_entry): Complete an initializer element
10413 on permanent_obstack.
10415 1999-10-19 Tom Tromey <tromey@cygnus.com>
10417 * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
10418 From Mike Moreton <mike@pillim.demon.co.uk>.
10420 1999-10-15 Greg McGary <gkm@gnu.org>
10422 * java-tree.h (flag_bounds_check): Remove extern decl.
10423 * lang.c (flag_bounds_check): Remove global variable.
10424 (lang_f_options): Remove "bounds-check" entry.
10425 (lang_init_options): Default flag_bounds_check to "on".
10427 1999-10-14 Tom Tromey <tromey@cygnus.com>
10429 * jvgenmain.c (usage): New function.
10430 (main): Use it. Also, handle `-D' options.
10431 * jvspec.c (lang_specific_driver): Recognize -D.
10432 (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
10434 * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
10436 1999-10-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10438 * jcf-dump.c (print_constant, disassemble_method): Don't call a
10439 variadic function with a non-literal format string.
10441 * parse-scan.y (report_main_declaration): Likewise.
10443 * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
10445 * parse.y (read_import_dir, patch_assignment, patch_binop,
10446 patch_array_ref): Likewise.
10448 * typeck.c (build_java_array_type): Likewise.
10450 * verify.c (verify_jvm_instructions): Likewise.
10452 1999-10-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
10454 * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
10456 1999-10-07 Anthony Green <green@cygnus.com>
10458 * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
10459 where CHECK_PUT may fail for valid reasons.
10461 * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
10462 UNSAFE_PUTN): New macros.
10464 1999-10-04 Tom Tromey <tromey@cygnus.com>
10466 * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
10467 well. Fixes Java PR gcj/59.
10468 * parse-scan.y (yyerror): Report errors.
10470 1999-09-24 Glenn Chambers <GChambers@provsol.com>
10472 * decl.c (insert_block): Remove unconditional `abort'.
10474 1999-09-24 Bernd Schmidt <bernds@cygnus.co.uk>
10476 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
10477 FUNCTION_CODE now of type int. All callers changed.
10478 Set the builtin's DECL_BUILT_IN_CLASS.
10480 1999-09-23 Tom Tromey <tromey@cygnus.com>
10482 * jvspec.c (lang_specific_driver): Don't read spec file if
10483 -fsyntax-only given.
10485 1999-09-22 Tom Tromey <tromey@cygnus.com>
10487 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
10489 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
10490 (WORDS_TO_LONG): Likewise.
10491 (WORDS_TO_DOUBLE): Likewise.
10493 1999-09-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
10495 * jcf-write.c (RELOCATION_VALUE_0): New macro.
10496 (RELOCATION_VALUE_1): Likewise.
10497 (emit_iinc, emit_reloc, push_constant1, push_constant2,
10498 push_in_const, push_long_const): Prototyped.
10499 (push_constant1): Argument `index' is of type HOST_WIDE_INT.
10500 (push_constant2): Likewise.
10501 (push_int_const): Cast find_constant1's integer arguments to `jword'.
10502 (find_constant_wide): Cast find_constant2's integer arguments to
10504 (find_constant_index): Cast find_constant2's and find_constant2's
10505 integer arguments to `jword'.
10506 (emit_pop): Argument `value' is of type HOST_WIDE_INT.
10507 (emit_switch_reloc): Use RELOCATION_VALUE_0.
10508 (emit_if): Use RELOCATION_VALUE_1.
10509 (emit_goto): Likewise.
10510 (emit_jsr): Likewise.
10511 (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
10512 argument to push_long_const to HOST_WIDE_INT.
10514 1999-09-15 Andreas Schwab <schwab@suse.de>
10516 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
10518 1999-09-20 Nick Clifton <nickc@cygnus.com>
10520 * lang.c (lang_decode_option): Extend comment.
10522 1999-09-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
10524 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
10527 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10529 * gjavah.c (get_field_name, print_method_info, print_include,
10530 add_namelet): Use xmalloc, not malloc.
10532 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
10533 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
10536 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
10538 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
10540 * jcf-path.c (add_entry): Likewise.
10542 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
10544 * jv-scan.c (xmalloc): Remove definition.
10546 * jvgenmain.c (xmalloc): Likewise.
10548 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
10550 * lex.c (java_store_unicode): Use xrealloc, not realloc.
10552 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
10553 concat, not xmalloc/sprintf.
10554 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
10555 (xstrdup): Remove definition.
10557 * parse.y (duplicate_declaration_error_p,
10558 constructor_circularity_msg, verify_constructor_circularity,
10559 check_abstract_method_definitions, java_check_regular_methods,
10560 java_check_abstract_methods, patch_method_invocation,
10561 check_for_static_method_reference, patch_assignment, patch_binop,
10562 patch_cast, array_constructor_check_entry, patch_return,
10563 patch_conditional_expr): Use xstrdup, not strdup.
10565 * zextract.c (ALLOC): Use xmalloc, not malloc.
10567 1999-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10569 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
10571 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
10572 (do_spec, lang_specific_pre_link, lang_specific_driver,
10573 input_filename, input_filename_length): Don't declare.
10574 (main_class_name, jvgenmain_spec, lang_specific_driver):
10576 (lang_specific_driver): All calls to the function pointer
10577 parameter now explicitly call `fatal'.
10579 1999-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
10581 * parse.y (find_applicable_accessible_methods_list): Search
10582 abstract classes as interfaces.
10584 1999-09-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10586 * class.c (finish_class): We're now outside a valid method
10587 declaration. Tell the rest of gcc so.
10589 1999-09-08 Bruce Korb autogen@linuxbox.com
10591 * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
10593 1999-09-07 Tom Tromey <tromey@cygnus.com>
10595 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
10597 (decode_signature_piece): Don't emit "::" in JArray<>.
10598 (print_namelet): Only print trailing `;' when printing a class.
10600 1999-09-10 Bernd Schmidt <bernds@cygnus.co.uk>
10602 * java-tree.h: Delete declarations for all tree nodes now moved to
10604 * decl.c: Delete their definitions.
10606 1999-09-04 Mark Mitchell <mark@codesourcery.com>
10608 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
10609 * Makefile.in (OBJS): Add ggc-callbacks.o.
10610 (OBJDEPS): Likewise.
10612 1999-09-03 Tom Tromey <tromey@cygnus.com>
10614 * parse.y (strip_out_static_field_access_decl): Return operand if
10615 it satisfies JDECL_P.
10617 1999-09-02 Tom Tromey <tromey@cygnus.com>
10619 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
10620 Handle nested arrays, like `[[I'.
10622 1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10624 * class.c (finish_class): Remove unused parameter, all callers
10627 * expr.c (build_java_athrow): Change return type to void.
10628 (java_lang_expand_expr): Make sure each case in switch returns a
10631 * java-tree.h (finish_class): Fix prototype to take void args.
10633 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
10634 (main): Issue return from main, not exit.
10636 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
10638 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
10640 * jv-scan.c (main): Issue return from main, not exit.
10642 * parse.y (check_abstract_method_definitions,
10643 java_check_abstract_method_definitions): Add static prototypes.
10644 (java_complete_expand_methods): Fix call to `finish_class'.
10646 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
10649 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10651 * lang.c (language_string): Constify.
10653 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10655 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
10656 Remove hacks for stuff which comes from libiberty.
10658 * Make-lang.in: Likewise.
10660 1999-08-30 Hans-Peter Nilsson <hp@axis.se>
10662 * Makefile.in (xref.o): Depend on xref.c explicitly.
10664 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10666 * java-tree.h (lang_printable_name): Constify a char*.
10668 * lang.c (lang_printable_name): Likewise.
10670 1999-08-27 Jeffrey A Law (law@cygnus.com)
10672 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
10673 comments in C code.
10675 1999-08-26 Tom Tromey <tromey@cygnus.com>
10677 * gjavah.c (print_cxx_classname): Print "::" before qualified
10680 1999-08-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
10682 * parse.y (lookup_cl): Changed leading comment. Now does its best
10683 to set the column number.
10684 (qualify_ambiguous_name): Take WFL wrappers into account.
10686 1999-08-25 Gregg Townsend <gmt@cs.arizona.edu>
10688 * verify.c (verify_jvm_instructions): Don't check instruction
10689 validity beyond end of method.
10691 1999-08-25 Tom Tromey <tromey@cygnus.com>
10693 * jvspec.c (lang_specific_driver): Correctly handle --help again.
10695 1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10697 * gjavah.c (print_name, print_base_classname, utf8_cmp,
10698 cxx_keyword_subst, generate_access, name_is_method_p,
10699 get_field_name, print_field_name, super_class_name, print_include,
10700 decode_signature_piece, print_class_decls, usage, help,
10701 java_no_argument, version, add_namelet, print_namelet): Add static
10703 (print_base_classname, utf8_cmp, cxx_keyword_subst,
10704 name_is_method_p): Constify a char*.
10705 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
10706 Provide a final else clause in an if-else-if.
10707 (print_field_info): Add missing final arg in function call to
10708 `print_field_name'.
10709 (print_method_info, decompile_method, decode_signature_piece,
10710 print_c_decl, print_full_cxx_name, print_stub,
10711 print_mangled_classname, super_class_name, print_include,
10712 add_namelet, add_class_decl, print_class_decls, process_file,
10713 help): Constify a char*.
10715 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
10716 push_int_const, find_constant_wide, find_constant_index,
10717 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
10718 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
10719 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
10720 emit_if, emit_goto, emit_jsr, call_cleanups,
10721 make_class_file_name): Add static prototypes.
10722 (generate_bytecode_return, generate_bytecode_insns): Pass a
10723 NULL_PTR, not a NULL_TREE.
10725 * jv-scan.c: Include "jcf.h".
10726 (main): Declare using DEFUN macro.
10728 * jvspec.c (find_spec_file, lang_specific_pre_link,
10729 lang_specific_driver): Add prototypes.
10730 (find_spec_file): Constify a char*.
10732 * keyword.gperf (hash, java_keyword): Add prototypes.
10734 * lang.c (lang_print_error): Add static prototype.
10735 (lang_init): Prefer memcpy over bcopy to avoid casts.
10737 * lex.c (yylex): Add static prototype.
10739 * parse-scan.y: Include "lex.c" earlier.
10741 * parse.h: Remove redundant declaration for `yylex'.
10743 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
10744 labeled_block_contains_loop_p): Add static prototypes.
10745 (not_accessible_p): Make static to match prototype.
10747 * verify.c (start_pc_cmp): Don't needlessly cast away const.
10749 1999-08-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
10751 * parse.y (check_method_redefinition): Changed leading comment.
10752 (check_abstract_method_definitions): New function.
10753 (java_check_abstract_method_definitions): New function.
10754 (java_check_regular_methods): Call it.
10755 (verify_constructor_super): Fixed indentation.
10756 (lookup_method_invoke): Likewise.
10758 1999-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
10760 * parse.y (method_header): Return a null pointer if the current
10761 class node is null.
10762 (finish_method_declaration): Return if the current function decl
10764 (source_start_java_method): Likewise.
10765 (java_method_add_stmt): Likewise.
10767 1999-08-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
10769 * class.c (emit_register_class): Removed unnecessary call to
10771 * parse.y (labeled_block_contains_loop_p): Removed unused local
10774 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10776 * parse.y (java_refold): Added prototype.
10778 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10780 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
10781 (java_stabilize_reference): Removed unnecessary `else'.
10782 (java_complete_lhs): Set flag to remember boolean. Call
10783 java_refold. Added comments.
10784 (java_decl_equiv): New function.
10785 (binop_compound_p): Likewise.
10786 (java_refold): Likewise.
10787 (patch_unaryop): Striped static field access assigned to decl and
10788 op. Changed promotion scheme for ++/-- operators.
10789 (search_loop): New function.
10790 (labeled_block_contains_loop_p): Likewise.
10791 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
10793 (patch_bc_statement): Call search_loop. Fixed comment.
10795 1999-08-14 Anthony Green <green@cygnus.com>
10797 * expr.c (java_lang_expand_expr): Mark static array data as
10800 1999-08-10 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
10802 * jvgenmain.c (main): NUL-terminate name_obstack.
10804 1999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10806 * check-init.c (check_bool2_init, done_alternative): Add static
10809 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
10810 (add_method, build_utf8_ref, build_class_ref,
10811 append_gpp_mangled_type, layout_class_method): Constify a char*.
10813 * decl.c (push_promoted_type, make_binding_level): Add static
10815 (push_promoted_type, pushdecl): Constify a char*.
10817 * except.c (find_handler_in_range, link_handler,
10818 check_start_handlers): Add static prototypes.
10820 * expr.c (process_jvm_instruction): Constify a char*.
10822 * gjavah.c (main): Constify a char*.
10824 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
10827 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
10829 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
10830 munge, print_ents): Constify a char*.
10832 * jcf-dump.c (disassemble_method): Constify a char*.
10833 (print_constant_pool, print_exception_table): Add static prototypes.
10834 (print_constant, print_exception_table, main, disassemble_method):
10837 * jcf-io.c (find_classfile, find_class): Likewise.
10839 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
10840 (set_source_filename, predefined_filename_p): Add static prototypes.
10841 (set_source_filename, get_constant, get_class_constant,
10842 find_in_current_zip): Constify a char*.
10844 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
10846 (add_entry, add_path, jcf_path_classpath_arg,
10847 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
10849 * jcf-reader.c (get_attribute, jcf_parse_preamble,
10850 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
10851 jcf_parse_one_method, jcf_parse_methods,
10852 jcf_parse_final_attributes): Add static prototypes.
10853 (get_attribute): Constify a char*.
10855 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
10856 jcf_dependency_add_target, jcf_path_classpath_arg,
10857 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
10859 * jv-scan.c (main): Constify a char*.
10860 (gcc_obstack_init): Add prototype arguments.
10862 * jvgenmain.c (gcc_obstack_init): Likewise.
10863 (main): Constify a char*.
10865 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
10867 (put_decl_string, lang_print_error): Constify a char*.
10868 (lang_init): Remove redundant extern prototype.
10870 * mangle.c (emit_unicode_mangled_name): Constify a char*.
10872 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
10873 Add static prototypes.
10874 (get_type_from_signature): Constify a char*.
10876 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
10877 Add static prototypes.
10878 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
10879 (verify_jvm_instructions): Constify a char*.
10881 * xref.c (xref_flag_value): Likewise.
10883 * xref.h (xref_flag_value): Likewise.
10885 * zextract.c (makeword, makelong): Add static prototypes.
10886 (makeword, makelong): Constify a uch*.
10888 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10890 * lang.c (java_dummy_print): Constify a char*.
10891 (lang_print_error): Likewise.
10892 (lang_init): Remove redundant prototype for `print_error_function'.
10893 (lang_init_source): Likewise.
10894 (lang_identify): Constify a char*.
10896 1999-08-09 Tom Tromey <tromey@cygnus.com>
10898 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
10899 (WORDS_TO_LONG): Likewise.
10900 (WORDS_TO_DOUBLE): Likewise.
10902 1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10904 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
10906 * expr.c (java_stack_pop, java_array_data_offset,
10907 build_java_throw_out_of_bounds_exception, case_identity,
10908 build_java_check_indexed_type): Add static prototypes.
10909 (linenumber_table, expand_invoke, expand_java_field_op,
10910 build_primtype_type_ref, expand_byte_code): Constify a char*.
10912 * java-tree.h (build_primtype_type_ref, linenumber_table):
10914 (java_lang_expand_expr): Add prototype.
10916 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
10917 `java_lang_expand_expr'.
10919 * lex.c (java_lex_error): Constify a char*.
10920 (java_get_unicode, java_read_char, java_allocate_new_line,
10921 java_unget_unicode, java_sneak_unicode): Prototype.
10923 * parse-scan.y (current_class, package_name, method_declarator,
10924 report_class_declaration, yyerror): Constify a char*.
10926 * parse.h (java_report_errors): Prototype.
10927 (yyerror): Constify a char*.
10929 * parse.y (classitf_redefinition_error, check_modifiers,
10930 parse_jdk1_1_error, lookup_package_type,
10931 lookup_package_type_and_set_next, get_printable_method_name,
10932 purify_type_name): Constify a char*.
10933 (build_super_invocation, maybe_generate_finit,
10934 verify_constructor_super, parser_add_interface,
10935 add_superinterfaces, jdep_resolve_class, note_possible_classname,
10936 java_complete_expand_methods, java_expand_finals,
10937 cut_identifier_in_qualified, java_stabilize_reference,
10938 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
10939 merge_string_cste): Prototype.
10940 (single_type_import_declaration, yyerror,
10941 variable_redefinition_error, build_array_from_name,
10942 build_unresolved_array_type, check_class_interface_creation,
10943 resolve_class, complete_class_report_errors,
10944 note_possible_classname, read_import_dir,
10945 find_in_imports_on_demand, resolve_package, fix_constructors,
10946 check_deprecation, lookup_method_invoke,
10947 maybe_build_primttype_type_ref, array_constructor_check_entry):
10949 (java_complete_expand_methods, java_expand_finals): Make static.
10950 (convert_narrow): Remove static prototype.
10952 1999-08-03 J"orn Rennecke <amylaar@cygnus.co.uk>
10954 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
10956 1999-08-02 Richard Henderson <rth@cygnus.com>
10958 * decl.c: Include defaults.h instead of expr.h.
10959 * parse.y: Likewise.
10961 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
10963 * java/decl.c (start_java_method): Change all uses of
10964 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
10965 Ensure expr.h is included.
10966 * java/expr.c (pop_arguments): Ditto.
10967 * java/parse.y (expand_start_java_method): Ditto.
10969 1999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10971 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
10973 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
10975 * decl.c: Include "function.h".
10976 * except.c: Likewise.
10977 * parse.y: Likewise.
10978 * Makefile.in: Update dependencies.
10980 1999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10982 * expr.c (build_java_soft_divmod): Provide a default case in switch.
10983 (java_lang_expand_expr): Mark parameters `target', `tmode' and
10984 `modifier' with ATTRIBUTE_UNUSED.
10986 * gjavah.c (process_file): Add braces around ambiguous `else'.
10988 * jcf-dump.c (print_access_flags, localvar_free): Change return
10991 * parse.y (java_complete_expand_method): Initialize variable
10993 (resolve_qualified_expression_name): Likewise for `field_decl'.
10994 (patch_method_invocation): Likewise for `class_to_search'.
10995 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
10996 (patch_assignment): Likewise for `lhs_type'.
10998 * verify.c (verify_jvm_instructions): Remove unused variable
11001 1999-07-25 Richard Henderson <rth@cygnus.com>
11003 * decl.c (va_list_type_node): New.
11005 1999-07-25 Anthony Green <green@cygnus.com>
11007 * gjavah.c (print_stub): New function.
11008 (METHOD_IS_NATIVE): New macro.
11009 (print_mangled_classname): Make static.
11010 (HANDLE_END_FIELD): Don't emit fields during stub generation.
11011 (process_file): Perform stub generation.
11012 (HANDLE_METHOD): Don't emit class decls during stub
11014 (HANDLE_END_METHOD): Take into account stub generation.
11015 (print_method_info): Handle stub generation.
11016 (print_stub): New function.
11017 (print_cxx_classname): Make signature consistant with others.
11018 (help): Describe -stubs option.
11019 (main): Create stub file.
11020 (version): Use version.c.
11021 (print_full_cxx_name): New function.
11022 (print_c_decl): Use print_full_cxx_name.
11024 1999-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
11026 * check-init.c (check_init): Handle MAX_EXPR.
11028 1999-07-15 Andrew Haley <aph@cygnus.com>
11030 * lang.c (flag_use_divide_subroutine): New variable.
11031 * typeck.c: (convert_ieee_real_to_integer): Bounds check
11032 fp-to-integer conversion.
11033 (convert): Call convert_ieee_real_to_integer when flag_fast_math
11036 * expr.c (build_java_soft_divmod): New function.
11037 (build_java_binop): Call build_java_soft_divmod if
11038 flag_use_divide_subroutine is set.
11039 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
11040 soft_lrem_node: new builtin functions.
11041 (init_decl_processing) Initialize the new builtins.
11042 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
11043 soft_lrem_node: new builtin functions.
11044 (build_java_soft_divmod): New function.
11045 * parse.y: Call build_java_soft_divmod if
11046 flag_use_divide_subroutine is set.
11047 * parse.c: Rebuilt.
11049 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
11050 a --specs= arg) even if not linking.
11051 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
11052 -fuse-divide-subroutine
11054 1999-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
11056 * parse.y (resolve_and_layout): Check methods only once.
11057 (resolve_qualified_expression_name): Verify thrown exceptions
11059 (check_thrown_exceptions): Reject exceptions thrown in
11060 initializer. Error message tuned.
11062 1999-07-14 Andrew Haley <aph@cygnus.com>
11064 * expr.c (expand_expr): Do not return the last statement in a
11065 block as the block's value.
11067 1999-07-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
11069 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
11070 CALL_EXPR, to avoid order of evaluation changes.
11072 1999-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
11074 * parse.y (qualify_ambiguous_name): Do not use
11075 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
11077 1999-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
11079 * check-init.c (check_init): Handle MAX_EXPR.
11080 * expr.c (force_evaluation_order): Force method call arguments to
11081 be evaluated in left-to-right order.
11082 * parse.y (qualify_ambiguous_name): Loop again to qualify
11083 NEW_ARRAY_EXPR properly.
11085 1999-06-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
11087 * parse.y (patch_invoke): Resolve unresolved invoked method
11089 (qualify_ambiguous_name): STRING_CST to qualify expression for
11090 type name resolution.
11092 1999-06-24 Andrew Haley <aph@cygnus.com>
11094 * class.c (finish_class): Whenever a deferred method is
11095 output, rescan the list of methods to see if a new candidate for
11096 output can be found.
11098 1999-06-28 Tom Tromey <tromey@cygnus.com>
11100 * jvspec.c (lang_specific_driver): Recognize --help.
11102 1999-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
11104 * parse.y (resolve_package): Fixed bogus return statement.
11105 (patch_method_invocation): Resolve method invocation beginning with
11106 a package name qualifier.
11108 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11110 * Make-lang.in (java.stage1): Depend on stage1-start.
11111 (java.stage2): Likewise for stage2-start.
11112 (java.stage3): Likewise for stage3-start.
11113 (java.stage4): Likewise for stage4-start.
11115 1999-06-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11117 * parse.y (java_complete_lhs): When doing cross referencing, don't
11118 try to keep file location on a WFL expanded as a CALL_EXPR.
11120 1999-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
11122 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
11123 compiling to class file a void method with an empty method body.
11124 As a side effect, the bytecode backend will generate the
11125 appropriate `return' instruction.
11127 1999-06-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
11129 * parse.y (lookup_package_type_and_set_next): New function prototype.
11130 (resolve_package): Search current and imported packages.
11131 (lookup_package_type_and_set_next): New function.
11133 1999-06-22 Andrew Haley <aph@cygnus.com>
11135 * verify.c (verify_jvm_instructions): Check for pending blocks
11136 before invalid PC test and opcode switch, not after.
11138 1999-06-21 Andrew Haley <aph@cygnus.com>
11140 * except.c (find_handler_in_range): The upper limit for exception
11141 ranges is exclusive, not inclusive: (start <= pc < end).
11142 (link_handler): find child pointer which points to outer by
11143 searching sibling list: previous code incorrectly assumed that
11144 outer->outer->first_child must point to outer.
11145 * verify.c (verify_jvm_instructions): FIXME added to code for
11147 (verify_jvm_instructions): Do not assume that the last block
11148 processed in a subroutine is a block which ends with a `ret'
11149 instruction. With some control flows it is possible that the last
11150 block ends with an `athrow'.
11152 1999-06-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11154 * parse.y (qualify_ambiguous_name): Reorganized the post
11155 evaluation of non WFL leading expression nodes.
11157 1999-06-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
11159 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
11162 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
11164 * parse.y (qualify_ambiguous_name): Handle qualified expression
11165 beginning with a STRING_CST.
11167 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
11169 * parse.y (register_fields): Set DECL_INITIAL on both
11170 pre-initialized static and public fields.
11171 (resolve_field_access): Static field access expressions to always
11173 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
11174 qualification. CONVERT_EXPR to be resolved as an expression name.
11175 (java_complete_lhs): Identify and access qualified final
11176 initialized field in switch statement case expression.
11177 (fold_constant_for_init): Pre-initialized field decl constant to
11180 1999-06-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
11182 * parse.y (note_possible_classname): Mark returned node with
11183 QUALIFIED_P only if the original class name contained a '/'.
11185 1999-06-05 Anthony Green <green@cygnus.com>
11187 * Make-lang.in (gcjh): More parallel build fixes.
11189 1999-06-03 Mike Stump <mrs@wrs.com>
11191 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
11193 1999-06-02 Anthony Green <green@cygnus.com>
11195 * except.c (link_handler): Chain exception handlers in order.
11197 1999-06-02 Anthony Green <green@cygnus.com>
11199 * expr.c (expand_byte_code): Fill unreachable bytecode regions
11200 with nops and process as usual in order to always set correct EH
11201 ranges. Emit detailed warnings about unreachable bytecodes.
11203 1999-06-02 Anthony Green <green@cygnus.com>
11205 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
11208 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
11210 * parse.y (lookup_field_wrapper): Unified returned value to NULL
11211 or the searched field decl.
11213 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
11215 * parse.y (fold_constant_for_init): Convert numerical constant
11216 values to the type of the assigned field.
11218 1999-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
11220 * expr.c (lookup_field): Relaxed the test on class loading error
11222 * parse.y (fold_constant_for_init): Enabeled old code.
11224 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
11226 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
11227 decide the validity of the cast of a java.lang.Cloneable reference
11229 (patch_conditional_expr): Fixed first argument passed to
11230 binary_numeric_promotion.
11232 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
11234 * parse.y (qualify_ambiguous_name): Take into account that a
11235 CONVERT_EXPR might specify a type as a WFL.
11237 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
11239 * parse.y (patch_assignment): Save the rhs before using it as an
11240 argument to _Jv_CheckArrayStore.
11242 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
11244 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
11246 1999-05-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11248 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
11249 floating point literal only when the exponent indicator has been
11252 1999-05-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
11254 * parse.y (formal_parameter:): Construct argument tree list
11255 element even if a yet unsupported final parameter was encountered.
11257 1999-05-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
11259 * parse.y (finish_method_declaration): Issue errors for native or
11260 abstract methods declared with a method body, as well as for non
11261 native or non abstract methods with no method body.
11263 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11265 * class.c (build_utf8_ref): Initialize variable `field'.
11267 * decl.c (init_decl_processing): Initialize variable `field'.
11269 * expr.c (build_known_method_ref): Mark parameters `method_type',
11270 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
11271 (process_jvm_instruction): Likewise for parameter `length'.
11273 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
11274 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
11277 * parse.y (maybe_generate_clinit): Remove unused variable
11278 `has_non_primitive_fields'.
11279 (find_in_imports_on_demand): Initialize variables `node_to_use'
11281 (patch_binop): Likewise for variable `prom_type'.
11282 (patch_unaryop): Likewise for variable `prom_type'.
11284 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
11286 * xref.c (xref_table): Add missing initializer.
11288 1999-05-14 Tom Tromey <tromey@cygnus.com>
11290 * java-except.h (struct eh_range): Removed unused `next' member.
11291 * verify.c (verify_jvm_instructions): Call check_nested_ranges
11292 after adding all exception handlers. Sort exception ranges in
11294 (struct pc_index): New structure.
11295 (start_pc_cmp): New function.
11296 * except.c (add_handler): Return `void'. Don't call link_handler;
11297 instead construct an ordinary linked list and do range
11299 (check_nested_ranges): New function.
11300 (link_handler): Changed interface to allow merging of eh_ranges.
11301 Split overlapping ranges. Return `void'.
11303 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
11305 * parse.y (constructor_block_end:): New rule, tagged <node>.
11306 (constructor_body:): Use `constructor_block_end' instead of
11309 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
11311 * parse.y (statement_nsi:): Pop `for' statement block.
11312 (java_complete_lhs): Labeled blocks containing no statement are
11313 marked as completing normally.
11315 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11317 * xref.c (xref_set_current_fp): New function, defined.
11318 * xref.h (xref_set_current_fp): New function, prototyped.
11320 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11322 * check-init.c (check_init): Take into account that
11323 LABELED_BLOCK_STMT can be empty.
11325 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
11327 * parse.y (java_check_regular_methods): Warning check on not
11328 overriding methods with default access in other packages does not
11329 apply to `<clinit>'.
11330 (java_complete_lhs): If block body is an empty_stmt_node, replace
11331 it by NULL_TREE. This prevents gcc from generating an irrelevant
11334 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
11336 * check-init.c (check_init): Removed code accepting to see things
11337 falling through default:, when doing xrefs.
11338 * java-tree.h (do_not_fold): New global variable, declared.
11339 * parse.y (do_not_fold): New global variable, defined.
11340 (java_complete_expand_method): Set `do_not_fold' to the value of
11341 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
11342 and reinstall them after them have been purged; do not check for
11343 initializations; do not issue missing return errors.
11344 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
11346 (patch_binop): Skip the fold part when doing xrefs.
11347 (build_string_concatenation): Skip the concatenation part when
11349 (patch_synchronized_statement): Do not generate a try-finally when
11351 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
11352 and keep the location where the throw was seen.
11353 * typeck.c (convert): When `do_not_fold' is set, do not attempt
11354 any treatment on the converted node an simply return a NOP_EXPR of
11356 * xref.c (xref_get_data): New function, defined.
11357 * xref.h (xref_get_data): New function, declared.
11358 (XREF_GET_DATA): Use xref_get_data.
11360 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11362 * gjavah.c (print_include): Cast the result of `strlen' to int
11363 when comparing against a signed value.
11364 (add_namelet): Likewise.
11366 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11368 * expr.c (expand_invoke): Mark parameter `nargs' with
11370 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
11372 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
11375 * jcf-reader.c (get_attribute): Cast a value to long
11376 when comparing against a signed expression. Likewise.
11378 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
11379 HOST_BITS_PER_CHAR.
11381 1999-05-11 Andrew Haley <aph@cygnus.com>
11383 * parse.y (source_end_java_method): If the current method contains
11384 any exception handlers, force asynchronous_exceptions: this is
11385 necessary because signal handlers in libjava may throw exceptions.
11386 * decl.c (end_java_method): Ditto.
11388 1999-05-11 Tom Tromey <tromey@cygnus.com>
11390 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
11392 * jvspec.c (THREAD_NAME): Removed.
11393 (GC_NAME): Likewise.
11394 (MATHLIB): Likewise.
11395 (WITHLIBC): Likewise.
11397 (THREADLIB): Likewise.
11398 (MATH_LIBRARY): Likewise.
11399 (lang_specific_driver): Don't add `-l' options to command line.
11400 Instead, add a single --specs option. Recognize `-L' options and
11401 use them to search for spec file.
11402 (find_spec_file): New function.
11403 (SPEC_FILE): New define.
11405 1999-05-11 Dave Brolley <brolley@cygnus.com>
11407 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
11408 cpplib-enabled build.
11410 1999-05-05 Per Bothner <bothner@cygnus.com>
11412 * class.c (make_field_value): DECL_INITIAL may be a string literal;
11413 temporarily zero it while calling rest_of_decl_compilation.
11415 * java-tree.h (string_ptr_type_node): Add declaration.
11416 * decl.c: Define and initialize string_ptr_type_node.
11417 * parse.y (patch_string_cst): Use string_ptr_type_node.
11419 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
11420 * parse.y (for_statement): Now unconditionally exit_block.
11421 (finish_labeled_statement): No longer exit_block if for-loop.
11422 (patch_loop_statement): Check harder if the loop is already labeled.
11424 * parse.y (patch_initialized_static_field): Removed function.
11425 (maybe_generate_clinit): Removed special handling for interfaces.
11426 (java_complete_expand_methods): Do a preliminary java_complete_tree
11427 on <clinit> to determine if it can be removed.
11428 (java_complete_expand_method): Remove special handling for <clinit>.
11429 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
11430 optimize if we get back empty_stmt_node.
11431 For MODIFY_EXPR, re-do checking of static initializers.
11432 (fold_constant_for_init): Don't return immediate if VAR_DECL.
11433 For VAR_DECL, pass correct context.
11435 * verify.c (verify_jvm_instructions): Better error messages.
11437 1999-05-03 Tom Tromey <tromey@cygnus.com>
11439 * parse-scan.y (interface_declaration): Call
11440 report_class_declaration for interfaces.
11442 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
11444 * Makefile.in: Remove -v from bison command lines.
11446 1999-04-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
11448 * check-init.c (check_init): Exclude a case of error when doing
11450 * class.c (layout_class_method): Don't generate the error message
11451 twice when compiling from source.
11452 * lang-options.h: Added `-Wredundant-modifers' and
11453 `-Wunusupported-jdk11' flags and help text.
11454 * lang.c (lang_decode_option): Added support for
11455 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
11456 flag_static_local_jdk11 and flag_redundant set accordingly.
11457 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
11458 * parse.h (EXPR_WFL_ADD_COL): New macro.
11459 (DECL_END_SOURCE_LINE): Likewise.
11460 (DECL_INHERITED_SOURCE_LINE): Likewise.
11461 * parse.y (static_ref_err): New function, prototyped.
11462 (CCB_TK): Now tagged <operator>.
11463 (class_body:): Remember the location of the closing '}' of a class
11464 definition when doing xrefs.
11465 (block:): Likewise.
11466 (block_end:): Likewise.
11467 (create_class): Remember the location of the inherited class
11468 identifier when doing xrefs.
11469 (register_fields): Added test on first operand of `init' before
11470 testing it TREE_CODE.
11471 (method_header): Store the location of the class identifier in the
11472 class decl when doing xrefs.
11473 (finish_method_declaration): Don't combine first/last method line
11475 (java_check_regular_methods): Warning check on not overriding
11476 methods with default access on other packages move before check on
11477 static methods. Initialization of `aflags' also moved up.
11478 (resolve_expression_name): Call static_ref_err to report the error.
11479 (static_ref_err): New function, implemented.
11480 (resolve_field_access): Returned simplified static field access
11482 (resolve_qualified_expression_name): Check for illegal use of
11483 static fields in a non static context. Call static_ref_err to
11484 report error in various places.
11485 (java_complete_tree): Do not fold initialized static fields when
11487 (java_complete_lhs): Likewise.
11489 1999-04-29 Anthony Green <green@cygnus.com>
11491 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
11492 create internal labels.
11493 (lookup_label): Ditto.
11495 1999-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11497 * class.c (layout_class_method): Generate <clinit>'s rtl for
11499 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
11500 for interfaces' <clinit>.
11501 * expr.c (lookup_field): Search for fields in interfaces.
11502 (expand_invoke): Fixed indentation.
11503 (expand_java_field_op): Likewise. Use IS_CLINIT.
11504 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
11505 (IS_CLINIT): New macro.
11506 * parse.y (type_declaration:): Call maybe_generate_clinit after an
11507 interface was parsed.
11508 (maybe_generate_clinit): Don't generate if the current class is an
11509 interface with only fields of primitive types.
11510 (reset_method_name): Use IS_CLINIT.
11511 (java_complete_expand_method): Expand <clinit> when it exists for
11512 interfaces. Use IS_CLINIT.
11513 (resolve_expression_name): Use DECL_CONTEXT instead of
11514 current_class to build static field references.
11515 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
11516 ARRAY_REF when doing xreferencing.
11517 (check_final_assignment): Fixed typo in leading comment. Use
11519 (patch_array_ref): Don't fully expand array references when
11521 (patch_return): Use IS_CLINIT.
11522 (patch_throw_statement): Likewise.
11524 1999-04-22 Tom Tromey <tromey@cygnus.com>
11526 * Make-lang.in (JAVA_SRCS): Added check-init.c.
11528 1999-04-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
11530 * decl.c (predef_filenames, predef_filenames_size): New globals
11531 (init_decl_processing): predef_filenames and predef_filenames_size
11533 * java-tree.h (predef_filenames, predef_filenames_size): Declared
11535 * jcf-parse.c (predefined_filename_p): New function.
11536 (yyparse): Check that files on the command line are specified only
11537 once and issue a warning otherwise.
11538 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
11539 * parse.y (source_end_java_method): Nullify NOP method bodies, to
11540 avoid a gcc warning with -W -Wall turned on.
11541 (java_expand_classes): Abort if errors were encountered.
11542 (java_complete_lhs): If the cross reference flag is set, wrap
11543 field DECL node around a WFL when resolving expression name.
11545 1999-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
11547 * lang.c (lang_decode_option): Fixed returned value when parsing
11548 `-fxref=...' and `-Wall'.
11549 * parse.y (source_end_java_method): Do not generate code when
11550 flag_emit_xref is set.
11551 (resolve_expression_name): Do not build static field access when
11552 flag_emit_xref is set.
11553 (resolve_field_access): No special treatment on `length' when
11554 flag_emit_xref is set. Do not build qualified static field access
11555 when flag_emit_xref is set.
11556 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
11557 when flag_emit_xref is set.
11558 (patch_assignment): Do not generate array store runtime check when
11559 flag_emit_xref is set.
11560 * xref.c (xref_flag_value): Fixed function declaration
11562 (xset_set_data): New function.
11563 * xref.h (xref_set_data): Added prototype for new function.
11564 (typedef struct xref_flag_table): New field data.
11565 (XREF_GET_DATA): New macro.
11567 1999-04-19 Tom Tromey <tromey@cygnus.com>
11569 * xref.h (enum): Removed trailing comma.
11571 * parse.y (resolve_qualified_expression_name): Added missing
11574 1999-04-15 Anthony Green <green@cygnus.com>
11576 * gjavah.c: New prototypes for java_float_finite and
11577 java_double_finite.
11579 1999-04-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11581 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
11584 1999-04-06 Jeffrey A Law (law@cygnus.com)
11586 * Makefile.in (TREE_H): Add tree-check.h.
11587 (RTL_H): Add genrtl.h.
11589 1999-04-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
11591 * parse.y (patch_assignment): Added ArrayStoreException runtime
11594 1999-04-06 Per Bothner <bothner@cygnus.com>
11596 * expr.c (pop_type_0): New function.
11597 (pop_type): Use pop_type_0.
11598 * java-tree.h (pop_type_0): New declaration.
11599 * verify.c (verify_jvm_instructions): Check return instructions.
11601 * parse.y (patch_binop): Don't fold if non-constant and emiting
11604 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11606 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
11608 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
11609 (main_jcf): Don't define.
11610 (process_file): Don't set `main_jcf'.
11612 * java-tree.h (main_jcf): Don't declare.
11614 * jcf-parse.c (main_jcf): Add static definition.
11616 * lang.c (main_jcf): Don't define.
11618 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11620 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
11622 * decl.c (copy_lang_decl): Likewise for `bcopy'.
11624 * jcf-depend.c: Include "config.h", not <config.h>.
11626 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
11629 * jcf-path.c: Include "config.h", not <config.h>.
11631 * lex.c: Don't include various system header files.
11632 (java_init_lex): Cast the argument of `bzero' to PTR
11634 * parse-scan.y (java_push_parser_context): Likewise.
11636 * parse.y (java_push_parser_context): Likewise.
11637 (patch_bc_statement): Match format specifier to variable argument.
11639 * xref.c: Don't include <stdio.h>.
11641 1999-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
11643 * parse.y (struct parser_ctxt *ctxp): Now global.
11644 (declare_local_variables): Use WFL compound value for the
11645 declaration source line value, when doing cross-referencing.
11647 1999-03-31 Tom Tromey <tromey@cygnus.com>
11649 * gjavah.c (print_field_info): Allow constants of other types.
11650 (print_include): Generate include when new name is proper prefix
11651 of already printed name.
11652 (add_namelet): Likewise.
11653 (cxx_keyword_subst): New function.
11654 (print_method_info): Use it.
11655 (print_field_name): New function.
11656 (get_field_name): New function.
11657 (print_field_info): Use get_field_name and print_field_name.
11659 1999-03-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11661 * Makefile.in (keyword.h): Generate using gperf language 'C', not
11662 'KR-C', so gperf uses the `const' keyword on strings.
11664 * keyword.gperf (java_keyword): Const-ify a char*.
11666 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
11668 * parse.y (patch_bc_statement): Fixed identation and a bogus
11671 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
11673 * parse.y (patch_assignment): Allow static variables in other
11674 classes to be assigned.
11676 1999-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11678 * class.c (maybe_add_interface): Remove unused variable
11680 (make_class_data): Use = for assignment, not ==. Likewise.
11681 (emit_register_classes): Remove unused variable `decl'.
11683 * lex.c: Fix comment so as not to contain an embedded `/*'.
11685 * verify.c (verify_jvm_instructions): Remove unused variable
11688 1999-03-27 Per Bothner <bothner@cygnus.com>
11690 * parse.y (complete_loop_body): Rename to finish_loop_body.
11691 (complete_labeled_statement): Rename to finish_labeled_statement.
11692 (complete_for_loop): Rename to finish_for_loop.
11693 (complete_method_declaration): Rename to finish_method_declaration.
11695 * java-tree.h (continue_identifier_node): New global node.
11696 * decl.c: Define and initialize continue_identifier_node.
11697 * parse.y (generate_labeled_block): Remove - no longer needed.
11698 (build_loop_body): Use continue_identifier_node for continue block.
11699 (finish_labeled_statement): Also do pop_labeled_block actions.
11700 (java_complete_lhs): POP_LOOP even if error.
11701 (build_labeled_block): Special handling for continue_identifier_node.
11702 (patch_loop_statement): Re-organize.
11703 (patch_bc_statement): Re-write.
11705 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
11707 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
11708 using a WFL compound value.
11709 * parse.y (xref.h): Include.
11710 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
11711 WFL compound value.
11712 (register_fields): Set WFL compound value to lineno if doing
11714 (java_complete_expand_method): Call expand_xref if flag_emit_xref
11716 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
11717 * xref.h (expand_xref): Prototype renamed from xref_generate.
11719 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
11721 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
11722 (GET_CURRENT_BLOCK): New macro.
11723 * parse.y (current_static_block): New global variable.
11724 (method_body:): Define action.
11725 (complete_method_declaration): Set current_function_decl to NULL
11726 when work on the current method is done.
11727 (declare_local_variables): Use GET_CURRENT_BLOCK.
11728 (java_method_add_stmt): Likewise.
11729 (java_complete_expand_method): Disable the use of `this' when
11730 expanding <clinit>.
11731 (enter_a_block): If no current method exist, use
11732 current_static_block to link static initializer blocks.
11733 (exit_block): Rewritten to use current_static_block when no current
11734 method decl exists.
11735 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
11736 (patch_return): Forbid the use of `return' in static initializers.
11737 (patch_throw_statement): Fixed indentation. Issue specific error
11738 for uncaught thrown checked exception in static initializer
11739 blocks. Removed FIXME.
11741 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
11743 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
11744 Link gcj from gcc.o.
11746 1999-03-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
11748 * parse.y (find_applicable_accessible_methods_list): When dealing
11749 with interface: ensure that a given interface or java.lang.Object
11750 are searched only once.
11752 1999-03-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11754 * gjavah.c (print_c_decl): Remove unused argument `flags'.
11756 * jcf-dump.c (print_access_flags): Add braces around if-else.
11758 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
11761 * lex.c (build_wfl_node): Add static prototype.
11763 * lex.h (build_wfl_node): Remove static prototype.
11765 * parse.y: Include lex.c early enough to declare everything needed.
11766 Ensure calls to `build_wfl_node' pass the proper arguments.
11767 (create_class): Remove unused variable `super_decl'.
11768 (get_printable_method_name): Initialize variable `name'.
11770 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
11772 * Changelog: Fixed 1999-03-22 typos.
11773 * lang.c (lang_decode_option): Fixed typo in error string in the
11776 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
11778 * Makefile.in (JAVA_OBJS): Added entry xref.o.
11779 (xref.o): New rule.
11780 * java-tree.h (flag_emit_xref): Declared extern.
11781 * lang.c (xref.h): Included.
11782 (flag_emit_xref): New global variable.
11783 (lang_decode_option): Added support for -fxref.
11785 * xref.h: Likewise.
11787 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
11789 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
11792 1999-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11794 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
11795 $(srcdir)/../system.h and $(JAVA_TREE_H).
11796 (jcf-io.o): Depend on $(JAVA_TREE_H).
11797 (mangle.o): Likewise.
11799 * check-init.c (check_cond_init): Add static prototype.
11801 * class.c (build_java_method_type, hashUtf8String,
11802 make_field_value, get_dispatch_vector, get_dispatch_table,
11803 append_gpp_mangled_type, mangle_static_field): Likewise.
11804 (strLengthUtf8): Hide unused definition.
11805 (hashUtf8String): Const-ify.
11806 (make_field_value): Un-ANSI-fy.
11808 * constants.c: Move inclusion of jcf.h above java-tree.h.
11809 (set_constant_entry, find_class_or_string_constant,
11810 find_name_and_type_constant, get_tag_node,
11811 build_constant_data_ref): Add static prototype.
11813 * decl.c (push_jvm_slot, builtin_function,
11814 lookup_name_current_level): Likewise.
11815 (builtin_function): Const-ify.
11817 * except.c (expand_start_java_handler, expand_end_java_handler):
11818 Add static prototype.
11820 * expr.c (flush_quick_stack, push_value, pop_value,
11821 java_stack_swap, java_stack_dup, build_java_athrow,
11822 build_java_jsr, build_java_ret, expand_java_multianewarray,
11823 expand_java_arraystore, expand_java_arrayload,
11824 expand_java_array_length, build_java_monitor, expand_java_pushc,
11825 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
11826 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
11827 expand_compare, expand_test, expand_cond, expand_java_goto,
11828 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
11829 expand_java_field_op, java_push_constant_from_pool): Likewise.
11831 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
11832 (build_java_arraynull_check): Mark parameters `node' and `type'
11833 with ATTRIBUTE_UNUSED.
11834 (note_label): Likewise for parameter `current_pc'.
11835 (expand_java_call, expand_java_ret): Hide unused definition.
11837 * java-tree.h (make_class, build_constants_constructor,
11838 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
11839 init_outgoing_cpool, register_class, emit_register_classes,
11840 java_layout_seen_class_methods): Prototype.
11841 (unicode_mangling_length): Const-ify.
11842 (append_gpp_mangled_name, append_gpp_mangled_classtype,
11843 emit_unicode_mangled_name, format_int, format_uint,
11844 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
11845 jcf_print_utf8_replace, open_class): Prototype.
11847 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
11848 <stdio.h>. Include tree.h/java-tree.h.
11849 (utf8_equal_string usage, process_class): Add static prototype.
11850 (open_class): Don't prototype this here.
11851 (utf8_equal_string): Match arguments to format specifiers.
11852 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
11853 TABLE_SWITCH, disassemble_method): Likewise.
11855 * jcf-io.c: Include tree.h/java-tree.h.
11856 (open_class, find_classfile, jcf_print_utf8,
11857 jcf_print_utf8_replace): Const-ify.
11859 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
11860 parse_class_file): Add static prototype.
11861 (find_in_current_zip): Match definition to existing static
11864 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
11865 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
11866 finish_jcf_block, define_jcf_label, get_jcf_label_here,
11867 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
11868 write_chunks, adjust_typed_op, generate_bytecode_conditional,
11869 generate_bytecode_return, perform_relocations, init_jcf_state,
11870 init_jcf_method, release_jcf_state, generate_classfile):
11871 Add static prototype.
11872 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
11873 (make_class_file_name): Const-ify.
11875 * jcf.h (find_classfile): Const-ify.
11877 * jv-scan.c (reset_report): Remove prototype.
11879 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
11880 (error): Rewrite to allow varargs.
11882 * lang.c (lang_f_options): Const-ify.
11884 * lex.c (java_parse_escape_sequence): Add static prototype.
11885 (java_allocate_new_line): Match definition to existing static
11888 * mangle.c Include tree.h/java-tree.h.
11889 (unicode_mangling_length, emit_unicode_mangled_name,
11890 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
11892 * parse.h (jdep_code): Remove trailing comma in enumeration.
11893 (java_get_line_col): Move prototype outside of !JC1_LITE test.
11894 (reset_report): Add prototype.
11896 * verify.c (push_pending_label, merge_types): Add static
11899 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
11901 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
11903 * parse.y (find_applicable_accessible_methods_list): Extend the
11904 search to superinterfaces when relevant.
11905 (search_applicable_methods_list): New function.
11907 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
11909 * class.c (unmangle_classname): Implemented stricter testing
11910 before setting the QUALIFIED_P flag on an identifier.
11912 1999-03-16 Per Bothner <bothner@cygnus.com>
11914 * parse.y (java_complete_lhs): Call force_evaluation_order
11915 after patch_newarray.
11916 (patch_binop): Don't call fold if there are side effects.
11918 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
11920 * parse.y (java_stabilize_reference): Use save_expr instead of
11921 building a SAVE_EXPR node.
11922 (java_complete_lhs): Patch the resulting string of the `+='
11923 operator (if necessary) and complete the RHS after having built
11926 1999-03-15 Per Bothner <bothner@cygnus.com>
11928 * class.c (make_class): Don't set CLASS_P here (because
11929 this function is also called by build_java_array_type).
11930 (push_class): Set CLASS_P here instead.
11931 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
11933 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
11934 context. If the context is class, perfer "super" over "synchronized".
11935 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
11937 * parse.y (create_class): Don't call parser_check_super here;
11938 it is not robust. Always wait until later.
11940 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
11941 match what JDK 1.2 does), but don't set ACC_PUBLIC.
11943 1999-03-13 Per Bothner <bothner@cygnus.com>
11945 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
11946 * lex.h (UNGETC): Change misleading macro.
11948 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11950 * parse.y (java_stabilize_reference): Return NODE when patching a
11952 (java_complete_lhs): Put parenthesis around truth values.
11954 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11956 * class.c (layout_class_method): Don't make rtl for interface
11958 * parse.h (GET_TYPE_NAME): New macro.
11959 * parse.y (if_then_statement:): Fixed indentation.
11960 (if_then_else_statement:): Likewise.
11961 (for_statement:): Fixed spacing.
11962 (try_statement:): Fixed indentation.
11963 (create_interface): Don't force interfaces to be abstract.
11964 (method_header): Abstract methods are OK in interfaces.
11965 (declare_local_variables): Fixed typo in comment.
11966 (java_complete_expand_method): Fixed indentation.
11967 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
11968 non accessible fields.
11969 (java_stabilize_reference): New function.
11970 (java_complete_lhs): Fixed indentation. Use
11971 java_stabilize_reference in compound assignment. Insert the
11972 cast. If not processing `+' fix string constants before processing
11975 1999-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11977 * constants.c (find_class_or_string_constant): Cast variable `j'
11978 to a `jword' when comparing against one.
11980 * expr.c (java_lang_expand_expr): Remove unused variables
11981 `has_finally_p' and `op0'.
11983 * gjavah.c (print_field_info): Cast a value to jint when comparing
11984 against one. Likewise for a jlong.
11985 (add_namelet): Likewise cast a `sizeof' to an int when comparing
11986 against a signed quantity.
11988 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
11989 (print_signature): Don't needlessly dereference variable `str'
11991 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
11992 `max_locals' with ATTRIBUTE_UNUSED.
11993 (jcf_parse_class): Likewise for variable `index'.
11995 * parse.h (reverse_jdep_list): Remove static prototype.
11997 * parse.y (build_jump_to_finally): Remove prototype and definition.
11998 (reverse_jdep_list): Add static prototype.
12000 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
12001 `assignment' and `expr_decl'.
12003 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
12005 1999-03-12 Andrew Haley <aph@cygnus.com>
12007 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
12008 we'll need a directory separator and a null character.
12010 1999-03-10 Per Bothner <bothner@cygnus.com>
12012 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
12014 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
12016 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
12019 1999-03-05 Per Bothner <bothner@cygnus.com>
12021 * lex.c (java_parse_end_comment): Take extra parameter (next char).
12023 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
12025 * class.c (layout_class_method): A static method in a base class
12026 is never overridden, so treat it like it doesn't exist.
12027 However, do complain about private non-static method overriding
12028 public static method.
12030 * parse.y: Don't set unused INITIALIZED_P flag.
12031 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
12033 * parse.y (find_expr_with_wfl): Optimize tail-calls.
12034 (build_array_from_name): Re-order &index[string] to &string[index].
12036 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
12037 error_mark (it might catch more errors, but it is more likely to lose).
12039 1999-03-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12041 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
12042 (parse-scan.o): Depend on toplev.h.
12044 * class.c (make_method_value): Add prototype. Make it static.
12045 Remove unused second argument, caller changed.
12047 * expr.c (java_lang_expand_expr): Remove unused variable
12050 * java-tree.h: Don't prototype find_in_current_zip.
12051 Add prototypes for verify_constant_pool, start_java_method,
12052 end_java_method, give_name_to_locals, expand_byte_code,
12053 open_in_zip, set_constant_value, find_constant1, find_constant2,
12054 find_utf8_constant, find_string_constant, find_class_constant,
12055 find_fieldref_index, find_methodref_index, write_constant_pool,
12056 count_constant_pool_bytes and encode_newarray_type.
12058 * jcf-dump.c: Remove unused variable `LONG_temp'.
12060 * jcf-parse.c: Include parse.h.
12061 (jcf_parse_source): Remove unused parameter, all callers changed.
12062 (jcf_figure_file_type): Add static prototype.
12063 (find_in_current_zip): Likewise. Also remove unused parameter,
12064 all callers changed.
12065 (read_class): Initialize variable `saved_pos'.
12067 * jcf-reader.c (jcf_parse_preamble): Mark variables
12068 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
12070 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
12071 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
12072 (java_parse_doc_section): Initialize variable `seen_star'.
12073 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
12074 (java_lex_error): Mark parameters `msg' and `forward' with
12076 (java_get_line_col): Mark parameters `filename' and `line' with
12079 * parse-scan.y: Include toplev.h.
12080 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
12082 * parse.h: use `struct JCF', not plain `JCF'.
12083 (java_parser_context_save_global, java_expand_classes
12084 java_parser_context_restore_global, java_parse): Add prototypes.
12086 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
12089 1999-02-24 Per Bothner <bothner@deneb.cygnus.com>
12091 * check-init.c (check_init): COPYN takes word count, not bit count.
12093 1999-02-26 Per Bothner <bothner@cygnus.com>
12095 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
12096 explicit build_decl. (Avoids crash in reload when optimizing.)
12098 1999-02-25 Per Bothner <bothner@cygnus.com>
12100 * decl.c (complete_start_java_method): Handle synchronized method
12101 even when compiling from bytecode.
12103 1999-02-26 Tom Tromey <tromey@cygnus.com>
12105 * gjavah.c (add_class_decl): Only generate `#include' if outer
12106 class is not the name of the class we are processing. Correctly
12107 append `.h' in #include.
12108 (process_file): Clean up newlines around generated `#include's.
12109 (decode_signature_piece): Correctly handle inner classes.
12110 (struct include): New structure.
12111 (all_includes): New global.
12112 (print_include): New function.
12113 (add_class_decl): Use it.
12114 (process_file): Likewise.
12115 (add_class_decl): Generate include for java-array.h if array
12117 (process_file): Don't generate java-array.h include.
12119 * gjavah.c (add_namelet): Check for standard package names here.
12120 (add_class_decl): Don't check for standard package names here.
12122 1999-02-25 Tom Tromey <tromey@cygnus.com>
12124 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
12125 When reading a zip file, only use strncmp if both strings are
12126 bigger than the buffer length. Initialize `k' when looping
12129 1999-02-24 Tom Tromey <tromey@cygnus.com>
12131 * gjavah.c (struct namelet): New structure.
12132 (add_namelet): New function.
12133 (print_namelet): New function.
12134 (print_class_decls): Use add_namelet and print_namelet to generate
12135 namespaces and not classes.
12136 (method_printed): New global.
12137 (HANDLE_END_METHOD): Examine method_printed.
12138 (print_method_info): Set method_printed when required. Print
12139 error if function to be ignored is marked virtual. Handle $finit$
12141 (METHOD_IS_FINAL): New macro.
12142 (print_field_info): Use it.
12143 (HANDLE_METHOD): Clear method_printed.
12144 (method_pass): New global.
12145 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
12146 (process_file): Do two passes over both fields and methods.
12147 (HANDLE_METHOD): Examine method_pass.
12148 (root): New global.
12149 (add_class_decl): New function.
12150 (print_class_decls): Don't scan over entire constant pool.
12152 1999-02-23 Tom Tromey <tromey@cygnus.com>
12154 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
12155 disable linking in that case.
12157 1999-02-20 Tom Tromey <tromey@cygnus.com>
12159 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
12162 1999-02-21 Per Bothner <bothner@cygnus.com>
12164 * decl.c (build_result_decl), java-tree.h: New method.
12165 (complete_start_java_method): Handle synchronized methods.
12166 Don't build DECL_RESULT here. (Ordering dependency problem.)
12167 (start_java_method): Call build_result_decl here instead ...
12168 * parse.y (java_complete_expand_method): ... and here.
12169 (expand_start_java_method): Don't call complete_start_java_method here.
12170 (java_complete_expand_method): Call it here instead.
12171 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
12172 * java-tree.h: ... here.
12174 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
12175 * parse.y (java_complete_lhs): Don't call force_evaluation_order
12176 for ARRAY_REF - it doesn't work when array bounds are checked.
12177 (patch_array_ref): Handle it here instead.
12179 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
12181 1999-02-19 Per Bothner <bothner@cygnus.com>
12183 Force left-to-right evaluation of binary operations etc.
12184 * expr.c (force_evaluation_order), java-tree.h: New function.
12185 * parse.y (java_complete_lhs): Pass binary operations, procedure
12186 calls, and ARRAY_REFs to force_evaluation_order.
12187 (various): Set TREE_SIDE_EFFECTS more carefully.
12189 Tolerate random (non-UTF8) encoding in comments without complaining.
12190 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
12191 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
12193 * parse.y (resolve_qualified_expression_name): Handle error_mark.
12194 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
12196 * parse.y (java_complete_lhs): Ignore an empty statement in a
12197 COMPOUND_EXPR. Don't complain about empty statement after return.
12199 1999-02-19 Per Bothner <bothner@cygnus.com>
12201 * parse.y (obtain_incomplete_type): Don't wrap unknown types
12202 in TREE_LIST - just chain the POINTER_TYPEs together.
12203 (resolve_class): If type already resolved, return decl.
12204 After resolving, update TREE_TYPE(class_type), and name (if array).
12205 * parse.h (do_resolve_class), parse.y: Make non-static.
12206 * class.c (maybe_layout_super_class): Take this_class argument.
12207 Do do_resolve_class if necessary.
12208 (layout_class, layout_class_methods): Adjust calls appropriately.
12209 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
12210 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
12211 * typeck.c (build_java_array_type): Don't call layout_class.
12213 1999-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12215 * parse.y (check_pkg_class_access): Allow private class access
12216 within the same package.
12217 (strip_out_static_field_access_decl): New function.
12218 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
12219 operator argument before testing its nature.
12221 1999-02-03 Per Bothner <bothner@cygnus.com>
12223 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
12224 (TRY_EXPR): Simplify - it no longer has a finally clause.
12225 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
12226 Simpler handling of TRY_EXPR, which no longer has a finally clause.
12227 * expr.c (java_lang_expand_expr): Likewise.
12228 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
12229 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
12230 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
12231 (build_try_statement): Remove finally parameter and handling.
12232 (build_try_finally_statement): New function.
12233 (patch_try_statement): No longer need to support finally clause.
12234 (try_statement): Update grammar action rules.
12235 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
12236 Simpler handling of TRY_EXPR, which no longer has a finally clause.
12238 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
12240 * jcf-parse.c (get_constant): Add braces around computation of 'd'
12241 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
12243 1999-02-17 Andrew Haley <aph@cygnus.com>
12245 * class.c (build_utf8_ref): Back out broken patch which was
12246 intended to to output signatures using '.' as a separator.
12248 * class.c (make_class_data): Output signatures using '.' as a
12249 separator, rather than '/'.
12250 (mangled_classname): Likewise.
12251 (make_field_value): Likewise.
12252 (make_method_value): Likewise.
12253 * constants.c (alloc_class_constant): Likewise.
12254 * expr.c (build_invokeinterface): Likewise.
12256 1999-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
12258 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
12259 of an ancient workaround.
12261 1999-02-10 Jeffrey A Law (law@cygnus.com)
12263 * jvspec.c (xmalloc): Kill the prototype. It does not belong
12266 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
12268 * lex.c (yylex): Encode \0 as UTF8.
12270 1999-02-10 Tom Tromey <tromey@cygnus.com>
12272 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
12273 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
12274 (libgcj_zip): Renamed.
12275 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
12277 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
12279 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
12280 (GC_NAME): Renamed -lgc to -lgcjgc.
12282 1999-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
12284 * lex.c (java_lang_cloneable): Initialize.
12285 * parse.y (java_lang_cloneable): New static variable.
12286 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
12287 doing one more qualification round.
12288 (valid_ref_assignconv_cast_p): Reject null source or
12289 destination. Allow an array to be cast into java.lang.Cloneable.
12290 (patch_cast): Swapped two first arguments to first call to
12291 valid_ref_assignconv_cast_p.
12293 1999-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
12295 * parse.h: DECL_P renamed JDECL_P.
12296 * parse.y: DECL_P replaced by JDECL_P.
12297 (build_array_from_name): Always use pointer's type.
12298 (patch_bc_statement): Extra code to search continue target in a
12299 for loop. Fixed comments. Continue target is current loop when
12302 1999-02-05 Andrew Haley <aph@cygnus.com>
12304 * class.c (make_class_data): The superclass of an interface should
12305 be null, not class Object.
12307 * lex.c (java_lex): Sign extend hex literals.
12309 1999-02-04 Andrew Haley <aph@cygnus.com>
12311 * class.c (build_utf8_ref): Output signatures using '.' as a
12312 separator, rather than '/'.
12313 (make_class_data): Likewise.
12315 1999-02-03 Marc Espie <Marc.Espie@liafa.jussieu.fr>
12317 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
12318 mkstemp.o. Get them from libiberty now.
12320 1999-02-02 Jeffrey A Law (law@cygnus.com)
12322 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
12324 1999-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12326 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
12329 1999-02-02 Per Bothner <bothner@cygnus.com>
12331 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
12332 * jcf-write.c (generate_bytecode_return): New function.
12333 (generate_bytecode_insns): Use it, for RETURN_EXPR.
12335 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
12336 generate special [fd]const_[01] instructions.
12338 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
12340 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
12341 handling OPCODE_lookupswitch or OPCODE_tableswitch.
12343 1999-02-01 Per Bothner <bothner@cygnus.com>
12345 * parse.y (patch_method_invocation): Handle calling static methods,
12346 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
12348 * parse.y (java_complete_lhs): Don't complain about unreachable
12349 exit condition in a do-while statement.
12351 1999-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
12353 * lex.c (java_read_char): Fixed utf8 decoding.
12354 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
12356 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
12357 comments. Local variable `all_primitive' is gone. Broadened
12358 acceptance of `0' to floating point targets. `long' can now be
12359 widened to `double' or `float'.
12360 (valid_method_invocation_conversion_p): Added leading
12361 comment. Fixed tabulation.
12362 (build_string_concatenation): Optimize out left or right empty
12365 1999-01-28 Per Bothner <bothner@cygnus.com>
12367 * jcf-write.c (localvar_alloc): Only emit entry for
12368 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
12369 (generate_bytecode_insns): Only call put_linenumber if
12370 debug_info_level > DINFO_LEVEL_NONE.
12371 * jvspec.c (lang_specific_driver): If no -O* or -g* option
12372 is specified, add -g1 (for compatibility wih javac).
12374 1999-01-28 Hans-Peter Nilsson <hp@axis.se>
12376 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
12377 gjavah.o, check-init.o, jv-scan.o
12379 1999-02-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12381 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
12383 * gjavah.c: Include config.h and system.h.
12385 * javaop.h (inline): Don't define, its handled by system.h.
12386 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
12387 from `inline' to `static inline'.
12389 * jcf.h (inline): Don't define, its handled by system.h.
12391 * lex.c (inline): Likewise.
12393 1999-01-31 Zack Weinberg <zack@rabi.columbia.edu>
12395 * lang-specs.h: Map -Qn to -fno-ident.
12397 1999-01-29 Richard Henderson <rth@cygnus.com>
12399 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
12401 1999-01-29 Tom Tromey <tromey@cygnus.com>
12403 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
12404 then cast it to Object before calling `append' method.
12406 1999-01-28 Per Bothner <bothner@cygnus.com>
12408 * check-init.c (check_bool2_init, check_bool_init, check_init):
12409 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
12410 * jcf-write.c (generate_bytecode_insns): Likewise.
12412 1999-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
12414 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
12415 * parse.y (patch_cast): Allow a boolean to be cast into a
12418 1999-01-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
12420 * parse.y: (class_declaration:): Fixed indentation.
12421 (class_member_declaration:): Extra `;' after field declaration now
12423 (interface_declaration:): Removed debug messages in error reports.
12424 (patch_binop): Nodes created and returned inherit the orignal
12425 node's COMPOUND_ASSIGN_P flag value.
12426 (patch_cast): Fix cast from char to floating point.
12428 1999-01-25 Andrew Haley <aph@cygnus.com>
12430 * except.c, java-except.h (expand_resume_after_catch): new
12432 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
12433 to branch back to main flow of control after a catch block.
12435 1999-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12437 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
12438 $(srcdir)/../system.h.
12439 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
12440 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
12441 (jcf-write.o): Likewise.
12442 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
12443 (mangle.o): Depend on $(srcdir)/../toplev.h.
12444 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
12445 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
12447 * class.c: Include output.h and parse.h.
12448 (mangled_classname): Add the `const' keyword to a char*.
12449 (find_named_method): Hide unused function definition.
12450 (build_utf8_ref): Change type of variable `c' to unsigned char.
12451 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
12452 (build_class_ref): Add the `const' keyword to a char*.
12453 (layout_class_method): Remove unused variable `buf'.
12455 * decl.c (find_local_variable): Remove unused variable `rtl'.
12456 (pushdecl): Likewise for variables `different_binding_level' and
12458 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
12459 (maybe_build_cleanup): Likewise for parameter `decl'.
12461 * except.c (expand_start_java_handler): Mark parameter `range'
12462 with ATTRIBUTE_UNUSED.
12464 * expr.c: Include except.h.
12465 (pop_type): Remove unused variable `i'.
12466 (pop_value): Likewise for variables `n_words' and `i'.
12467 (expand_java_arrayload): Likewise for variable `convert'.
12468 (java_lang_expand_expr): Likewise for variables `op0', `type',
12469 `mode', `unsignedp', `node' and `elements'.
12470 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
12472 (process_jvm_instruction): Add a `const' qualifier to a char*.
12474 * gjavah.c (output_directory): Add the `const' keyword to a char*.
12475 (temp_directory): Likewise.
12476 (print_c_decl): Likewise.
12477 (print_method_info): Likewise.
12478 (decode_signature_piece): Likewise.
12479 (print_mangled_classname): Likewise.
12481 * java-except.h: Provide prototypes for maybe_start_try,
12482 maybe_end_try and add_handler.
12484 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
12485 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
12486 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
12487 init_expr_processing, push_super_field, init_class_processing,
12488 can_widen_reference_to, class_depth, verify_jvm_instructions,
12489 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
12490 set_local_type, merge_type_state, push_type, load_type_state,
12491 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
12492 emit_unicode_mangled_name): Add prototypes.
12494 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
12495 (print_signature_type): Use ISDIGIT, not isdigit.
12496 (print_signature): Remove unused variable `j'.
12498 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
12499 int when comparing against one.
12501 * jcf-parse.c: Include toplev.h.
12503 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
12504 (localvar_free): Remove unused variable `i'.
12505 (generate_bytecode_conditional): Likewise for variable `kind'.
12507 * jv-scan.c: Include config.h and system.h. Remove redundant
12508 OS header and gansidecl.h includes.
12509 (warning): Add the `const' keyword to a char*. Also add
12510 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
12511 __STDC__, when determining whether to use ANSI-isms.
12512 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
12513 (xmalloc): Don't redundantly prototype here.
12514 (main): Remove unused parameter `envp'. Also fix the arguments
12515 passed to function `fatal' to match the format specifier.
12517 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
12519 * mangle.c: Include toplev.h.
12520 (emit_unicode_mangled_name): Declare parameter `len'.
12522 * parse.y (parse_warning_context): Add the `const' keyword to a
12523 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
12524 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
12525 (issue_warning_error_from_context): Add the `const' keyword to
12527 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
12528 not `__STDC__' for whether to use ANSI-isms.
12530 * typeck.c (incomplete_type_error): Mark parameters `value' and
12531 `type' with ATTRIBUTE_UNUSED.
12532 (parse_signature_type): Use ISDIGIT, not isdigit.
12534 * verify.c (check_pending_block): Add the `const' keyword to a char*.
12535 (verify_jvm_instructions): Likewise. Remove unused variables
12536 `field_name' and `default_val'.
12538 * zextract.c: Include config.h and system.h. Remove redundant
12539 OS header includes.
12541 * zipfile.h: Prototype `read_zip_archive'.
12543 1999-01-21 Andrew Haley <aph@cygnus.com>
12545 * typeck.c (convert): Allow conversions to void type: some
12546 optimizations in gcc do this.
12548 1999-01-21 Andrew Haley <aph@cygnus.com>
12550 * typeck.c (convert_ieee_real_to_integer): New function.
12551 (convert): When not using fast-math and using hardware fp, convert
12552 an IEEE NaN to zero.
12554 1999-01-18 Andrew Haley <aph@cygnus.com>
12556 * parse.y (patch_binop): Do a type conversion from signed to
12557 unsigned and then back to signed when a ">>>" is found.
12559 1999-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12561 * java-tree.h: (check_for_initialization): Added prototype.
12562 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
12563 * parse.y (do_resolve_class): Removed unused locals.
12564 (read_import_dir): Likewise.
12565 (resolve_qualified_expression_name): Array creation
12566 expressions are valid primary expressions.
12567 (qualify_ambiguous_name): Likewise.
12568 (patch_synchronized_statement): Removed unused local.
12570 1999-01-17 Jeffrey A Law (law@cygnus.com)
12572 * Makefile.in (zextract.o): Add dependencies.
12574 * Makefile.in: Do not put ^Ls at the start of a line.
12576 1999-01-15 Per Bothner <bothner@cygnus.com>
12578 * expr.c (process_jvm_instruction): Coerce to correct Throwable
12579 sub-type the result of the call that gets the exception value.
12581 * parse.y (java_complete_expand_methods): If flags_syntax_only,
12582 don't call finish_class.
12584 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
12585 clear found before continuing.
12587 * verify.c (verify_jvm_instructions): On an array load, allow
12588 and handle top of stack to be TYPE_NULL.
12590 * gjavah.c (generate_access): Translate Java package private or
12591 protected access to C++ public, but with a comment.
12593 1999-01-13 Andrew Haley <aph@cygnus.com>
12595 * expr.c (generate_name): Name prefix changed to avoid clashes
12596 with assembler temp labels.
12598 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
12599 MODIFY_EXPR. Without this, code for the assignment may not be
12600 generated at all and the synchronized statement will read an
12601 uninitialized variable.
12603 1999-01-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
12605 * class.c (maybe_layout_super_class): Fixed returned value.
12606 * lex.c: Added 1999 to the copyright.
12607 (java_init_lex): Initialize java_lang_imported.
12608 * lex.h: Added 1999 to the copyright.
12609 * parse.h: Added 1999 to the copyright.
12610 (REGISTER_IMPORT): Fixed typo in trailing macro.
12611 (CURRENT_OSB): New macro.
12612 (struct parser_ctxt): New fields osb_depth, osb_limit.
12613 * parse.y (java_lang_id): New global variable.
12614 (type_import_on_demand_declaration): Don't import java.lang.* twice.
12615 (array_creation_expression:): Use CURRENT_OSB.
12616 (dims:): Uses a stack to keep track of array dimensions.
12617 (cast_expression:): Use CURRENT_OSB.
12618 (find_expr_with_wfl): Return NULL if node found doesn't meet the
12620 (register_fields): Fixed typos in comment.
12621 (check_method_redefinition): Fixed comment indentation.
12622 (java_check_regular_methods): Set saved found wfl to NULL after
12623 having reinstalled it in the previously found DECL_NAME.
12625 1999-01-10 Richard Henderson <rth@cygnus.com>
12627 * gjavah.c (java_float_finite): Use a union to do type punning.
12628 (java_double_finite): Likewise.
12630 1999-01-09 Per Bothner <bothner@cygnus.com>
12632 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
12633 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
12634 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
12635 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
12636 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
12637 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
12639 1999-01-08 Per Bothner <bothner@cygnus.com>
12641 * check-init.c (check_init): If compiling to native, we don't
12642 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
12644 1999-01-08 Tom Tromey <tromey@cygnus.com>
12646 * parse-scan.y (variable_declarator_id): Set or increment
12648 (bracket_count): New global.
12649 (formal_parameter): Handle case where bracket pairs trail variable
12652 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
12654 * jcf-parse.c (yyparse): variable len changed from a char to an
12655 int to prevent overflow.
12657 1999-01-06 Per Bothner <bothner@cygnus.com>
12659 * java-tree.h: Declare read_class.
12660 * jcf-parse.c (read_class): New function.
12661 (load_class): Now just call read_class.
12663 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
12664 * jcf-parse.c (parse_source_file): Declare save_error_count,
12665 which is needed by java_parse_abort_on_error macro,
12666 * parse.y (java_layout_classes, java_expand_classes): Likewise.
12668 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
12669 constructor, if initializing a static field.
12670 (patch_new_array_init): Set TREE_CONSTANT if it is.
12671 * expr.c (java_lang_expand_expr): For a static array constructor
12672 of primitive elements, allocate the array itself statically.
12673 Disabled until we can set the vtable field statically.
12675 * check-init.c: New file. Checks for definite assignment.
12676 * Makefile.in (JAVA_OBJS): Add check-init.o.
12677 * parse.y (java_complete_expand_method): Call check_for_initialization.
12678 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
12680 1999-01-06 Graham <grahams@rcp.co.uk>
12682 * parse.y : include system.h instead of including
12683 standard headers directly with the exception of <dirent.h>.
12685 1999-01-06 Per Bothner <bothner@cygnus.com>
12687 * lex.h: Moved static function declarations to lex.c,
12688 to shut up some -Wall warnings.
12689 * lex.c: Static function declarations moved here.
12690 * jcf-dump.c: Small fixes to shut up -Wall warnings.
12692 1999-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12694 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
12696 1998-12-22 Per Bothner <bothner@cygnus.com>
12698 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
12699 * verify.c (verify_jvm_instructions): Fix off-by-one error.
12701 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
12702 (localvar_alloc): Change return type to void,
12703 (emit_unop): Remove unused variable size.
12705 * jcf-write.c (struct jcf_block): Add new union.
12706 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
12707 (call_cleanups): New functions.
12708 (struct jcf_partial): New fields num_finalizers and return_value_decl.
12709 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
12710 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
12711 * lang.c (lang_init): Call using_eh_for_cleanups.
12712 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
12713 completing operands to patch_synchronized_statement.
12714 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
12715 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
12716 WITH_CLEANUP_EXPR instead of TRY_EXPR.
12718 1998-12-20 John F. Carr <jfc@mit.edu>
12720 * Make-lang.in: Comment out control-Ls; they upset some makes.
12722 1998-12-18 Tom Tromey <tromey@cygnus.com>
12724 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
12727 1998-12-17 Tom Tromey <tromey@cygnus.com>
12729 * parse.y (DIR_SEPARATOR): New define.
12730 (check_class_interface_creation): Use it.
12732 * parse-scan.y (report_main_declaration): Recognize
12733 `java.lang.String' in argument to main.
12735 1998-12-16 Per Bothner <bothner@cygnus.com>
12737 * parse.y (create_interface): Remove bogus test.
12739 1998-12-16 Per Bothner <bothner@cygnus.com>
12741 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
12742 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
12744 1998-12-16 Tom Tromey <tromey@cygnus.com>
12746 * parse-scan.y (qualified_name): Use correct sprintf format.
12748 1998-12-15 Tom Tromey <tromey@cygnus.com>
12750 * gjavah.c (print_field_info): Changed how most negative number is
12753 1998-12-14 Per Bothner <bothner@cygnus.com>
12755 * parse.y (fold_constant_for_init): New function.
12756 (resolve_expression_name): Don't replace static final
12757 constant-initialized fields by its value.
12758 (java_complete_lhs): New. Same as java_complete_tree, except does
12759 not replace static final constant-initialized fields by their values.
12760 (register_fields): If there is an initializer, set DECL_INITIAL and
12761 MODIFY_EXPR_FROM_INITIALIZATION_P.
12762 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
12763 Only call patch_initialized_static_field if
12764 MODIFY_EXPR_FROM_INITIALIZATION_P.
12765 (patch_initialized_static_field): If not valid constant, clear
12768 * parse.y (lookup_field_wrapper): Fix thinko.
12770 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
12771 set and restore global lineno.
12773 1998-12-14 Tom Tromey <tromey@cygnus.com>
12775 * gjavah.c (print_field_info): If value to print is the smallest
12776 value of its size, then print as hex to avoid later warnings from
12779 1998-12-14 Tom Tromey <tromey@cygnus.com>
12781 * gjavah.c (decompile_method): Decompile `return null'.
12782 (process_file): Generate `#pragma interface'.
12783 (method_declared): New global.
12784 (print_method_info): Set it.
12785 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
12786 (print_method_info): Handle abstract methods.
12788 1998-12-13 Per Bothner <bothner@cygnus.com>
12790 * parse.y (patch_method_invocation): If class_decl is null
12791 (e.g. an array type), use original type.
12793 * parse.y (check_thrown_exceptions): Temporary hack to suppress
12794 errors about uncaught exception from clone (of array, specifically).
12796 1998-12-13 Tom Tromey <tromey@cygnus.com>
12798 * gjavah.c (decompile_method): Handle all types of `return'
12799 opcode. Decompile `return this' and `return'.
12800 (method_access): New global.
12801 (print_method_info): Set it.
12802 (decompile_method): Don't decompile a synchronized method.
12804 1998-12-13 Tom Tromey <tromey@cygnus.com>
12806 * jcf-reader.c (jcf_parse_one_method): Recognize
12808 * gjavah.c (HANDLE_END_METHOD): New macro.
12809 (HANDLE_CODE_ATTRIBUTE): New macro.
12810 (decompile_method): New function.
12811 (print_method_info): Don't print `;\n' at end of function decl.
12812 Include java-opcodes.h.
12813 (decompiled): New global.
12815 1998-12-12 Per Bothner <bothner@cygnus.com>
12817 * class.c (build_class_ref): Handle PRIMTYPE.class if
12818 flag_emit_class_files.
12819 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
12820 if flag_emit_class_files.
12821 * parse.y (java_complete_tree): Pre-liminary support for
12822 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
12824 * parse.y (patch_synchronized_statement): Don't call monitorexit
12825 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
12827 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
12829 * zipfile.h (opendir_in_zip): New declaration.
12830 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
12831 (opendir_in_zip): New function, using code from open_in_zip.
12832 (open_in_zip): Call opendir_in_zip.
12833 (find_class): Remove no-longer-used do_class_file parameter,
12834 but add source_ok parameter. Change logic so if we find a .java file,
12835 we don't look for .class in later classpath emtries.
12836 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
12837 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
12838 * gjavah.c: Update call to find_class.
12839 * jcf-dump.c: Likewise.
12841 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
12842 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
12843 nothing if body is empty_stmt_node.
12844 Various little fixes so SP gets correctly adjusted.
12845 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
12846 For CALL_EXPR, test if static first.
12847 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
12848 such as the ones we create for Object and Class.
12849 Set and restore current_function_decl.
12850 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
12851 (note_possible_classname): New function.
12852 (read_import_entry): Removed. Merged with read_import_dir.
12853 (read_import_dir): Don't call find_class - that only gives us
12854 the first classpath entry having the needed package.
12855 Use the struct buffer data structure from buffer.h.
12856 (read_import_dir, find_in_imports_on_demand): The remembered
12857 class names now use '.' (not '/') as package separator.
12859 * parse.y (java_complete_expand_methods): Call write_classfile
12860 here, and not in java_expand_classes (which only gets first class).
12862 1998-12-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
12864 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
12865 (register_fields): If a static fields has an initializer, just
12866 chain it on ctxp->static_initialized, and handle later.
12867 (java_complete_expand_methods): Force <clinit> first.
12868 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
12869 - it's already been completed.
12870 (patch_initialized_static_field): New function.
12871 (java_complete_field): Call it.
12873 1998-12-12 Per Bothner <bothner@cygnus.com>
12875 * expr.c (encode_newarray_type, build_new_array): New functions.
12876 * java-tree.h: Declare build_new_array.
12877 * jcf-write.c (patch_newarray): Use build_new_array.
12879 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
12880 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
12882 * parse.y (patch_new_array_init): Re-organize.
12883 Now is passed the actual array (pointer) type of the value.
12884 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
12885 (patch_array_constructor): Removed - merged into patch_new_array_init.
12886 (java_complete_tree): Update patch_new_array_init.
12888 * jcf-write.c (find_constant_index): New function.
12889 (generate_bytecode_insns): Use find_constant_index.
12890 (generate_classfile): Use find_constant_index for ConstantValue.
12892 1998-12-11 Tom Tromey <tromey@cygnus.com>
12894 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
12895 * decl.c (init_decl_processing): Renamed dtable -> vtable.
12896 * class.c (make_class_data): Renamed dtable -> vtable, and
12897 dtable_method_count -> vtable_method_count.
12899 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
12901 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
12902 global variables, initialized.
12903 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
12904 Declared new global variables.
12905 * lex.c (java_lex): Return long_zero_node, float_zero_node,
12906 double_zero_node, integer_zero_node upon direct matching.
12907 * parse.y (purify_type_name): Added function prototype.
12908 (duplicate_declaration_error_p): Consider new_type as potentially
12909 being a incomplete type. Use purify_type_name on type string.
12910 (method_header): saved_type: unused variable removed. Don't figure
12911 return type if method name is invalid.
12912 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
12913 processed by patch_unaryop.
12914 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
12915 increment/decrement node into its original type after binary
12916 numeric promotion on its operands.
12918 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
12920 * parse.y (array_initializer:): Array init operand is NULL_TREE
12921 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
12922 now an error. Fixed indentation problems.
12923 (patch_string): Handle error_mark_node as an argument.
12924 (patch_new_array_init): Fixed indentation problems.
12925 (array_constructor_check_entry): Removed check on null wfl_value.
12926 Return an error if wfl_value's walk returns an error.
12928 1998-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
12930 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
12931 * lex.c (java_lex): Remember column position before advancing one
12932 token. Retain location information on OCB_TK.
12933 * lex.h (typedef struct java_lc): Added new field.
12934 * parse.h (GET_SKIP_TYPE): New macro.
12935 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
12936 * parse.y (build_new_array_init, patch_new_array_init,
12937 patch_array_constructor, maybe_build_array_element_wfl,
12938 array_constructor_check_entry): New function prototypes.
12939 (switch_block:): Tagged <node>.
12940 (OCB_TK): Tagged <operator>.
12941 (array_initializer:): Installed actions.
12942 (variable_initializer): Build location information on element if
12944 (switch_statement:): Fixed indentation typo.
12945 (switch_block:): Redefined default action.
12946 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
12947 (patch_assignment): Removed duplicate code.
12948 (maybe_build_array_element_wfl, build_new_array_init,
12949 patch_new_array_init, patch_array_constructor,
12950 array_constructor_check_entry): New functions.
12952 1998-12-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
12954 * parse.y (array_initializer): Tagged <node>.
12955 (variable_initializer:): Use default rule.
12956 (array_initializer:): Defined actions.
12957 (variable_initializers:): Likewise.
12958 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
12959 non-static field accesses.
12960 (patch_invoke): Fixed indentation typo.
12961 (java_complete_tree): Likewise.
12962 (build_labeled_block): Changed leading comment. Generate an error
12963 in case of duplicate loop labels.
12964 (patch_conditional_expr): Patch results of string concatenation
12967 1998-12-06 Per Bothner <bothner@cygnus.com>
12969 * constants.c (find_methodref_index): When the class is an interface,
12970 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
12972 * decl.c (finit_identifier_node): Use "$finit$", rather than
12973 "<finit>" (which Sun's verifier rejects).
12974 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
12975 (generate_field_initialization_code): Removed.
12976 (fix_constructors) Don't add call to $finit$ here (wrong order).
12977 (patch_method_invocation): Add $finit$ call here.
12979 * java-tree.h (CALL_USING_SUPER): New macro.
12980 * parse.y (patch_invoke): Remove im local variable.
12981 (patch_method_invocation, patch_invoke): Don't pass super parameter.
12982 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
12983 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
12985 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
12987 * parse.y (java_complete_tree): Don't complain about unreachable
12988 statement if it is empty_stmt_node.
12990 * jcf-write.c (find_constant_wide): New function.
12991 (push_long_const): Use find_constant_wide.
12993 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
12994 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
12995 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
12996 Emit invokeinterface when calling an interface method.
12997 Emit invokespecial also when calling super or private methods.
12999 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
13001 1998-12-06 Per Bothner <bothner@cygnus.com>
13003 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
13005 1998-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
13007 * java-tree.h (java_layout_seen_class_methods): New function
13009 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
13010 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
13011 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
13012 * parse.y (method_declarator:): Defined action.
13013 (issue_warning_error_from_context): input_filename saved, set to
13014 the appropriate value and restored after java_error is called.
13015 (build_unresolved_array_type): Fixed comment.
13016 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
13017 (method_header): Deal with return type the same way type are
13018 handled for fields and method's parameters and local variables
13020 (check_method_redefinition): Removed extra CR.
13021 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
13022 (java_layout_seen_class_methods): New function.
13023 (java_layout_classes): Call java_layout_seen_class_methods.
13025 1998-12-03 Per Bothner <bothner@cygnus.com>
13027 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
13029 1998-12-03 Per Bothner <bothner@cygnus.com>
13031 * jcf-dump.c (main): Fix error message.
13032 * jcf-path.c (add_entry): Style fix.
13034 1998-12-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
13036 * class.c (layout_class_method): Call build_java_argument_signature
13037 on constructors too.
13038 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
13039 (patch_method_invocation): Define a primary when resolving an
13040 expression name. Augmented comment on code checking illegal `this'
13041 usage. Loosened it test by accepting NEW_CLASS_EXPR.
13043 1998-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
13045 * class.c (layout_class_method): Don't report error on non-static
13046 overriding static if the method is private.
13047 * java-tree.h (finish_class): Prototype added.
13048 * lex.c (java_get_line_col): Handle col argument -2 value.
13049 * parse.h: All static method declarations moved to parse.y.
13050 * parse.y: Now contains all static method declarations previously
13052 (find_expr_with_wfl, missing_return_error,
13053 unreachable_stmt_error): New functions.
13054 (java_get_real_method_name): Identify constructors bearing class
13055 names in source code compiled classes only.
13056 (java_complete_expand_methods): Call missing_return_error.
13057 (invocation_mode): Private methods invoked as static methods.
13058 (java_complete_tree): Call unreachable_stmt_error.
13060 1998-12-01 Tom Tromey <tromey@cygnus.com>
13062 * Makefile.in (+target): Removed.
13063 (+xmake_file): Likewise.
13064 (+tmake_file): Likewise.
13065 (.NOEXPORT): Removed duplicate.
13067 1998-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13069 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
13071 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
13073 * jvgenmain.c: Remove the xmalloc prototype, we get it from
13074 libiberty.h. Provide an xmalloc definition.
13076 * jvspec.c: Remove the xmalloc prototype.
13078 * parse-scan.y: Include config.h and system.h. Don't include
13079 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
13080 Provide an xstrdup definition.
13082 1998-11-26 Alexandre Oliva <oliva@dcc.unicamp.br>
13084 * jcf-path.c (add_entry): Recognize ".jar" too.
13085 * lang-specs.h: Likewise.
13087 1998-11-26 Per Bothner <bothner@cygnus.com>
13089 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
13090 soft_monitorenter_node, soft_monitorexit_node, throw_node.
13092 * jcf-write.c (generate_bytecode_insns):
13093 Handle pre/post-increment/decrement of long.
13095 * jcf-write.c (generate_bytecode_insns):
13096 Handle missing exception handler (finally for synchronized).
13098 1998-11-25 Per Bothner <bothner@cygnus.com>
13100 * java-tree.h (end_params_node): Declare global.
13101 * decl.c (end_params_node): New global.
13102 (init_decl_processing, start_java_method): Use end_params_node for
13103 end of list of parameter types. Follows correct gcc conventions.
13104 * expr.c (pop_argument_types, pop_arguments): Likewise.
13105 * lang.c (put_decl_node): Likewise.
13106 * typeck.c (various places): Likewise.
13107 * class.y (various places): Likewise.
13108 * parse.y (various places): Likewise.
13110 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
13111 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
13113 * class.c: Add #include flags.h, remove no-longer needed declaration.
13115 * class.c (layout_class_method): Remove commented-out code, re-format.
13116 Don't add vtable entry (or index) for private methods.
13117 * expr.c (expand_invoke): A private method is implicitly final.
13118 * class.c (make_class_data): If inlining or optimizing,
13119 skip private methods.
13121 * class.c (finish_class): New function. Calls existing methods,
13122 but alls emits deferred inline functions.
13123 * jcf-parse.c (parse_class_file): Call finish_class.
13124 * parse.y (java_complete_expand_methods): Likewise.
13126 * expr.c (build_java_binop): Explicit default, to silence -Wall.
13128 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
13130 1998-11-25 Marc Espie <espie@quatramaran.ens.fr>
13132 * jcf-write.c (generate_bytecode_conditional): Fix typo.
13134 1998-11-24 Per Bothner <bothner@cygnus.com>
13136 * (generate_classfile): Always write class access flag with
13139 1998-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
13141 * class.c (maybe_layout_super_class): New function.
13142 (layout_class): Reorganized. Loop on class methods dispatched into
13143 a new function. Call maybe_layout_super_class.
13144 (layout_class_methods, layout_class_method): New functions.
13145 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
13147 (expand_invoke): Likewise.
13148 * java-tree.h (all_class_list): New global variable declared.
13149 (layout_class_methods, layout_class_method): New function
13151 (LAYOUT_SEEN_CLASS_METHODS): New macro.
13152 * jcf-parse.c (all_class_list): New global variable.
13153 (load_class): Extended what class_or_name can be. Use parser
13154 context mechanism to save globals before calling jcf_parse.
13155 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
13156 is set on the file name.
13157 (jcf_parse): Layout class methods when Object is loaded, otherwise
13158 record class in all_class_list for delayed method layout.
13159 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
13160 * lang.c (put_decl_node): Decode <init> into the decl context
13162 * lex.c (java_allocate_new_line): Use xmalloc.
13163 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
13164 pointers, not TREE_LIST elements.
13165 (struct parser_ctxt): Fixed comment indentations, added comments
13166 and reordered some fields.
13167 (java_check_methods): Function prototype removed.
13168 * parse.y (java_push_parser_context): Use xmalloc.
13169 (java_parser_context_restore_global): Pop extra pushed ctxp only
13170 when there's nothing next.
13171 (maybe_create_class_interface_decl): Fixed comment, add new
13172 created class decl to all_class_list.
13173 (method_header): Use GET_REAL_TYPE on argument's types.
13174 (method_declarator): Use GET_REAL_TYPE, change type to the real
13175 type in TREE_LIST dependency node. Build argument list with the
13177 (create_jdep_list): Use xmalloc. Removed allocation error message.
13178 (obtain_incomplete_type): Fixed leading comment. Broadened
13179 incoming argument meaning.
13180 (register_incomplete_type): Use xmalloc. Removed allocation error
13182 (safe_layout_class): Fixed leading comment.
13183 (jdep_resolve_class): Reversed if statement condition and switch
13184 if and else bodies.
13185 (resolve_and_layout): Fixed leading comment. Broadened incoming
13187 (complete_class_report_errors): New local variable name, for
13188 clarity. purify_type_name used for all error cases.
13189 (java_get_real_method_name): Stricter check on constructors.
13190 (java_check_regular_methods): Reverse methods list only if not
13191 already laid out. Layout artificial constructor.
13192 (java_check_methods): Deleted.
13193 (source_start_java_method): Obtain incomplete type for patchable
13195 (java_layout_classes): Fixed leading comment. Use
13196 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
13197 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
13198 before returning. Fixed comments.
13199 (java_expand_classes): Check for errors up front.
13200 (patch_method_invocation): Class to search is resolved and laid
13203 1998-11-24 Per Bothner <bothner@cygnus.com>
13205 * expr.c (java_lang_expand_expr): Add missing emit_queue.
13207 * javaop.h (int8): Removed - not used.
13208 (jbyte): Redefine portably with correct signedness.
13210 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
13212 * jcf-write.c (generate_bytecode_insns): Fix typo
13213 OPCODE_getstatic to OPCODE_getfield.
13215 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
13216 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
13217 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
13219 1998-11-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
13221 * jcf-parse.c (jcf_parse_source): Function returned type is
13222 void. Added prototype.
13223 (jcf_parse): Function returned type is void.
13224 (yyparse): Remove call to fclose on the last parsed file.
13226 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
13228 1998-11-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
13230 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
13231 (layout_class): Cope with methods featuring WFL in decl names.
13232 * decl.c (unqualified_object_id_node): New global variable,
13234 (build_decl_no_layout): Removed.
13235 * expr.c (build_primtype_type_ref): Handle Double.
13236 (java_lang_expand_expr): Fixed indentations.
13237 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
13238 (flag_wall, flag_redundant, flag_not_overriding,
13239 flag_static_local_jdk1_1, unqualified_object_id_node): Global
13240 variable declarations.
13241 (build_decl_no_layout): Removed prototype.
13242 (java_get_real_method_name): Added prototype.
13243 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
13244 (java_parse_abort_on_error): Macro now just returns.
13245 * jcf-parse.c (jcf_parse_source): Check fclose returned
13246 value. Call emit_register_classes if java_report_errors returns
13248 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
13249 flag_static_local_jdk1_1): New integer flags.
13250 (lang_decode_option): New flags set here.
13251 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
13252 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
13253 the flag_redundant variable.
13254 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
13255 when parsing java.lang.Object class.
13256 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
13257 NULL_TREE to build.
13258 (resolve_qualified_expression_name): Fixed indentation.
13259 (patch_array_ref): Changed prototype.
13260 (not_initialized_as_it_should_p): Prototype removed.
13261 (java_report_errors): Added function prototype.
13262 * parse.y (formal_parameter:): Changed error message for not yet
13263 supported final parameters.
13264 (class_type_list:): Set both PURPOSE and VALUE of created
13265 TREE_LIST to be class_type.
13266 (primary_no_new_array:): Handle class literals on primitive types.
13267 (parse_warning_context): Reinstalled correct force_error and
13268 do_warning flags setups.
13269 (java_report_errors): Changed prototype. Return java_error_count
13271 (variable_redefinition_error): Consider treating variable type as
13273 (create_interface): Warn about redundant abstract modifier if
13274 flag_redundant is set. Changed error message.
13275 (lookup_field_wrapper): Save/restore globals before/after looking
13277 (duplicate_declaration_error_p): Consider treating declaration
13278 type as a fake pointer.
13279 (register_fields): Extract real type from dependency node. Check
13280 for duplicate field declaration after type adjustment. Use
13281 DECL_INITIAL to store static final initialized values.
13282 (method_header): Extract real function type from dependency node.
13283 (check_abstract_method_header): Use GET_METHOD_NAME.
13284 (obtain_incomplete_type): Layout fake pointer type.
13285 (safe_layout_class): Don't try to check for methods before layout.
13286 (java_complete_class): Don't check for correct throws clause
13287 elements inheritance here.
13288 (resolve_and_layout): Broadened name parameter meaning.
13289 (reset_method_name): Use GET_METHOD_NAME.
13290 (java_get_real_method_name): New function.
13291 (java_check_regular_methods): Don't check methods in
13292 java.lang.Object. Verify lineage of throws clause elements. Use
13293 flag_no_overriding in warning report.
13294 (check_throws_clauses): Don't check if class was from
13295 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
13296 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
13297 (declare_local_variables): Use flag_static_local_jdk1_1 to report
13298 warning on unsupported final local variables. Use build_decl
13299 instead of build_decl_no_layout. Get real local variable type from
13301 (source_start_java_method): Get real parameter type from
13302 dependency node. Call build_decl instead of build_decl_no_layout.
13303 (java_layout_classes): Reverse tree and layout type and class as
13304 required. Mark class as loaded when done.
13305 (resolve_field_access): Fixed indentation. Restricted condition
13306 leading to static field access code generation. Set field_type
13307 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
13308 (resolve_qualified_expression_name): Initialize type_found to
13309 null. Handle static field resolved during qualification. Fixed
13310 layout on non primitive field decl types.
13311 (not_accessible_p): Fixed typo in comment.
13312 (patch_method_invocation): Resolve and layout class to search from
13314 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
13315 layout non primitive type, if necessary. Make method node only to
13317 (find_applicable_accessible_methods_list): Consider WFL'ed method
13318 decl names. Fixed indentation.
13319 (argument_types_convertible): Resolve and layout target type if
13321 (java_complete_tree): Fixed indentation problems. Rewrote
13322 CALL_EXPR thrown exceptions check. Re-installed further processing
13323 of the assignment in certain cases.
13324 (patch_assignment): Call maybe_build_primttype_type_ref to perform
13325 inlining on class literals.
13326 (valid_builtin_assignconv_identity_widening_p): Cope with constant
13328 (valid_method_invocation_conversion_p): Likewise.
13329 (patch_string): Temporary disable forbidden use of `this' in
13330 explicit constructor invocations when doing string concatenation
13331 within their scope.
13332 (patch_unaryop): Added comment. Reinstalled code to disable
13333 further check on assignment operation with cast expression RHS.
13334 (patch_switch_statement): Fixed indentation.
13335 (build_try_statement): Call build_decl instead of
13336 build_decl_no_layout.
13337 (patch_synchronized_statement): Likewise.
13338 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
13339 IS_UNCHECKED_EXPRESSION_P.
13340 (check_thrown_exceptions_do): Changed leading comment. Resolve and
13341 layout argument exception type.
13342 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
13343 of IS_UNCHECKED_EXPRESSION_P.
13345 1998-11-18 Anthony Green <green@cygnus.com>
13347 * jcf-parse.c (yyparse): Open class file in binary mode.
13349 1998-11-15 Per Bothner <bothner@cygnus.com>
13351 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
13353 * jcf-write.c (perform_relocations): Move check out one loop.
13355 1998-11-15 Anthony Green <green@hoser.cygnus.com>
13357 * Make-lang.in: Fix reference to srcdir.
13358 * jv-scan.c: Add missing xmalloc prototype.
13359 * jvgenmain.c: Ditto.
13361 1998-11-15 Per Bothner <bothner@cygnus.com>
13363 * decl.c (error_mark_node), java-tree.h: New global.
13364 * parse.y: Use empty_stmt_node instead of size_zero_node.
13365 (build_if_else_statement): If missing else, use empty_stmt_node.
13367 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
13368 (java_complete_expand_method): Complain if return is missing.
13369 (java_check_regular_methods): Comment out incorrect error check.
13370 (not_accessible_p): Fix incorrect handling of protected methods.
13371 (patch_method_invocation): Pass correct context to not_accessible_p.
13372 (find_applicable_accessible_methods_list): Likewise.
13373 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
13374 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
13375 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
13376 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
13378 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
13379 (push_int_const): Remove reundant NOTE_PUSH.
13380 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
13381 (- case SWITCH_EXPR): Fix code generation bug.
13382 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
13383 (generate_classfile): More robust for abstract methods.
13385 1998-11-15 Anthony Green <green@cygnus.com>
13387 * Makefile.in: jv-scan and jvgenmain all require libiberty.
13388 * Make-lang.in: Ditto.
13390 * jv-scan.c: Remove xmalloc and xstrdup definitions.
13391 * jvgenmain: Ditto.
13393 1998-11-15 Per Bothner <bothner@cygnus.com>
13395 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
13397 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
13399 1998-11-14 Per Bothner <bothner@cygnus.com>
13401 Allow uses of interface types to verify. This is not really
13402 type-safe, but it matches what Sun does, and is OK as long as
13403 there are appropriate run-time checks.
13404 * verify.c (merge_types): If merging two interface types,
13405 just set the result to java.lang.Object.
13406 * expr.c (pop_type): Any interface is matches by java.lang.Object.
13408 1998-11-13 Tom Tromey <tromey@cygnus.com>
13410 * gjavah.c (main): Handle --output-class-directory argument.
13411 * jvspec.c (lang_specific_driver): Translate `-d' into
13412 -foutput-class-dir.
13413 * jcf.h (jcf_write_base_directory): Declare.
13414 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
13415 * lang-options.h: Mention -foutput-class-dir.
13416 * jcf-write.c (jcf_write_base_directory): New global.
13417 (make_class_file_name): Put generated .class file into `-d'
13418 directory, or into source directory if -d not given. Function now
13420 (write_classfile): Free class file name. Handle case where class
13422 (DIR_SEPARATOR): New macro.
13423 Include <sys/stat.h>
13425 * Makefile.in (prefix): New macro.
13427 1998-11-12 Per Bothner <bothner@cygnus.com>
13429 * parse.y (patch_invoke): Do less if flag_emit_class_files.
13430 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
13431 here (done in patch_invoke instead).
13432 (case_identity): Moved here from parse.y.
13434 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
13435 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
13436 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
13437 so they can be efficiently scanned without recursion.
13438 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
13439 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
13440 in BLOCK iteratively, rather than recursively.
13442 * parse.y (do_unary_numeric_promotion): New function.
13443 (patch_unaryop, patch_binop, patch_array_ref): Use it.
13445 * parse.y (patch_newarray): Various fixes.
13447 Re-do handling of switch statements (for proper block scoping).
13448 * parse.y: Add just a single block for the enture switch block,
13449 but don't create any "case blocks".
13450 (group_of_labels): Rmeoved unneeded non-terminal.
13451 CASE_EXPR and DEFAULT_EXPR are added to current block.
13452 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
13453 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
13454 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
13455 * parse.y (wfl_operator, print_int_node): Make non-static.
13456 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
13457 as part of recursive scan of block.
13458 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
13459 (patch_switch_statement): Most tests move dinto java_complete_tree.
13461 * parse.y: Make various production be non-typed (void).
13462 * parse.y (parse_error): Merged into issue_warning_error_from_context.
13463 * parse.y (add_stmt_to_compound): Don't create/change extra node.
13464 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
13466 * jcf-write.c (struct jcf_handler): New type.
13467 (struct jcf_switch_state): New type.
13468 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
13469 (alloc_handler, emit_unop, emit_reloc): New functions.
13470 (adjust_typed_op): Add extra parameter ("max type" offset).
13471 (emit_switch_reloc, emit_case-reloc): New function.
13472 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
13473 (generate_bytecode_insns): Support REAL_CST, switch statements,
13474 exception handling, method calls, object/array creation, and more.
13476 * class.c: Remove some unused variables.
13477 * constants.c (find_string_constant): New function.
13478 (count_constant_pool_bytes): Fix to correctly handle wide constants.
13479 * decl.c (complete_start_java_method): Don't _Jv_InitClass
13480 if flag_emit_class_files.
13482 1998-11-12 Tom Tromey <tromey@cygnus.com>
13484 * jcf-io.c (find_class): Added explanatory comment.
13486 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
13487 trailing slash to `.zip' entries.
13489 * jvspec.c (lang_specific_driver): Correctly handle case where
13490 GC_NAME not defined.
13492 1998-11-11 Tom Tromey <tromey@cygnus.com>
13494 * jvspec.c (GC_NAME): New define.
13495 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
13497 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
13499 1998-11-11 Per Bothner <bothner@cygnus.com>
13501 * jcf-dump.c (TABLE_SWITCH): Fix typos.
13503 1998-11-11 Tom Tromey <tromey@cygnus.com>
13505 * jcf-dump.c (main): Correctly recognize `--'-style long options.
13507 1998-11-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
13509 * class.c (is_compiled_class): Call safe_layout_class for class
13510 compiled from source.
13511 * conver.h (convert_to_integer, convert_to_real,
13512 convert_to_pointer): Added prototypes.
13513 * decl.c (init_decl_processing): Non longer push the decls of
13514 `methodtable', `constants', `Class', `Field', `dispatchTable'
13515 `jexception' and `Method'.
13516 * expr.c (build_invokeinterface): New function.
13517 (expand_invoke): static variable CLASS_IDENT now in
13518 build_invokeinterface. Use build_invokeinterface.
13519 (expand_java_field_op): Moved code to inline
13520 java.lang.PRIMTYPE.TYPE into a function.
13521 (build_primtype_type_ref): New function.
13522 * java-tree.def (INSTANCEOF_EXPR): New tree code.
13523 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
13524 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
13525 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
13526 (DECL_LOCAL_STATIC_VALUE): New macro.
13527 (build_invokeinterface, build_primtype_type_ref): New function
13529 (java_parse_abort_on_error): Macro rewritten.
13530 * jcf-parse.c (current_method): Add comment to declaration.
13531 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
13532 Function prototypes fixed.
13533 (jcf_parse_source): push/pop parser context. save/restore global.
13534 (parse_source_file): Fixed leading comment. Now take a
13535 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
13536 classes and pop the parser context anymore.
13537 (yyparse): Push parser context, save globals, parse the source
13538 file, restore globals and pop the parser context when processing a
13540 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
13541 * lex.c (java_parse_doc_section): New function.
13542 (java_lex): Call java_parse_doc_section when appropriate. Build an
13543 operator around INSTANCEOF_TK.
13544 * lex.h (java_lineterminator, java_sprint_unicode,
13545 java_unicode_2_utf8, java_lex_error, java_store_unicode):
13546 Prototypes rewritten.
13547 (java_parse_escape_sequence, java_letter_or_digit_p,
13548 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
13549 java_read_unicode, java_store_unicode, java_read_char,
13550 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
13551 Added function prototypes.
13552 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
13554 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
13556 (struct parser_ctxt): New fields: deprecated,
13557 current_parsed_class_un, gclass_list.
13558 (fix_method_argument_names, issue_warning_error_from_context,
13559 resolve_package, lookup_package_type): New function prototypes.
13560 (resolve_expression_name): Fixed function prototype.
13561 (find_applicable_accessible_methods_list): Fixed indentation, added
13562 extra argument in prototype.
13563 (check_final_assignment, build_null_of_type, check_deprecation,
13564 check_method_redefinition, reset_method_name,
13565 java_check_regular_methods, java_check_abstract_methods,
13566 maybe_build_primttype_type_ref): New function prototype.
13567 * parse.y (conver.h): Include.
13568 (INSTANCEOF_TK): Tagged <operator>.
13569 (single_type_import_declaration): Use REGISTER_IMPORT macro.
13570 (relational_expression:): Build binop for instanceof.
13571 (java_push_parser_context): Remember ctxp->gclass_list across
13573 (java_pop_parser_context): Simply return if no context
13574 exists. Remember gclass_list across contexts.
13575 (issue_warning_error_from_context): New function.
13576 (parse_error_context): Don't setup ctxp->elc here. Call
13577 issue_warning_error_from_context instead.
13578 (parse_warning_context): Likewise.
13579 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
13580 setup. Link new class/interface to ctxp->gclass_list.
13581 (add_superinterfaces): Register interface as incomplete if not
13583 (create_class): Remember class unqualified name in
13584 ctxp->current_parsed_class_un. Check class deprecation.
13585 (register_fields): Check field deprecation. Remember static final
13586 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
13588 (method_header): New local variable ORIG_ARG. Use unqualified
13589 current class name for check on constructor errors. Promote return
13590 type if of record type. Argument list fix moved in
13591 fix_method_argument_names, called here. Check method deprecation.
13592 (fix_method_argument_names): New function.
13593 (method_declarator): Promote record typed arguments.
13594 (safe_layout_class): Check class methods before layout.
13595 (java_complete_class): Compute field layout when patched.
13596 (do_resolve_class): Try to load class after having it renamed
13597 after the package name.
13598 (get_printable_method_name): Use DECL_CONTEXT.
13599 (reset_method_name): New function.
13600 (check_method_redefinition): Use reset_method_name.
13601 (java_check_regular_methods): New local variable
13602 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
13603 names for error report. Check for compile-time error when method
13604 found has default (package) access.
13605 (java_check_abstract_methods): Now takes an interface DECL node as
13606 an argument. Also reinstall real name on unchecked
13607 overriding/hiding methods for error report.
13608 (java_check_methods): Fixed leading comment. Get classes to verify
13609 from ctxp->gclass_list. Use CHECK_METHODS macro and set
13610 CLASS_METHOD_CHECKED_P on class verification.
13611 (lookup_java_method2): Get real method name if necessary.
13612 (find_in_imports): Don't check package class access here.
13613 (resolve_package, lookup_package_type): New functions.
13614 (java_layout_classes): Fixed leading comment. Take classes to be
13615 laid out from ctxp->gclass_list.
13616 (java_complete_expand_methods): Don't expand native and abstract
13618 (java_expand_classes): New function.
13619 (resolve_expression_name): Use additional argument ORIG. Retrieve
13620 values of static final field of primitive types.
13621 (resolve_field_access): Handles static final field of promotive
13623 (resolve_qualified_expression_name): Handle STRING_CST as
13624 primaries and package name resolution. Check deprecation on found
13625 decls. Set where_found and type_found on non static field resolved
13626 during qualification. Layout non primitive field decl types.
13627 (check_deprecation): New function.
13628 (maybe_access_field): Simplified.
13629 (patch_method_invocation_stmt): Local variable CLASS_TYPE
13630 removed. Reverse method's argument when primary is a type. Don't
13631 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
13632 instead. Include abstract class in the list of class searchable
13633 for constructors. Use DECL_CONTEXT of found method for access
13634 checks. Check method deprecation.
13635 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
13636 converting arguments. Handle INVOKE_INTERFACE.
13637 (lookup_method_invoke): Search constructor using existing
13638 infrastructure (don't rely on lookup_java_constructor anymore).
13639 (find_applicable_accessible_methods_list): Extra argument flag
13640 LC. Now include constructor in the search.
13641 (qualify_ambiguous_name): Conditional expression are primaries.
13642 (not_initialized_as_it_should_p): static final are always
13644 (java_complete_tree): Pass extra NULL argument to
13645 resolve_expression_name. Stricter test to carry on patching
13646 assignments. New case for INSTANCEOF_EXPR.
13647 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
13648 (check_final_assignment, maybe_build_primttype_type_ref): New
13650 (patch_assignment): Detect resolved static finals and carry normal
13651 assignment error check on them. Inline PRIMTYPE.TYPE read access.
13652 (try_builtin_assignconv): Access constant 0 on all primitive
13654 (valid_builtin_assignconv_identity_widening_p): Accept identical
13655 types. Accept all promoted type on int type.
13656 (valid_ref_assignconv_cast_p): Accept a null pointer to be
13657 assigned to a reference.
13658 (valid_method_invocation_conversion_p): Accept to check null
13660 (build_binop): Merge declaration and initialization of local
13662 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
13663 numeric types. Improved validity test for qualify operators on
13665 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
13666 and PREINCREMENT_EXPR. Also detect resolved static finals of a
13667 primitive type and issue the appropriate error message.
13668 (resolve_type_during_patch): Mark class loaded when resolved.
13669 (patch_cast): Allow null to be cased to reference types.
13670 (build_null_of_type): New function.
13671 (patch_array_ref): Handle array on references correctly.
13672 (patch_return): Removed unused local variable MODIFY. Force
13673 boolean to be returned as integers. Allows null to be returned by
13674 a function returning a reference.
13675 * typeck.c (convert_to_integer, convert_to_real,
13676 convert_to_pointer): Prototypes moved to convert.h
13677 (lookup_argument_method): Use method real name, if necessary.
13679 1998-10-30 Tom Tromey <tromey@cygnus.com>
13681 * class.c (build_class_ref): Changed name of primitive classes to
13684 * class.c (make_class_data): Renamed fields: nmethods to
13685 method_count, method_count to dtable_method_count. Always set
13686 `state' field to 0.
13687 * decl.c (init_decl_processing): Likewise.
13689 1998-10-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
13691 * class.c (layout_class): Don't mangle <finit>, produce
13692 __finit<class> instead. Don't verify artificial methods.
13693 * decl.c (finit_identifier_node): New declared global.
13694 (init_decl_processing): finit_identifier_node initialized.
13695 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
13696 * java-tree.h (finit_identifier_node): Declared as extern.
13697 (struct lang_decl): New field called_constructor.
13698 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
13699 (CLASS_HAS_FINIT_P): New macro.
13700 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
13701 explicit constructor invocation.
13702 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
13703 CALL_SUPER_CONSTRUCTOR_P): New macros.
13704 (write_classfile): Added prototype.
13705 * jcf-parse.c (jcf_parse_source): Parse and remember for
13706 generation if the file was seen on the command line.
13707 (parse_source_file): Don't write the class file here.
13708 (yyparse): Loop on files rewritten. Set current_jcf.
13709 (parse_zip_file_entries): Parse class file only if it was found.
13710 * lang.c (init_parse): Don't open command line provided filename
13712 (lang_parse): Don't set main_jcf anymore.
13713 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
13714 (JCONSTRUCTOR_CHECK): New macro.
13715 (JBSC_TYPE_P): New macro.
13716 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
13717 (COMPLETE_CHECK_OP_2): New macro.
13718 (struct parse_ctxt): New field explicit_constructor_p.
13719 (check_class_interface_creation): Fixed prototype indentation.
13720 (patch_method_invocation_stmt): Prototype reflects added argument.
13721 (patch_invoke): Likewise.
13722 (complete_method_declaration, build_super_invocation,
13723 verify_constructor_circularity,
13724 build_this_super_qualified_invocation, get_printable_method_name,
13725 patch_conditional_expr, maybe_generate_finit, fix_constructors,
13726 verify_constructor_super, create_artificial_method,
13727 start_artificial_method_body, end_artificial_method_body,
13728 generate_field_initialization_code): New function prototypes.
13729 * parse.y: Fixed leading comment
13730 (constructor_header:, constructor_body:, block_end:): Rules tagged
13732 (type_declaration:): Call maybe_generate_finit.
13733 (method_declaration:): Action for method_body: placed in new
13734 function complete_method_declaration, called here.
13735 (constructor_declaration:): Defined actions. Removed leading
13737 (constructor_header:): New rule with action.
13738 (constructor_body:): Rule rewritten using block_begin: and
13739 block_end:. Defined actions.
13740 (constructor_declarator:, explicit_constructor_invocation:):
13742 (block:): Use new rules block_begin: block_end:.
13743 (block_begin:, block_end:): New rules and actions.
13744 (block_statements:): Fixed error message for explicit
13746 (method_invocation:): Call build_this_super_qualified_invocation
13747 if primary is `this' or `super' was seen.
13748 (conditional_expression:): Action defined.
13749 (extra_ctxp_pushed_p): New static global flag.
13750 (java_parser_context_save_global): Create parser context if
13751 necessary. Use extra_ctxp_pushed_p to remember it.
13752 (java_parser_context_restore_global): Pop extra parser context if
13754 (build_array_from_name): Array on primitive types are marked
13756 (register_fields): Restore new name in field initializer
13757 expression if type was altered. Non static fields initialized upon
13758 declaration marked initialized.
13759 (maybe_generate_finit): New function.
13760 (maybe_generate_clinit): Use create_artificial_method,
13761 start_artificial_method_body, end_artificial_method_body. Generate
13762 debug info for enclosed initialization statements.
13763 (method_header): Fixed leading comment. Check constructor
13764 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
13766 (complete_method_declaration, constructor_circularity_msg,
13767 verify_constructor_circularity): New functions.
13768 (get_printable_method_name): New function.
13769 (check_method_redefinition): Don't rename <finit> methods. Fix
13770 declared constructor names. Error message for
13771 constructors modified.
13772 (java_check_regular_methods): Local variable seen_constructor
13773 renamed saw_constructor. Skip verification on constructors. Create
13774 default constructor with create_artificial_method.
13775 (java_check_methods): Removed unnecessary empty line.
13776 (create_artificial_method, start_artificial_method_body,
13777 end_artificial_method_body): New functions.
13778 (java_layout_classes): Changed leading comment. Reverse fields
13779 list if necessary. Always layout java.lang.Object if being
13781 (java_complete_expand_methods): Verify constructor circularity.
13782 (java_complete_expand_method): Call fix_constructor on
13783 constructors. Local variable no_ac_found removed. Restore
13784 bindings if method body expansion failed.
13785 (fix_constructors, verify_constructor_super,
13786 generate_field_initialization_code): New function.
13787 (java_expand_classes): Fixed leading comment. Write class file
13789 (resolve_expression_name): Check for illegal instance variable
13790 usage within the argument scope of an explicit constructor
13792 (resolve_qualified_expression_name): Pass extra from_super flag
13793 when invoking patch_method_invocation_stmt. New case for
13794 conditional expression when used as a primary. Check for error
13795 when acquiring super.
13796 (patch_method_invocation_stmt): Added extra argument super. New
13797 local variable is_static_flag. Set class_to_search according to
13798 the nature of the constructor invocation. Don't add `this'
13799 argument when expanding NEW_CLASS_EXPR. Check for illegal method
13800 invocation within the argument scope of explicit constructor
13801 invocation. Set is_static according to is_static_flag. Provide
13802 extra `super' argument to patch_invoke invocation.
13803 (patch_invoke): New argument from_super. Loop on arguments
13804 indentation fixed. Pass from_super to invocation_mode. New switch
13805 case INVOKE_SUPER. Fixed error message in switch default case.
13806 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
13808 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
13809 (lookup_method_invoke): Fixed prototypes in candidates list. Error
13810 message takes constructors into account.
13811 (find_applicable_accessible_methods_list): Fixed indentation.
13812 (qualify_ambiguous_name): Take explicit constructor invocation
13813 into account. Deal with a conditional expression as a primary to
13815 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
13816 case. Added extra argument to patch_method_invocation_stmt.
13817 Register calls made to explicit constructor `this'. Don't call
13818 save_expr in ARRAY_REF case when emitting class files. Check for
13819 illegal use of this when expanding explicit constructor invocation
13821 (complete_function_arguments): Set and reset parser context
13822 explicit_constructor_p field value when appropriate.
13823 (build_super_invocation, build_this_super_qualified_invocation):
13825 (patch_assignment): Fixed typo.
13826 (patch_unaryop): Check on final fields occurs only when a decl
13828 (patch_return): Take constructors into account.
13829 (patch_conditional_expr): New function.
13830 * typeck.c (build_java_signature): Removed unnecessary empty line.
13832 1998-10-28 Jeffrey A Law (law@cygnus.com)
13834 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
13836 1998-10-28 Tom Tromey <tromey@cygnus.com>
13838 * decl.c (init_decl_processing): Renamed fields.
13839 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
13840 interface_len, msize fields.
13842 * class.c (make_class_data): Removed subclass_head and
13843 subclass_next fields.
13844 * decl.c (init_decl_processing): Removed subclass_head and
13845 subclass_next fields.
13847 1998-10-28 Jeffrey A Law (law@cygnus.com)
13849 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
13850 * mangle.c (emit_unicode_mangled_name): Similarly.
13852 1998-10-26 Nick Clifton <nickc@cygnus.com>
13854 * jcf-parse.c (get_constant): Place braces around code to compute
13855 'd' when REAL_ARITHMETIC is not defined.
13857 1998-10-25 H.J. Lu (hjl@gnu.org)
13859 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
13862 1998-10-23 Tom Tromey <tromey@cygnus.com>
13864 * lang-specs.h: `.zip' files are input to jc1.
13866 1998-10-22 Per Bothner <bothner@cygnus.com>
13868 * jvspecs.c: Add (but don't enable) support for combining multiple
13869 .class and .java input filenames to a single jc1 invocation.
13870 Add support for -C flag (copile to .class files).
13871 Translate -classpath and -CLASSPATH arguments.
13872 * lang-specs.h: Don't set %2 spec.
13874 1998-10-22 Tom Tromey <tromey@cygnus.com>
13876 * jcf-path.c (add_entry): Don't add trailing separator if entry is
13878 (add_path): Don't add trailing separator to non-empty path
13881 * lang.c (lang_decode_option): Check for -fclasspath and
13882 -fCLASSPATH before examining other `-f' options.
13884 * java-tree.h (finalize_identifier_node): Don't declare.
13885 * class.c (make_class_data): Don't push "final" field.
13886 * decl.c (init_decl_processing): Don't push "final" field.
13887 (finalize_identifier_node): Removed.
13888 (init_decl_processing): Don't set finalize_identifier_node.
13890 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
13892 1998-10-11 Anthony Green <green@cygnus.com>
13894 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
13895 (JV_SCAN_SOURCES): New macro.
13896 (JCF_DUMP_SOURCES): Likewise.
13897 (jcf-dump$(exeext)): New target.
13898 (jv-scan$(exeext)): New target.
13900 1998-10-22 Tom Tromey <tromey@cygnus.com>
13902 * Makefile.in (LEX): Removed.
13903 (LEXFLAGS): Likewise.
13904 (SET_BISON): New macro.
13906 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
13907 spurious diffs in parse.c.
13908 ($(PARSE_SCAN_C)): Likewise.
13909 (PARSE_DIR): New macro.
13911 (PARSE_SCAN_C): Likewise.
13912 (PARSE_RELDIR): New macro.
13914 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
13916 * jcf-io.c (find_class): Use saw_java_source to determine when to
13917 look for `.java' file.
13918 * jcf-parse.c (saw_java_source): New global.
13919 (yyparse): Set it if `.java' file seen.
13921 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
13922 (GCJH_SOURCES): Likewise.
13923 * Makefile.in (datadir): New macro.
13924 (libjava_zip): Likewise.
13925 (JAVA_OBJS): Added jcf-path.o.
13926 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
13927 (../gcjh$(exeext)): Likewise.
13928 (jcf-path.o): New target.
13929 * java-tree.h (fix_classpath): Removed decl.
13930 * jcf-parse.c (fix_classpath): Removed.
13931 (load_class): Don't call fix_classpath.
13932 * parse.y (read_import_dir): Don't call fix_classpath.
13933 * lex.h: Don't mention classpath.
13934 * lex.c (java_init_lex): Don't initialize classpath.
13935 * jcf-io.c (classpath): Removed global.
13936 (find_class): Use jcf_path iteration functions. Correctly search
13937 class path for .java file.
13938 (open_in_zip): New argument `is_system'.
13939 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
13940 classpath-related options.
13941 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
13943 (lang_init): Call jcf_path_init.
13944 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
13945 * lang-specs.h: Handle -I. Minor cleanup to -M options.
13946 Correctly put braces around second string in each entry.
13947 * gjavah.c (main): Call jcf_path_init. Recognize all the new
13948 classpath-related options.
13949 (help): Updated for new options.
13950 * jcf.h: Declare functions from jcf-path.c. Don't mention
13951 `classpath' global.
13952 * jcf-path.c: New file.
13954 * jcf-depend.c: Include jcf.h.
13956 * jcf-write.c (localvar_alloc): Returns `void'.
13957 (localvar_free): Removed unused variable.
13959 * lang.c (OBJECT_SUFFIX): Define if not already defined.
13960 (init_parse): Use OBJECT_SUFFIX, not ".o".
13962 1998-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
13964 * class.c (emit_register_classes): Renamed from
13965 emit_register_class.
13966 * java-tree.h (emit_register_classes): Prototype renamed from
13967 emit_register_class.
13968 * jcf-parse.c (yyparse): Call emit_register_classes once before
13970 * parse.y (java_expand_classes): No longer register classes.
13972 1998-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
13974 * class.c (is_compiled_class): New local variable
13975 seen_in_zip. Identify classes found in currently compiled source
13977 * decl.c (complete_start_java_method): Fixed typo.
13978 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
13979 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
13980 (CLASS_P): Moved around.
13981 (java_parse_abort_on_error): Macro moved from jcf-parse.c
13982 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
13984 (jcf_parse_source): Changed leading comment. Removed unnecessary
13985 fclose and CLASS_FROM_SOURCE_P marking.
13986 (parse_source_file): New local variables remember_for_generation
13987 and filename. Mark parsed file name identifier node. Removed block
13988 executed when parse_only was null. Set remember_for_generation.
13989 Use it as an argument to java_pop_parser_context.
13990 (yyparse): New local variables several_files, list, next node and
13991 current_file_list. Split ampersand separated file names into
13992 current_file_list. Iterate through the list and parse accordingly.
13993 * parse.h (java_pop_parser_context): New function prototype.
13994 * parse.y (ctxp_for_generation): New static global variable.
13995 (java_pop_parser_context): New argument generate. Link popped ctxp
13996 to ctxp_for_generation list accordingly.
13997 (java_complete_expand_methods): Fixed indentation.
13998 (java_expand_classes): New function.
14000 1998-10-17 Per Bothner <bothner@cygnus.com>
14002 * Makefile.in: Link with libiberty.a instead of memmove.o.
14004 1998-10-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
14006 * lex.c (setjmp.h): No longer included.
14007 * lex.h (setjmp.h): Included.
14008 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
14009 (duplicate_declaration_error_p): Renamed from
14010 duplicate_declaration_error.
14011 (build_array_from_name): New function prototype.
14012 * parse.y (setjmp.h): No longer included.
14013 (variable_declarator_id): Define action.
14014 (build_array_from_name): New function.
14015 (duplicate_declaration_error_p): Renamed from
14016 duplicate_declaration_error. Fixed leading comment.
14017 (register_fields): Main `for' loop reorganized. Uses
14018 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
14019 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
14020 build_array_from_name.
14021 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
14023 (read_import_dir): Don't try to skip `.' and `..'.
14024 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
14025 build_array_from_name. Main `for' loop reorganized.
14026 (resolve_qualified_expression_name): When building access to a
14027 field, use the type where the field was found, not its own type.
14028 (maybe_access_field): Use field DECL_CONTEXT if the type where the
14029 field was found is null.
14030 (qualify_ambiguous_name): Sweep through all successive array
14033 1998-10-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
14035 * java-tree.h (pop_labeled_block, lang_printable_name,
14036 maybe_add_interface, set_super_info, get_access_flags_from_decl,
14037 interface_of_p, inherits_from_p, fix_classpath,
14038 complete_start_java_method, emit_handlers, init_outgoing_cpool,
14039 make_class_data, register_class, alloc_name_constant): New
14040 function prototypes.
14041 * lang.c (lang_decode_option): Set argc argument unused. Fixed
14042 indentation. Added cast to remove warning.
14043 (lang_printable_name): Set v argument unused.
14044 (lang_print_error): Added argument to lang_printable_name call.
14045 (java_dummy_print, print_lang_decl, print_lang_type,
14046 print_lang_identifier, lang_print_xnode): All argument marked
14048 * lex.c (java_unget_unicode): Removed unnecessary argument.
14049 (java_allocate_new_line): Unused local variable is gone.
14050 (java_read_char): Added parenthesis in expressions to remove
14051 warnings. Added final return statement.
14052 (java_read_unicode): Added parenthesis in expression to remove
14054 (java_parse_end_comment): Fixed java_unget_unicode invocation.
14055 (java_parse_escape_sequence): Likewise.
14056 (java_lex): Unused local variables are gone. Fixed
14057 java_unget_unicode invocation.
14058 * lex.h (set_float_handler): Prototype added when JC1_LITE not
14060 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
14061 lang_printable_name invocation in macro.
14062 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
14064 (duplicate_declaration_error): Suppressed unused argument in
14066 (identical_subpath_p): Function declaration is gone.
14067 (patch_invoke): Suppressed unused argument in prototype.
14068 (patch_cast, build_labeled_block, check_thrown_exceptions):
14070 * parse.y (setjmp.h): Included
14071 (toplev.h): Likewise.
14072 (field_declaration:): Suppressed unused local
14073 (label_decl:): Fixed build_labeled_block invocation.
14074 (java_pop_parser_context): Put extra parenthesis around assignment
14076 (yyerror): Suppressed unused local variables.
14077 (variable_redefinition_error): Fixed lang_printable_name
14079 (create_interface): Suppressed unused local variables.
14080 (create_class): Likewise.
14081 (duplicate_declaration_error): Suppressed unused argument. Fixed
14082 lang_printable_name invocation.
14083 (register_fields): Suppressed unused local variable. Fixed
14084 duplicate_declaration_error invocation.
14085 (method_header): Suppressed unused local variable.
14086 (method_declarator, parser_check_super): Likewise.
14087 (java_complete_class): Suppressed unused local variable. Fixed
14088 fatal error message.
14089 (complete_class_report_errors): Added default: in switch.
14090 (java_check_regular_methods): Fixed lang_printable_name
14092 (check_throws_clauses): Likewise.
14093 (java_check_abstract_methods): Suppressed unused local
14094 variable. Fixed lang_printable_name invocation.
14095 (read_import_entry): Added supplemental return statement.
14096 (read_import_dir): Suppressed unused local variables.
14097 (check_pkg_class_access, declare_local_variables): Likewise.
14098 (source_start_java_method): Suppressed unused extern variable
14100 (expand_start_java_method): Suppressed unused extern and local
14101 variable declarations.
14102 (java_complete_expand_methods): Likewise.
14103 (java_complete_expand_method): Suppressed unused local variables.
14104 (make_qualified_name): Likewise.
14105 (resolve_qualified_expression_name): Added default: in
14106 switch. Fixed lang_printable_name invocation.
14107 (class_instance_creation_expression): Added parenthesis around
14109 (patch_method_invocation_stmt): Fixed lang_printable_name and
14110 patch_invoke invocations.
14111 (check_for_static_method_reference): Fixed lang_printable_name
14113 (patch_invoke): Suppressed unused arguments and local variables.
14114 (lookup_method_invoke): Suppressed unused local variables.
14115 (qualify_ambiguous_name): Added default: in switch.
14116 (identical_subpath_p): Function removed.
14117 (patch_assignment): Suppressed unused local variables. Suppressed
14118 unnecessary if statement. Fixed lang_printable_name invocations.
14119 (try_builtin_assignconv): Fixed lang_printable_name invocations.
14120 (valid_ref_assignconv_cast_p): Parenthesis around
14121 expression. Suppressed unused local variables.
14122 (build_binop): Suppressed unused local variables. fixed
14123 lang_printable_name invocations.
14124 (string_constant_concatenation): Suppressed unused local
14126 (patch_unaryop): Fixed lang_printable_name invocation.
14127 (patch_cast): Suppressed unnecessary argument. Fixed
14128 lang_printable_name invocation.
14129 (patch_array_ref): Fixed lang_printable_name invocation.
14130 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
14131 (build_labeled_block): Suppressed unused argument.
14132 (generate_labeled_block): Fixed build_labeled_block invocation.
14133 (build_loop_body): Suppressed unused local variables.
14134 (patch_loop_statement): Likewise.
14135 (patch_exit): Fixed lang_printable_name invocation.
14136 (patch_switch_statement): Likewise.
14137 (case_identity): First argument marked unused.
14138 (patch_try_statement): Fixed lang_printable_name invocations.
14139 (patch_synchronized_statement, patch_throw_statement): Likewise.
14140 (check_thrown_exceptions): Fixed check_thrown_exceptions and
14141 lang_printable_name invocations.
14142 (check_thrown_exceptions_do): Suppressed unused argument.
14144 1998-10-14 Tom Tromey <tromey@cygnus.com>
14146 * jcf-write.c (write_classfile): Add output class file as target.
14147 * lang-options.h: Added -MD, -MMD, -M, and -MM.
14148 * jcf.h: Added declarations for dependency-tracking functions.
14149 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
14150 * lang.c (lang_decode_option): Recognize -MD and -MMD.
14151 (finish_parse): Call jcf_dependency_write.
14152 (dependency_tracking): New global.
14153 (DEPEND_SET_FILE): New define.
14154 (DEPEND_ENABLE): New define.
14155 (init_parse): Enable dependency tracking if required.
14157 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
14158 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
14159 (../gcjh$(exeext)): Likewise.
14160 (jcf-depend.o): New target.
14161 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
14162 (GCJH_SOURCES): Likewise.
14163 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
14165 (find_classfile): Added dep_name argument.
14166 (find_class): Compute name of dependency.
14167 (open_in_zip): Call jcf_dependency_add_file.
14168 * gjavah.c (output_file): No longer global.
14169 (usage): Don't mention "gjavah".
14171 (java_no_argument): Likewise.
14172 (version): Likewise.
14173 (main): Recognize and handle -M family of options.
14174 (print_mangled_classname): Return is void.
14175 (process_file): Handle case where output is suppressed.
14176 (HANDLE_END_FIELD): Likewise.
14177 (HANDLE_METHOD): Likewise.
14178 * jcf-depend.c: New file.
14180 1998-10-13 Jeffrey A Law (law@cygnus.com)
14182 * java-tree.def: Add missing newline at EOF.
14184 1998-10-13 Tom Tromey <tromey@cygnus.com>
14186 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
14187 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
14189 Include <config.h> and "system.h".
14190 (disassemble_method): Undefine RET to avoid clash with
14191 config/i386/i386.h.
14193 1998-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
14195 * decl.c (runtime_exception_type_node, error_exception_type_node):
14196 New global variables.
14197 (init_decl_processing): Initialized.
14198 * expr.c (java_lang_expand_expr): Set caught exception type to
14199 null if catch handler argument doesn't exit.
14200 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
14202 * java-tree.h (runtime_exception_type_node,
14203 error_exception_type_node): Global variables declared.
14204 (DECL_FUNCTION_THROWS): New macro.
14205 (DECL_FUNCTION_BODY): Modified comment.
14206 (DECL_SPECIFIC_COUNT): Likewise.
14207 (struct lang_decl): New field throws_list.
14208 (IS_UNCHECKED_EXPRESSION_P): New macro.
14209 * lex.c (java_lex): Generate location information for THROW_TK.
14210 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
14211 EXCEPTIONS_P): New macros.
14212 (enum jdep_code): New value JDEP_EXCEPTION.
14213 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
14214 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
14215 PATCH_METHOD_RETURN_ERROR): New macros.
14216 (patch_method_invocation_stmt): Added new argument to prototype.
14217 (patch_synchronized_statement, patch_throw_statement,
14218 check_thrown_exceptions, check_thrown_exceptions_do,
14219 purge_unchecked_exceptions, check_throws_clauses): New function
14221 * parse.y Fixed typo in keyword section.
14222 (throw:): Rule tagged <node>.
14223 (THROW_TK): Keyword tagged <operator>.
14224 (method_header:): Last argument to call to method_header passed
14226 (throws:, class_type_list:, throw_statement:,
14227 synchronized_statement:, synchronized:): Defined actions.
14228 (method_header): New local variable current. Register exceptions
14229 from throws clause.
14230 (java_complete_tree): Complete and verify exceptions from throws
14232 (complete_class_report_errors): Error message on exceptions not
14234 (java_check_regular_methods): Fixed typo. Shortcut on private
14235 overriding methods. Changed error message on method
14236 redefinition. Check for throws clause compatibility.
14237 (check_throws_clauses): New function.
14238 (java_check_abstract_methods): Use DECL_NAME for wfl or current
14239 method. Changed error message on method redefinition.
14240 (currently_caught_type_list): New static variable.
14241 (java_complete_expand_methods): Purge unchecked exceptions from
14242 throws clause list. Call PUSH_EXCEPTIONS before walk and
14243 POP_EXCEPTIONS after.
14244 (resolve_qualified_expression_name): Pass new argument as NULL to
14245 patch_method_invocation_stmt.
14246 (patch_method_invocation_stmt): New argument ref_decl. Invoke
14247 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
14248 argument list when appropriate. Use new argument if non null to
14249 store selected method decl.
14250 (patch_invoke): Convert if necessary args of builtin types before
14251 forming CALL_EXPR. Argument list no longer reversed here.
14252 (invocation_mode): Treat final methods as static methods.
14253 (java_complete_tree): New cases for THROW_EXPR: and
14254 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
14256 (complete_function_arguments): No more RECORD_TYPE
14257 conversion. Function parameter nodes no longer saved.
14258 (valid_ref_assignconv_cast_p): Avoid handling null type.
14259 (patch_binop): Fixed null constant reference handling.
14260 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
14261 BUILD_THROW macros.
14262 (patch_try_statement): Fixed comments. Record caught types in
14263 list, push the list, expand try block and pop the list.
14264 (patch_synchronized_statement, patch_throw_statement,
14265 check_thrown_exceptions, check_thrown_exceptions_do,
14266 purge_unchecked_exceptions): New functions.
14267 * typeck.c (lookup_argument_method): Allow WFL in place of method
14268 DECL_NAME during method definition check
14270 1998-10-09 Tom Tromey <tromey@cygnus.com>
14272 * gjavah.c (decode_signature_piece): New function.
14273 (print_c_decl): Use it. Added `name_override' argument.
14274 (print_method_info): Use name_override argument to print_c_decl.
14275 (seen_fields): Removed.
14276 (print_field_info): Don't update seen_fields.
14277 (struct method_name): New structure.
14278 (method_name_list): New global.
14279 (print_method_info): Add new method to list of methods.
14280 (name_is_method_p): New function.
14281 (print_field_info): If field name has same name as method, then
14283 (process_file): Parse methods before fields.
14284 (field_pass): New global.
14285 (HANDLE_END_FIELD): Take field_pass into account.
14287 1998-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
14289 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
14290 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
14292 1998-10-03 Anthony Green <green@cygnus.com>
14294 * jvspec.c: Fix bug in jvgenmain_spec patch.
14296 1998-10-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
14298 * Makefile.in (lang.o:): Install dependency on java-tree.def.
14299 * decl.c (soft_exceptioninfo_call_node): New global variable.
14300 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
14301 takes extra integer argument. soft_exceptioninfo_call_node
14303 * except.c (java_set_exception_lang_code): New function
14304 (method_init_exceptions): Called here.
14305 (prepare_eh_table_type): New function.
14306 (expand_end_java_handler): Called here.
14307 * expr.c (build_java_throw_out_of_bounds_exception): Now features
14308 one argument. Modified generation of call to
14309 soft_badarrayindex_node to use new argument.
14310 (build_java_arrayaccess): Pass faulty index value to
14311 build_java_throw_out_of_bounds_exception.
14312 (generate_name): New function.
14313 (java_lang_expand_expr): New local variables node, current,
14314 has_finally_p. Expand TRY_EXPR node.
14315 (process_jvm_instruction): Replace top of the stack with thrown
14316 object reference when entering exception handler.
14317 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
14318 specific tree codes.
14319 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
14321 (DECL_SPECIFIC_COUNT): New macro.
14322 (prepare_eh_table_type, java_set_exception_lang_code,
14323 generate_name): New function declarations.
14324 (match_java_method): Declaration deleted.
14325 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
14327 * lex.c (TRY_TK, CATCH_TK): Generate location information.
14328 * parse.h (redefinition_error, refine_accessible_methods_list,
14329 can_cast_to_p): Function declaration removed.
14330 (classitf_redefinition_error, variable_redefinition_error,
14331 parse_jdk1_1_error, find_applicable_accessible_methods_list,
14332 find_most_specific_methods_list, argument_types_convertible,
14333 enter_a_block, valid_builtin_assignconv_identity_widening_p,
14334 valid_cast_to_p, valid_method_invocation_conversion_p,
14335 try_reference_assignconv, add_stmt_to_compound,
14336 build_jump_to_finally, build_tree_list, patch_try_statement,
14337 java_get_catch_block): New function declarations.
14338 * parse.y (string_buffer_type): Global variable deleted.
14339 (group_of_labels, catches, catch_clause, catch_clause_parameter,
14340 finally): Rules tagged <node>.
14341 (TRY_TK, CATCH_TK): Token tagged <operator>.
14342 (class_body_declaration:, class_member_declaration:,
14343 formal_parameter:, explicit_constructor_invocation:,
14344 interface_member_declaration:, constant_declaration:,
14345 primary_no_new_array:, class_instance_creation_expression:,
14346 array_creation_expression:): Issue error on unsuported JDK1.1
14348 (try_statement:, catches:, finally:): Define actions.
14349 (catch_clause_parameter): New rule.
14350 (catch_clause:): Use new rule catch_clause_parameter.
14351 (parse_jdk1_1_error): New function.
14352 (redefinition_error): Renamed classitf_redefinition_error.
14353 (variable_redefinition_error): New function.
14354 (check_class_interface_creation): Call
14355 classitf_redefinition_error.
14356 (java_complete_tree): Added error message on JDEP_TYPE: case.
14357 (complete_class_report_errors): Fixed indentation.
14358 (declare_local_variables): Call variable_redefinition_error.
14359 (source_end_java_method): Call java_set_exception_lang_code and
14360 emit_handlers where appropriate.
14361 (java_method_add_stmt): Call add_stmt_to_block.
14362 (add_stmt_to_block): New function.
14363 (lookup_method_invoke): Fixed outside comment. new local variable
14364 candicates. Call find_applicable_accessible_methods_list and
14365 find_most_specific_methods_list when searching for a
14366 method. Modified error report to list possible candidates when
14368 (find_applicable_accessible_methods_list,
14369 find_most_specific_methods_list, argument_types_convertible): New
14371 (refine_accessible_methods_list): Function deleted.
14372 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
14373 expr (if applicable) before calling patch_array_ref.
14374 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
14375 (enter_block): Fixed comment.
14376 (enter_a_block): New function.
14377 (patch_assignment): Reorganized. Call try_reference_assignconv for
14378 references. Call valid_cast_to_p instead of can_cast_to_p.
14379 (try_reference_assignconv,
14380 valid_builtin_assignconv_identity_widening_p): New functions.
14381 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
14382 (valid_cast_to_p, valid_method_invocation_conversion_p): New
14384 (build_string_concatenation): Don't resolve StringBuffer.
14385 (patch_cast): Fixed inverted arguments.
14386 (patch_array_ref): Code to save array expr deleted. Call
14387 valid_cast_to_p instead of can_cast_to_p.
14388 (generate_labeled_block): Call generate_name.
14389 (build_jump_to_finally, build_try_statement, java_get_catch_block,
14390 patch_try_statement): New functions.
14391 * typeck.c (match_java_method): Function deleted.
14393 1998-10-02 Anthony Green <green@cygnus.com>
14395 * jvspec.c: jvgenmain_spec uses different temporary file names.
14397 1998-10-02 Anthony Green <green@cygnus.com>
14399 * jvspec.c (lang_specific_driver): Fail if user specifies
14400 --main= when not linking.
14402 1998-09-28 Tom Tromey <tromey@cygnus.com>
14404 * class.c (make_class_data): Push value for `thread' field.
14405 * decl.c (init_decl_processing): Added `thread' field to class.
14407 * class.c (add_field): Always make static fields externally
14410 1998-09-26 Anthony Green <green@cygnus.com>
14412 * expr.c (build_java_athrow,
14413 build_java_throw_out_of_bounds_exception, expand_invoke,
14414 build_newarray, expand_java_multianewarray, build_java_monitor):
14415 Update comments to reflect _Jv_* function names.
14417 1998-09-25 Per Bothner <bothner@cygnus.com>
14419 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
14420 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
14421 * parse.y (expand_start_java_method): Likewise.
14423 1998-09-24 Per Bothner <bothner@cygnus.com>
14425 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
14427 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
14428 (add_field): No longer need to convert from RECORD_TYPE to pointer,
14429 * expr.c: Remove no-longer-needed calls to promote_type.
14430 * decl.c (give_name_to_locals): Liekwise.
14431 * jcf-parse.c (get_class_constant): Compensate for new signatures.
14432 * parse.y: Add/remove promote_type calls as appropriate.
14433 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
14434 (parse_signature_string): Likewise.
14435 (build_java_array_type): Fix for now signature convenions.
14437 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
14439 1998-09-23 Tom Tromey <tromey@cygnus.com>
14441 * class.c (init_class_processing): libjava function renamed to
14444 1998-09-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
14446 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
14447 * java-tree.def: Fixed DEFTREECODE third argument.
14448 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
14449 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
14450 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
14451 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
14452 JAVA_THIS_EXPR): Now replaced by tree code definitions.
14453 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
14454 * lang.c (java_tree_code_type, java_tree_code_length,
14455 java_tree_code_name): New arrays.
14456 (lang_init): Append Java tree node definitions to Gcc ones.
14457 * lex.c (expression_obstack): Declared as extern when JC1_LITE
14459 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
14461 (java_lex): Allow declaration of empty string constants. Retain
14462 location information on CASE_TK and DEFAULT_TK.
14463 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
14464 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
14465 Modified to be more robust.
14466 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
14467 (build_new_invocation, try_builtin_assignconv,
14468 patch_switch_statement, string_constant_concatenation,
14469 build_string_concatenation, patch_string_cst, patch_string,
14470 java_expand_switch): New function declarations.
14471 * parse.y: Rules related to switch and EH tagged <node>.
14472 (label_id): Set to NULL_TREE
14473 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
14475 (this_or_super:): Fixed indentation.
14476 (statement:, statement_nsi:, statement_without_trailing_substatement:,
14477 statement_expression:): Removed call to RULE on all sub-rules.
14478 (switch_expression:, switch_labels:): New rules.
14479 (switch_statement:, switch_block:, switch_block_statement_groups:,
14480 switch_block_statement_group:, switch_labels:, switch_label:):
14482 (throw_statement:, synchronized_statement:, try_statement:):
14483 Defined temporary actions.
14484 (class_instance_creation_expression:): Call
14485 build_new_invocation. Fixed indentation.
14486 (field_access): Fixed indentation.
14487 (method_invocation): Likewise.
14488 (make_qualified_primary): Use THIS_EXPR.
14489 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
14490 resolving from SUPER, set *type_found.
14491 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
14492 (java_complete_tree): Removed unused local variable `location'. Case
14493 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
14494 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
14495 on MODIFY_EXPR: and all binary operator tree code cases. Removed
14496 STRING_CST: case. default: checks for patchable strings.
14497 (complete_function_arguments): Transform string constant or
14498 crafted StringBuffer if necessary.
14499 (build_method_invocation): Fixed comments.
14500 (build_new_invocation): New function.
14501 (patch_assignment): Call try_builtin_assignconv to figure a valid
14502 assignment conversion between builtin types.
14503 (try_builtin_assignconv): New function.
14504 (build_binop): Use URSHIFT_EXPR directly to call build.
14505 (operator_string): Use UNARY_PLUS_EXPR.
14506 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
14508 (do_merge_string_cste, merge_string_cste,
14509 string_constant_concatenation, build_string_concatenation,
14510 patch_string, patch_string_cst): New function.
14511 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
14512 (patch_unaryop): Likewise. New test of valid ++/-- operands.
14513 (build_newarray_node): Use NEW_ARRAY_EXPR.
14514 (build_this): Use THIS_EXPR.
14515 (build_return): Enable debug information on return statement.
14516 (build_if_else_statement): Likewise.
14517 (complete_labeled_statement): Fixed related comment.
14518 (build_loop_body): Fixed comment.
14519 (build_bc_statement): Enable debug information on break/continue
14521 (patch_bc_statement): Fixed typos. Handle SWITCH statement
14523 (patch_switch_statement, case_identity, java_expand_switch): New
14526 1998-09-21 Per Bothner <bothner@cygnus.com>
14528 * buffer.h (BUFFER_INIT): New macro.
14529 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
14530 Pass (struct jcf_partial *state) to most functions.
14531 (jcf_block, jcf_relocation): New types.
14532 Support labels, branches, conditionals, loops.
14534 1998-09-21 Tom Tromey <tromey@cygnus.com>
14536 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
14538 1998-09-21 Per Bothner <bothner@cygnus.com>
14540 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
14541 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
14542 not integer_type_node (INT_TYPE_SIZ bits).
14544 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
14546 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
14547 * jcf-dump.c (print_exception_table): New function.
14548 (disassemble_method): Better handling of wide instructions.
14549 Make more robust for bad input.
14551 1998-09-30 Jeffrey A Law (law@cygnus.com)
14553 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
14556 1998-09-17 Jeffrey A Law (law@cygnus.com)
14558 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
14560 1998-09-17 Tom Tromey <tromey@cygnus.com>
14562 * Makefile.in ($(PARSE_H)): Removed target.
14564 1998-09-17 Jeffrey A Law (law@cygnus.com)
14566 * Makefile.in (JAVA_OBJS): Add memmove.o
14567 (memmove.o): New target & rules.
14569 1998-09-15 Tom Tromey <tromey@cygnus.com>
14571 * expr.c (expand_invoke): Don't generate a call to the class init
14574 1998-09-14 Jeffrey A Law (law@cygnus.com)
14576 * Makefile.in: Add many missing dependencies.
14577 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
14579 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
14580 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
14582 1998-09-11 Per Bothner <bothner@cygnus.com>
14584 * decl.c (complete_start_java_method): If method is static (and
14585 not private) call _Jv_InitClass.
14586 * expr.c (expand_invoke): Don't call build_class_init.
14588 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
14590 1998-09-10 Jeffrey A Law (law@cygnus.com)
14592 * Make-lang.in (GCJ): Define before using.
14594 1998-09-09 Jeffrey A Law (law@cygnus.com)
14596 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
14597 losing due to namespace pollution in GNU getopt.h
14599 1998-09-09 Tom Tromey <tromey@cygnus.com>
14601 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
14602 (java.all.cross): Likewise.
14603 (java.rest.encap): Likewise.
14605 1998-09-08 Jeffrey A Law (law@cygnus.com)
14607 * gjavah.c (print_class_decls): Fix thinko in arglist
14608 * jcv-io.c (find_classfile): Similarly.
14610 1998-09-07 Jeffrey A Law (law@cygnus.com)
14612 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
14614 1998-09-05 Tom Tromey <tromey@cygnus.com>
14616 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
14617 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
14618 * Makefile.in (PARSE_C): New macro.
14619 (PARSE_H): Likewise.
14620 (PARSE_SCAN_C): Likewise.
14621 ($(PARSE_C)): Target renamed from parse.c.
14622 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
14623 (clean): Remove parse-scan.c as well.
14624 (parse.o): Depend on $(PARSE_C).
14626 1998-09-05 Anthony Green <green@cygnus.com>
14628 * README, license.terms: Removed.
14630 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
14631 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
14632 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
14633 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
14634 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
14635 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
14636 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
14637 and Java trademark attribution.
14639 1998-09-04 Tom Tromey <tromey@cygnus.com>
14641 * Makefile.in: Use gcjh, not gjavah.
14642 * config-lang.in (stagestuff): Use gcjh, not gjavah.
14643 * Make-lang.in: Changed gjavah to gcjh everywhere.
14645 1998-09-03 Per Bothner <bothner@cygnus.com>
14647 * gjavah.c: Support new -prepend -add -append flags.
14648 (print_method_info): Method is not virtual if class is final.
14650 1998-09-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
14652 * jv-scan.c: Fixed copyright assignment.
14653 * keyword.gperf: Likewise.
14654 * keyword.h: Likewise.
14655 * lex.c: Fixed copyright assignment.
14656 (java_lex): Push unicode back when parsing '<'.
14657 * lex.h: Fixed copyright assignment.
14658 * parse-scan.y: Likewise.
14659 * parse.h: Fixed copyright assignment.
14660 (build_debugable_stmt, complete_for_loop): New function prototypes.
14661 * parse.y: Fixed copyright assignment.
14662 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
14663 size_zero_node when completing a loop with no exit condition.
14664 (for_statement_nsi:): Define action.
14665 (for_init:, for_update:): Return size_zero_node when empty.
14666 (declare_local_variables): Call build_debugable_stmt.
14667 (build_debugable_stmt): New function.
14668 (build_loop_body): Build debugable statement around loop
14670 (complete_loop_body): Take into account the debugable statement
14671 around the EXIT_EXPR.
14672 (complete_loop_body): New function.
14673 (patch_exit_expr): Fixed condition inversion.
14675 1998-09-02 Tom Tromey <tromey@cygnus.com>
14677 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
14678 name of thread define.
14679 * jvspec.c (THREAD_NAME): New macro.
14681 (THREADLIB): Likewise.
14682 (lang_specific_driver): Recognize attempt to link with thread
14683 library or gc library. Recognize -ljava on command line so it
14684 isn't linked against more than once.
14686 1998-09-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
14688 * parse-scan.y (report_main_declaration): Name of the class
14689 containing `main' can be a qualified name.
14691 1998-08-31 Tom Tromey <tromey@cygnus.com>
14693 * config-lang.in: Changed gjavac to gjc everywhere.
14694 * Make-lang.in: Changed gjavac to gjc everywhere.
14696 1998-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
14698 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
14699 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
14700 and install the files.
14701 * Makefile.in (JAVA_OBJS_LITE): New variable.
14702 (compiler:): Now include jv-scan as a dependency.
14703 (../jv-scan$(exeext), parse-scan.c): New targets.
14704 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
14705 * config-lang.in (compilers): Removed gcj, gjavah from the list.
14706 * jcf-parse.c (parse_source_file): Call java_layout_classes and
14707 check for errors even if parse_only.
14708 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
14710 (yylex): New function. Uses java_lex body.
14711 (java_lex): Removed commented out statement. Remove local variable
14712 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
14713 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
14714 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
14715 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
14716 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
14717 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
14719 (java_lex_error): Empty if JC1_LITE is defined.
14720 (java_get_line_col): Return 0 if JC1_LITE is defined.
14721 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
14722 SET_MODIFIER_CTX): Moved into the section containing the macros
14723 conditionally defined by JC1_LITE.
14724 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
14725 argument if JC1_LITE is defined.
14726 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
14727 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
14729 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
14730 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
14731 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
14732 to different values according to JC1_LITE.
14733 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
14734 declared if JC1_LITE set.
14735 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
14736 defined if JC1_LITE not set.
14737 (struct parser_ctx): Reorganized and skip the jc1 front end part
14739 (java_layout_classes): New function definition.
14740 (java_push_parser_context, java_init_lex, yyparse, yylex,
14741 yyerror): Prototype always declared. All other static function
14742 prototypes declared only if JC1_LITE is not set.
14743 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
14744 declared in parse.h.
14745 (java_layout_classes): New function.
14746 (java_complete_expand_methods): No longer layout the class here.
14747 * parse-scan.y: New file.
14748 * jv-scan.c: New file.
14750 1998-08-25 Tom Tromey <tromey@cygnus.com>
14752 * gjavah.c (main): Handle -friend option.
14753 (friend_specs): New global.
14754 (generate_access): Handle friend_specs.
14755 (process_file): Likewise.
14756 (MAX_FRIENDS): New macro.
14757 (friend_count): New global.
14758 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
14759 Changed all callers.
14761 1998-08-24 Per Bothner <bothner@cygnus.com>
14763 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
14764 (main): Handle processing all the entries of a named .zip archive.
14765 * jcf-io.c (jcf_trim_old_input): New function.
14766 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
14768 1998-08-24 Per Bothner <bothner@cygnus.com>
14770 * lang.c (flag_assume_compiled): Make default be on.
14772 1998-08-21 Per Bothner <bothner@cygnus.com>
14774 * jcf-dump.c: Add bunches of flags to control output more.
14775 (process_class): New function; support printing more than one class.
14776 (main): Support new --print-main and --javap flags.
14777 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
14778 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
14780 1998-08-20 Per Bothner <bothner@cygnus.com>
14782 Change mangling of dispatch table to match C++ vtable (w/thunks).
14783 * class.c (build_dtable_decl), java-tree.h: New function.
14784 (make_class_data): Call it.
14785 * decl.c (init_decl_processing): Likewise.
14787 1998-08-19 Warren Levy <warrenl@cygnus.com>
14789 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
14790 soft_anewarray; adjust args passed.
14791 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
14792 match _Jv_NewObjectArray.
14794 1998-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
14796 * decl.c (push_labeled_block, pop_labeled_block): New functions.
14797 * expr.c (loopup_label): Call create_label_decl.
14798 (create_label_decl): New function.
14799 (java_lang_expand_expr): Call expand_start_bindings with argument
14801 * java-tree.h Added space after PROTO in function declarations
14803 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
14804 (create_label_decl, push_labeled_block): New function
14806 * lex.c (label_id): Initialize.
14807 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
14809 * parse.h Added space after PROTO in function declarations when
14811 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
14812 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
14813 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
14814 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
14816 (struct parser_ctxt): New fields current_loop,
14817 current_labeled_block.
14818 (build_if_else_statement, patch_if_else_statement,
14819 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
14820 generate_labeled_block, complete_labeled_statement,
14821 build_bc_statement, patch_bc_statement, patch_loop_statement,
14822 build_new_loop, build_loop_body, complete_loop_body): New function
14824 * parse.y (java_warning_count): New global variable.
14825 (label_id): New static variable.
14826 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
14827 (block:): Return size_zero_node when block is empty.
14828 (empty_statement:): Return size_zero_node.
14829 (statement:): Implement supplemental action when for_statement: is
14831 (label_decl:): New rule.
14832 (labeled_statement:): Rewritten using label_decl. Actions
14834 (labeled_statement_nsi:): Likewise.
14835 (if_then_statement): Actions implemented.
14836 (while_expression): New rule.
14837 (while_statement:): Rewritten using while_expression. Actions
14839 (while_statement_nsi:): Likewise.
14840 (do_statement_begin:): New rule.
14841 (do_statement:): Rewritten using do_statement_begin. Actions
14843 (for_statement:): Rewritten using for_begin. Actions implemented.
14844 (for_statement_nsi:): Likewise.
14845 (for_header:, for_begin:): New rules.
14846 (for_init:): Actions implemented.
14847 (statement_expression_list:, break_statement:,
14848 continue_statement:): Likewise.
14849 (yyerror): Count number of issued warning(s).
14850 (java_report_errors): Report error(s) and/or warning(s).
14851 (java_complete_class): Use build_java_argument_signature to
14852 recompute completed method signature.
14853 (java_check_regular_methods): New locals method_wfl and aflags.
14854 Use method_wfl instead of lookup_cl during error reports. Fixed
14855 indentation and modified some error messages. Use
14856 lang_printable_name in method instead of the DECL_NAME. New code
14857 to issue warnings on methods not overriding corresponding methods
14858 private to a different package.
14859 (java_method_add_stmt): Call add_stmt_to_compound.
14860 (add_stmt_to_compound): New function.
14861 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
14862 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
14863 (build_if_else_statement, patch_if_else_statement,
14864 build_labeled_block, generate_labeled_block,
14865 complete_labeled_statement, build_new_loop, build_loop_body,
14866 complete_loop_body, patch_loop_statement, build_bc_statement,
14867 patch_bc_statement, patch_exit_expr): New functions.
14868 * typeck.c (build_java_signature): Build argument signature before
14869 enclosing it in between parenthesis.
14871 1998-08-17 Warren Levy <warrenl@cygnus.com>
14873 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
14874 (JAVA_OBJS): Added reminder comment
14876 1998-08-13 Nick Clifton <nickc@cygnus.com>
14878 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
14879 be interpreted as a long long.
14881 1998-08-13 Warren Levy <warrenl@cygnus.com>
14883 * decl.c (init_decl_processing): Use _Jv_InitClass, not
14884 soft_initialise_class. Use _Jv_NewMultiArray, not
14885 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
14886 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
14887 _Jv_CheckArrayStore, not soft_checkarraystore. Use
14888 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
14890 1998-08-12 Per Bothner <bothner@cygnus.com>
14892 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
14893 length_identifier_node): New global tree node constants.
14894 * parse.y (kw_super, kw_this, kw_length): Removed globals.
14895 Replace uses by super_identifier_node etc.
14896 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
14898 * parse.y (resolve_field_access): Don't special-case ".length" if
14899 flag_emit_class_files.
14900 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
14901 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
14904 1998-08-11 Per Bothner <bothner@cygnus.com>
14906 * decl.c (init_decl_processing): Remove unused method_type_node fields.
14907 * class.c (make_method_value): Remove init for removed fields.
14909 * class.c (layout_class): Use build_java_argument_signature.
14910 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
14912 * typeck.c (push_java_argument_signature): Removed. Merged into ...
14913 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
14914 (build_java_signature): Don't use push_java_argument_signature.
14916 * typeck.c (lookup_argument_method): New function.
14917 * parse.y (java_check_regular_methods): Use lookup_argument_method
14918 instead of lookup_java_method2 followed by lookup_java_method.
14920 * parse.y (check_method_redefinition): Minor optimization.
14922 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
14923 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
14925 1998-08-10 Tom Tromey <tromey@cygnus.com>
14927 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
14930 * gjavah.c (java_float_finite): Use K&R-style definition.
14931 (java_double_finite): Likewise.
14932 (generate_access): Now returns void. Changed all callers.
14933 (last_access_generated): Removed.
14934 (process_file): Only make a single pass over the .class file.
14936 1998-07-29 Per Bothner <bothner@cygnus.com>
14938 * class.c (get_dispatch_table): Add extra dummy vtable entry,
14939 for compatibility for G++ (with -fvtable-thunks).
14940 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
14942 * gjavah.c (process_file): Use public inheritance for super-class.
14944 1998-07-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
14946 * lex.c (java_init_lex): Initialize ctxp->package.
14947 * parse.h (struct parser_ctxt): package and package_len replaced
14948 by tree package, an identifier node. Field method_decl_list is
14949 gone. Fixed comments.
14950 (lookup_field_wrapper, merge_qualified_name, not_accessible,
14951 class_in_current_package): New function prototypes.
14952 * parse.y (array_type:): Set class loaded flag on primitive type
14954 (package_declaration:): Assign ctxp->package to the
14956 (method_invocation:): Handle invocation of method qualified by
14958 (single_type_import_declaration:): Removed ambiguity check.
14959 (java_pop_parser_context): New local variable `next'. Reset and
14960 set IMPORT_CLASSFILE_NAME flags on current and previous import
14962 (java_accstring_lookup): Use new local macro COPY_RETURN.
14963 (lookup_field_wrapper): New function.
14964 (parser_qualified_classname): Use merge_qualified_name.
14965 (parser_check_super_interface): Broaden error message.
14966 (do_resolve_class): Check for qualified class name in the current
14967 compilation unit if appropriate.
14968 (process_imports): Check for already defined classes.
14969 (check_pkg_class_access): Got rid of call to
14970 get_access_flags_from_decl.
14971 (java_complete_expand_methods): Call safe_layout_class based on
14972 the current class size.
14973 (make_qualified_primary): Build a WFL qualification on primary if
14975 (merge_qualified_name): New function.
14976 (make_qualified_name): Use merge_qualified_name.
14977 (resolve_expression_name): Use safe_lookup_field.
14978 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
14979 (resolve_qualified_expression_name): Likewise. Check on resolved
14980 element accessibility.
14981 (not_accessible_p, class_in_current_package): New functions.
14982 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
14983 (patch_method_invocation_stmt): Merged common pieces. Check
14984 accessibility of invoked method.
14985 (check_for_static_method_reference): Add returned type in error
14987 (invocation_mode): Get rid of bogus check on PRIVATE methods.
14988 (refine_accessible_methods_list): Merged two conditions in test.
14989 (java_complete_class): Sanity check on stabilize_ref gone.
14990 * zextract.c (read_zip_archive): Cast lseek second argument to long.
14992 1998-07-28 Per Bothner <bothner@cygnus.com>
14994 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
14996 1998-07-24 Tom Tromey <tromey@cygnus.com>
14998 * gjavah.c (F_NAN): Removed.
14999 (F_NAN_MASK): New macro.
15000 (F_POSITIVE_INFINITY): Removed.
15001 (F_NEGATIVE_INFINITY): Likewise.
15002 (java_float_finite): Rewrote.
15003 (D_NAN_MASK): Renamed.
15004 (java_double_finite): Rewrote.
15005 (D_POSITIVE_INFINITY): Removed.
15006 (D_NEGATIVE_INFINITY): Likewise.
15008 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
15009 If verbose, print underlying representation of value in hex.
15011 1998-07-24 Per Bothner <bothner@cygnus.com>
15013 * buffer.h, buffer.c: New files.
15014 * Makefile.in (JAVA_OBJS): Add buffer.o.
15016 Support locals variables and writing their debug entries to .class.
15017 * jcf-write.c: Simplify some by user new buffer type.
15018 (vode_buffer_grow): Removed.
15019 (struct localvar_info): New type.
15020 (localsvars, localvartable): New buffers.
15021 (localvar_alloc, localvar_free): New functions.
15022 (generate_bytecode_insns): Handle local variables.
15023 (generate_classfile): Write LocalVariableTable attribute.
15025 1998-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
15027 * jcf-io.c (open_in_zip): Check the zipfile magic number.
15028 * zipfile.h (ZIPMAGIC): New macro.
15030 1998-07-24 Tom Tromey <tromey@cygnus.com>
15032 * Makefile.in (gjavah.o): Updated dependencies.
15033 (jcf-dump.o): Likewise.
15034 (all.indirect): Use ../gjavah.
15035 (../gjavah$(exeext)): Likewise.
15036 (clean): Don't remove gjavah.
15037 (clean): Remove parse.c, not java/parse.c.
15038 * Make-lang.in (java): Added gjavah.
15039 (gjavah$(exeext)): New target.
15040 (GJAVAH_SOURCES): New macro.
15041 (java.all.build): Added gjavah.
15042 (java.all.cross): Likewise.
15043 (java.rest.encap): Likewise.
15044 * config-lang.in (compilers, stagestuff): Added gjavah.
15046 1998-07-23 Tom Tromey <tromey@cygnus.com>
15048 * gjavah.c (java_float_finite): New function.
15049 (java_double_finite): Likewise.
15050 (F_POSITIVE_INFINITY): New macro.
15051 (F_NEGATIVE_INFINITY): Likewise.
15053 (D_POSITIVE_INFINITY): Likewise.
15054 (D_NEGATIVE_INFINITY): Likewise.
15056 (print_field_info): Use java_float_finite and java_double_finite.
15058 1998-07-23 Per Bothner <bothner@cygnus.com>
15060 * parse.y (method_header): Name "this" implicit argument.
15062 1998-07-22 Per Bothner <bothner@cygnus.com>
15064 * jcf-write.c: Write out LineNumberTable attribute in .class file.
15065 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
15066 (put_linenumber): New function.
15067 (generate_bytecode_insns, generate_classfile): Write line numbers.
15069 1998-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
15071 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
15072 (lookup_name, build_known_method_ref, build_class_init,
15073 build_invokevirtual, invoke_build_dtable, match_java_method,
15074 build_field_ref, pushdecl_force_head, build_java_binop,
15075 binary_numeric_promotion, build_decl_no_layout,
15076 build_java_arrayaccess, build_newarray, build_anewarray,
15077 build_java_array_length_access, build_java_arraynull_check): New
15078 extern function prototypes.
15079 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
15080 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
15082 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
15084 * jcf.h (jcf_out_of_synch): New extern function prototype.
15085 * parse.h: Static/global function implemented in parse.y
15086 prototyped and declarations moved at the end of the file.
15087 (DECL_P): Check that the argument isn't null.
15088 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
15089 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
15090 (QUAL_DECL_TYPE): New macro.
15091 (PARAMS): Macro definition removed.
15092 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
15093 (return_statement:): Call build_return.
15094 (field_access:): Call make_qualified_primary in sub rule.
15095 (method_invocation:): Build method invocation and call
15096 make_qualified_primary when processing primaries.
15097 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
15098 get_type_from_signature.
15099 (java_check_regular_method): Extra integer 0 argument when calling
15100 lookup_java_method2.
15101 (lookup_java_interface_method2): Extra method DECL argument when
15102 calling lookup_java_interface_method2.
15103 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
15104 COMPOUND_EXPR node.
15105 (java_complete_expand_method): Layout current class iff not
15106 already done. Don't process interface's methods.
15107 (java_complete_expand_method): Use super class only if it
15108 exists. Use current class otherwise.
15109 (make_qualified_primary): New function.
15110 (resolve_expression_name): Process qualified expression or
15111 expression from primary the same way.
15112 (resolve_expression_name): Two last arguments to
15113 resolve_field_access are now NULL_TREEs.
15114 (resolve_field_access): New variable is_static. Local field must
15115 be DECLs. is_static computed on field DECLs only. Append code in
15116 where_found to the field access if necessary. Use QUAL_DECL_TYPE
15117 to initialize field_type.
15118 (resolve_qualified_expression_name): New local variable,
15119 previous_call_static and is_static. Handle primaries with function
15120 calls, casts, array references and `this'. `super' now handled as
15121 `(super_class)this'. Use is_static to clarify boolean expressions.
15122 Added code to handle case where a proper handle is required to
15123 access a field. Use QUAL_DECL_TYPE where applicable.
15124 (maybe_access_field): New function.
15125 (patch_method_invocation_stmt): New arguments primary, where,
15126 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
15127 deleted. Use `where' as a type to search from if specified. Check
15128 for static method reference where forbidden. Append primary or
15129 current_this to the argument list if not calling constructor nor
15131 (check_for_static_method_reference): New function.
15132 (patch_invoke): Layout the class on which new is done if
15134 (lookup_method_invoke): Changed format to report errors on
15136 (qualify_ambiguous_name): New local variable this_found. Now
15137 handle things from primaries. Method call are considered
15139 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
15140 changed into NULLs.
15141 (not_initialized_as_it_should_p): Comply with the new DECL_P.
15142 (java_complete_tree): New case fo RETURN_EXPR. Process function
15143 call arguments in separate function.
15144 (complete_function_arguments): New function.
15145 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
15147 (patch_assignment): Take the return function slot into account as
15148 a RHS. Distinguish assignment from a return.
15149 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
15150 when checking methods in interfaces.
15151 (resolve_type_during_patch): NULL argument to unresolve_type_p
15152 instead of NULL_TREE.
15153 (patch_newarray): Fixed typo in comment.
15154 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
15155 (build_return, patch_return): New functions.
15156 * typeck.c (lookup_java_constructor): Fixed typo in comment.
15158 1998-07-21 Per Bothner <bothner@cygnus.com>
15160 * constants.c (find_name_and_type_constant, find_fieldref_index,
15161 find_methodref_index): New methods.
15162 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
15163 just return given method. Also, rename to build_known_method_ref.
15164 (expand_invoke): Rename call to build_invoke_non_interface.
15165 * java-tree.h, parse.h: Update prototype.
15166 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
15167 (such as expand_expr_stmt) if flag_emit_class_files.
15168 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
15169 STACK_TARGET, IGNORE_TARGET): New macros.
15170 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
15171 (generate_bytecode_insn): New function to generate method's bytecode.
15172 (generate_classfile): Node generate Code attribute for a method.
15173 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
15174 push_long_const, field_op, adjust_typed_op, maybe_wide):
15175 New functions used by generate_bytecode_insn.
15177 * typeck.c (signature_include_return): Remove variable.
15178 (push_java_argument_signature, build_java_argument_signature): New.
15179 (build_java_signature): Use push_java_argument_signature.
15180 * parse.y: Use build_java_argument_signature instead of fiddling
15181 with signature_include_return.
15183 1998-07-17 Tom Tromey <tromey@cygnus.com>
15185 * gjavah.c (print_c_decl): Always generate JArray<>* for array
15188 * Makefile.in (all.indirect): Added gjavah$(exeext).
15189 (gjavah$(exeext)): Added $(exeext).
15192 1998-07-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
15194 * class.c (layout_class): Call to java_layout_parsed_class replace
15195 by safe_layout_class.
15196 * expr.c (build_java_array_length_access): Removed static storage
15197 class in the function definition.
15198 (build_java_arraynull_check): Likewise.
15199 Also fixed typos in two comments.
15200 * lex.c (java_init_lex): Initialize static global kw_length.
15201 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
15202 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
15204 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
15205 * parse.h (resolve_no_layout): New static function declaration.
15206 (get_identifier_in_static): Declaration removed.
15207 (java_layout_parsed_class): Function name declaration changed to
15209 (build_newarray_node, patch_newarray, resolve_type_during_patch,
15210 not_initialized_as_it_should_p, build_this): New static function
15212 (pushdecl_force_head, build_java_binop, int_fits_type_p,
15213 binary_numeric_promotion, stabilize_reference,
15214 build_decl_no_layout, build_java_arrayaccess): Extern function
15215 declarations moved into their own section.
15216 (build_newarray, build_anewarray, build_java_array_length_access,
15217 build_java_arraynull_check): New extern function declarations.
15218 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
15219 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
15221 (CALL_CONSTRUCTOR_P): New macro.
15222 * parse.y (kw_length): New static global tree node.
15223 (return_statement): Tagged <node>.
15224 (RETURN_TK): Tagged <operator>.
15225 (variable_declarator_id:): Build variable declaration with an
15226 empty initialization value if a syntax error was found in the
15227 initialization part of the variable declaration.
15228 (statement_without_trailing_substatement:): return_statement: now
15229 uses the default rule.
15230 (return_statement:): Temporarily fixed to return NULL_TREE.
15231 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
15232 (class_instance_creation_expression:): Class creation rules now
15233 call build_method_invocation upon reduction.
15234 (array_creation_expression:): Rules call build_newarray_node upon
15236 (dim_exprs:): Build a list of dimension expressions.
15237 (dim_expr:): Store location of the OSB_TK in the dimension
15239 (method_invocation:): Added a new error rule.
15240 (build_unresolved_array_type): WFL argument may also be an array
15241 on a primitive type. Name of the argument changed to reflect this.
15242 (method_declarator): Insert argument type at the beginning of the
15243 argument type list and later reverse the list.
15244 (unresolved_type_p): Argument 'returned' may be optionally
15246 (java_layout_class_from_source): Function renamed
15248 (resolve_and_layout): Now call resolve_no_layout and
15250 (resolve_no_layout): New function.
15251 (purify_type_name): New function.
15252 (complete_class_report_errors): Call purify_type_name during error
15253 report on a type not found.
15254 (process_imports): error_found local variable doesn't need to be
15255 initialized to zero.
15256 (declare_local_variables): New local type_wfl. Fixed typo in error
15257 message. type_wfl assigned to unresolved type and used to register
15258 incomplete type. Build a WFL around the variable initialization
15259 statement so that debug info can be generated on it.
15260 (source_start_java_method): Reverse argument list after they've
15262 (current_this): New static global variable.
15263 (java_complete_expand_methods): Set current_this when appropriate.
15264 (resolve_expression_name): Build correct static and non static
15265 field access bearing a simple name.
15266 (resolve_field_access): Resolve the length field of arrays. Handle
15268 (patch_method_invocation_stmt): Set the type of the method
15269 invocation to error_mark_node. This value is later overridden by a
15270 valid type, if any. Don't handle qualified constructor invocation
15271 as qualified method invocation. Call lookup_method_invoke with its
15272 new flag. It's no longer necessary to access the selected method
15273 as the value of a tree list. Handle constructor invocation.
15274 (patch_invoke): Reverse argument list when invoking non interface
15275 methods. Insert call to new as the first argument of the
15277 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
15278 defined within a final class. Return INVOKE_STATIC if the invoked
15279 method is a constructor.
15280 (lookup_method_invoke): New lc argument is a flag to indicate a
15281 constructor lookup. Now handle constructor lookup. Choose the most
15282 specific method in case several were matching the invocation
15283 requirements. Return a method decl instead of a tree list featuring
15284 one single method decl element.
15285 (refine_accessible_methods_list): New lc flag argument to
15286 indicate that a constructor is being looked up.
15287 (not_initialized_as_it_should_p): New function.
15288 (java_complete_tree): Now process fake tree codes
15289 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
15290 save_expr on resolved function call arguments. Case on
15291 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
15292 (patch_assignment): LHS can be a field access expression. When
15293 dealing with reference, lhs_type is the promoted type of the
15294 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
15296 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
15297 (patch_binop): Use not_initialized_as_it_should_p where
15299 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
15300 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
15302 (resolve_type_during_patch): New function.
15303 (patch_cast): Call resolve_type_during_patch to resolve type and
15304 report error accordingly.
15305 (patch_array_ref): Use not_initialized_as_it_should_p where
15306 applicable. Array base expression is saved before being
15307 used. Promote the type of an array elements if it contains non
15309 (build_newarray_node, patch_newarray, build_this): New functions.
15311 1998-07-16 Tom Tromey <tromey@cygnus.com>
15313 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
15314 increment it in `for' statement.
15315 (print_field_info): If number is inf or nan, don't print it.
15316 (print_method_info): If method name is `delete', just ignore it.
15317 (print_c_decl): Special-case jstringArray.
15319 * gjavah.c (help): New function.
15320 (no_argument): New function.
15321 (usage): Changed text.
15322 (main): Rewrote argument handling. Now handles -v, --help,
15324 (version): New function.
15325 (found_error): New global.
15326 (main): Return found_error.
15327 (generate_access): Set found_error.
15328 (print_c_decl): Likewise.
15330 1998-07-15 Tom Tromey <tromey@cygnus.com>
15332 * gjavah.c (print_c_decl): Don't print "," when examining field.
15333 Skip type name when looking at "[L" types.
15334 (process_file): Now static.
15335 (generate_access): Now returns int.
15336 (last_access_generated): New global.
15337 (process_file): Clear last_access_generated; make multiple passes
15339 (print_field_info): Just return if generate_access returns true.
15340 (print_method_info): Likewise. Also, allow <init> functions to
15342 (print_c_decl): Added is_init argument. Print constructors
15344 (print_cxx_classname): Use UTF8_GET to extract characters from
15346 (print_base_classname): New function.
15347 (print_class_decls): New function.
15348 (process_file): Use it.
15349 (utf8_cmp): New function.
15351 1998-07-13 Nick Clifton <nickc@cygnus.com>
15353 * lang-options.h: Format changed to match changes in gcc/toplev.c
15354 to implement a --help option.
15356 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
15358 * decl.c (init_decl_processing): Revert change to dtable_type.
15360 1998-07-09 Per Bothner <bothner@cygnus.com>
15362 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
15364 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
15366 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
15368 * lang.c (lang_init): Default flag_exceptions to 1, without
15369 checking to see if it's 2 first.
15371 1998-07-08 Jeffrey A Law (law@cygnus.com)
15373 * constants.c: Include "system.h".
15374 * decl.c: Likewise.
15375 * lang.c (flag_new_exceptions): Get via extern now.
15376 (lang_init_options): New functions. Turn on flag_new_exceptions.
15378 1998-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
15380 * lex.c (java_lex): Return 0 when we see an invalid character in
15383 * lex.c (java_read_char): Specify extra argument when calling
15385 (java_read_unicode, java_parse_end_comment,
15386 java_parse_escape_sequence): Likewise,
15387 (java_lex): Specify extra argument when calling
15388 java_lex_error. Test that IDs are beginning with a legal character
15389 for IDs. Handle invalid characters with an error message and a
15390 call to java_lex_error.
15391 (java_lex_error): Adjust column position by new argument
15392 `forward'. Issue an error even if in the middle of reporting an
15395 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
15397 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
15398 we don't explicitly put a null pointer when we're copying it.
15400 1998-07-07 Tom Tromey <tromey@cygnus.com>
15402 * gjavah.c (print_cxx_classname): New function.
15403 (super_class_name): Likewise.
15404 (print_super_fields): Removed.
15405 (in_super): Removed.
15406 (print_field_info): Never generate #defines.
15407 (print_c_decl): Changed generated types to match JNI. No longer
15408 print class name before method name.
15409 (print_method_info): Print "static" before static methods.
15410 Print "virtual" before non-final methods.
15411 (usage): Use exit(1), not exit(-1).
15413 (print_field_info): Use %.17g to print a double.
15414 (last_access): New globals.
15415 (process_file): Initialize last_access.
15416 (usage): Now static.
15417 (ACC_VISIBILITY): New define.
15418 (generate_access): New function.
15419 (print_field_info): Call it.
15420 (print_method_info): Likewise. Also, generate information for all
15421 methods, not just native methods. Return void.
15422 (print_c_decl): Return void.
15423 (print_field_info): Return void.
15425 1998-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
15427 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
15428 processing the jc1 grammar file. Prefix bison functions and
15429 variables with java_.
15430 (parse.c): Dependencies on parse.h and lex.h
15431 * expr.c (build_java_arrayaccess): Function now global.
15432 * java-tree.h: Comment reorganized to carry on previous
15433 classification effort.
15434 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
15435 RESOLVE_TYPE_NAME_P): New flags on WFLs.
15436 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
15437 java_parse (new prefix java_ generated by bison).
15438 (java_layout_parsed_class, java_register_parsed_class): Function
15440 (yyparse): Removed unnecessary call to init_outgoing_cpool.
15441 * lex.c (static tree wfl_op): Variable deleted.
15442 (java_init_lex): Initialize kw_super and kw_this. Initialize more
15443 ctxp fields to NULL_TREE.
15444 (java_lex): No longer create WFL for operators. Filename caching
15445 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
15446 created as STRING_CST and later expanded. Removed extra argument
15447 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
15449 (build_wfl_node): Removed code in comments.
15450 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
15451 store token and location data in the current bison token.
15452 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
15453 static/extern function declaration at the beginning of the file.
15454 (struct qualification): Data structure definition deleted.
15455 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
15456 (qualify_ambiguous_name): Function declaration modified. Function
15457 now returns nothing.
15458 (build_array_ref, patch_array_ref, make_qualified_name,
15459 resolve_qualified_expression_name, maybe_generate_clinit,
15460 resolve_field_access): New static function declarations.
15461 (build_java_arrayaccess): New extern function declaration.
15462 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
15463 (CALL_EXPR_PRIMARY): Macro deleted.
15464 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
15465 (struct parser_ctxt): Field initialized_final
15466 removed. non_static_initialized, static_initialized: New fields.
15467 * parse.y (static tree kw_super, static tree kw_this): New global
15469 (%union): tree wfl field of operator member replaced by int
15470 location. WFLs are non longer created for operators.
15471 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
15472 (qualified_name:): Now calls make_qualified_name to build the
15474 (type_declaration:): Consider generating <clinit> when class
15476 (variable_declarator:): Directly build an assignment node when the
15477 variable is initialized when declared.
15478 (this_or_super:): Build a WFL and set current location when THIS
15479 or SUPER are parsed.
15480 (expression_statement:): Wrap statement around a WFL.
15481 (primary_no_new_array:): Fixed typo. Changed value returned by
15482 THIS_TK because of its new type (temporary).
15483 (dim_exprs:): Temporary fix because of OSB_TK's new type.
15484 (field_access:): Build qualified name with SUPER.
15485 (method_invocation:): Fixed returned value because of SUPER's new
15487 (array_access:): Use OSB_TK location information.
15488 (post_increment_expression:, post_decrement_expression:,
15489 unary_expression:, pre_increment_expression:,
15490 pre_decrement_expression:, unary_expression_not_plus_minus:,
15491 cast_expression:, multiplicative_expression:,
15492 additive_expression:, shift_expression:, relational_expression:,
15493 equality_expression:, and_expression:, exclusive_or_expression:,
15494 inclusive_or_expression:, conditional_and_expression:,
15495 conditional_or_expression:, assignment:): Use new location/token
15496 information available on operators.
15497 (create_class): Set super_decl_type to NULL_TREE when processing
15499 (register_fields): Field initialization is now a MODIFY_EXPR
15500 node. Chain initialization code to the matching lists (according
15501 to the field declaration modifiers).
15502 (maybe_generate_clinit): New function.
15503 (method_header): Don't set method's DECL_NAME to a WFL when adding
15504 methods to java.lang.Object.
15505 (resolve_and_layout): Now can return NULL_TREE if the type
15506 resolution fails. Otherwise, return the class DECL instead of its
15508 (check_method_redefinition): Don't patch method DECL_NAME if it
15509 belongs to java.lang.Object.
15510 (process_imports): Simply assign error_found to the value returned
15511 by check_pkg_class_access.
15512 (declare_local_variables): Don't use their init statements (if
15513 any) when parsing error were previously found. Reuse MODIFY_EXPR
15514 build during parsing as an init statement.
15515 (java_method_add_stmt): Now return the current method body.
15516 (java_layout_parsed_class, java_register_parsed_class): Functions
15518 (java_complete_expand_methods): Initialize the constant pool on a
15519 per class basis. Layout the classes before expanding their method
15520 bodies. Don't try expand artificial constructor code if error were
15521 found. Make the classes data and register them if no error were
15523 (java_complete_expand_method): Retrieve an artificial constructor
15524 argument list before entering its body. Assign the top block to
15525 the artificial constructor function body and set types of declared
15526 blocks and compound statements to void. Walk method body if not an
15527 artificial constructor.
15528 (make_qualified_name, cut_identifier_in_qualified): New functions.
15529 (resolve_expression_name): Fixed comments. Save/restore the
15530 current class CLASS_LOADED_P flag value. Build non qualified
15531 static field access and handle qualified expression names.
15532 (resolve_field_access, resolve_qualified_expression_name): New
15534 (patch_method_invocation_stmt): Use the new expression resolution
15535 scheme, calling resolve_field_access when the function call is
15536 resolved as an expression.
15537 (qualify_ambiguous_name): Function rewritten to work on qualified
15538 expression produced by make_qualified_name.
15539 (java_complete_tree): Promote type when function's argument are
15540 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
15541 the assignment to discover further errors if RHS is a expression
15542 name that fails to evaluate. Declare LHS initialized even though
15543 the assignment failed. Don't use the location variable and removed
15544 extra argument in patch function calls. Now handle the ARRAY_REF
15545 case and build internal string representation when STRING_CSTs are
15547 (build_method_invocation): Don't wrap function call around a WFL.
15548 (build_assignment): Likewise. Use the operator location
15550 (patch_assignment): Handle array access LHSs. Handle error
15551 provenance, resulting in a better error report.
15552 (build_binop): Use op_location from operator as binop location
15554 (build_unaryop, build_incdec, build_cast): Likewise.
15555 (patch_binop): Extract location information from the node. Fixed
15556 typo in error message.
15557 (patch_unary_op): Extract location information from the node.
15558 (build_array_ref, patch_array_ref): New functions.
15560 1998-07-01 Tom Tromey <tromey@cygnus.com>
15562 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
15563 match _Jv_IsInstanceOf.
15564 * decl.c (init_decl_processing): Use _Jv_NewArray, not
15565 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
15567 1998-06-30 Tom Tromey <tromey@cygnus.com>
15569 * decl.c (init_decl_processing): Functions are now named
15570 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
15572 1998-06-29 Per Bothner <bothner@cygnus.com>
15574 * java-tree.h (load_class): Add prototype.
15575 * class.c (is_compiled_class): Add missing arg to load_class.
15576 * expr.c (expand_java_NEW): Call load_class.
15577 * parse.y (process_import): Removed bogus use of void return value.
15579 1998-06-25 Per Bothner <bothner@cygnus.com>
15581 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
15582 Function name is "_Jv_Throw" instead of "soft_athrow".
15583 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
15584 Function name is "_Jv_AllocObject" instead of "soft_new".
15585 Takes an extra parameter (object size).
15586 * expr.c: Update calls.
15588 1998-06-24 Per Bothner <bothner@cygnus.com>
15590 * lex.c (java_get_line_col): Handle end-of-file.
15591 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
15593 1998-06-24 Andrew MacLeod <amacleod@cygnus.com>
15595 * lang.c (lang_init): Make -fexceptions the default.
15596 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
15597 exception handling is not turned on.
15599 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
15601 * lang.c (flag_new_exceptions): Make this this default.
15602 * decl.c (end_java_method): Call emit_handlers.
15603 * except.c (method_init_exceptions): Set language code and version.
15604 (expand_start_java_handler): Enable exception, and call
15605 expand_eh_region_start.
15606 (expand_end_java_handler): Enable exception, and set up catch blocks.
15607 (emit_handlers): New routine to generate the saved handlers.
15608 * java-except.h (emit_handlers): Add prototype.
15610 1998-06-12 Per Bothner <bothner@cygnus.com>
15612 We used to have three different representations of the constant pool:
15613 the CPool structure, the tree_constant_pool, and the constructures
15614 used to build the Class object (which may need class and string
15615 constants) in compiled code. None were appropriate for compiling
15616 to .class files, so I did a major overhaul.
15618 First, the tree_constant_pool array was removed. Things were
15619 modified to the CPool structure in the JCF could be used.
15620 Second, a "capacity" field was added to the CPool, and functions
15621 written to search for a matching constant, adding one if not found.
15622 The code that generated the Class object was changed to use a CPool.
15623 The actual TREE_LISTs used to build the CONSTRUCTORs used for
15624 the static Class object are now only in build_constants_constructor.
15625 Finally, I wrote code which can generate a .class file (including its
15626 constant pool) from the RECORD_TYPE of a class. This is a big step
15627 on the way to compiling Java source into .class files.
15629 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
15630 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
15632 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
15633 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
15634 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
15635 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
15636 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
15637 (lang_type): Removed constant_pool field.
15638 * jcf.h (CPool): Renamed size to count. Added field capacity.
15639 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
15640 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
15641 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
15643 * constants.c (current_constant_pool_tags, current_constant_pool_data,
15644 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
15645 * constants.c (build_constants_constructor): Use new outgoing_cpool.
15646 (set_constant_entry, find_constant1, find_constant2,
15647 find_class_constant, count_constant_pool_bytes, write_constant_pool,
15648 find_utf8_constant, find_class_or_string_constant): New functions.
15650 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
15651 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
15652 (give_name_to_class, get_class_constant): Likewise.
15653 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
15654 (get_name_and_type_constant, get_ref_constant): Removed.
15655 * parse.h (parser_ctxt): Remove field tree_constant_pool.
15656 * parse.y: Don't save/restore tree_constant_pool.
15657 * verify.c (verify_jvm_instructions): Update for new approach.
15658 * expr.c (expand_invoke, expand_java_field_op): Likewise.
15660 * lang-options.h: Added -femit-class-file, -femit-class-files.
15661 * lang.c (flag_emit_class_files), java-tree.h: New flag.
15662 (lang_f_options): Added "emit-class-file(s)".
15664 * expr.c (build_java_arrayaccess): Generate more efficient array
15665 bounds checking, by using unsigned compare.
15667 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
15669 1998-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
15671 * parse.h: New comment on the handling of unresolved type
15672 identifiers. JDEPs are now part of the jdep_code enum.
15673 (typedef struct jdep): Now use enum jdep_code or int, depending on
15674 availability. Both are narrowed down to an 8 bits bitfield.
15675 (CALL_EXPR_PRIMARY): Fixed comment.
15677 1998-06-10 Tom Tromey <tromey@cygnus.com>
15679 * Make-lang.in (java): Added gjavac and jvgenmain.
15680 (java.start.encap): Depend on gjavac.
15681 (java.rest.encap): Depend on jvgenmain.
15683 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
15684 (JAVA_CROSS_NAME): Likewise.
15685 (java.all.build): Depend on jvgenmain and gjavac.
15686 (java.all.cross): Depend on jvgenmain and gjavac-cross.
15687 (jvgenmain$(exeext)): New target.
15688 (java.install-common): Wrote.
15689 * config-lang.in (compilers, stagestuff): Added gjavac and
15692 1998-06-10 Dave Brolley <brolley@cygnus.com>
15694 * lang.c (lang_decode_option): New argc/argv interface.
15696 1998-06-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
15698 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
15699 * decl.c (build_decl_no_layout): New function.
15700 * expr.c (java_lang_expand_expr): Layout declarations found in
15701 blocks before they're pushed.
15702 * jcf-parse.c (load_class): Save current line when parsing class
15704 (parse_source_file): Register class before expanding their
15706 * lang.c (put_decl_node): Produce `null' when `void *' is
15708 * lex.c (static tree wfl_op): New static global, for error report
15710 (java_init_lex): wfl_operator and wfl_op initialized
15711 here. Filename caching added for wfl_op. Return wfl_op when `(' is
15713 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
15714 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
15715 build_unresolved_array_type): New static function definitions.
15716 (build_decl_no_layout): New extern function declared.
15717 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
15718 faulty modifier exists.
15719 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
15720 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
15721 (UNARY_PLUS_EXPR): New fake operator.
15722 (struct parser_ctxt): New field osb_number.
15723 * parse.y (static tree wfl_operator): New static WFL for operator
15724 bound error messages.
15725 (DECR_TK, INCR_TK): Moved.
15726 (OP_TK): Tagged <operator>.
15727 (array_type:): Now call build_unresolved_array_type.
15728 (dim_expr:): Count the number of '[' seen.
15729 (post_increment_expression, post_decrement_expression,
15730 pre_increment_expression, pre_decrement_expression,
15731 unary_expression_not_plus_minus, unary_expression:): Actions are
15732 now building the corresponding unary expressions.
15733 (cast_expression:): Actions are now building cast expressions.
15734 (build_unresolved_array_type): New function.
15735 (create_interface): Reset the number of declared interfaces.
15736 (create_class): Likewise.
15737 (method_header): Methods declared within the scope of an interface
15738 are now implicitly set public and abstract.
15739 (java_complete_class): Variable's and parameter's type are patched
15740 with a promoted type.
15741 (declare_local_variables): Resolved non builtin types are promoted
15742 before being used to build a variable decl. Removed type patch
15743 posted on variable initialization statement.
15744 (source_start_java_method): Use build_decl_no_layout to build the
15745 decl of a parameter of incomplete type.
15746 (java_register_parsed_class): Process interfaces too. Call
15747 rest_of_decl_compilation on each processed class declarations.
15748 (java_complete_expand_methods): Don't attempt to expand things in
15750 (java_complete_tree): Process CONVERT_EXPR, even though it always
15751 has a type. Propagate error_mark_node to node's type too. Promote
15752 method's call argument type and return error_mark_node if
15753 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
15754 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
15755 handle unary operator nodes.
15756 (build_assignment): Added comment.
15757 (print_int_node): New function.
15758 (patch_assignment): New second argument. New error handling. Use
15759 print_int_node. Handle references. Use can_cast_to_p to issue
15760 different error message according to the context and check upon
15761 the initialization of the RHS.
15762 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
15763 (operator_string): Handle more operators.
15764 (patch_binop): No longer use a function static
15765 wfl_operator. Improved error message on shift distance.
15766 (build_unaryop, build_incdec, build_cast, patch_unaryop,
15767 patch_cast): New functions.
15769 1998-06-05 Per Bothner <bothner@cygnus.com>
15771 * jvspec.c: New file.
15772 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
15774 * java-tree.h (identifier_subst): Add declaration.
15776 1998-06-04 Tom Tromey <tromey@cygnus.com>
15778 * jvgenmain.c (main): Generate call to JvRunMain.
15780 * class.c (make_class_data): Push value for "sync_info" field.
15781 * decl.c (init_decl_processing): Push "sync_info" field.
15783 1998-06-03 Per Bothner <bothner@cygnus.com>
15785 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
15786 Java (source) name, not signature.
15787 Set TYPE_ALIGN to (at least) that of element_type.
15789 1998-06-02 Per Bothner <bothner@cygnus.com>
15791 * class.c: Moved classname-mangling-rekated code to ...
15792 * mangle.c: ... this new file.
15793 * jvgenmain.c: New program (needs mangle.c) to generate main program.
15794 * Makefile.in: Update for above changes.
15796 1998-06-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
15798 * expr.c (truthvalue_conversion): Convert integer and floating
15799 point value to their truth value.
15800 * lex.c (java_lex): Handle the `null' literal.
15801 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
15802 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
15803 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
15806 * parse.y: Reorganization/documentation on token declaration.
15807 (binop_lookup[]): New added new tree codes.
15808 (relational_expression): Build corresponding binary operators.
15809 (equality_expression, conditional_and_expression,
15810 conditional_or_expression): Likewise.
15811 (java_complete_class): Fix crash in debug message.
15812 (java_complete_tree): Check initialization of method call
15813 arguments. Further bogus node evaluation to detect more error
15814 during assignments. Handles more binary operators.
15815 (patch_assignment): Use DECL_P.
15816 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
15818 (operator_string): Handle more case. Compacted source.
15819 (patch_binop): Changed function comment. Checking for
15820 uninitialized first operand takes the compound assignment into
15821 account and uses DECL_P. Checking for uninitialized second operand
15822 delayed to routine's end. Use macros to issue type bound error
15823 messages and issue messages on both operands if their types are
15824 different. Force fixed type into node. Handle all binary
15827 1998-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
15829 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
15830 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
15831 build operator node and return tokens.
15832 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
15833 * parse.h (java_complete_tree): Changed returned type in prototype.
15834 (build_method_invocation, build_assignment, patch_assignment,
15835 patch_binop): New static function declarations.
15836 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
15837 BUILD_EXPR_WFL): New macros.
15838 * parse.y (enum tree_code binop_lookup[]): New static for token to
15840 (%union): Parser union has new sub-structure `operator'.
15841 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
15842 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
15843 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
15844 ASSIGN_ANY_TK): Tokens tagged `operator'.
15845 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
15846 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
15847 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
15848 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
15849 (assignment_operator:): Rule tagged `operator'.
15850 (expression_statement:): Re-installed default rule.
15851 (method_invocation:): Sub rules call build_method_invocation.
15852 (postfix_expression:): Don't attempt to resolve name here. Just
15854 (multiplicative_expression:): Sub-rules build corresponding binop
15856 (additive_expression:, shift_expression:, and_expression:,
15857 exclusive_or_expression:, inclusive_or_expression:): Likewise.
15858 (assignment:): Sub rule invoke build_assignment.
15859 (assignment_operator:): Default rules on sub rules.
15860 (force_error): Added documentation on this variable.
15861 (declare_local_variables): Build initialization calling
15863 (expand_start_java_method): Removed unused rtx declaration. Mark
15864 arguments as already initialized.
15865 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
15866 (java_complete_expand_methods): Don't process next method if
15867 completion of the previous one triggered errors.
15868 (java_complete_expand_method): Call source_end_java_method if no
15869 error were found during completion.
15870 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
15871 locals declaratilon. Handle names found within a class. Return
15872 error_mark_node when things aren't found.
15873 (patch_method_invocation_stmt): Return error_mark_node on failures.
15874 (patch_invoke): Removed unused local. Return the correct node.
15875 (java_complete_tree): Now returns a value. The BLOCK section binds
15876 local identifiers and the type of a BLOCK is now void. Assign the
15877 result of operand completion on COMPOUND_EXPR. Assign the
15878 encapsulated node of a WFL to the result of its completion, except
15879 when the node is an identifier. Now handle MODIFY_EXPR and several
15880 binary operators. Return error_mark_node on errors.
15881 (build_method_invocation, build_assignment, patch_assignment,
15882 build_binop, operator_string, patch_binop): New functions.
15883 * typeck.c (binary_numeric_promotion): New function.
15885 1998-05-21 Per Bothner <bothner@cygnus.com>
15887 * class.c (identifier_subst): New convenience wrapper for ident_subst.
15888 Replace most uses of ident_subst by identifier_subst.
15890 * class.c (push_class_static_dummy_field): Removed function.
15891 (build_class_ref): Find Class object decl by looking up "CNAME.class",
15892 instead of looking got "class" static field. Create that decl here.
15893 (class_identifier_node): Removed; no longer needed.
15894 (init_class_processing): Don't init class_identifier_node.
15895 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
15896 Do nreverse 0 times (instead of twice) for Object and Class.
15897 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
15899 1998-05-20 Per Bothner <bothner@cygnus.com>
15901 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
15902 while initializing linenumber_count and linenumber_table.
15903 Do it before init_function_start (which calls emit_line_note).
15904 * expr.c (expand_byte_code): Don't need to clear lineno here.
15906 1998-05-18 Tom Tromey <tromey@cygnus.com>
15908 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
15909 then mangle number as _N_.
15911 * class.c (mangle_class_field): New function.
15912 (build_class_ref): Set assembler name of class reference using
15913 mangle_class_field.
15914 (push_class_static_dummy_field): Likewise.
15916 1998-05-17 Michael Tiemann <tiemann@cygnus.com>
15918 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
15919 of assigning to TREE_CODE. The latter method exploits a feature
15920 of GCC that is not ANSI compliant.
15922 1998-05-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
15924 * decl.c (pushdecl_force_head): New function.
15925 (pushlevel): Removed conditional printf.
15926 (complete_start_java_method): Don't enter local variable scope if
15927 function is compiled from source code.
15928 * expr.c: parse.h now included
15929 (java_lang_expand_expr): New function.
15930 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
15931 printf. Terminate buffer when doing directories.
15932 * jcf-parse.c (parse_source_file): Call lang_init_source before
15933 parsing and before code generation.
15934 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
15935 use printf if the macro is defined.
15936 * lang.c (lang_init): Install lang_expand_expr hook on
15937 java_lang_expand_expr.
15938 (java_dummy_print): New function.
15939 (lang_init_source): New function.
15940 * lex.c (java_lex): Remember location of an opening brace at the
15941 second nesting level.
15942 (java_is_eol): Unget character seen after a CR if it is EOF.
15943 * parse.h: Now includes lex.h
15944 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
15945 printf if the macro is defined.
15946 (expand_start_java_method, build_expr_block, enter_block,
15947 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
15948 New static function declarations.
15949 (pushdecl_force_head): New extern function declaration.
15950 (INCOMPLETE_TYPE_P): New macro.
15951 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
15952 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
15953 BLOCK_EXPR_ORIGIN): New macros.
15954 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
15955 DECL_SOURCE_LINE_LAST): New macros.
15956 (struct parser_ctxt): Removed field current_method_decl, redundant
15957 with the field current_function_decl. Added fields
15958 first_ccb_indent1 and pending_block.
15959 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
15960 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
15962 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
15963 (compilation_unit:): Cosmetic on sub rule.
15964 (type_declaration:): Cosmetic on sub rules. Added an error rule.
15965 (variable_initializer:): Installed default rule on expression:.
15966 (method_declaration:): method_header: starts a new
15967 method. method_body: installs the function body, absorbs blocks
15968 emitted for temporary variable scopings, pops function's body block
15969 and merges function's last statement lineno in DECL_SOURCE_LINE.
15970 (method_body:): Installed default rules.
15971 (block:): Call enter_block when an opening brace is seen. Absorb
15972 scoping blocks and call exit_block when a closing brace is seen.
15973 (block_statement:): Cosmetic changes.
15974 (method_invocation:): Create WFL around CALL_EXPR node.
15975 (patch_stage): Added comment around definition.
15976 (method_header): Try to use first_ccb_indent1 as the first line of
15977 the method, so BP debug info are emitted at the first opening
15978 brace of the function. If the function has no body, use the
15979 location of the function's name. Override currently defined method
15980 name with the matching WFL so we can point redefinition errors
15981 using the location where the function's name was declared.
15982 (check_abstract_method_header): Interprets DECL_NAME as an
15983 identifier or as a WFL, accordingly.
15984 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
15985 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
15986 location and name information out of it and reinstall DECL_NAME to
15987 its original identifier node value.
15988 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
15989 function's source code).
15990 (read_import_dir): Test the value returned by find_class and issue
15991 a fatal accordingly.
15992 (declare_local_variables): Push a new block for the scope of the
15993 new variable(s) if code has been already generated at that nesting
15994 level. Pinpoint redefinition errors using the variable id
15995 WFLs. Generate initialization code if necessary. If the variable
15996 type is incomplete, register a patch on its decl.
15997 (source_start_java_method): Rewritten. Define a new block for the
15998 function's parameters. Build parameter decl out of function's
15999 arguments and register them for a patch if their types are
16001 (expand_start_java_method): Includes the part of
16002 source_start_java_method that was pushing the parameter decls and
16003 completing the method start code.
16004 (source_end_java_method): Removed call the expand_end_bindings and
16005 poplevel (already taken care of). Reinstall function's arguments
16006 and get function's last line of code before calling
16007 expand_function_end.
16008 (java_method_add_stmt): New comment before the function's
16009 code. Complement the second operand of the current COMPOUND_EXPR
16011 (java_complete_expand_methods): Don't generate debug info on line
16012 zero when expanding a generated constructor.
16013 (java_complete_expand_method): Set start and end line numbers for
16014 a artificially generated constructor to one and manually call
16015 enter_block and exit_block when defining it. For all methods:
16016 expand function's start calling the new expand_start_java_method
16017 and invoke java_complete_tree on the effective method's body, if
16019 (resolve_expression_name): Now use lookup_name_in_blocks to search
16020 local variable decls and print out an error when variables are
16022 (patch_method_invocation_stmt): Inserted comment before the
16024 (lookup_method_invoke): Chain method's arguments using chainon
16025 with the current arg list as a second argument. Inserted missing
16026 IDENTIFIER_POINTER when reporting an error on methods not found.
16027 (refine_accessible_methods_list): Don't retain constructors.
16028 (patch_arguments): Function removed.
16029 (java_complete_tree): Inserted comment before the function's
16030 code. New case for BLOCKs. Moved the WFL case a bit
16031 further. Complete function's arguments.
16032 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
16033 maybe_absorb_scoping_blocks): New functions.
16035 1998-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
16037 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
16039 * jcf-parse.c (parse_source_file, java_error_count): New forward
16040 and extern declarations.
16041 (java_parse_abort_on_error): Macro moved.
16042 (jcf_parse_source): fatal called if fopen fails. Now calls
16044 (parse_source_file): New parse_only parameter. Reflects the
16045 elimination of the second pass.
16046 (yyparse): parse_source_file called with argument set to 0.
16047 * jcf.h (JCF_ZERO): Sets java_source to zero.
16048 * lex.c (java_init_lex): pass argument is gone. Function modified
16049 to be called once during the analysis of a file.
16050 (java_unget_unicode): Fixed typo in fatal message.
16051 (java_get_line_col): Likewise.
16052 (java_lval): Likewise. String literals no longer built during
16054 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
16056 * parse.h (MODIFIER_WFL): New macro.
16057 (parse_check_super, parser_check_super_interface): Now return int.
16058 (parser_chain_incomplete_item, not_builtin_p,
16059 complete_method_decl): Declarations removed.
16060 (build_method_invocation_stmt, build_invoke): Renamed using the
16061 `patch' instead of `build'
16062 (register-incomplete_type, obtain_incomplete_type,
16063 java_complete_tree, java_complete_expand_method,
16064 unresolved_type_p, create_jdep_list): New function declarations.
16065 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
16066 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
16067 (jdep): New typedef on new struct _jdep.
16068 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
16069 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
16070 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
16071 JDEP_RESOLVED_P): New macros.
16072 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
16073 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
16074 JDEP_VARIABLE): New enum values and jdep kinds.
16075 (jdeplist): New typedef on struct _jdeplist.
16076 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
16078 (CALL_EXPR_PRIMARY): New macro.
16079 (struct parser_ctxt): Fields java_pass, current_method_decl,
16080 method_decl_list deleted. New field jdeplist.
16081 (INCOMPLETE_P): Macro deleted.
16082 * parse.y (single_type_import_declaration:): Removed pass switch.
16083 (type_import_on_demand_declaration): Likewise.
16084 (field_declaration:): Removed pass switch on all sub rules.
16085 (class_declaration:): Call the complete_class_decl removed on
16087 (method_declaration:): Removed second pass switch. No longer chain
16088 methods decl when method_header reduced.
16089 (method_header:): Sub rules no longer depend on pass switch.
16090 (method_declarator:): Likewise.
16091 (method_body:): Likewise.
16092 (abstract_method_declaration:): Likewise.
16093 (block_statement:): Likewise.
16094 (local_variable_declaration:): Likewise.
16095 (argument_list:): Likewise.
16096 (method_invocation:): Likewise. Call to build_method_invocation_stmt
16097 removed. Partial CLASS_EXPR tree node built instead.
16098 (postfix_expression:): Removed pass switch on all sub rules.
16099 (java_pop_parser_context): Free classd_list content.
16100 (yyerror): Call obstrack_grow0 to finalize error message.
16101 (check_class_interface_creation): Comment modified to reflect new
16102 returned value meaning. Removed second pass switch. Return 1 if an
16103 error was found, 0 otherwise. Adjust pointer on filename if a
16104 leading path separator was found.
16105 (maybe_create_class_interface_decl): Removed first pass switch
16106 when linking the class decl to the class_list. Install a new
16107 jdep_list for the class.
16108 (add_superinterfaces): List of unresolved interfaces is
16109 gone. Unresolved interfaces are directly added to the current
16111 (create_interface): Second pass shortcut removed.
16112 ctpx->modifier_ctx access through MODIFIER_WFL.
16113 (create_class): Second pass shortcut removed. Call to
16114 register_incomplete_type replaces the call to
16115 parser_chain_incomplete_item.
16116 (complete_class_decl): Function removed.
16117 (duplicate_declaration_error): New way of retrieving redeclared
16119 (register_fields): Call to lookup_modifier_cl replaced by
16120 MODIFIER_WFL. New way of handling unresolved type, using
16121 unresolved_type_p and obtain_incomplete_type.
16122 register_incomplete_type replaces call to parser_chain_incomplete_item.
16123 (patch_stage): New static global variable.
16124 (method_header): New way of handling unresolved type, using
16125 unresolved_type_p and obtain_incomplete_type. patch_stage used to
16126 indicates that the method decl needs to be patched.
16127 (check_abstract_method_header): Call to lookup_modifier_cl
16128 replaced by MODIFIER_WFL.
16129 (method_declarator): Incomplete argument type are registered
16130 calling register_incomplete_type. Patch on the declared method is
16131 issued in that case.
16132 (unresolved_type_p): New function.
16133 (parser_check_super_interface): New comment to reflect function's
16134 modified returned type (int). Function and has a new argument
16135 this_wfl. Call to parse_error_context uses this_wfl instead of
16136 relying on lookup_cl.
16137 (parser_check_super): Comment reflects function's new returned
16138 type (int). Function returns nonzero value on error.
16139 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
16140 register_incomplete_type, jdep_resolve_class): New functions to
16141 handle incomplete types in declarations.
16142 (java_complete_class): Rewritten to work with the new incomplete
16143 type handling scheme.
16144 (complete_class_report_errors): Likewise.
16145 (complete_method_decl): Removed: it jobs is now handled by
16146 java_complete_class.
16147 (do_resolve_class): Class loaded in not already loaded and not
16148 found in Java source code.
16149 (java_check_regular_methods, java_check_abstract_methods): Don't
16150 call complete_method_decl anymore.
16151 (lookup_modifier_cl, not_builtin_p): Functions deleted.
16152 (read_import_dir): Got rid of the pass number dependency.
16153 (declare_local_variables): New handling of unresolved types (patch
16155 (source_start_java_method): New parameter level. Function called
16156 with level set to 1 when argument types are potentially
16157 unresolved. Called to complete the job with level set to 2 once
16158 types are complete.
16159 (source_end_java_method): Call to permanent_allocation
16160 removed. Waiting to be replaced by a more suitable obstack
16162 (java_complete_expand_methods, java_complete_expand_method,
16163 java_expand_finals): New functions.
16164 (build_method_invocation_stmt): Renamed
16165 patch_method_invocation_stmt. Extracts function call expression
16166 (wfl) and arguments (args) from CALL_EXPR tree operands.
16167 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
16168 call. Patch the function and argument operand of the CALL_EXPR
16170 (patch_argument, java_complete_tree): New functions.
16172 1998-04-20 Per Bothner <bothner@cygnus.com>
16174 Recover from missing fields and methods (i.e. error instead of fatal).
16175 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
16176 * expr.c (expand_invoke): Recover from missing method.
16177 (expand_java_field_op): Recover from missing field.
16178 Inline references to java.lang.{Integer,Char,...}.TYPE.
16179 * typeck.c (get_type_from_signature), java-tree.h: New function.
16180 * class.c (add_method): Use get_type_from_signature.
16181 (build_class_ref): Handle a class that was not found.
16182 * typeck.c (convert): Handle conversion to pointers (for convenience).
16183 * verify.c (verify_jvm_instructions): Use get_type_from_signature
16184 instead of lookup_field to handle missing fields.
16186 * jcf-parse.c (process_zip_dir): Set java_source.
16188 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
16190 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
16192 1998-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
16194 * jcf-parse.c (load_class): Don't change input_filename before
16195 calling jcf_parse_source (but still do it before calling
16197 (jcf_parse_source): Assign input_filename after having saved the
16199 * lex.c (java_init_lex): Chain a WFL node to the import on demand
16200 list. ctxp->modifier_ctx zeroed according to its new
16201 definition. ctxp->filename initialized. Removed
16202 JAVA_MODIFIER_CTX_UNMARK.
16203 (java_unget_unicode): Update the character based column position.
16204 (java_allocate_new_line): ref_count not used anymore. Always free
16205 ctxp->p_line. Initialize c_line->char_col to 0.
16206 (java_get_unicode): Update the character based column position.
16207 (java_lex): Use ctxp->elc to store current position in source
16208 file, at the beginning of the parsed token. Set modifier_ctx entry
16209 corresponding to the parse modifier to a WFL node. Return a WFL
16210 node when an identifier is parsed.
16211 (java_lex_error): Now uses ctxp->elc to store current position in
16213 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
16214 * lex.h (build_wfl_node): New function definitions.
16215 (struct java_line): ref_count and next fields are gone. New field
16217 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
16218 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
16219 (JAVA_COLUMN_DELTA): New macro.
16220 (java_lc): New typedef on new struct _java_lc.
16221 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
16222 (parse_error_context, parse_warning_context): Changed prototypes.
16223 (java_get_line_col): Added as an available global function.
16224 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
16225 (IC_DECL): Replaced by macro IC_TYPE
16226 (DEPEND_WFL): New macro.
16227 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
16229 (exit_java_complete_class): Removed a commented out statement.
16230 (struct parser_ctxt): Added comments on fields. modifier_ctx is
16231 now an array of tree nodes. Deleted fields line_list and
16232 e_line. New field elc, to replace e_line.
16233 * parse.y (array_type:): Build WFL node.
16234 (qualified_name:): Build a single WFL node out of two. Retain
16235 the location information of the first node in the resulting node.
16236 (package_declaration:): Use package name as a WFL node
16237 (single_type_import_declaration:): Use imported name as a WFL node.
16238 (type_import_on_demand_declaration:): Use root of the imported
16239 packages as a WFL node.
16240 (field_declaration:): Removed unused local variable cl.
16241 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
16242 (yyerror): New static elc. Removed static error_line, error_pos.
16243 New local code_from_source. Save ctxp->elc into elc at the first
16244 pass. Call java_get_line_col to get a string of the line where
16245 the error occurred.
16246 (debug_line): Removed static function.
16247 (parse_error_context, parse_warning_context): Parameter cl is now
16248 a WFL node. Use its value to initialize ctxp->elc.
16249 (redefinition_error): Parameter cl is now a WFL node.
16250 (parse_add_interface): New parameter wfl. No longer call
16251 lookup_cl, use wfl instead.
16252 (check_class_interface_creation): Parameter cl is now a WFL node.
16253 (maybe_create_class_interface_decl): Likewise.
16254 (add_superinterfaces): New function.
16255 (create_interface): Removed local cl, node, super_decl,
16256 super_decl_type. Function now uses id as a WFL node. Better
16257 warning/error report on obsolete or forbidden mix of
16258 modifiers. Now calls add_superinterfaces to register interfaces.
16259 (create_class): Removed local cl, node. Local variable id is used
16260 as a WFL node. Better error report on forbidden modifier
16261 mix. Uses add_superinterfaces to register interfaces.
16262 (find_field): Argument cl is now a WFL node. Now store the WFL
16263 node of a fields that needs to be checked for their
16265 (method_header): Local variable node non longer used. Local
16266 variable id replaces cl.
16267 (check_modifiers_consistency): Local variable cl is now a WFL
16269 (method_declarator): Local variable cl replaced by parameter id.
16270 (parser_qualified_name): Now uses parameter name as a WFL node.
16271 (parser_check_super_interface): New parameter wfl, for achieve
16272 greater accuracy during error reports.
16273 (parser_chain_incomplete_item): New parameter named location. Used,
16274 along the decl, to construct the incomplete item node.
16275 (java_complete_class): resolve_class now uses WFL node extracted
16276 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
16278 (complete_method_decl): Unresolved function's argument types are WFL.
16279 (resolve_class): Parameter cl is now a WFL node.
16280 (resolve_and_layout): Likewise.
16281 (do_resolve_class): Likewise. Try first to use cl and then do the
16282 lookup on the decl when calling check_pkg_class_access.
16283 (complete_class_report_errors): Use IC_TYPE in place of
16284 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
16285 instead of doing a lookup over the decl.
16286 (java_check_final): Use WFL info from field tree list.
16287 (lookup_cl): Rewritten and returns a statically defined WFL node.
16288 (lookup_modifier_cl): Now uses information from WFL nodes.
16289 (process_imports): Likewise.
16290 (read_import_dir): name and cl arguments replaced by a single WFL
16291 node. Function modified accordingly.
16292 (find_in_imports_on_demand): Now uses WFL node.
16293 (check_pkg_class_access): cl argument is now a WFL node.
16294 (declare_local_variables): Fixed to use WFL nodes.
16295 (resolve_expression_name): Likewise.
16296 (build_method_invocation_stmt): name_combo argument renamed
16297 wfl. Function modified to use WFL nodes.
16298 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
16299 (lookup_method_invoke): cl is now a WFL node. Added missing
16300 IDENTIFIER_POINTER to class type decl name.
16302 1998-04-14 Dave Brolley <brolley@cygnus.com>
16304 * lang.c (init_parse): Now returns char* containing the filename.
16306 1998-04-10 Per Bothner <bothner@cygnus.com>
16308 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
16310 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
16311 * class.c (make_class_data): If flag_assume_compiled, initial class
16312 state is CSTATE_PREPARED; make superclass and interfaces direct
16313 references, rather than constant pool indexes.
16315 1998-04-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
16317 * parser.y: Include flags.h. Removed debug variable pl.
16318 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
16319 (block:): Likewise.
16320 (labeled_statement_nsi:): Generate debug info when reducing
16321 expression_statement:.
16322 (check_pkg_class_access): get_access_flags_from_decl invocation
16323 fixed for new CLASS_* flags location.
16324 (source_end_java_method): Save/restore parser context when
16325 entering/leaving this routine. Restore lineno to its right value
16326 before calling expand_end_bindings.
16327 (build_method_invocation_stmt): build_invoke called with the
16328 current line information.
16329 (build_invoke): New argument cl. Wrap the function call around a
16331 (refine_accessible_methods_list): Changed comment, removed
16333 * parse.h: Fixed typo in comments.
16334 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
16335 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
16336 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
16338 * lex.c (java_lex): Record the last closing curly bracket of a
16340 * jcf-parse.c (jcf_parse_source): Now calls
16341 java_check_methods. Clarified comment, fixed typo.
16343 1998-04-09 Dave Brolley <brolley@cygnus.com>
16345 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
16346 (finish_parse): Expose for non USE_CPPLIB builds.
16348 1998-04-08 Jeffrey A Law (law@cygnus.com)
16350 * lang.c (lang_print_xnode): New function.
16352 1998-04-03 Per Bothner <bothner@cygnus.com>
16354 * decl.c (class_dtable_decl), java-tree.h: New tree node.
16355 * class.c (get_dispatch_vector, get_dispatch_table): New functions
16356 used to build a class's dispatch table.
16357 (make_class_data): Generate dispatch table if flag_assume_compiled.
16358 Set dtable of class object to address of class_dtable_decl.
16360 * decl.c (int_decl_processing): Make soft_badarrayindex_node
16361 be volatile and have side effects - generates better code.
16363 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
16364 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
16366 * expr.c (expand_invoke): If class is final, method is
16367 effectively final, so can call it directly.
16369 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
16371 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
16373 1998-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
16375 * parse.y (build_method_invocation_stmt): Removed extra argument
16378 1998-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
16380 * expr.c (dtable_indent): Now static global.
16381 (expand_invoke): Now call invoke_build_dtable and
16382 build_invokevirtual.
16383 (invoke_build_dtable, build_invokevirtual): New functions.
16384 * jcf-io.c (find_class): Defer issuing a warning by setting
16385 jcf->outofsynch to 1.
16386 * jcf-parse.c (jcf_out_of_synch): New function.
16387 (load_class): Test this_jcf.outofsynch flag and call
16388 jcf_out_of_synch accordingly.
16389 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
16390 comment indentation.
16391 * lex.c (java_get_unicode): Fixed code indentation.
16392 (java_lex): Create string literal. Fixed typo. Removed several
16393 premature obstack_free.
16394 * parse.h: New enums for name resolution and invocation mode.
16395 (struct qualification): New data structure.
16396 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
16397 (do_resolve_class, build_method_invocation_stmt,
16398 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
16399 debug_line, identical_subpath_p, invocation_mode,
16400 refine_accessible_methods_list, build_invoke,
16401 lookup_method_invoke): New functions declared.
16402 (build_invokevirtual, invoke_build_dtable, match_java_method,
16403 build_field_ref, jcf_out_of_synch): New references to external
16405 (struct parse_ctxt): Removed artificial_constructor field.
16406 * parse.y: (array_type:): Type defined for this rule.
16407 (class_type:): Installed default rule for interface_type:.
16408 (array_type:): Now build Java array type.
16409 (qualified_name:): Now use obstack_grow0.
16410 (method_declaration:): Skip the artificial constructor added to
16412 (abstract_method_declaration:): Execute the code only during pass 1.
16413 (block:): Installed default rule in block_statements:.
16414 (block_statement:): Add the statement to the method during pass 2.
16415 (statement_expression): Installed default rule for
16416 method_invocation:.
16417 (argument_list:): Added code to build the argument list.
16418 (method_invocation:): Added call to create the method invocation
16420 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
16421 (debug_line): New function for debug.
16422 (complete_class_decl): No longer do something during pass 1.
16423 (method_header): Use BUILD_PTR_FROM_NAME.
16424 (parser_qualified_classname): Use obstack_grow0. Removed bogus
16426 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
16427 function's main comment.
16428 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
16430 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
16431 (resolve_class): Now works with arrays.
16432 (do_resolve_class, resolve_and_layout): New functions.
16433 (java_check_regular_methods): Reverse method list before and after
16434 having processed it. No longer set ctxp->artificial_constructor.
16435 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
16436 accordingly. Fixed typo in issued error message. Now use
16438 (find_in_imports_on_demand): Now use obstack_grow0.
16439 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
16440 (source_end_java_method): Call expand_expr_stmt instead of
16441 expand_expr. Calls it before calling expand_function_end.
16442 (java_method_add_stmt): Do nothing if errors were found during
16444 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
16445 (build_method_invocation_stmt, build_invoke, invocation_mode,
16446 lookup_method_invoke, refine_accessible_methods_list,
16447 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
16449 * typeck.c (build_java_signature): Properly end method signature
16450 if return type skipped.
16451 (match_java_method): New function.
16453 1998-03-16 Per Bothner <bothner@cygnus.com>
16455 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
16457 1998-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
16459 * expr.c (build_invoke_non_interface): New function.
16460 (methods_ident, ncode_ident): Now static globals.
16461 (expand_invoke): Use build_invoke_non_interface.
16462 * java-tree.h (struct lang_decl): New field function_decl_body.
16463 (DECL_FUNCTION_BODY): New macro.
16464 * jcf-parse.c (jcf_parse_source): Deeper check before setting
16465 CLASS_FROM_SOURCE_P.
16466 (parse_source_file): Fixed typos. Call java_layout_parsed_class
16467 before starting pass 2. Call to java_generate_parsed_class replaced
16468 by java_register_parsed_class.
16469 * lex.c: Fixed typo in header. Some line width related formating.
16470 * lex.h: Some line width related formating.
16471 * parse.h (source_end_java_method, resolve_expression_name,
16472 complete_class_decl, maybe_create_class_interface_decl,
16473 check_class_interface_creation): New static function declarations.
16474 (java_layout_parsed_class, java_method_add_stmt): New function
16476 (struct parser_ctxt): Field mark_class_generate removed. New
16477 fields class_list and artificial_constructor.
16478 * parse.y: Fixed typo in header.
16479 (class_declaration:): Call complete_class_decl when class body
16481 (method_declaration:): Call source_end_java_method in pass 2 when
16482 the method body is defined.
16483 (postfix_expression:): Do expression name resolution on sub-rule
16484 name during pass 2.
16485 (create_class, create_interface): Merged common pieces.
16486 (check_class_interface_creation, maybe_create_class_interface_decl):
16488 (complete_class_decl): New function.
16489 (register_fields): Fixed line width related typo.
16490 (method_header): Correctly skip first argument when fixing
16491 argument line. Changed the loop.
16492 (java_check_circular_reference): Now use ctxp->class_list.
16493 (java_complete_class): Removed start/stop marking.
16494 (java_check_regular_methods): Now takes a class decl as an
16495 argument. Add default constructor if none were encountered.
16496 (java_check_methods): Now use ctxp->class_list. Changed call to
16497 java_check_regular_methods.
16498 (source_start_java_method): Set DECL_ARG_TYPE for each function
16500 (source_end_java_method, java_method_add_stmt): New functions.
16501 (java_generate_parsed_class): No longer exists.
16502 (java_layout_parsed_class, java_register_parsed_class): New functions.
16503 (resolve_expression_name): New function.
16505 1998-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
16507 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
16508 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
16509 until pass initializations are done. Call read_import_dir with
16511 * parse.h: (lookup_modifier_cl): New function declared.
16512 (INTERFACE_FIELD_MODIFIERS): New macro.
16513 (OBSOLETE_MODIFIER_WARNING): New macro.
16514 * parse.y: (register_fields): Class type and current field name in
16515 local variables. Check modifier(s) if adding field(s) to an interface.
16516 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
16517 and report errors using the faulty modifier line context.
16518 (lookup_modifier_cl): New function.
16519 (read_import_dir): Detect and report default import processing
16522 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
16524 Add a pair of -fassume-compiled/-fno-assume-compiled options.
16525 * class.c (is_compiled_class): Return 1 after making sure it
16526 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
16527 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
16528 * java-tree.h (flag_assume_compiled): Add decl.
16529 * lang.c (lang_f_options): Add the flag.
16530 (flag_assume_compiled): Add decl, default to 0.
16532 1998-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
16534 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
16535 (is_compiled_class): Likewise.
16536 (layout_class): Likewise.
16537 (layout_class): Detect and lay out classes defined in source code.
16538 (interface_of_p, add_interface_do, may_add_interface): New
16540 (add_interface): Now use add_interface_do.
16541 (add_method_1): New function.
16542 (add_method): Now use add_method_1.
16543 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
16544 (complete_start_java_method): New function.
16545 (start_java_mehod): Now call complete_start_java_method.
16546 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
16547 (expand_invoke): Likewise and fixed typo.
16548 *gjava.c: (print_super_field): Use new argument to find_class
16551 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
16552 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
16553 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
16555 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
16556 (add_method_1, push_class): New prototypes.
16557 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
16558 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
16559 directory where the class was found.
16560 (find_class): New argument DO_CLASS_FILE. Function find_class
16561 modified accordingly.
16562 *jcf-parse.c: (fix_class_path): New function.
16563 (load_class): Use new VERBOSE argument. load_class now finds and
16564 loads/parses .class/.java files. Save read_state of current_jcf
16566 (java_parser_abort_on_error): New macro.
16567 (jcf_parse_source, parse_source_file): New function.
16568 (jcf_parse): Fixed typo.
16569 (yyparse): Call parse_source_file () only.
16570 (process_zip_dir): Fixed typo, fix zdir->filename_length when
16571 writing the real class name back in the zip directory entry.
16572 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
16573 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
16574 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
16575 (find_class): Prototype fixed.
16576 *lex.c: Added 1998 time stamp.
16577 Removed all static global variables, moved into the parser
16578 context data structure.. Now include unistd.h if SEEK_SET not
16580 (java_init_lex): Rewritten.
16581 (java_sneak_unicode): Modified current unicode access in current line.
16582 (java_unget_unicode): Likewise.
16583 (java_allocate_new_line): New allocation management.
16584 (java_read_char): Modified access and storage of unget_utf8_value.
16585 New way of processing current unicode.
16586 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
16587 (java_get_unicode): Now use the parser context.
16588 (java_lineterminator): Likewise.
16589 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
16590 of the reentrant parser implementation. Function now use the
16591 parser context data structure and java_lval. Fixed production of
16592 the float and double constant "out of range" error message. Fixed
16593 obstack use. Return integer value when hitting a modifier. Now
16594 return type for TRUE, FALSE and other predefined types. Return
16595 identifier as a TREE_LIST list containing the current line context
16596 as the TREE_VALUE sub-node.
16597 (java_unicode_2_utf8): Fixed typo in declaration.
16598 (java_lex_error): Now use the parser context data structure.
16599 *lex.h: Added 1998 time stamp.
16600 (struct java_line): New fields ref_count and next.
16601 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
16602 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
16603 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
16604 *parse.h: Added 1998 time stamp.
16605 (java_parse_source_file): Renamed from parse_source_file.
16606 (YYERROR_NOW, YYNOT_TWICE): Fixed.
16607 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
16608 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
16609 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
16610 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
16611 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
16612 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
16613 (struct parser_ctxt): New data structure to keep the parser context.
16614 *parse.y: Added 1998 time stamp, got rid of static global variables.
16615 (java_error_count, ctxp): New global variables.
16616 (%union): New value field.
16617 (numeric_type, integral_type): Rules removed.
16618 (primitive_type): Rule defined to handle integral, float, double and
16620 (qualified_name, package_declaration,
16621 single_type_import_declaration, type_import_on_demand_declaration,
16622 modifiers, class_declaration, super, interfaces,
16623 interface_type_list, class_body, field_declaration,
16624 field_declaration, variable_declarators, variable_declarator,
16625 variable_declarator_id, method_declaration, method_header,
16626 formal_parameter_list, formal_parameter, method_body, block,
16627 static, interface_declaration, extends_interfaces,
16628 abstract_method_declaration, local_variable_declarators): Rules now
16630 (force_error, do_warning): New global statics.
16631 (push_parser_context, parser_context_save_global,
16632 parser_context_restore_global, pop_parser_context): New functions.
16633 (yyerror): Now uses the global parser context. Fixed use of obstack.
16634 (parse_error, parse_error_context, parse_warning_context,
16635 java_accstring_lookup, redefinition_error, check_modifiers,
16636 parser_add_interface, create_interface, create_class, find_field,
16637 duplicate_declaration_error, register_fields, method_header,
16638 check_modifiers_consistency, check_abstract_method_header,
16639 method_declarator, parser_qualified_classname,
16640 parser_check_super_interface, parser_check_super,
16641 parser_chain_incomplete_item, java_check_circular_reference,
16642 layout_class_from_source, java_complete_class,
16643 complete_method_decl, resolve_class, complete_class_report_errors,
16644 java_check_final, check_method_redefinition,
16645 java_check_regular_methods, java_check_abstract_methods,
16646 java_check_methods, lookup_java_interface_method2,
16647 lookup_java_method2, lookup_cl, find_name_in_single_imports,
16648 process_imports, find_in_imports, read_import_entry,
16649 read_import_dir, find_in_imports_on_demand,
16650 check_pkg_class_access, not_builtin_p, declare_local_variables,
16651 source_start_java_method, java_generate_parsed_class): New
16653 *typeck.c: (signature_include_return): New global variable.
16654 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
16655 to add the function returned type in the signature.
16657 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
16659 * jcf-io.c (open_in_zip): Use strncmp and LEN.
16661 1998-01-29 Dave Brolley <brolley@cygnus.com>
16663 * Make-lang.in (java.info): Added.
16664 (java.install-info): Added
16666 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
16668 * Makefile.in (clean): Also remove java/parse.c.
16670 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
16672 Add a pair of -fbounds-check/-fno-bounds-check options.
16673 * lang.c (lang_decode_option): Add code to grok arguments.
16674 (flag_bounds_check): Add decl.
16675 (lang_f_options): New array w/ the option in it.
16676 * java-tree.h (flag_bounds_check): Add decl.
16677 * lang-options.h: New file.
16678 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
16679 of a static macro value.
16680 (JAVA_ARRAY_EXCEPTION): Delete macro.
16682 1998-01-23 Per Bothner <bothner@cygnus.com>
16684 * typeck.c (build_java_array_type): Fix two bugs in previous change.
16685 * expr.c (build_anewarray): Add missing promote_type.
16687 1998-01-22 Per Bothner <bothner@cygnus.com>
16689 Add array types with known length to optimize bounds checking.
16690 * typeck.c (build_java_array_type): Take length parameter.
16691 (java_array_type_length, build_prim_array_type): New functions.
16692 * java-tree.h: Update for new functions.
16693 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
16694 * class.c: Use build_prim_array_type.
16695 * expr.c (can_widen_reference_to): Handle known-length array types.
16696 (verify_jvm_instructions): Keep track of integer push instructions
16697 followed by newarray/anewarray, so we can build known-length arrays.
16698 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
16699 (java_array_data_offset): New function.
16700 (build_java_array_length_access): New function. Optimize if constant.
16701 (build_java_arrayaccess): Constant fold bounds check.
16702 (expand_java_newarray, expand_java_anewarray): Replaced by ...
16703 (build_newarray, build_anewarray): New functions.
16704 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
16705 * verify.c (merge_types): Handle known-lengh array types.
16707 1998-01-19 Per Bothner <bothner@cygnus.com>
16709 * expr.c (expand_byte_code): Fix performace bug, which caused
16710 searching linenumber_table to be linear rather than constant.
16712 1997-12-12 Per Bothner <bothner@cygnus.com>
16714 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
16716 * decl.c, java-tree.h (soft_fmod_node): New global.
16717 * decl.c (init_decl_processing): Define __builtin_fmod.
16718 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
16719 using __builtin_fmod.
16721 1997-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
16723 * keyword.h: New file, output of keyword.gperf as processed by
16725 * lex.c (java_lex_init): Initialize java_error_flag.
16726 * parse.c (YYERROR_NOW): Uses java_error_flag.
16727 * parse.y: New static java_error_flag. Useless definition of
16729 * parse.y (java_error): Portable error recovery using
16730 java_error_flag (not yet completely tuned).
16732 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
16734 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
16736 1997-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
16738 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
16739 (parse.c, lex.c, keyword.h): New rules for Java source code
16741 * parse.c: Renamed into jcf-parse.c.
16742 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
16743 * keyword.gperf: New file, Java keywords.
16744 * parse.y: New file, Java language grammar.
16745 * parse.h: New file, Java language grammar definitions.
16746 * lex.c: New file, Java language lexer.
16747 * lex.h: New file, Java language lexer definitions.
16749 1997-12-03 Per Bothner <bothner@cygnus.com>
16751 * decl.c (clinit_identifier_node), java-tree.h: New global.
16752 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
16753 * verify.c (verify_jvm_instructions): Inline use of removed macros.
16754 * expr.c (expand_java_field_op): Check for invalid assignment
16757 * jcf-reader.c (get_attribute): Test for wrong attribute length.
16759 1997-10-27 Per Bothner <bothner@cygnus.com>
16761 * verify.c (verify_jvm_instructions): When processing a handler,
16762 attempt to set the current_subr to the right value.
16763 (More complicated code combines Sep 17 and Oct 22 versions.)
16765 1997-10-24 Per Bothner <bothner@cygnus.com>
16767 * class.c (push_class): Figure out (guess) name of source file.
16768 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
16769 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
16770 (parse_class_file): Change return type from int to void.
16771 Call debug_start_source_file/debug_end_source_file.
16773 * expr.c (build_java_binop): Fix masking 2nd operand.
16774 * decl.c (init_decl_processing): Set sizetype first.
16776 1997-10-22 Per Bothner <bothner@cygnus.com>
16778 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
16779 (Revert Sep 17 change.)
16781 1997-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
16783 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
16784 .class extension in their name and fix thing so we don't process
16785 them parse_zip_file_entries().
16786 (parse_zip_file_entries): Cleaned unused local variables.
16788 1997-10-20 Per Bothner <bothner@cygnus.com>
16790 * expr.c (can_widen_reference_to): Allows equal array element types.
16791 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
16792 * jcf-dump.c (RET): Get (and print) index.
16794 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
16795 Promote element type to POINTER_TYPE.
16797 1997-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
16799 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
16800 find_in_current_zip, jcf_figure_file_type): Moved from
16801 jcf-reader.c to parse.c.
16802 * zextract.c: (read_zip_archive): takes file_comment_length possible
16803 field into account.
16805 1997-10-20 Per Bothner <bothner@cygnus.com>
16807 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
16809 * verify.c (merge_types): Handle array types even better ...
16811 1997-10-17 Per Bothner <bothner@cygnus.com>
16813 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
16815 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
16816 * class.c (make_class_data): Don't build fields_decl if no fields.
16817 When building fields_decl, skip if DECL_ARTIFICIAL.
16819 * expr.c (java_stack_swap): Update stack_type_map.
16820 * verify.c (merge_types): Handle array types better.
16822 1997-10-15 Per Bothner <bothner@cygnus.com>
16824 * class.c (add_field): Don't promote short integral fields to
16825 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
16826 * expr.c (push_value): Promote and convert short integral values.
16828 * decl.c, java-tree.h (integer_two_node): New constant node.
16829 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
16831 1997-10-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
16833 * class.c (append_gpp_mangled_type): Use function argument
16834 unpromoted type to generate mangled name.
16836 1997-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
16838 * constants.c (build_constant_data_ref): Now uses current_class
16839 instead of main_class.
16840 (build_constants_constructor): Now uses current_class instead of
16842 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
16843 of the global variable SeepZipFiles done here.
16844 * zextract.c (read_zip_archive): extra_field optional field taken
16845 into account while computing the position of the class file in the
16847 * verify.c (verify_jvm_instructions): Use current_jcf to search
16849 * parse.c (load_class): First search for the class to load in the
16850 current zip file. Saves current_jcf (restored before returning
16851 from that function). Don't call JCF_FINISH in the class was found
16852 in the current ZIP file.
16853 (jcf_parse): If the class was found in the current ZIP file, save
16854 its tree_constant_pool (for later reuse).
16855 (parse_class_file): New function. Process each method defined in
16856 the current class and record the class as to be later registered.
16857 (yyparse): Rewritten. Figure the type of the current file and switch
16859 * lang.c: New global variable current_jcf.
16860 (lang_init): Removed compiling_from_source test (done later, in
16861 yyparse). Removed call the jcf_parse ().
16862 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
16863 (typedef struct JCF): New fields seen_in_zip (to mark a class found
16864 in the current ZIP file) and zip_offset (offset to the class data in
16865 the current zip file).
16866 * jcf-reader.c: zipfile.h included.
16867 localToFile: New ZipFileCache static global variable
16868 (parse_zip_file_entries): New function. Browse the current ZIP
16869 file directory and process each class found.
16870 (process_zip_dir): New function. Register each class found in the
16871 ZIP file directory. The class aren't parsed but a valid JCF is
16872 link to each of them.
16873 (find_in_current_zip): New function. Search for a class in the
16874 current ZIP file directory. If found, prepare the class so that it
16876 (jcf_figure_file_type): New function. Examine the file structure
16877 to figure a class file, a ZIP file. If none of these categories are
16878 matched, a source file is assumed.
16879 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
16880 SeenZipFile: New global variable.
16881 (open_in_zip): Use zipmember's length to accelerate the search for
16882 a member. If zipmember was NULL and zip file successfully read,
16884 * java-tree.h: New global variable current_jcf declared. Added
16885 declaration for current_constant_pool_tags, current_constant_pool_data,
16886 current_constant_pool_length, current_constant_pool_data_ref.
16887 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
16888 store the JCF of classes seen in a zip file) and tree *constant_pool
16889 (to save a loaded class constant pool). current_class declared here.
16890 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
16891 retrieve method_ref_constant.
16892 (PUSHC): java_push_constant_from_pool now uses current_jcf.
16893 (OBJECT): get_class_constant now uses current_jcf.
16894 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
16895 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
16896 (expand_invoke): Now uses current_class instead of main_class
16897 (build_class_init): Now uses current_class instead of main_class
16898 * class.c: New static global variable registered_class.
16899 (register_class): New function.
16900 (emit_register_class): Modified to use registered_class instead of
16902 (is_compiled_class): Now take into account class seen in the archive.
16904 1997-10-06 Per Bothner <bothner@cygnus.com>
16906 * except.h: Renamed to: java-except.h.
16907 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
16908 * except.c: Add semi-working (commented out) implementation.
16910 * expr.c (expand_iinc): Add needed flush_quick_stack.
16911 * parse.c (set_source_filename): New function.
16912 (give_name_to_class): Set input_filename from package.classname.java.
16914 * jcf-io.c (find_class): Don't look first in ".".
16916 1997-10-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
16918 * zextract.c (read_zip_archive): Now takes into account the
16920 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
16922 1997-09-20 Per Bothner <bothner@cygnus.com>
16924 * constants.c, java-tree.h (build_internal_class_name): New function.
16925 (alloc_class_constant): Re-implement using build_internal_class_name.
16926 * class.c (make_class_data): Likewise.
16927 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
16929 1997-09-17 Per Bothner <bothner@cygnus.com>
16931 * verify.c (verify_jvm_instructions): Temporarily set current_subr
16932 to NULL before pushing an exception handler target.
16934 * expr.c (flush_quick_stack): Save from low stack indexes to high.
16935 (java_stack_swap, java_stack_dup): Re-write to be safe from
16936 clobbering registers.
16937 (build_class_init): New function.
16939 1997-09-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
16941 * typeck.c (build_java_array_type): Temporary use
16942 permanent_obstack to create the array 'length' field.
16943 * expr.c (lookup_label): Temporay use permanent_obstack to create
16944 label if not found.
16945 * class.c (push_super_field): Tempory use permanent_obstack.
16947 1997-09-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
16949 * typeck.c (type_for_mode): Now handles double_type_node and
16951 * verify.c (verify_jvm_instructions): The instruction following
16952 the wide bytecode is checked. OPCODE_ret added to the list of
16955 1997-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
16957 * class.c (make_class): Temporary use permanent_obstack. Set the
16958 class CLASS_P field to 1.
16959 (push_class): Temporary use permanent_obstack.
16960 (set_super_info): Temporary use permanent_obstack.
16961 (add_method): Temporary use permanent_obstack, set
16962 METHOD_TRANSIENT().
16963 (add_field): Temporary use permanent_obstack. Sets
16964 FIELD_VOLATILE() and FIELD_TRANSIENT().
16965 (build_class_ref): Temporary use permanent_obstack if the class
16967 (build_static_field_ref): Temporary use permanent_obstack when
16968 creating field's rtl.
16969 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
16970 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
16971 and fields. Function finalized, as far as flag handling.
16972 (push_class_static_dummy_field): Temporary use permanent_obstack.
16973 (emit_register_class): Force generation of class registration at
16975 * decl.c (end_java_method): Call permanent_allocation() before
16977 * expr.c (can_widen_reference_to): Added comment to interface
16978 handling, fixed typo.
16979 (lookup_field): Now uses CLASS_P() to correct FIXME
16980 (expand_invoke): Verification on public && !static &&
16981 !abstract moved into soft_lookupinterfacemethod (kaffe).
16982 Use Object class dtable if objectref is an array when expanding
16984 (java_push_constant_from_pool): Temporary use permanent_obstack
16985 for CONSTANT_string
16986 * parse.c (get_ref_constant): Temporary use permanent_obstack to
16987 create constant references.
16988 (get_constant): Temporary use permanent_obstack to create constant.
16989 (load_class): Temporary use permanent_obstack to load class.
16990 (jcf_parse): Temporary use permanent_obstack to perform class
16992 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
16993 (build_java_signature): Temporary use permanent_obstack.
16994 * verify.c: (verify_jvm_instruction): removed unnecessary verification
16996 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
16997 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
17000 1997-09-11 Per Bothner <bothner@cygnus.com>
17002 * class.c (append_gpp_mangled_type): Fix typo.
17003 (emit_register_class): Use main_class to get class object, rather
17004 than looking for no-longer-existing static decl starting with _CL.
17005 * typeck.c (parse_signature_type): Promote array element type
17006 if it is a RECORD_TYPE.
17008 1997-09-10 Per Bothner <bothner@cygnus.com>
17010 * class.c (push_class_static_dummy_field): New function.
17011 (mangle_static_field): New. Do G++-style mangling of static fields.
17012 (layout_class): Mandle static fields here, not in add_field.
17013 (build_class_ref): The class object is now a dummy static field.
17014 * decl.c (find_local_variable): Look for best, instead of first match.
17015 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
17016 (build_java_athrow): Don't check here if exception is Throwable.
17017 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
17018 (TYPE_USED): Removed. No longer used ...
17019 * parse.c (jcf_parse): Call push_class_static_dummy_field.
17020 * verify.c (push_pending_label): New function.
17021 (push_pending_block): Renamed to check_pending_block.
17022 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
17023 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
17024 re-checking possible handlers) after a store (less wasted work).
17025 Check for null handler (finally) before calling add_handler.
17026 Various changes to (finally?) correctly handle try/finally.
17028 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
17030 * class.c: Include stdio.h.
17032 1997-09-04 Per Bothner <bothner@cygnus.com>
17034 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
17035 to make sure class is initialized before static/special invoke.
17037 * verify.c (verify_jvm_instructions): On a store instruction,
17038 call find_local_variable to force pre-allocation of decl and rtx.
17039 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
17041 1997-09-03 Per Bothner <bothner@cygnus.com>
17043 * class.c (build_class_ref): Strip off "promoted_" if need be.
17044 (make_field_value): Call build_java_signature when needed.
17045 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
17046 * expr.c (build_java_athrow): Don't push_value of exception.
17047 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
17048 match specification of [fd]cmp[lg] for NaNs.
17049 (expand_byte_code): Add support for exception handler ranges.
17050 * except.c: Add skeleton for EH code-generation.
17051 * verify.c (merge_types): Treat all promoted integral types as equal.
17052 * constants.c (build_constants_constructor): To force creation of
17053 current_constant_pool_data_ref, call build_constant_data_ref.
17055 * javaop.def (lload): Fix typo.
17056 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
17058 1997-09-02 Brendan Kehoe <brendan@lisa.cygnus.com>
17060 * parse.c: Don't include function.h.
17062 1997-08-27 Per Bothner <bothner@cygnus.com>
17064 * except.[ch]: New files.
17065 * Makefile.in (JAVA_OBJS): Add except.o
17066 * expr.c: Temporary warning about unimplemented exceptions.
17067 * verify.c: Verify exception handlers.
17069 * jcf-dump.c (disassemble_method): Print exception table.
17071 1997-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
17073 * expr.c (verify_jvm_instructions): Started a thorough
17074 verification of invoke* bytecodes.
17075 (expand_byte_code): flush quick stack if PC is the target of a
17076 branch. and undef RET (conflicting with config/i386/i386.h).
17077 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
17079 (expand_invoke): Now handles invokeinterface and do more
17080 verification according to the bytecode.
17081 (lookup_field): Don't try to load the class if processing
17083 (can_widen_reference_to): Now handles interfaces.
17084 * decl.c (init_decl_processing): New global variable
17085 soft_lookupinterfacemethod_node, declared in java-tree.h.
17086 Call set_super_info on string_type_node.
17087 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
17089 * class.c (set_super_info): Fills the CLASS_* flags according to
17091 (get_access_flags_from_decl): Handles all class flags.
17093 1997-08-26 Per Bothner <bothner@cygnus.com>
17095 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
17096 * parse.c (yyparse): Check for abstract method, and missing code.
17097 * expr.c (expand_byte_code): Change interface.
17098 * lang.c (put_decl_node): Print promoted types prettier.
17099 * verify.c (verify_jvm_instruction): Change interface.
17100 Partial support for scanning exception table.
17101 For load instructions, handle promoted integral types.
17103 1997-08-21 Per Bothner <bothner@cygnus.com>
17105 * verify.c: New file, with contents moved from expr.c.
17106 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
17107 * typeck.c (is_array_type_p): Moved here from expr.c.
17108 * java-tree.h: Add some now-needed function declarations.
17109 * Makefile.in (JAVA_OBJS): Added verify.o.
17111 1997-08-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
17113 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
17114 METHOD_ABSTRACT flag.
17116 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
17117 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
17118 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
17120 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
17122 (start_java_method): Hook for SYNCHRONIZED methods.
17124 * expr.c (build_java_jsr, build_java_ret): New functions
17125 (JSR,PRE): New macros
17126 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
17127 (verify_jvm_instructions): tableswitch, lookupswitch,
17128 monitorenter, monitorexit, goto_w: verified.
17129 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
17130 (build_java_monitor): New function.
17131 (MONITOR_OPERATION): Modified to call build_java_monitor()
17132 (verify_jvm_instructions): Started a thorough verification of
17135 1997-08-19 Per Bothner <bothner@cygnus.com>
17137 Support verification of jsr/ret subroutines (used for try/finally).
17138 * decl.c (return_address_type_node): New type node.
17139 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
17140 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
17141 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
17142 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
17143 TYPE_USED): New macros for special types in type_map.
17145 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
17146 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
17148 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
17150 * expr.c (can_widen_reference_to): New function.
17151 (pop_type): Use it.
17152 (merge_type_state): Support handling start of subroutine.
17153 (push_pending_block): Return char* error message, instead of calling
17154 fatal on an error. Also handle subroutines.
17155 (verify_jvm_instructions): Handle errors from push_poending_block.
17156 Support jsr and ret instructions.
17158 1997-08-19 Per Bothner <bothner@cygnus.com>
17160 * jcf-io.c (find_classfile): Fix thinko.
17161 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
17163 1997-08-12 Jason Merrill <jason@yorick.cygnus.com>
17165 * Makefile.in (BISON): Remove.
17167 1997-08-07 Per Bothner <bothner@cygnus.com>
17169 * Makefile.in: Convert to autoconf.
17170 * config-lang.in (outputs): Added java/Makefile.
17172 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
17173 Rename cc1java to jc1.
17175 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
17176 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
17178 * class.c (class_depth): Do load_class if needed.
17180 Mostly better verification.
17181 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
17182 (init_decl_processing): Change return type of soft_checkcast.
17183 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
17184 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
17185 lang_print_error): New functions.
17186 (lang_init): Set global hook print_error_function to lang_print_error.
17187 * expr.c: In the type_map ptr_type_node is only used for null now.
17188 (pop_type, merge_types): Hence ptr_type_node matches any reference.
17189 (merge_types): Dererence pointer to record types before comparing.
17190 (decode_newarray_type, merge_types): On error just return NULL.
17191 (build_java_binop): Add preliminary implementation (with warning)
17192 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
17193 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
17194 (expand_compare, expand_java_goto, expand_java_call): Don't
17195 push_pending_block, since that only makes sense when verifying.
17196 (merge_type_state): Different return codes.
17197 (push_pending_block): A block may need to be verified more than once.
17198 (expand_byte_code): Warn about unused code at code generation time.
17199 (verify_jvm_instruction): Changed logic, since code may need to be
17200 re-verified if type-state has changed. Also, better error handling.
17201 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
17202 Improve newarray, anewarray, ?aload, athrow,
17203 * java-tree.h (LABEL_CHANGED): New macro.
17205 1997-08-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
17207 * decl.c (soft_athrow_node): New global variable initialized.
17208 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
17209 * typeck.c (convert): Added support for REAL_TYPE.
17210 (convert_to_char): New function.
17211 (convert): Handle CHAR_TYPE.
17212 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
17213 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
17214 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
17216 (verify_jvm_instructions): Added break a the end of bogus unop: label.
17217 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
17218 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
17219 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
17220 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
17221 to Use The Right Things.
17222 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
17223 compatible with INT. BOOLEAN is made equivalent to BYTE.
17224 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
17225 OPCODE_ifnonnull): Now supported.
17226 (build_java_athrow): New function.
17228 1997-08-04 Per Bothner <bothner@cygnus.com>
17230 Rename method name <init> to match G++ (and fix mangling).
17231 * class.c (layout_class): Replace method name of <init> by class name.
17232 (make_method_value): Do inverse renaming of constructor from <init>.
17233 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
17234 * typeck.c (lookup_java_constructor): New function.
17235 * expr.c (expand_invoke): If method_name is <init>, call
17236 lookup_java_constructor to find constructor.
17238 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
17240 1997-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
17242 * parse.c (get_class_constant): Modified to handle array "classes"
17243 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
17245 (convert): Modified to handle real type.
17246 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
17247 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
17248 variables declared.
17249 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
17250 soft_multianewarray, soft_newarray_node, soft_throw_node): New
17251 global variables initialized.
17252 (find_local_variable): Handles the case of a pointer
17253 (end_java_method): Restore the use of one more scope
17254 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
17255 build_java_array_length_access, expand_java_arrayload,
17256 expand_java_arraystore, expand_java_array_length,
17257 expand_java_multianewarray, expand_java_anewarray,
17258 build_java_check_indexed_type, is_array_type_p,
17259 build_java_throw_out_of_bound_exception): New functions.
17260 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
17261 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
17262 OPCODE_<t>aload): Implemented code for verification.
17263 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
17264 ARRAY_NEW_MULTI): Macro defined.
17265 (CONVERT): Modified to invoke convert().
17266 (case OPCODE_aload2): Fixed index typo from 2 to 1.
17268 1997-07-31 Per Bothner <bothner@cygnus.com>
17270 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
17271 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
17272 (make_class_data): Field name needs '/' as package prefix.
17273 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
17275 1997-07-25 Per Bothner <bothner@cygnus.com>
17277 Implement debug information for local variables.
17278 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
17279 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
17280 DECL_LOCAL_SLOT_CHAIN): New macros.
17281 (struct lang_decl_var): New type.
17282 * parse.c (give_name_to_locals): Move to decl.c.
17283 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
17284 (start_java_method): Re-write parameter handling.
17285 (pending_local_decls): New global variable.
17286 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
17287 (find_local_variable): Accept pc so we can skips decls not in range.
17288 (struct binding_level): Add end_pc field.
17289 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
17290 (various): Change so current pc gets passed to find_local_variable.
17292 * decl.c (init_decl_processing): Re-arrange fields in
17293 class_type_node and and method_type_node to match kaffe 0.9.1.
17294 * class.c (make_method_value, make_class_data): Update
17295 initializations to match.
17297 1997-07-16 Per Bothner <bothner@cygnus.com>
17299 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
17300 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
17301 (push_super_field): New function.
17302 (make_class_data): Handle inheritance of class static initializer.
17303 (layout_class): New name mangling.
17304 * constants.c (build_constant_data_ref): Init type of data array
17305 to a one-element array.
17306 (build_constants_constructor): Set DECL_SIZE from complete array type.
17307 * decl.c: Rename class_type, object_type etc to class_type_node,
17308 object_type_node etc. Make former inherit from latter.
17309 * expr.c (expand_invoke): Add cast of function address.
17310 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
17311 * parse.c (yyparse): Don't call layout_class here.
17312 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
17314 1997-06-14 Per Bothner <bothner@cygnus.com>
17316 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
17317 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
17318 (alloc_class_constant): New.
17319 * expr.c (expand_invoke): Make sure method's class is initialized.
17320 * class.c (interits_from_p, emit_register_class): New functions.
17321 * parse.c (yyparse): Call emit_register_class.
17323 1997-06-09 Per Bothner <bothner@cygnus.com>
17325 * constants.c: New file, to handle constant pool.
17326 * Makefile.in (JAVA_OBJS): Add constants.o.
17327 * decl.c (init_decl_processing): Update, fix, finish various structs.
17328 (pushdecl_top_level): New.
17329 * parse.c (layout_class): Moved to class.c.
17330 * expr.c (java_push_constant_from_pool): New function.
17331 * class.c (build_class_ref): Make work fully
17332 (make_class_data): Emit super-class, constant pool, interface vector.
17334 1997-06-03 Per Bothner <bothner@cygnus.com>
17336 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
17337 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
17338 * class.c (class_depth): New function.
17339 (lookup_named_class): Replaced by new function lookup_class.
17340 * decl.c (object_type_node, string_type_node): New.
17341 Remove various types that we no longer need.
17342 * expr.c (verify_jvm_instructions): New separate verifier pass.
17343 (push_type, pop_type): New functions for verifier.
17344 (type_stack_dup, pop_argument_types, merge_types): Likewise.
17345 (expand_byte_code): Simplify, since we assume already verified.
17346 (expand_invoke): Now mostly works.
17347 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
17348 * lang.c (main_class): Move to parse.c. Don't make_class yet.
17349 * parse.c: Wait to allocate class object until we know its name.
17350 (layout_class): Calculate DECL_VINDEX for each virtual method.
17351 * typeck.c (get_array_type): Rename to ...
17352 (build_java_array_type): ... and provide working implementation.
17353 (build_java_signature): New function - build Java signature of type.
17354 (set_java_signature): New function - cache signature with type.
17355 (lookup_java_method): New function.
17357 1997-05-06 Per Bothner <bothner@deneb.cygnus.com>
17359 * class.c (ident_subst): Take extra SUFFIX parameter.
17360 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
17361 (set_constant_value, build_static_field_ref, is_compiled_class): New.
17362 (build_class_ref): Actually implement.
17363 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
17364 * decl.c (builtin_function): New.
17365 (init_decl_processing): Update for current Kaffe. Declare some
17366 builtin Kaffe functions.
17367 * expr.c (build_address_of): New.
17368 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
17369 Renamed (from expand_java_new etc), and added working implementations.
17370 (build_field_ref): Now also handle static fields.
17371 (expand_invoke): Implement invokestatic, and start implement rest.
17372 * java-opcodes.h: Use javaop.def to avoid duplicated list.
17373 * javaop.def: Rename invokevirt -> invokevirtual.
17374 * lang.c (use_handles): Removed.
17375 * parse.c: Add support for ConstantValue attribute.
17376 Handle nested loading of a class. (JPOOL_UTF): New.
17378 1997-03-11 Per Bothner <bothner@deneb.cygnus.com>
17380 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
17382 1997-02-27 Per Bothner <bothner@deneb.cygnus.com>
17384 * Make-lang.in (java.install-man): New empty rule.
17385 * typeck.c (set_local_type): New function.
17386 * expr.c (STORE_INTERNAL): Call find_local_variable,
17387 not find_stack_slot. Call set_local_type.
17389 1997-02-12 Per Bothner <bothner@kalessin.cygnus.com>
17391 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
17392 and building RECORD_TYPE CONSTRUCTORs.
17393 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
17395 * lang.c (use_handles): Change the default to 0.
17396 * decl.c: Define and build class_type, field_type, utf8const_type.
17397 * class.c (make_class_data, make_field_value,
17398 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
17399 hashUtf8String, strLengthUtf8, mangled_classname:
17400 Functions to build reflective data structures.
17401 * parse.c (yyparse): Call make_class_data.
17403 * jcf-io.c (open_class, find_classfile): New functions.
17404 * jcf-dump.c: Support reading classfile from explicitly-named
17405 class file (without CLASSPATH searching).
17407 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>
17409 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
17410 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
17411 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
17412 (get_constant): Now trivial for CONSTANT_Utf8.
17414 * jcf.h: Make NEW_CPOOL the default.
17415 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
17417 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>