1 2005-04-18 Andrew Haley <aph@redhat.com>
3 * java-except.h (struct eh_range.handler): Remove unused field.
4 (handle_nested_ranges): Remove function declaration.
5 (sanity_check_exception_range): Add function declaration.
6 * verify.c (verify_jvm_instructions): Remove call to
8 * verify-glue.c (verify_jvm_instructions_new): Call
9 sanity_check_exception_range.
10 * except.c (link_handler, eh_range_freelist, link_handler,
11 handle_nested_ranges): Remove.
12 (add_handler): Rewrite.
13 (sanity_check_exception_range): New function.
14 (print_ranges): New function.
16 2005-04-13 Julian Brown <julian@codesourcery.com>
18 * decl.c (finish_method): Give methods once-only linkage.
20 2005-04-11 Richard Sandiford <rsandifo@redhat.com>
22 * lang.opt: Refer to the GCC internals documentation instead of c.opt.
24 2005-04-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
26 * java-tree.h: Don't use PARAMS().
28 2005-04-07 Per Bothner <per@bothner.com>
30 * class.c (push_class): By default, suppress debug output.
31 (finish_class): Enable debug output for classes we're emitting.
33 2005-04-07 Andrew Haley <aph@redhat.com>
35 * gcj.texi: Correct gcj-dbtool instructions.
37 2005-04-04 Kazu Hirata <kazu@cs.umass.edu>
39 * gcj.texi: Fix a typo.
40 * lang.c: Fix a comment typo.
42 2005-04-01 Thomas Fitzsimmons <fitzsim@redhat.com>
44 * gcj.texi (Invoking gij): Add descriptions of new -X options.
45 Mention recognized-and-ignored compatibility options.
46 (Memory allocation): Add descriptions of JvMalloc, JvRealloc and
48 (About CNI): Add Memory allocation section.
50 2005-04-01 Tom Tromey <tromey@redhat.com>
52 * decl.c (java_init_decl_processing): Fix types of
53 _Jv_MonitorEnter, _Jv_MonitorExit, _Jv_AllocObject,
54 _Jv_AllocObjectNoFinalizer, _Jv_Throw, _Jv_NewPrimArray,
55 _Jv_JNI_PopSystemFrame, _Jv_divI, _Jv_remI, _Jv_divJ, _Jv_remJ.
57 2005-03-31 Jan Hubicka <jh@suse.cz>
59 * Make-lang.in (class.o, decl.o): Depend on cgraph.h.
60 * class.c: Include cgraph.h
61 (make_local_functoin_alias): Mark aslias as needed.
62 * resource.c: Include cgraph.h
63 (compile_resource_data): Go via cgraph interface.
65 2005-03-30 Ian Lance Taylor <ian@airs.com>
67 * parse.y (maybe_yank_clinit): Don't crash if bbody is NULL.
69 2005-03-30 Tom Tromey <tromey@redhat.com>
71 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): Handle cases where
72 inner_class_info_index==0 or outer_class_info_index==0.
74 2005-03-29 Tom Tromey <tromey@redhat.com>
76 * gcj.texi (libgcj Runtime Properties): Document
77 gnu.gcj.runtime.endorsed.dirs.
79 2005-03-24 Anthony Green <green@redhat.com>
81 * gcj.texi (Invoking gcj-dbtool): Document new LIBDIR option to
84 2005-03-23 Tom Tromey <tromey@redhat.com>
86 * decl.c (GCJ_CURRENT_BC_ABI_VERSION): New define.
87 (parse_version): Use it.
89 2005-03-23 Joseph S. Myers <joseph@codesourcery.com>
91 * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
93 2005-03-18 Andrew Haley <aph@redhat.com>
96 * decl.c (update_aliases): Don't update variables that are about
98 (maybe_poplevels): Add comment.
100 2005-03-17 Bryce McKinlay <mckinlay@redhat.com>
103 * jcf-parse.c (duplicate_class_warning): New function.
104 (java_parse_file): Call duplicate_class_warning if
105 CLASS_FROM_CURRENTLY_COMPILED_P is already set.
106 (parse_zip_file_entries): Likewise. Also set
107 CLASS_FROM_CURRENTLY_COMPILED_P.
109 2005-03-16 Andrew Haley <aph@redhat.com>
111 * expr.c (expand_java_arrayload): Don't generate a
112 NullPointerException based on the type of the node.
113 (build_java_array_length_access): Likewise.
115 2005-03-15 Zack Weinberg <zack@codesourcery.com>
117 * Make-lang.in (TEXI_JAVA_FILES): Add gcc-vers.texi.
119 2005-03-11 Tom Tromey <tromey@redhat.com>
121 * gcj.texi (Invoking gcj-dbtool): Document 'gcj-dbtool -p'.
122 (libgcj Runtime Properties): Document the default .db.
124 2005-03-10 Ranjit Mathew <rmathew@hotmail.com>
127 * parse.y (checks_throws_clauses): Check exceptions list even when
128 the base class does not come from a source file being compiled.
129 (java_complete_lhs): Remove unused variable 'wfl'.
131 2005-03-09 Ranjit Mathew <rmathew@hotmail.com>
134 * decl.c (finish_method): Emit _Jv_InitClass for private static
135 methods inside inner classes as well.
137 2005-03-08 Julian Brown <julian@codesourcery.com>
138 * Revert patch from 2005-03-08 for causing bootstrap failure on
141 2005-03-08 Julian Brown <julian@codesourcery.com>
143 * decl.c (finish_method): Give methods once-only linkage.
145 2005-03-07 Ranjit Mathew <rmathew@hotmail.com>
147 * lang.c (flag_new_verifier): Enable by default, regardless of ABI.
149 2005-03-07 Bryce McKinlay <mckinlay@redhat.com>
151 * verify-glue.c (vfy_is_assignable_from): Perform static check using
152 can_widen_reference_to if the C++ ABI is in use.
153 (vfy_get_interface_count, vfy_get_interface): Remove unused functions.
154 * verify-impl.c (debug_print, make_utf8_const, init_type, copy_type,
155 type_isresolved, init_state, set_pc, state_get_pc,
156 _Jv_BytecodeVerifier): Clean up unused and disabled functions.
157 (verify_fail): Report the current PC from the verifier context.
158 (free_state): Remove #if 0 block to enable this function.
159 (free_verifier_context): Call free_state on state_list iterator
160 values before freeing them.
161 * expr.c (pop_type_0): Pop correct type for error message when stack
162 contains a multi-word type.
164 2005-03-07 Ranjit Mathew <rmathew@hotmail.com>
166 * expr.c (build_java_array_length_access): Remove !flag_new_verifier
167 for known NULL array length access.
169 2005-03-07 Tom Tromey <tromey@redhat.com>
171 * gcj.texi (Invoking gcj-dbtool): Document '-f'.
173 2005-03-06 Kazu Hirata <kazu@cs.umass.edu>
175 * jcf-dump.c, jcf-io.c, jcf-reader.c, lang.c, parse.h,
176 typeck.c: Update copyright.
178 2005-03-06 Ranjit Mathew <rmathew@hotmail.com>
181 * xref.c, xref.h: Remove file.
182 * Make-lang.in (java/xref.o): Remove.
183 * java-tree.h (flag_emit_xref, do_not_fold): Remove declaration.
184 * lang.c (flag_emit_xref): Remove definition.
185 * parse.h (DECL_END_SOURCE_LINE, DECL_INHERITED_SOURCE_LINE): Remove.
186 * typeck.c (convert): Remove use of do_not_fold.
187 * parse.y (do_not_fold): Remove definition.
188 (parser grammar): Remove xref code.
189 (maybe_create_class_interface_decl, create_class): Likewise.
190 (register_fields, method_header, finish_method_declaration): Likewise.
191 (declare_local_variables, source_end_java_method): Likewise.
192 (java_complete_expand_classes): Do not set do_not_fold.
193 (java_complete_expand_method): Remove xref code.
194 (java_expand_classes, resolve_field_access, patch_invoke): Likewise.
195 (java_complete_tree, java_complete_lhs, patch_assignment): Likewise.
196 (patch_binop, build_string_concatenation, patch_array_ref): Likewise.
197 (patch_synchronized_statement, patch_throw_statement): Likewise.
198 (maybe_build_class_init_for_field): Likewise.
200 2005-03-05 Kazu Hirata <kazu@cs.umass.edu>
202 * expr.c (build_expr_wfl, expr_add_location): Use TYPE_P
203 instead of IS_NON_TYPE_CODE_CLASS.
205 2005-03-04 Andrew Haley <aph@redhat.com>
208 * class.c (set_method_index): Don't set method_index if it is
210 (layout_class_method): Don't complain about "non-static method foo
211 overrides static method" in the case of indirect dispatch.
213 2005-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
215 * jcf-io.c (caching_stat): Use __extension__ to avoid pedantic
217 * Make-lang.in: Don't elide warnings in jcf-io.c.
219 2005-03-01 Per Bothner <per@bothner.com>
222 * check-init.c (wfl): Remove static.
223 (final_assign_error, check_init): Replace calls to parse_error_context
225 (check_init): Save, set, and restore input_location for each exp.
227 2005-03-01 Per Bothner <per@bothner.com>
229 * jcf-reader.c (get_attribute): Handle SourceDebugExtension (JSR 45)
230 if HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE is defined.
231 * jcf-dump.c (HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE): Print contents.
233 2005-03-01 Per Bothner <per@bothner.com>
235 * java-tree.h (IDENTIFIER_HANDLECLASS_VALUE): Remove ancient macro.
237 2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
240 * gcj.texi (Invocation): Add descriptions of JvVMInitArgs and
243 2005-02-22 Tom Tromey <tromey@redhat.com>
246 * verify-impl.c (EITHER): New define.
247 (types_compatible): Handle it.
248 (check_field_constant): Use it.
250 2005-02-18 Tom Tromey <tromey@redhat.com>
253 * verify-impl.c (types_equal): Fixed test.
256 * verify-glue.c (vfy_class_has_field): New function.
257 * verify.h (vfy_class_has_field): Declare.
258 * verify-impl.c (check_field_constant): Added 'putfield'
260 (verify_instructions_0): Updated.
261 (types_equal): New function.
263 2005-02-14 Tom Tromey <tromey@redhat.com>
266 * jcf-write.c (generate_bytecode_insns) <CALL_EXPR>: Note the
267 stack effect of multianewarray.
269 2005-02-14 Andrew Haley <aph@redhat.com>
272 * expr.c (expand_byte_code): Call promote_arguments().
273 (promote_arguments): New function.
274 * decl.c (check_local_unnamed_variable): Remove special case for
276 (find_local_variable): Promote all boolean types to int
277 when searching for local variable decls.
279 2005-02-12 Kazu Hirata <kazu@cs.umass.edu>
281 * builtins.c, java-except.h, jcf-parse.c, jv-scan.c, lex.c,
282 parse-scan.y: Update copyright.
284 2005-02-11 Per Bothner <per@bothner.com>
287 * parse-scan.y (input_location): Remove variable.
288 (main_input_filename): New - replaces input_filename, which isn't
289 settable if USE_MAPPED_LOCATION.
290 * lex.c (java_init_lex): Wrap some more places in #ifndef JC1-LITE,
291 so we don't reference input_location or wfl_operator in that case.
292 * jv-scan.c (expand_location): Remove - no longer used.
293 (main): Set main_input_filename rather than input_filename.
295 2005-02-09 Richard Henderson <rth@redhat.com>
297 * builtins.c (initialize_builtins): Call build_common_builtin_nodes.
298 * decl.c (java_init_decl_processing): Initialize const_ptr_type_node.
300 2005-02-08 Marcin Dalecki <martin@dalecki.de>
302 * expr.c (add_type_assertion): Use the proper enumeration type,
303 since this is what htab_find_slot() is expecting.
305 2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
307 * gcj.texi: Update copyright dates.
309 2005-02-02 Tom Tromey <tromey@redhat.com>
311 * gcj.texi (libgcj Runtime Properties): Default library_control
314 2005-02-02 Ranjit Mathew <rmathew@hotmail.com>
317 * parse-scan.y (formal_parameter): Use $2 (type) instead of $$
318 (modifiers) when square brackets are present in a declaration for
320 * jv-scan.c (main): Set input_filename and input_line.
322 2005-02-01 Tom Tromey <tromey@redhat.com>
325 * gjavah.c (get_field_name): Don't override name for JNI header.
327 2005-02-01 Roger Sayle <roger@eyesopen.com>
329 * jcf-write.c (generate_bytecode_insns): Implement RSHIFT_EXPR
330 of unsigned types using iushr and lushr JVM bytecodes.
332 2005-02-01 Ranjit Mathew <rmathew@hotmail.com>
335 * gjavah.c (jni_print_float): Do not emit floating-point
336 initialiser for a static final field.
337 (jni_print_double): Likewise.
339 2005-02-01 Mark Mitchell <mark@codesourcery.com>
342 2005-01-31 Mark Mitchell <mark@codesourcery.com>
343 * gjavah.c (print_field_info): Mark static data members of
344 floating-point type with "__extension__".
346 2005-01-31 Mark Mitchell <mark@codesourcery.com>
348 * gjavah.c (print_field_info): Mark static data members of
349 floating-point type with "__extension__".
351 2005-02-01 Ranjit Mathew <rmathew@hotmail.com>
354 * parse.y (build_string_concatenation): Remove redundant if.
355 (patch_conditional_expr): Attempt to patch_string() the condition
356 of a ?: as well, in addition to its other operands.
358 2005-01-25 Tom Tromey <tromey@redhat.com>
360 * Make-lang.in (java/java-tree-inline.o): Removed.
362 2005-01-25 Ranjit Mathew <rmathew@hotmail.com>
365 * parse.y (patch_binop): Allow comparisons against NULL only
366 if the other operand is of a reference type.
368 2005-01-24 Tom Tromey <tromey@redhat.com>
370 * java-tree.h (gcj_abi_version): Declare.
371 * class.c (make_class_data): Push gcj_abi_version into "next"
372 field. Renamed field.
373 * decl.c (gcj_abi_version): New global.
374 (parse_version): New function.
375 (java_init_decl_processing): Call it. Renamed 'next' field.
377 (GCJ_BINARYCOMPAT_ADDITION): New define.
379 2005-01-24 Roger Sayle <roger@eyesopen.com>
382 * jcf-write.c (generate_bytecode_insns): Conversions between
383 integer types of the same precision shouldn't generate widening
384 or narrowing conversion bytecodes.
386 2005-01-22 Kazu Hirata <kazu@cs.umass.edu>
388 * java-except.h, java-tree.h: Remove unused prototypes.
390 2005-01-20 Andrew Pinski <pinskia@gcc.gnu.org>
393 * jcf-write.c (perform_relocations): Don't call memcpy if source
394 and destination are the same.
396 2005-01-17 Tom Tromey <tromey@redhat.com>
398 * verify-impl.c (get_short): Sign extend.
401 2005-01-12 Ranjit Mathew <rmathew@hotmail.com>
403 * expr.c (build_jni_stub): Replace mistaken use of TYPE_SIZE_UNIT
406 2005-01-10 Ranjit Mathew <rmathew@hotmail.com>
408 * verify.c: Revert to the version before the BC-ABI merge.
410 2005-01-10 Ranjit Mathew <rmathew@hotmail.com>
413 * check-init.c (check_init): Take care of references that do not
414 have an explicit final variable declaration (e.g. array length
415 access) for pre/post in/de-crement operators.
417 2005-01-08 Mark Wielaard <mark@klomp.org>
419 * parse.y (process_imports): Allocate (and free) original_name only
420 when not already defined.
421 * jcf-parse.c (read_class): Free results of find_class() and
423 (java_parse_file): Keep pointer to head of file_list and free when
424 done. Free result of lrealpath().
426 2005-01-05 Tom Tromey <tromey@redhat.com>
428 * gcj.texi (Standard Properties): java.ext.dirs is now used.
430 2004-12-20 Andrew Haley <aph@redhat.com>
432 * typeck.c: Use fold_convert for ints and booleans.
434 2004-12-17 Andrew Haley <aph@redhat.com>
437 * typeck.c (convert): Use a CONVERT_EXPR when converting to
438 BOOLEAN_TYPE or CHAR_TYPE.
439 (convert_to_boolean, convert_to_char) : Remove.
440 * convert.h (convert_to_boolean, convert_to_char) : Remove.
441 * expr.c (expand_load_internal): Do type conversion if type is not
444 2004-12-13 Danny Smith <dannysmith@users.sourceforge.net>
447 * class.c (emit_register_classes): Use TARGET_USE_JCR_SECTION.
450 2004-12-07 Andrew Haley <aph@redhat.com>
453 * jcf-parse.c (load_class): Remove sanity test for missing inner
456 2004-12-06 Tom Tromey <tromey@redhat.com>
458 * Make-lang.in (JAVA_MANFILES): Added gcj-dbtool.
459 (java.uninstall): Likewise.
460 (java.maintainer-clean): Likewise.
461 (.INTERMEDIATE): Likewise.
462 (java.install-man): Likewise.
463 (gcj-dbtool.pod): New target.
464 * gcj.texi (Code Generation): Document -findirect-dispatch.
465 (libgcj Runtime Properties): Document
466 gnu.gcj.precompiled.db.path.
467 (Top): Link to "Invoking gcj-dbtool".
469 2004-12-06 Tom Tromey <tromey@redhat.com>
472 * java-tree.h (extract_field_decl): Declare.
473 * parse.y (extract_field_decl): Renamed from
474 strip_out_static_field_access_decl. No longer static.
475 * check-init.c (get_variable_decl): Unwrap COMPOUND_EXPRs.
477 2004-12-03 Tom Tromey <tromey@redhat.com>
479 * lang.c (flag_new_verifier): Define.
480 (java_post_options): Set flag_new_verifier if indirect dispatch
482 * lang.opt (fnew-verifier): Removed.
484 2004-12-03 Tom Tromey <tromey@redhat.com>
487 * Make-lang.in (java.install-common): Only install transformed
488 gcjh if gcj-cross exists.
490 2004-12-03 Andrew Haley <aph@redhat.com>
493 * except.c (link_handler): Patch 'outer' field of siblings of the
494 range we're demoting.
496 2004-12-03 Andrew Haley <aph@redhat.com>
499 * class.c (layout_class_method): Don't fail to override a method
500 simply because it has DECL_ARTIFICIAL set.
502 2004-12-02 Tom Tromey <tromey@redhat.com>
505 * parse.y (craft_constructor): Special case null_pointer_node.
507 2004-12-02 Tom Tromey <tromey@redhat.com>
510 * java-gimplify.c (java_gimplify_expr): Don't call
511 SET_EXPR_LOCATION unless wrapped tree is an expression.
513 2004-11-27 Per Bothner <per@bothner.com>
515 * jcf-parse.c (set_source_filename): Improvement to Andrew's fix:
516 Fix fencepost error in 'i', which got executed one too many times.
517 Also, fold memcpy into explicit loop, as originally intended.
518 Also, free temporary 'buf' which otherwise leaks.
520 2004-11-27 Per Bothner <per@bothner.com>
522 * expr.c (build_expr_wfl): Only declare last_file and last_filenode
523 local static variables if not USE_MAPPED_LOCATION.
525 2004-11-27 Kazu Hirata <kazu@cs.umass.edu>
527 * class.c, decl.c, expr.c: Fix comment typos.
529 2004-11-26 Andrew Pinski <pinskia@physics.uc.edu>
532 * decl.c (end_java_method): Call
533 attach_init_test_initialization_flags on all the init_decls.
534 * parse.y (attach_init_test_initialization_flags): Move to ...
535 * expr.c (attach_init_test_initialization_flags): here and
536 support BIND_EXPR also.
537 * java-tree.h (attach_init_test_initialization_flags): Prototype.
538 * jcf-parse.c (parse_class_file): Don't disable class init
541 2004-11-25 Joseph S. Myers <joseph@codesourcery.com>
543 * gjavah.c, jcf-dump.c, jv-scan.c, jvspec.c: Avoid ` as left quote
546 2004-11-24 Richard Henderson <rth@redhat.com>
548 * verify-glue.c (vfy_init_name, vfy_clinit_name, vfy_object_type,
549 vfy_string_type, vfy_throwable_type): Use ANSI declaration form.
551 2004-11-24 Tom Tromey <tromey@redhat.com>
553 * verify.c (defer_merging): Don't use C++-style comment.
554 * verify.h (java_opcode): Added java_opcode_end.
555 * class.c (build_class_ref): Remove C++ comment and old FIXME.
557 * verify-impl.c (vfy_push_type): Removed bogus "return".
558 (initialize_stack): Use vfy_alloc and vfy_free.
559 (verify_instructions_0): Likewise.
561 * Merged gcj-abi-2-dev-branch to trunk.
563 2004-11-24 Andrew Haley <aph@redhat.com>
565 * jcf-parse.c (parse_class_file): Set file_start_location.
567 2004-11-10 Tom Tromey <tromey@redhat.com>
569 * class.c (make_field_value): Don't call build_static_field_ref.
570 (build_static_field_ref): Don't emit direct references when using
573 * gcj.texi (Invoking gij): Document -verbose. Put -verbose and
574 -verbose:class into man page synopsis.
576 2004-11-09 Tom Tromey <tromey@redhat.com>
578 * expr.c (build_java_arraystore_check): Still generate check if
579 element type is itself an array.
581 2004-11-08 Tom Tromey <tromey@redhat.com>
583 * java-tree.h (soft_check_assignment_node): Removed.
584 (enum java_tree_index): Removed JTI_SOFT_CHECK_ASSIGNMENT_NODE.
585 * decl.c (java_init_decl_processing): Don't initialize
586 soft_check_assignment_node.
588 2004-11-05 Tom Tromey <tromey@redhat.com>
590 * class.c (layout_class_methods): Don't add Miranda methods when
591 using indirect dispatch.
593 2004-11-05 Bryce McKinlay <mckinlay@redhat.com>
595 * class.c (make_class_data): Call emit_assertion_table to set the
596 'assertion_table' field.
597 (build_signature_for_libgcj): Move here from expr.c.
598 (add_assertion_table_entry): New function. Callback for assertion
600 (emit_assertion_table): New. Take class argument, and generate
601 assertion table DECL based on the TYPE_ASSERTIONS hashtable.
602 * decl.c (init_decl_processing): Define assertion_entry_type record.
603 Push 'assertion_table' class field instead of 'verify'.
604 * expr.c (type_assertion_eq): Compare 'assertion_code' field.
605 (type_assertion_hash): Include 'assertion_code' in hash.
606 (add_type_assertion): Rewritten. Take class and assertion_code
607 arguments. Add assertions to the TYPE_ASSERTIONS hashtable.
608 (can_widen_reference_to): Use new add_type_assertion() arguments.
609 * java-tree.h (java_tree_index): Add JTI_ASSERTION_ENTRY_TYPE,
610 JTI_ASSERTION_TABLE_TYPE. Remove JTI_VERIFY_IDENTIFIER_NODE.
611 (verify_identifier_node): Removed.
612 (assertion_entry_type, assertion_table_type): New.
613 (ASSERTION_TYPES_COMPATIBLE, ASSERTION_IS_INSTANTIABLE): New. Type
614 assertion code definitions.
615 (struct type_assertion): Add assertion_code. Rename 'source_type' and
616 'target_type' to 'op1' and 'op2'.
617 (add_type_assertion): Declare.
618 (lang_printable_name_wls): Remove unused definition.
619 * verify-glue.c: (vfy_is_assignable_from): New. Call add_type_assertion
620 to emit runtime assertion.
621 (vfy_note_stack_type): Clean up non-C90 declarations.
622 (vfy_note_local_type): Likewise.
623 * verify.h (vfy_is_assignable_from): Declare.
624 * verify-impl.c (is_assignable_from_slow): Remove unused function.
625 (ref_compatible): Rename arguments. Call vfy_is_assignable_from()
626 instead of is_assignable_from_slow().
627 (types_compatible): Reinstate ref_compatible() call.
629 2004-11-04 Tom Tromey <tromey@redhat.com>
631 * class.c (build_static_field_ref): Reverted previous patch.
633 * class.c (build_static_field_ref): Don't emit direct references
634 when using indirect dispatch.
636 2004-11-03 Tom Tromey <tromey@redhat.com>
638 * expr.c (expand_java_arrayload): Set lhs_type_node.
639 (expand_java_arraystore): Set rhs_type_node.
641 2004-11-02 Tom Tromey <tromey@redhat.com>
643 * jcf-parse.c (compute_class_name): Use filename length from zip
644 directory, not strlen.
646 * expr.c (expand_invoke): Mark new interface methods as abstract.
648 2004-11-01 Tom Tromey <tromey@redhat.com>
650 * verify-impl.c (push_jump): Removed check for uninitialized
652 (push_exception_jump): Likewise.
653 (handle_ret_insn): Likewise.
654 (handle_jsr_insn): Likewise.
655 (state_check_no_uninitialized_objects): Removed.
657 * decl.c (check_local_unnamed_variable): Recognize
658 promoted-to-int parameters when using the new verifier.
659 * expr.c (expand_java_arraystore): Explicitly request array type
660 when using new verifier.
661 (expand_java_arrayload): Likewise.
662 (invoke_build_dtable): Don't pass object_type_node as
663 expression argument to build_java_indirect_ref.
664 (build_java_check_indexed_type): Do nothing.
665 (build_java_arraystore_check): Handle case where array doesn't
667 (build_java_array_length_access): Likewise.
668 (expand_invoke): Handle case where interface overrides a method
670 (pop_type_0): Always succeed for reference types.
671 (process_jvm_instruction): Don't pop a value in a dead
673 (pop_arguments): Convert arguments to correct types.
675 2004-10-29 Andrew Haley <aph@redhat.com>
677 * jcf-parse.c (give_name_to_class): Remove line that was
680 2004-10-29 Andrew Haley <aph@redhat.com>
682 * jcf-parse.c (set_source_filename): Add code to build new sfname.
684 2004-10-20 Andrew Haley <aph@redhat.com>
686 * decl.c (end_java_method): Don't expand if flag_syntax_only.
688 2004-10-26 Tom Tromey <tromey@redhat.com>
690 * verify.h (vfy_notify_verified): Removed.
691 * verify-glue.c (vfy_notify_verified): Removed.
693 2004-10-26 Tom Tromey <tromey@redhat.com>
695 * verify-impl.c (debug_print_state): Declare `i' before code.
696 (merge_types): Modify `t' when it is null_type.
698 2004-10-26 Tom Tromey <tromey@redhat.com>
700 * verify-impl.c (type_print): Renamed from print. Now static and
702 (debug_print_state): Use type_print.
704 2004-10-25 Tom Tromey <tromey@redhat.com>
706 * expr.c (build_invokeinterface): Compute correct offset for
707 index into interface methods.
709 2004-10-20 Tom Tromey <tromey@redhat.com>
711 * java-tree.h (verify_jvm_instructions_new): Declare.
713 * jvspec.c (jvgenmain_spec): Remove -fnew-verifier from cc1
716 * verify-impl.c (verify_instructions): Correctly handle wide
718 * verify-glue.c (vfy_get_class_name): Use DECL_NAME.
719 (vfy_get_component_type): Strip pointer types.
720 (vfy_find_class): Use get_type_from_signature. Strip pointer
722 Include java-except.h.
724 2004-10-20 Bryce McKinlay <mckinlay@redhat.com>
726 * verify-impl.c (type_array_elementpop_raw, vfy_pop_type_t,
727 vfy_push_type_t, set_variable, add_new_state, merge_into,
728 handle_jsr_insn, branch_prepass, check_class_constant,
729 check_wide_constant, get_one_type, compute_static_types,
730 verify_instructions_0): Clean up C99 declarations after statements.
732 2004-10-20 Tom Tromey <tromey@redhat.com>
734 * verify-impl.c (merge_refs): Compare reference against iterator,
737 * verify-glue.c (vfy_tag): Mask off resolved flag.
739 2004-10-19 Tom Tromey <tromey@redhat.com>
741 * verify-impl.c (verify_instructions): Call vfy_note_local_type.
742 (init_state_with_stack): Initialize `this_type' in state.
743 (verify_method): Use debug_print.
744 * verify-glue.c (vfy_is_primitive): Removed debugging print.
745 (vfy_note_stack_depth): Reverted last patch.
746 (vfy_note_stack_type): Note pointer to Object, not Object.
747 (vfy_note_local_type): Likewise.
749 * verify.h (vfy_note_instruction_seen): Declare.
750 * verify-glue.c (verify_jvm_instructions_new): Set
751 BCODE_EXCEPTION_TARGET on target instruction.
752 (vfy_note_instruction_seen): New function.
753 * verify-impl.c (FLAG_INSN_SEEN): New define.
754 (verify_instructions_0): Set flag on instruction. Save state for
756 (verify_instructions): Call vfy_note_instruction_seen.
758 * verify-glue.c (vfy_note_stack_depth): Fix off-by-one error.
759 (verify_jvm_instructions_new): Call method_init_exceptions,
760 add_handler, and handle_nested_ranges.
761 * verify-impl.c (verify_method): Return 1 on success.
762 (verify_instructions_0): Save the state at PC=0.
764 * verify-impl.c (init_type_from_class): Set is_resolved and
765 ref_next on new ref_intersection.
766 (init_type_from_string): Likewise.
768 2004-10-15 Bryce McKinlay <mckinlay@redhat.com>
770 * expr.c (expand_bytecode): Use verify_jvm_instructions_new
771 if flag_new_verifier is set.
772 * java-tree.h (flag_new_verifier): Declare.
773 * lang.opt (fnew-verifier): New option.
774 * verify-impl.c: Work around namespace pollution by undef'ing
776 (struct verifier_context): Make 'bytecode' const.
777 (verify_fail_pc): Pass -1 PC argument to vfy_fail.
778 (types_compatible): For the BC-ABI, always consider reference types
780 (check_class_constant): Use vfr->current_class.
781 (check_constant): Likewise.
782 (check_wide_constant): Likewise.
783 (check_field_constant): Check for 'L' at start of type name.
784 (get_one_type): Return pointer instead of type. Set type result in
785 caller via passed type pointer.
786 (compute_argument_types): Update to use new get_one_type arguments.
787 (compute_return_type): Likewise.
788 (make_verifier_context): New. Allocate and initialize 'vfr'.
789 (free_verifier_context): New. Free 'vfr' and its contents.
790 (verify_method): Remove ATTRIBUTE_UNUSED. Call make_verifier_context
791 and free_verifier_context.
793 2004-10-15 Tom Tromey <tromey@redhat.com>
795 * verify-glue.c (vfy_note_local_type): Mark argument as unused.
796 * verify.h (vfy_fail): Fixed formatting.
798 * verify-impl.c (vfr): Fixed comment formatting.
799 (collapse_type): New function.
800 (verify_instructions): Notify compiler about type map.
801 * verify.h (vfy_note_stack_depth): Updated.
802 (vfy_note_stack_type): Likewise.
803 (vfy_note_local_type): Likewise.
804 (vfy_unsuitable_type, vfy_return_address_type, vfy_null_type):
806 * verify-glue.c (vfy_note_stack_depth): Correctly size type
807 state. Added `method' argument.
808 (vfy_note_stack_type): Renamed from vfy_note_type. Added `method'
810 (vfy_note_local_type): New function.
811 (vfy_unsuitable_type): Likewise.
812 (vfy_return_address_type): Likewise.
813 (vfy_null_type): Likewise.
815 * verify.h (VFY_IN_GCC): Removed.
816 (VFY_WANT_TYPEMAP): Removed.
817 * verify-impl.c (verify_instructions_0): Removed useless "\".
818 (struct state) <next>: Uncomment.
820 2004-10-13 Bryce McKinlay <mckinlay@redhat.com>
822 * verify-impl.c: Formatting fixes. Reformat C++-style comments to
825 2004-10-06 Bryce McKinlay <mckinlay@redhat.com>
827 * Make-lang.in (verify.o): Re-enabled this target.
828 * verify-glue.c (vfy_get_interface_count): Add ATTRIBUTE_UNUSED.
829 (vfy_get_interface): Likewise.
830 (verify_jvm_instructions_new): Renamed from verify_jvm_instructions.
831 * verify.h (verify_jvm_instructions_new): Declare.
832 * verify-impl.c (free_state): Temporarily comment out unused
835 2004-10-06 Tom Tromey <tromey@redhat.com>
837 * java-tree.h (JV_STATE_READ): New enum value.
839 2004-10-06 Bryce McKinlay <mckinlay@redhat.com>
841 * verify.h: New file.
843 2004-10-05 Bryce McKinlay <mckinlay@redhat.com>
845 * verify-impl.c, verify-glue.c, verify.h: New files.
846 * Make-lang.in: Add rules for verify-impl.o and verify-glue.o.
848 2004-09-24 Andrew Haley <aph@redhat.com>
850 * decl.c (check_local_unnamed_variable): Always use the PARM_DECL
851 for a slot if it's of pointer type.
853 2004-09-14 Tom Tromey <tromey@redhat.com>
855 * class.c (make_class_data): Correctly initialize "state" field.
856 Initialize "engine" field.
857 * decl.c (java_init_decl_processing): Add "engine" field.
859 2004-09-10 Andrew Haley <aph@redhat.com>
862 * expr.c (build_invokeinterface): Use fast method for interface
864 * java-tree.h (enum java_tree_index): Add JTI_ITABLE_TYPE,
866 (struct lang_type): Add itable_methods, itable_decl, itable_syms_decl.
867 (emit_symbol_table): Add new arg, element_size.
868 * decl.c (java_init_decl_processing): Initialize Class.itable.
869 * class.c (GEN_TABLE): New macro.
870 (gen_indirect_dispatch_tables): Use it. Add itable.
871 (make_class_data): Add new arg for emit_symbol_table().
873 (add_miranda_methods): Make sure search_class has been parsed.
874 (emit_symbol_table): Add new arg, element_size.
876 2004-09-06 Andrew Haley <aph@redhat.com>
878 * verify.c (merge_types): Return Object for all merges of
880 * expr.c (add_type_assertion): Don't generate assertions when
881 source type is array of Object.
883 2004-09-03 Andrew Haley <aph@redhat.com>
885 * class.c (finish_class): Nullify TYPE_VERIFY_METHOD.
887 * lang.c (java_post_options): Force flag_verify_invocations if
888 we're not using indirect dispatch.
890 * expr.c (pop_type_0): Move test for interfaces before call to
891 can_widen_reference_to().
892 (build_signature_for_libgcj): Remove generation of canonical array
894 (add_type_assertion): Canonicalize both arrays.
895 Don't assert that type X can be assigned to Object.
896 Don't assert that type X an be assigned to type X.
897 Don't assert that Object can be assigned to type X.
898 (can_widen_reference_to): Warn whenever we generate an assertion.
899 (process_jvm_instruction): Use throwable_type_node for the type of
902 2004-09-01 Andrew Haley <aph@redhat.com>
904 * decl.c (java_init_decl_processing): Change
905 verify_identifier_node to "__verify".
906 * expr.c (add_type_assertion): Use verify_identifier_node for name.
907 * java-tree.h (verify_identifier_node): Change to "__verify".
909 * expr.c (build_signature_for_libgcj): New function.
910 (add_type_assertion): Use it to construct signatures for
911 source_type and target_type.
913 2004-08-27 Andrew Haley <aph@redhat.com>
915 * java-tree.h (enum java_tree_index): Add JTI_VERIFY_IDENTIFIER_NODE.
916 (verify_identifier_node): New.
917 (TYPE_VERIFY_METHOD): New.
918 (struct type_assertion): New type.
919 * expr.c (type_assertion_eq): New function.
920 (type_assertion_hash): New function.
921 (add_type_assertion): New function.
922 (can_widen_reference_to): Call add_type_assertion().
923 * decl.c (java_init_decl_processing): Add verify_identifier_node.
924 * class.c (make_class_data): Initialize TYPE_VERIFY_METHOD (type).
925 (finish_class): Output TYPE_VERIFY_METHOD (type).
927 * decl.c (end_java_method): Nullify unused fields.
929 2004-08-17 Andrew Haley <aph@redhat.com>
931 * verify.c (defer_merging): Quieten.
932 * jcf-parse.c (load_class): Only try to open a class file if it's
933 java.lang.Object or if it's part of the current compilation.
934 Check that the class we just tried to load is the class we just
936 (java_parse_file): Set flag_verify_invocations off if we're
937 compiling from .class.
938 (parse_zip_file_entries): Abort if we try to read a dummy class.
939 * expr.c (can_widen_reference_to): Quieten.
940 (build_invokevirtual): Abort if we try to invokevirtual an
942 (expand_invoke): Don't build a non-interface call to an interface.
943 (build_instanceof): Don't do premature optimization if
944 flag_verify_invocations is not set.
945 * class.c (set_super_info): Disable code that inherits TYPE_DUMMY
947 (build_static_field_ref): Add correct type conversion for
949 (add_miranda_methods): Disable generation of Miranda methods for
951 (layout_class_method): Don't complain about non-static method
952 overrides static method with dummy classes.
954 2004-08-13 Tom Tromey <tromey@redhat.com>
956 * class.c (build_static_field_ref): Re-enable atable lookups for
959 * parse.y (strip_out_static_field_access_decl): Indentation fix.
961 2004-08-11 Tom Tromey <tromey@redhat.com>
963 * gcj.texi (libgcj Runtime Properties): Document new properties.
965 2004-08-06 Andrew Haley <aph@redhat.com>
967 * jcf-parse.c (load_class): Check that we really have loaded the
968 class we're looking for.
970 2004-07-19 Andrew Haley <aph@redhat.com>
972 * verify.c (verify_jvm_instructions): Comment change only.
974 * typeck.c (build_java_array_type): Add size field to array name.
976 * java-tree.h (LOCAL_SLOT_P): New.
977 (update_aliases): Add PC argument.
978 (pushdecl_function_level): New function.
980 * java-gimplify.c (java_gimplify_expr): Handle VAR_DECL,
981 MODIFY_EXPR, and SAVE_EXPR.
982 (java_gimplify_modify_expr): New function.
984 * expr.c (push_type_0): Call find_stack_slot() to create temporary.
985 (expand_iinc): Pass PC to update_aliases().
986 (STORE_INTERNAL): Likewise.
987 (process_jvm_instruction): Likewise.
989 * decl.c (base_decl_map): New variable.
990 (uniq): New variable.
991 (update_aliases): Rewrite with more thorough checking.
992 (debug_variable_p): New function.
993 (push_jvm_slot): Don't initialize local variable. Don't pushdecl.
994 (check_local_named_variable): Delete whole function.
995 (initialize_local_variable): New function.
996 (check_local_unnamed_variable): Add checks and comments.
997 (find_local_variable): Rewrite.
998 (java_replace_reference): New function.
999 (function_binding_level): New variable.
1000 (pushdecl_function_level): New function.
1001 (maybe_pushlevels): Set DECL_LOCAL_END_PC.
1002 (maybe_pushlevels): Call pushdecl() on each of the new decls.
1003 (start_java_method): Reset uniq. Create base_decl_map. Set
1004 function_binding_level.
1005 (end_java_method): Null unused fields to save memory.
1007 2004-06-29 Andrew Haley <aph@redhat.com>
1009 * except.c (expand_start_java_handler): Push a new binding level.
1010 Don't build a TRY_CATCH_EXPR now, we'll do it later. Call
1011 register_exception_range() to register where we'll do it.
1012 (expand_end_java_handler): Remove old bogus code. Replace with
1013 new logic that simply builds TRY_CATCH_EXPRs and inserts them at
1014 the top of the expression we're curently building.
1015 (maybe_end_try): Delete.
1016 * decl.c (binding_level.exception_range): New field.
1017 (clear_binding_level): Add field exception_range. Reformat.
1018 (poplevel): Call expand_end_java_handler().
1019 (poplevel): Call java_add_stmt only if functionbody is false.
1020 (maybe_poplevels): Don't call maybe_end_try() from here.
1021 (end_java_method): Clear no longer used trees in function decl.
1022 (register_exception_range): New function.
1023 * java-tree.h (register_exception_range, struct eh_range): Declare.
1025 2004-06-22 Andrew Haley <aph@redhat.com>
1027 * class.c (gen_indirect_dispatch_tables): Set the DECL_OWNER of
1029 * check-init.c (get_variable_decl): Teach check-init about
1030 FIELD_DECLs addressed via the otable.
1031 * jcf-parse.c (load_class): Check CLASS_LOADED_P, not
1034 2004-05-28 Andrew Haley <aph@redhat.com>
1036 * jcf-parse.c (load_class): Don't try to read a class that we've
1039 * expr.c (build_invokeinterface): Use the old-fashioned way of
1040 doing indirect dispatch: look up interfaces by name.
1041 * java-tree.h (enum java_tree_index): Add
1042 JTI_SOFT_LOOKUPINTERFACEMETHODBYNAME_NODE
1043 * decl.c (java_init_decl_processing): Add
1044 soft_lookupinterfacemethodbyname_node.
1046 * gjavah.c (print_method_info): Final methods have vtable entries,
1047 so gjavah needs to output them.
1048 * class.c (layout_class_method): Generate vtable entries for final
1050 * parse.y (invocation_mode): Use INVOKE_VIRTUAL for indirect
1051 dispatch, even if a method is final.
1053 2004-05-25 Andrew Haley <aph@redhat.com>
1055 * class.c (build_symbol_entry): Convert the names of constructors
1056 to init_identifier_node when generating an entry for the indirect
1059 * expr.c (build_known_method_ref): Generate indirect calls for
1060 all methods marked DECL_EXTERNAL or TREE_PUBLIC.
1062 2004-05-24 Andrew Haley <aph@redhat.com>
1064 * expr.c (build_known_method_ref): Make sure ARRAY_REF access to
1065 atable element is of the right type.
1067 * class.c (build_static_field_ref): Cast pointer to correct type
1070 2004-04-20 Bryce McKinlay <mckinlay@redhat.com>
1072 * Merged with HEAD as of 20040514. Diff against
1073 gcj-abi-2-merge-20040514.
1075 2004-04-16 Andrew Haley <aph@redhat.com>
1077 * verify.c (check_pending_block): Disable subroutine checks.
1078 (defer_merging): New function.
1079 (merge_types): If types are dummy, use defer_merging to combine them.
1080 (verify_jvm_instructions): If invocation is invokeinterface and
1081 target is dummy, assume target really is an interface.
1083 * parse.y (patch_invoke): Break out call to java_create_object.
1085 * lang.c (flag_verify_invocations): New.
1087 * jcf-parse.c (load_class): If we've already failed to load a
1088 class, don't try again.
1089 (load_class): If we can't find a .class file, don't fail, but emit
1091 (parse_class_file): Don't act on dummy methods.
1093 * java-tree.h (flag_verify_invocations): New.
1095 (lang_type.dummy_class): New field.
1096 (java_create_object): New function.
1097 (METHOD_DUMMY): New.
1099 * expr.c (build_field_ref): Widen field offset.
1100 (pop_type_0): If the type in stack_type_map is a TREE_LIST, check
1101 that each of its elements is compatible with the one we're
1103 (pop_type_0): Issue a warning to say that we need to generate a
1105 (java_create_object): New function.
1106 (build_field_ref): Only generate hard refs if we're not using
1108 (expand_java_field_op): If we're using !verify_invocations and we
1109 see a missing field, generate a decl for it.
1111 (expand_invoke): If a class doesn't have the method we seek and
1112 we're using !flag_verify_invocations, generate a decl for the
1115 (build_known_method_ref): Always use indirect dispatch via the
1116 atable for static methods.
1118 (expand_java_NEW): Break out object creation into new function,
1121 (can_widen_reference_to): Issue a warning to say that we need to
1122 generate a runtime check.
1124 * class.c (set_super_info): Inherit TYPE_DUMMY from sureclass.
1125 (make_method_value): Also use index for interfaces.
1126 (make_class_data): Skip dummy field for inherited data.
1127 Don't build method array for dummy methods.
1128 Set size_in_byte to -1 when using inirect dispatch
1129 Don't build a hard class ref if we don't have a hard ref to our
1130 superclass, or if we're using inirect dispatch.
1131 Null out dispatch tables.
1133 (layout_class_method): Don't complain about non-static method
1134 overrides static method is method is artificial.
1136 (build_static_field_ref): Disable atable references to static
1137 fields for the time being.
1139 (layout_class_methods): Check for CLASS_INTERFACE as
1140 well as CLASS_ABSTRACT.
1142 2004-11-24 Steven Bosscher <stevenb@suse.de>
1144 * class.c (make_class_data): Don't check flag_inline_functions.
1145 * lang.c (flag_really_inline): Remove unused flag.
1146 (java_handle_option): Don't set it here. Remove special handling
1147 of flag_inline_functions for Java.
1148 (java_init): Don't set flag_inline_trees here. Already done...
1149 (java_post_options): ...here. Don't clear flag_inline_functions.
1151 2004-11-24 Steven Bosscher <stevenb@suse.de>
1153 * java-gimplify.c (java_gimplify_labeled_block_expr): New function.
1154 (java_gimplify_exit_block_expr): New function.
1155 (java_gimplify_expr): Use them to gimplify EXIT_BLOCK_EXPR and
1157 * java-tree.def (LABELED_BLOCK_EXPR): Moved from tree.def.
1158 (EXIT_BLOCK_EXPR): Likewise.
1159 * java-tree.h (LABELED_BLOCK_LABEL): Moved from tree.h.
1160 (LABELED_BLOCK_BODY): Likewise.
1161 (EXIT_BLOCK_LABELED_BLOCK): Likewise.
1162 * jcf-write.c (generate_bytecode_insns): Don't handle the unused
1163 EXIT_BLOCK_RETURN operand. Use EXIT_BLOCK_LABELED_BLOCK instead of
1165 * lang.c (java_tree_inlining_walk_subtrees): Handle EXIT_BLOCK_EXPR.
1166 (java_dump_tree): Use LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY, and
1167 EXIT_BLOCK_LABELED_BLOCK instead of TREE_OPERAND. Don't handle the
1168 second operand of EXIT_BLOCK_EXPR.
1169 * parse.y (find_expr_with_wfl): Use LABELED_BLOCK_BODY instead of
1171 (build_bc_statement): Use build1 to build EXIT_BLOCK_EXPR nodes.
1173 2004-11-23 Ben Elliston <bje@au.ibm.com>
1175 * xref.h (xref_flag_value): Remove.
1176 (xref_set_data, xref_get_data): Likewise.
1177 (xref_set_current_fp): Likewise.
1178 (XREF_NONE): Likewise.
1179 (XREF_GET_DATA): Likewise.
1180 * xref.c (xref_flag_value): Remove.
1181 (xref_set_data, xref_get_data): Likewise.
1182 (xref_set_current_fp): Likewise.
1184 2004-11-23 Ben Elliston <bje@au.ibm.com>
1186 * gjavah.c (output_directory): Make static.
1187 (temp_directory): Likewise.
1189 2004-11-15 Tom Tromey <tromey@redhat.com>
1191 * decl.c (instn_ptr_type_node): Removed.
1192 (lineNumbers_ptr_type_node): Removed.
1193 (jint_type): Removed.
1194 (jint_ptr_type): Removed.
1196 2004-11-09 Andrew Pinski <pinskia@physics.uc.edu>
1199 * check-init.c (check_init): Ignore DECL_EXPR.
1200 * expr.c (always_initialize_class_p): Reenable.
1201 (build_class_init): Use a variable to store the decl. Also use
1202 boolean_false_node instead of integer_zero_node.
1203 * parse.y (attach_init_test_initialization_flags): Add a decl_expr
1206 2004-11-08 Tom Tromey <tromey@redhat.com>
1209 * gjavah.c (HANDLE_END_FIELD): Call print_field_info when
1210 generating a JNI header.
1211 (print_field_info): Handle JNI headers.
1212 (jni_print_float): Likewise.
1213 (jni_print_double): Likewise.
1215 2004-11-08 Andrew Pinski <pinskia@physics.uc.edu>
1217 * decl.c (end_java_method): Remove duplicated code.
1219 2004-11-06 Zack Weinberg <zack@codesourcery.com>
1220 Gerald Pfeifer <gerald@pfeifer.com>
1222 * lex.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
1225 2004-11-02 Bryce McKinlay <mckinlay@redhat.com>
1228 * class.c: Reinstate 2004-08-18 patch.
1229 (make_local_function_alias): Don't create an alias for extern (native)
1232 2004-10-22 Eric Botcazou <ebotcazou@libertysurf.fr>
1235 * class.c (make_local_function_alias): Revert 2004-08-18 change.
1236 (make_method_value): Likewise.
1238 2004-10-21 Andrew Haley <aph@redhat.com>
1241 * jcf-parse.c (set_source_filename): Add code to build new sfname.
1243 2004-10-20 Andrew Haley <aph@redhat.com>
1245 * decl.c (end_java_method): Don't expand if flag_syntax_only.
1246 Remove duplicated code block.
1248 2004-10-18 Steven Bosscher <stevenb@suse.de>
1250 * Make-lang.in (java/parse.o-warn, java/parse-scan.o-warn):
1251 New rules to work around old Bison warnings.
1253 2004-10-17 Steven Bosscher <stevenb@suse.de>
1255 * class.c (ident_subst): Always alloca buffer.
1256 * java-opcodes.h (LAST_AND_UNUSED_JAVA_OPCODE): Add this dummy
1257 opcode after including javaop.def.
1258 * jcf-dump.c (CHECK_PC_IN_RANGE): Return 0 from the arm of the
1259 conditional expression that exits, to avoid warnings.
1260 * verify.c (CHECK_PC_IN_RANGE): Mark the __GNUC__ definition as
1261 a user of an extension.
1262 * win32-host.c: Move check down to have non-empty file when
1263 WIN32 is not defined.
1265 * Make-lang.in (java-warn): Add STRICT_WARN.
1266 (java/jcf-io.o-warn): Don't have Werror for this file.
1267 * jcf-io.c (caching_stat): Add FIXME for non-POSIX scandir use.
1269 2004-10-16 Hans-Peter Nilsson <hp@bitrange.com>
1271 * expr.c (expr_add_location): Move declaration to before all
1273 * parse.y (java_expand_classes): Ditto.
1274 * lex.c (java_peek_unicode): Ditto.
1276 2004-10-16 Ranjit Mathew <rmathew@hotmail.com>
1278 * check-init.c: Use %<, %> and %q for quoting in diagnostics,
1279 if possible, else convert `foo' to 'foo'.
1280 * class.c: Likewise.
1283 * jcf-io.c: Likewise.
1284 * jcf-parse.c: Likewise.
1287 * parse.h: Likewise.
1289 2004-10-16 Ranjit Mathew <rmathew@hotmail.com>
1291 * parse.y (parse_warning_context): Remove ATTRIBUTE_PRINTF_2 and
1292 rename parameter 'msg' to 'msgid' in function declaration.
1293 (issue_warning_error_from_context): Likewise.
1294 (yyerror): Rename parameter 'msg' to 'msgid'.
1295 (all over): Use new quoting style for diagnostics.
1297 2004-10-15 Kazu Hirata <kazu@cs.umass.edu>
1299 * boehm.c, builtins.c, java-except.h, jcf-io.c, jcf-path.c,
1300 jcf.h, lang-specs.h, lex.c, lex.h, resource.c, win32-host.c:
1303 2004-10-14 Matt Austern <austern@apple.com>
1305 * lang.c (java_tree_inlining_walk_subtrees): Last arg is struct
1308 2004-10-13 Tom Tromey <tromey@redhat.com>
1311 * lang.opt (--extdirs): Document.
1312 * jvspec.c (lang_specific_driver): Recognize -encoding and
1315 2004-10-06 Ulrich Weigand <uweigand@de.ibm.com>
1317 * parse.y (issue_warning_error_from_context): Use va_list *
1318 instead of va_list parameter.
1319 (parse_error_context): Update call.
1320 (parse_warning_context): Likewise.
1322 2004-10-05 Zack Weinberg <zack@codesourcery.com>
1324 * parse.y, parse-scan.y: Add list of diagnostic messages to
1325 insulate translation template from version of yacc/bison used
1326 to compile the grammar.
1328 2004-10-05 Ranjit Mathew <rmathew@hotmail.com>
1330 Prepare for %q, %< and %> in diagnostic message strings.
1331 * java-tree.h (parse_error_context): remove ATTRIBUTE_PRINTF_2.
1332 Name second parameter 'msgid'.
1333 * parse.y: Additionally include pretty-print.h and diagnostic.h.
1334 (issue_warning_error_from_context): Use pretty-printer functions
1335 instead of vsprintf for constructing formatted messages. Rename
1336 parameter 'msg' to 'msgid'.
1337 (parse_error_context): Rename parameter 'msg' to 'msgid'.
1338 (parse_warning_context): Likewise.
1340 2004-10-05 Andrew Haley <aph@redhat.com>
1343 * jcf-parse.c (parse_zip_file_entries): If a class has a
1344 superclass and a TYPE_SIZE of zero, lay it out.
1346 2004-09-30 Andrew Haley <aph@redhat.com>
1349 * jcf-parse.c (compute_class_name): Rewrite.
1351 2004-10-01 Jan Hubicka <jh@suse.cz>
1353 * java.c (java_expand_body): Update call of tree_rest_of_compilation.
1355 2004-10-01 Kazu Hirata <kazu@cs.umass.edu>
1357 * lex.c: Fix a comment typo.
1359 2004-10-01 Kazu Hirata <kazu@cs.umass.edu>
1361 * java-tree.h: Fix a comment typo.
1363 2004-09-30 Per Bothner <per@bothner.com>
1365 Simplify lexer. Implement --enable-mapped-location support.
1366 * jcf-parse.c (parse_class_file): Use linemap_line_start.
1367 (parse_source_file_1): Pass filename as extra parameter, so we can call
1368 linemap_add and set input_location here, rather than in both callers.
1369 (read_class): Pass copied filename to parse_source_file_1.
1370 Don't initialize wfl_operator - only needed for source compilation.
1371 (read_class, jcf_parse): Call linemap_add with LC_LEAVE.
1372 * lex.h: Remove a bunch of debugging macros.
1373 * lex.h (struct_java_line, struct java_error): Remove types.
1374 (JAVA_COLUMN_DELTA): Remove - use java_lexer.next_colums instead.
1375 (struct java_lc_s): Remove prev_col field.
1376 (struct java_lexer): New fields next_unicode, next_columns, and
1377 avail_unicode. New position field, and maybe token_start field.
1378 Don't need hit_eof field - use next_unicode == -1 instead.
1379 (JAVA_INTEGERAL_RANGE_ERROR): Rename to JAVA_RANGE_ERROR.
1380 (JAVA_RANGE_ERROR, JAVA_FLOAT_ANGE_ERROR): Update accordingly.
1381 * parse.h: Various changes for USE_MAPPED_LOCATION.
1382 (EXPR_WFL_EMIT_LINE_NOTE): XXX
1383 (BUILD_EXPR_WFL, EXPR_WFL_ADD_COL): Remove no-longer-used macros.
1384 (struct parser_ctxt): New file_start_location field.
1385 Remove p_line, c_line fields since we no longer save lines.
1386 Remove elc, lineno, and current_jcf fields - no longer used.
1387 * parse.y: Updates for USE_MAPPED_LOCATION and new lexer.
1388 Don't use EXPR_WFL_ADD_COL since that isn't trivial with
1389 source_location and is probably not needed anymore anyway.
1390 Use new expr_add_Location function.
1391 (SET_EXPR_LOCATION_FROM_TOKEN): New convenience macro.
1392 (java_pop_parser_context): Minor cleanup.
1393 (java_parser_context_save_global, java_parser_context_restore_global,
1394 java_pop_parser_context): Save/restore input_location as a unit.
1395 (issue_warning_error_from_context): If USE_MAPPED_LOCATION take
1396 a source_location instead of a wfl context node.
1397 (check_class_interface_creation): input_filename is not addressable.
1398 (create_artificial_method): Calling java_parser_context_save_global
1399 and java_parser_context_restore_global is overkill. Instead,
1400 temporarily set input_location from class decl.
1401 (java_layout_seen_class_methods): Set input_location from method decl.
1402 (fix_constructors): Make more robust if no EXPR_WITH_FILE_LOCATION.
1403 (finish_loop_body): Likewise.
1404 * lex.c: Updates for USE_MAPPED_LOCATION. Use build_unknwon_wfl.
1405 (java_sprint_unicode): Take a character, not index in line.
1406 (java_sneak_uncode): Replaced by java_peek_unicode.
1407 (java_unget_unicode): No longer used.
1408 (java_allocate_new_line. java_store_unicode): Removed, since we
1409 no longer remember "lines".
1410 (java_new_lexer): Update for new data structures.
1411 (java_read_char): Move unget_value checking to java_read_unicode.
1412 (java_get_unicode, java_peek_unicode, java_next_unicode): New more
1413 efficient functions that are used directly when lexing.
1414 (java_read_unicode_collapsing_terminators): No longer needed.
1415 (java_parse_end_comment, java_parse_escape_sequence, do_java_lex):
1416 Re-organize to use java_peek_unicode to avoid java_unget_unicode.
1417 (java_parse_escape_sequence): Rewrite to be simpler / more efficient.
1418 (do_java_lex): Lots of movings around to avoid java_unget_unicode,
1419 combine switch branches, and test for common token kinds earlier.
1420 (java_lex_error): Rewrite.
1421 * jv-scan.c (expand_location): New function, copied from tree.c.
1422 (main): Set ctxp->filename instead of setting input_filename directly.
1424 2004-09-30 Per Bothner <per@bothner.com>
1426 More cleanup for --enable-mapped-location.
1427 * class.c (push_class): If USE_MAPPED_LOCATION don't set
1428 input_location here. Instead do it in give_name_to_class.
1429 (build_class_ref): Set DECL_ARTIFICIAL, for the sake of dwarf2out.
1430 * expr.c (expand_byte_code): Call linemap_line_start.
1431 * expr.c (build_expr_wfl): If USE_MAPPED_LOCATION, change final
1432 parameters to a source_location. Don't need EXPR_WFL_FILENAME_NODE.
1433 (expr_add_location): New function, if USE_MAPPED_LOCATION.
1434 * class.c (maybe_layout_super_class): Adjust build_expr_wfl call
1435 to USE_MAPPED_LOCATION case.
1437 * java-tree.h (JAVA_FILE_P, ZIP_FILE_P): Remove unused macros.
1438 * jcf-parse.c (java_parse_file): Don't set input_filename.
1439 Use IS_A_COMMAND_LINE_FILENAME_P to check for duplicate filenames.
1440 Create a list of TRANSLATION_UNIT_DECL.
1441 (current_file_list): Is now a TRANSLATION_UNIT_DECL chain. The
1442 reason is so we can set a DECL_SOURCE_LOCATION for each file.
1443 (java_parse_file): Don't set unused ZIP_FILE_P, JAVA_FILE_P..
1444 Create line-map LC_ENTER/LC_LEAVE entries for archive itself.
1445 (file_start_location): New static.
1446 (set_source_filename): Avoid extra access to input_filename macro.
1447 Concatenate new name with class's package prefix.
1448 (set_source_filename, give_name_to_class): Update.
1449 (give_name_to_class): Set class's "line 0" input_location here.
1450 (parse_class_file): Set input_location as a unit.
1452 * jcf-parse.c (load_class): Sanity test if missing inner class file.
1454 2004-09-29 Per Bothner <per@bothner.com>
1456 * java-tree.h: Redefine some macros and add some declaration
1457 to handle the USE_MAPPED_LOCATION case.
1458 * parse.h (EXPR_WFL_QUALIFICATION): Use operand 1, not 2.
1459 * java-tree.h (EXPR_WFL_FILENAME_NODE): Use operand 2, not 1.
1460 * java-tree.def (EXPR_WITH_FILE_LOCATION): Only need two operands in
1461 USE_MAPPED_LOCATION case, since EXPR_WFL_FILENAME_NODE is gone.
1463 * check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
1464 * decl.c (finish_method, java_add_stmt): Likewise.
1465 * java-gimplify.c (java-gimplify.c): Likewise.
1466 * jcf-write.c (generate_bytecode_insns): Likewise.
1467 * lang.c (java_post_options): Likewise - call linemap_add.
1469 2004-09-29 Andrew Haley <aph@redhat.com>
1472 * parse.y (patch_binop): Don't mess with the TREE_SIDE_EFFECTS of the
1473 result of TRUNC_MOD_EXPR.
1474 (patch_unaryop): Likewise for CONVERT_EXPR, which may throw.
1475 * decl.c (java_init_decl_processing): Mark
1476 soft_lookupinterfacemethod_node and soft_instanceof_node pure.
1478 2004-09-28 Tom Tromey <tromey@redhat.com>
1481 * class.c (add_miranda_methods): Load superinterface if not
1484 2004-09-28 Andrew Haley <aph@redhat.com>
1487 * jcf-parse.c (load_class): Don't try to read a class that we've
1490 2004-09-28 Andrew Haley <aph@redhat.com>
1492 * jcf-parse.c (load_class): Back out previous broken patch.
1494 2004-09-28 Andrew Haley <aph@redhat.com>
1497 * jcf-parse.c (load_class): Don't try to read a class that we've
1499 Check that we really did read the right class.
1501 2004-09-25 Tom Tromey <tromey@redhat.com>
1504 * parse.y (create_artificial_method): Use add_method_1.
1506 2004-09-25 Kazu Hirata <kazu@cs.umass.edu>
1508 * expr.c, jcf-dump.c, parse-scan.y, parse.y: Fix
1510 * gcj.texi: Fix typos.
1512 2004-09-24 Tom Tromey <tromey@redhat.com>
1515 * parse.y (class_instance_creation_expression): Set `$$' to NULL
1516 in error parts of rule.
1517 (unary_expression): Don't call error_if_numeric_overflow when $1
1520 2004-09-24 Tom Tromey <tromey@redhat.com>
1523 * parse.y (resolve_qualified_expression_name): Set
1524 CAN_COMPLETE_NORMALLY on first call when chaining static calls.
1525 * expr.c (force_evaluation_order): Check for empty argument list
1526 after stripping COMPOUND_EXPR.
1528 2004-09-23 Andrew Haley <aph@redhat.com>
1531 * parse.y (java_complete_lhs): Call patch_string() on Operand 1 of
1534 2004-09-23 Tom Tromey <tromey@redhat.com>
1537 * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
1538 where operand is null.
1540 2004-09-23 Tom Tromey <tromey@redhat.com>
1543 * parse.y (not_accessible_p): Allow access to protected members
1544 even when class is not static.
1546 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
1548 * Make-lang.in: Revert the gcc-none.o change.
1550 2004-09-22 Nathan Sidwell <nathan@codesourcery.com>
1552 * parse.y (patch_anonymous_class): VEC_space returns true if there
1555 2004-09-21 Matt Austern <austern@apple.com>
1558 * gjavah.c (free_method_name_list): Fix function definition so
1559 it's a proper C prototype.
1561 2004-09-21 Tom Tromey <tromey@redhat.com>
1564 * gjavah.c (free_method_name_list): New method.
1567 2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
1568 Zack Weinberg <zack@codesourcery.com>
1570 * java-tree.def: Use tree_code_class enumeration constants
1571 instead of code letters.
1572 * java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for
1573 new tree-class enumeration constants.
1575 2004-09-13 Tom Tromey <tromey@redhat.com>
1578 * class.c (layout_class_method): Put synthetic methods into the
1581 2004-09-11 Andrew Pinski <apinski@apple.com>
1583 * Make-lang.in (java/ggc-none.c): Change dependency
1584 for ggc.h into $(GGC_H).
1586 2004-09-11 Mohan Embar <gnustuff@thisiscool.com>
1588 * Make-lang.in (java/win32-host.o): Add dependency on
1590 * win32-host.c: Add includes for coretypes.h, jcf.h
1592 2004-09-11 Mohan Embar <gnustuff@thisiscool.com>
1594 * Make-lang.in (GCJH_OBJS): Change dependency from
1595 ggc-none.o to java/ggc-none.o
1596 (JCFDUMP_OBJS): Likewise.
1597 (java/ggc-none.o): New target.
1599 2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
1601 * boehm.c (get_boehm_type_descriptor): Adjust build_int_cst calls.
1602 * class.c (build_utf8_ref, build_static_field_ref,
1603 make_field_value, make_method_value, get_dispatch_table,
1604 make_class_data, emit_symbol_table, emit_catch_table): Likewise.
1605 * constants.c (get_tag_node, build_ref_from_constant_pool,
1606 build_constants_constructor): Likewise.
1607 * decl.c (java_init_decl_processing): Likewise.
1608 * expr.c (build_java_array_length_access, build_newarray,
1609 expand_java_multianewarray, expand_java_pushc, expand_iinc,
1610 build_java_binop, build_field_ref, expand_java_add_case,
1611 expand_java_call, build_known_method_ref, build_invokevirtual,
1612 build_invokeinterface, build_jni_stub): Likewise.
1613 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
1614 * jcf-parse.c (get_constant): Likewise.
1615 * lex.c (do_java_lex): Likewise.
1616 * parse.y (patch_binop, patch_unaryop, patch_cast,
1617 build_newarray_node, patch_newarray): Likewise.
1618 * resource.c (compile_resource_data): Likewise.
1619 * typeck.c (build_prim_array_type): Likewise.
1621 2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
1623 * decl.c (java_init_decl_processing): Adjust
1624 initialize_sizetypes call.
1626 2004-08-23 Nathan Sidwell <nathan@codesourcery.com>
1628 * jv-scan.c (fancy_abort): Add.
1630 2004-08-20 Nathan Sidwell <nathan@codesourcery.com>
1632 * expr.c (build_java_arrayaccess): Use convert to change
1635 2004-08-19 Bryce McKinlay <mckinlay@redhat.com>
1637 * class.c (make_local_function_alias): Allocate extra space for 'L'
1638 in name buffer. Reported by Thomas Neumann.
1640 2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
1642 * parse.h (JAVA_RADIX10_FLAG): Rename to ...
1643 (JAVA_NOT_RADIX10_FLAG): ... here. Invert meaning.
1644 * lex.c (do_java_lex): Adjust.
1645 (error_if_numeric_overflow): Likewise.
1647 2004-08-18 Andrew Pinski <apinski@apple.com>
1649 * class.c (make_local_function_alias): Only make a new decl if we
1650 support alias attribute on all decls.
1652 2004-08-18 Bryce McKinlay <mckinlay@redhat.com>
1654 * class.c (make_local_function_alias): New function. Create local
1655 alias for public method DECL.
1656 (make_method_value): Use make_local_function_alias.
1657 * parse.y (craft_constructor): Don't special-case anonymous classes.
1658 Always set ctor_name to init_identifier_node.
1659 (lookup_method_invoke): Call layout_class_method when creating
1660 anonymous class constructor.
1662 2004-08-18 Richard Henderson <rth@redhat.com>
1664 * java-gimplify.c (java_gimplify_expr): Move '2' handling into
1665 default case. Treat '<' similarly. Update for
1666 is_gimple_formal_tmp_var name change.
1668 2004-08-17 Andrew Haley <aph@redhat.com>
1670 * lang.c (lang_printable_name): Obey verbose flag.
1671 * parse.y (constructor_circularity_msg): Set VERBOSE arg for
1672 lang_printable_name().
1673 (verify_constructor_circularity, get_printable_method_name,
1674 check_abstract_method_definitions, java_check_regular_methods,
1675 java_check_abstract_methods, check_inner_class_access,
1676 fix_constructors, patch_method_invocation, patch_return):
1678 * expr.c (pop_type_0): Likewise.
1680 * java-tree.h (lang_printable_name_wls): Delete.
1682 2004-08-16 Tom Tromey <tromey@redhat.com>
1685 * parse.y (primary): Changed for initialized and uninitialized
1687 (array_access): Handle array_creation_initialized.
1688 (array_creation_expression): Split into
1689 array_creation_initialized and array_creation_uninitialized.
1691 2004-08-16 Andrew Haley <aph@redhat.com>
1693 * jcf-write.c (find_constant_index): Canonicalize NaNs when
1694 generating bytecode.
1696 2004-08-16 Elliot Lee <sopwith@redhat.com>
1699 * jcf-parse.c (java_parse_file): Handle filenames with embedded
1700 spaces, and quoted filelists.
1702 2004-08-15 Nathan Sidwell <nathan@codesourcery.com>
1704 * boehm.c (get_boehm_type_descriptor): Use build_int_cst.
1705 * class.c (build_utf8_ref, build_static_field_ref,
1706 make_field_value, make_method_value, get_dispatch_table,
1707 make_class_data, emit_symbol_table, emit_catch_table): Likewise.
1708 * constants.c (get_tag_node, build_ref_from_constant_pool,
1709 build_constants_constructor): Likewise.
1710 * decl.c (java_init_decl_processing): Likewise.
1711 * expr.c (build_java_array_length_access, build_newarray,
1712 expand_java_multianewarray, expand_java_pushc, expand_iinc,
1713 build_java_binop, build_field_ref, expand_java_add_case,
1714 expand_java_call, build_known_method_ref, build_invokevirtual,
1715 build_invokeinterface, build_jni_stub): Likewise.
1716 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
1717 * jcf-parse.c (get_constant): Likewise.
1718 * lex.c (do_java_lex): Likewise.
1719 * parse.y (patch_binop, patch_unaryop, patch_cast,
1720 build_null_of_type, patch_newarray): Likewise.
1721 * resource.c (compile_resource_data): Likewise.
1722 * typeck.c (build_prim_array_type): Likewise.
1724 2004-08-10 Bryce McKinlay <mckinlay@redhat.com>
1726 * java-gimplify.c (java_gimplify_new_array_init): Use create_tmp_var.
1727 Don't create BLOCK here or call java_gimplify_block.
1729 2004-08-09 H.J. Lu <hongjiu.lu@intel.com>
1731 * java-tree.h (flag_deprecated): Removed.
1732 * lang.opt (Wdeprecated): Use existing Var(warn_deprecated).
1733 * parse.y (check_deprecation): Check warn_deprecated instead of
1736 2004-08-06 Kelley Cook <kcook@gcc.gnu.org>
1738 * lang.c (flag_emit_class_files, flag_filelist_file, flag_redundant,
1739 flag_use_divide_subroutine, flag_use_boehm_gc, flag_store_check,
1740 flag_hash_synchronization, flag_assert, flag_jni, flag_newer,
1741 flag_check_references, flag_extraneous_semicolon, flag_deprecated,
1742 flag_force_classes_archive_check, flag_optimize_sci,
1743 flag_indirect_dispatch): Remove explicit declarations.
1744 * lang.opt: Add implicit declare/define/assign. Remove obsolete
1747 2004-08-05 Michael Chastain <mec.gnu@mindspring.com>
1750 * Make-lang.in (java.install-man): Install from either build
1751 tree or source tree, whichever has the file first.
1753 2004-08-05 Nathan Sidwell <nathan@codesourcery.com>
1755 * jcf-parse.c (get_constant): Adjust force_fit_type call.
1756 * lex.h (SET_LVAL_NODE_TYPE): Remove.
1757 * lex.c (java_perform_atof): Use SET_LVAL_NODE directly.
1758 (do_java_lex): Likewise. Adjust force_fit_type call.
1760 2004-08-04 Roger Sayle <roger@eyesopen.com>
1761 Andrew Haley <aph@redhat.com>
1763 * typeck.c (convert_ieee_real_to_integer): Call fold on the range
1764 checking trees as they're being built.
1765 (convert): Call convert_ieee_real_to_integer if we're
1766 converting a constant, even if we're writing a class file.
1768 2004-08-02 Bryce McKinlay <mckinlay@redhat.com>
1771 * parse.y (fold_constant_for_init): Call resolve_field_access with
1772 correct current_class context.
1774 2004-08-01 Roger Sayle <roger@eyesopen.com>
1776 * decl.c (update_aliases, initialize_local_variable): Replace calls
1777 to build with calls to buildN.
1778 * java-gimplify.c (java_gimplify_modify_expr): Likewise.
1779 * java-tree.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Likewise.
1780 * parse.h (BUILD_THROW): Likewise.
1781 * parse.y (switch_expression, synchronized_statement,
1782 catch_clause_parameter, array_creation_expression,
1783 conditional_expression, make_qualified_name,
1784 resolve_qualified_expression_name, patch_method_invocation,
1785 patch_invoke, build_method_invocation, build_new_invocation,
1786 build_assignment, patch_assignment, build_binop, patch_binop,
1787 build_string_concatenation, build_incdec, patch_unaryop,
1788 patch_cast, build_array_ref, build_newarray_node, patch_newarray,
1789 patch_return, build_if_else_statement, build_labeled_block,
1790 build_new_loop, build_loop_body, build_bc_statement,
1791 build_assertion, encapsulate_with_try_catch, build_try_statement,
1792 build_try_finally_statement, patch_synchronized_statement,
1793 emit_test_initialization): Likewise, replace build with buildN.
1795 2004-07-28 Eric Christopher <echristo@redhat.com>
1797 * lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
1798 (java_unsafe_for_reeval): Ditto.
1800 2004-07-26 <hp@bitrange.com>
1802 * parse.y (build_super_invocation): Adjust declaration order to
1803 avoid declaration after statement.
1805 2004-07-25 Bernardo Innocenti <bernie@develer.com>
1807 * decl.c: Rename all identifiers named `class' to `cl'.
1809 2004-07-25 Richard Henderson <rth@redhat.com>
1811 * decl.c (build_result_decl): Set DECL_ARTIFICIAL and DECL_IGNORED_P.
1813 2004-07-23 Mike Stump <mrs@apple.com>
1815 * boehm.c (set_bit): Improve type safety wrt unsignedness.
1816 * gjavah.c (throwable_p, decode_signature_piece,
1817 print_full_cxx_name, print_include, add_namelet, add_class_decl,
1818 process_file): Likewise.
1819 * jcf-dump.c (main): Likewise.
1820 * jcf-io.c (read_zip_member): Likewise.
1821 * jcf-parse.c (HANDLE_CONSTANT_Utf8, get_constant,
1822 give_name_to_class, get_class_constant): Likewise.
1823 * jcf-write.c (find_constant_wide, push_long_const,
1824 generate_classfile): Likewise.
1825 * lex.c (java_new_lexer, java_read_char, cxx_keyword_p): Likewise.
1826 * parse.y (read_import_dir): Likewise.
1827 * typeck.c (parse_signature_type): Likewise.
1828 * verify.c (verify_jvm_instructions): Likewise.
1829 * zextract.c (find_zip_file_start, read_zip_archive): Likewise.
1831 2004-07-23 Thomas Fitzsimmons <fitzsim@redhat.com>
1833 * Make-lang.in: Replace rmic and rmiregistry references with
1834 grmic and grmiregistry.
1835 * gcj.texi: Likewise.
1837 2004-07-20 Andrew Haley <aph@redhat.com>
1840 * verify.c (verify_jvm_instructions): Comment change only.
1842 * typeck.c (build_java_array_type): Add size field to array name.
1844 * java-tree.h (LOCAL_SLOT_P): New.
1845 (update_aliases): Add PC argument.
1846 (pushdecl_function_level): New function.
1848 * java-gimplify.c (java_gimplify_expr): Handle VAR_DECL,
1849 MODIFY_EXPR, and SAVE_EXPR.
1850 (java_gimplify_modify_expr): New function.
1852 * expr.c (push_type_0): Call find_stack_slot() to create temporary.
1853 (expand_iinc): Pass PC to update_aliases().
1854 (STORE_INTERNAL): Likewise.
1855 (process_jvm_instruction): Likewise.
1857 * decl.c (base_decl_map): New variable.
1858 (uniq): New variable.
1859 (update_aliases): Rewrite with more thorough checking.
1860 (debug_variable_p): New function.
1861 (push_jvm_slot): Don't initialize local variable. Don't pushdecl.
1862 (check_local_named_variable): Delete whole function.
1863 (initialize_local_variable): New function.
1864 (check_local_unnamed_variable): Add checks and comments.
1865 (find_local_variable): Rewrite.
1866 (java_replace_reference): New function.
1867 (function_binding_level): New variable.
1868 (pushdecl_function_level): New function.
1869 (maybe_pushlevels): Set DECL_LOCAL_END_PC.
1870 (maybe_pushlevels): Call pushdecl() on each of the new decls.
1871 (start_java_method): Reset uniq. Create base_decl_map. Set
1872 function_binding_level.
1873 (end_java_method): Null unused fields to save memory.
1875 2004-07-20 Nathan Sidwell <nathan@codesourcery.com>
1877 * class.c (add_interface_do): Remove.
1878 (set_super_info, interface_of_p, maybe_add_interface,
1879 add_interface, make_class_data, layout_class,
1880 add_miranda_methods): Adjust BINFO accessors and addition.
1881 * expr.c (can_widen_reference_to, lookup_field): Adjust BINFO
1883 * jcf-write.c (generate_classfile): Likewise.
1884 * parse.y (patch_anonymous_class, check_inner_circular_reference,
1885 check_circular_reference, java_complete_class,
1886 check_abstract_method_definitions,
1887 java_check_abstract_method_definitions,
1888 check_interface_throws_clauses, java_check_abstract_methods,
1889 lookup_java_interface_method2,
1890 find_applicable_accessible_methods_list): Adjust BINFO accessors
1892 * typeck.c (find_method_in_interfaces): Adjust BINFO accessors.
1894 2004-07-18 Roger Sayle <roger@eyesopen.com>
1896 * builtins.c (max_builtin, min_builtin,
1897 java_build_function_call_expr): Replace calls to build with buildN.
1898 * class.c (build_class_ref, build_static_field_ref,
1899 get_dispatch_table, make_class_data, layout_class_method): Likewise.
1900 * constants.c (build_ref_from_constant_pool): Likewise.
1901 * decl.c (update_aliases, push_jvm_slot, poplevel, finish_method,
1902 add_stmt_to_compound): Likewise.
1903 * except.c (build_exception_object_ref, expand_end_java_handler):
1905 * java-gimplify.c (java_gimplify_case_expr,
1906 java_gimplify_default_expr, java_gimplify_block,
1907 java_gimplify_new_array_init, java_gimplify_try_expr): Likewise.
1908 * jcf-write.c (generate_bytecode_insns): Likewise.
1909 * typeck.c (convert_ieee_real_to_integer): Likewise.
1911 2004-07-17 Joseph S. Myers <jsm@polyomino.org.uk>
1913 * java-tree.h (builtin_function): Declare.
1915 2004-07-16 Steven Bosscher <stevenb@suse.de>
1917 * parse.y (java_complete_expand_methods, java_expand_classes): Don't
1918 abuse restore_line_number_status.
1920 2004-07-15 Frank Ch. Eigler <fche@redhat.com>
1923 * jcf-parse.c (java_emit_static_constructor): Specify default
1926 2004-07-13 Per Bothner <per@bothner.com>
1928 * java-tree.h (all_class_filename): Remove useless macro.
1929 (enum java_tree_index): Remove JTI_ALL_CLASS_FILENAME constant.
1930 (BUILD_FILENAME_IDENTIFIER_NODE): Remove useless macro.
1931 * parse.y (java_parser_context_restore_global): Replace
1932 BUILD_FILENAME_IDENTIFIER_NODE by plain get_identifier.
1933 * jcf-parse.c (read_class, java_parse_file): Likewise.
1935 2004-07-12 Bryce McKinlay <mckinlay@redhat.com>
1938 gjavah.c (print_field_info): Emit constant only if field is static.
1940 2004-07-11 Roger Sayle <roger@eyesopen.com>
1942 * expr.c (java_truthvalue_conversion, flush_quick_stack,
1943 java_stack_swap, java_stack_dup, build_java_athrow, build_java_jsr,
1944 build_java_ret, build_java_throw_out_of_bounds_exception,
1945 build_java_array_length_access, java_check_reference,
1946 build_java_arrayaccess, build_java_arraystore_check, build_newarray,
1947 build_anewarray, expand_java_multianewarray, expand_java_arraystore,
1948 expand_java_arrayload, build_java_monitor, expand_java_return,
1949 expand_load_internal, expand_java_NEW, build_get_class,
1950 build_instanceof, expand_java_CHECKCAST, expand_iinc,
1951 build_java_soft_divmod, build_java_binop, build_field_ref,
1952 expand_compare, expand_java_goto, expand_java_switch,
1953 expand_java_add_case, build_class_init, build_known_method_ref,
1954 invoke_build_dtable, build_invokevirtual, build_invokeinterface,
1955 expand_invoke, build_jni_stub, expand_java_field_op,
1956 java_expand_expr, expand_byte_code, STORE_INTERNAL,
1957 force_evaluation_order, emit_init_test_initialization): Convert
1958 calls to "build" into calls to the prefered "buildN" functions.
1960 2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk>
1962 * java-tree.h (set_block): Remove.
1963 * lang.c (java_clear_binding_stack): New.
1964 (LANG_HOOKS_CLEAR_BINDING_STACK): Define.
1965 * decl.c (struct binding_level): Remove this_block.
1966 (clear_binding_level): Likewise.
1967 (poplevel): Don't handle this_block.
1968 (set_block): Remove.
1970 2004-07-10 Bryce McKinlay <mckinlay@redhat.com>
1972 * class.c (common_enclosing_context_p): Remove statement with no
1975 2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
1978 * parse.y (create_anonymous_class): Remove 'location' argument. Use
1979 the WFL from TYPE_NAME to get line number for the decl. Fix comment.
1980 (craft_constructor): Inherit access flags for implicit constructor
1981 from the enclosing class.
1982 (create_class): Fix comment typo.
1983 (resolve_qualified_expression_name): Pass type of qualifier to
1984 not_accessible_p, not the type in which target field was found.
1985 (not_accessible_p): Handle inner classes. Expand protected
1986 qualifier-subtype check to enclosing instances, but don't apply this
1987 check to static members. Allow protected access to inner classes
1988 of a subtype. Allow private access within common enclosing context.
1989 (build_super_invocation): Get WFL line number info from current
1991 (build_incomplete_class_ref): Update for new create_anonymous_class
1993 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Use
1994 common_enclosing_instance_p.
1995 * class.c (common_enclosing_context_p): New. Determine if types
1996 share a common enclosing context, even across static contexts.
1997 (common_enclosing_instance_p): Renamed from
1998 common_enclosing_context_p. Determines if types share a common
1999 non-static enclosing instance.
2000 * java-tree.h (common_enclosing_instance_p): Declare.
2001 * jcf-write.c (get_method_access_flags): New. Surpress private flag
2002 for inner class constructors.
2003 (generate_classfile): Use get_method_access_flags.
2005 2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
2007 * class.c (interface_of_p): Check for null TYPE_BINFO.
2009 2004-07-09 Nathan Sidwell <nathan@codesourcery.com>
2011 * class.c (make_class): Do not create binfo here.
2012 (set_super_info): Create it here.
2013 * java-tree.h (CLASS_HAS_SUPER): Cope with lack of a binfo.
2015 2004-07-08 Richard Henderson <rth@redhat.com>
2017 * expr.c (case_identity, get_primitive_array_vtable,
2018 java_expand_expr, emit_init_test_initialization): Remove.
2019 * java-tree.h (java_expand_expr): Remove.
2020 * lang.c (LANG_HOOKS_EXPAND_EXPR): Remove.
2022 2004-07-07 Per Bothner <per@bothner.com>
2024 * class.c (build_static_field_ref): Add a NOP_EXPR; otherwise we
2025 get internal error due to mismatched types.
2027 * gcj.texi (Invoking gij): Document new -verbose:class flag.
2029 * gcj.texi (Linking): New node. Document -lgij usage.
2031 2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
2033 * java-tree.h (CLASSTYPE_SPUER): Adjust BINFO macros.
2034 (TYPE_NVIRTUALS, TYPE_VTABLE): Likewise.
2035 * java/class.c (set_super_info, class_depth, interface_of_p,
2036 maybe_add_interface, add_interface, make_class_data,
2037 layout_class, add_miranda_methods): Adjust BINFO macros.
2038 * expr.c (can_widen_reference_to, lookup_field): Likewise.
2039 * jcf-write.c (generate_classfile): Likewise.
2040 * parse.y (patch_anonymous_class,
2041 check_inner_circular_reference, check_circular_reference,
2042 java_complete_class, check_abstract_method_definitions,
2043 java_check_abstract_method_definitions,
2044 check_interface_throws_clauses, java_check_abstract_methods,
2045 lookup_java_interface_method2,
2046 find_applicable_accessible_methods_list): Likewise.
2047 * typeck.c (find_method_in_interface): Likewise.
2048 * verify.c (merge_types): Likewise.
2050 2004-07-06 Nathan Sidwell <nathan@codesourcery.com>
2052 * java-tree.h (CLASS_HAS_SUPER_FLAG): Use BINFO_FLAG_1.
2053 * class.c (add_interface_do): Use BINFO_VIRTUAL_P.
2055 2004-07-05 Nathan Sidwell <nathan@codesourcery.com>
2057 * class.c (make_class): Use make_tree_binfo.
2058 (set_super_info, add_interface_do): Likewise.
2059 * java-tree.h (CLASS_HAS_SUPER_FLAG): Expect a BINFO.
2061 2004-07-04 Ranjit Mathew <rmathew@hotmail.com>
2063 * verify.c: Correct array element access formatting thinko.
2065 2004-07-04 Ranjit Mathew <rmathew@hotmail.com>
2067 * verify.c: Insert a short blurb at the start referring to the JVMS.
2068 (merge_type_state): Remove redundant nested if statement.
2069 (verify_jvm_instructions): Ensure current_subr is initialised to
2071 Minor formatting fixes all over the place.
2073 2004-07-02 Richard Henderson <rth@redhat.com>
2075 * jcf-write.c (generate_bytecode_insns <case SAVE_EXPR>): Rewrite.
2077 2004-07-01 Richard Henderson <rth@redhat.com>
2079 * class.c (registerClass_libfunc): Remove.
2080 (init_class_processing): Don't set it.
2081 (emit_register_classes): Take list_p parameter. Fill it in
2082 with _Jv_RegisterClass calls.
2083 * decl.c (java_init_decl_processing): Don't call
2084 init_resource_processing.
2085 * jcf-parse.c (java_emit_static_constructor): New.
2086 (java_parse_file): Call it.
2087 * resource.c (registerResource_libfunc): Remove.
2088 (init_resource_processing): Remove.
2089 (write_resource_constructor): Take list_p parameter. Fill it in
2090 with _Jv_RegisterResource calls.
2091 * java-tree.h: Update prototypes.
2093 2004-06-29 Bryce McKinlay <mckinlay@redhat.com>
2096 * class.c (layout_class_method): Do not override package-private
2097 method if its in a different package.
2098 (split_qualified_name): Move here from parse.y. Rename from
2099 breakdown_qualified. Add comment.
2100 (in_same_package): Move here from parse.y. Add comment.
2101 * java-tree.h (break_down_qualified, in_same_package): Declare.
2102 (in_same_package): Likewise.
2103 * parse.y (breakdown_qualified, in_same_package): Moved to class.c.
2106 2004-06-29 Andrew Haley <aph@redhat.com>
2108 * except.c (expand_start_java_handler): Push a new binding level.
2109 Don't build a TRY_CATCH_EXPR now, we'll do it later. Call
2110 register_exception_range() to register where we'll do it.
2111 (expand_end_java_handler): Remove old bogus code. Replace with
2112 new logic that simply builds TRY_CATCH_EXPRs and inserts them at
2113 the top of the expression we're curently building.
2114 (maybe_end_try): Delete.
2115 * decl.c (binding_level.exception_range): New field.
2116 (clear_binding_level): Add field exception_range. Reformat.
2117 (poplevel): Call expand_end_java_handler().
2118 (poplevel): Call java_add_stmt only if functionbody is false.
2119 (maybe_poplevels): Don't call maybe_end_try() from here.
2120 (end_java_method): Clear no longer used trees in function decl.
2121 (register_exception_range): New function.
2122 * java-tree.h (register_exception_range, struct eh_range): Declare.
2124 2004-06-28 Bryce McKinlay <mckinlay@redhat.com>
2126 * jcf-write.c (get_classfile_modifiers): Formatting fixes.
2128 2004-06-27 Ranjit Mathew <rmathew@hotmail.com>
2131 * expr.c (class_has_finalize_method): Fix method name indentation.
2132 (expand_java_call): Remove K&R style parameter declaration.
2133 (expand_invoke): Fix statement indentation.
2134 (expand_java_field_op): Likewise.
2135 * parse-scan.y: Fix typo.
2136 (reset_report): Fix method name indentation.
2137 * parse.y (unresolved_type_p, build_expr_block): Remove extra blank
2139 * verify.c (verify_jvm_instructions): Document parameters, insert
2141 * lang.c (lang_init_source): Fix method name indentation.
2142 * class.c (common_enclosing_context_p): Likewise.
2143 (emit_symbol_table): Fix parameter list indentation.
2144 * decl.c (add_stmt_to_compound, java_add_stmt): Remove K&R style
2145 parameter declaration.
2146 * constants.c: Fix copyright notice indentation.
2147 * typeck.c (find_method_in_superclasses): Fix parameter list
2149 (find_method_in_interfaces): Likewise.
2150 * zextract.c (makelong): Fix method name indentation.
2152 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
2155 * parse.y (create_interface): Set correct access modifiers for
2157 * jcf-write.c (get_classfile_modifiers): New function.
2158 (generate_classfile): Use get_classfile_modifiers, not
2161 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
2163 * parse.y (register_incomplete_type): Set JDEP_ENCLOSING for "super"
2164 dependency to current parser context, not NULL_TREE, for top-level
2166 (jdep_resolve_class): Enable member access check for all inner
2169 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
2171 * parse.y (qualify_and_find): Pass type decl, not identifier, to
2174 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
2177 * expr.c (expand_java_field_op): Ensure that target class for static
2178 field access has been loaded.
2180 2004-06-26 Bryce McKinlay <mckinlay@redhat.com>
2181 Ranjit Mathew <rmathew@hotmail.com>
2183 PR java/1207, java/16178
2184 * jcf-parse.c (load_class): Return immediately if passed a type decl
2185 where CLASS_FROM_SOURCE_P is set. Remove FIXME.
2186 * parse.y (do_resolve_class): Remove checks for CLASS_FROM_SOURCE_P
2187 before calling load_class.
2188 (qualify_and_find): Likewise.
2189 (find_in_imports_on_demand): Likewise.
2190 (find_applicable_accessible_methods_list): Likewise.
2192 2004-06-24 Bryce McKinlay <mckinlay@redhat.com>
2194 * parse.y (java_layout_seen_class_methods): Don't call load_class
2195 on class defined by source parser.
2197 2004-06-23 Bryce McKinlay <mckinlay@redhat.com>
2199 * parse.y (set_nested_class_simple_name_value): Removed.
2200 (java_complete_expand_class): Remove calls to
2201 set_nested_class_simple_name_value.
2203 2004-06-22 Andrew Haley <aph@redhat.com>
2204 Ranjit Mathew <rmathew@hotmail.com>
2206 Fixes PR java/16113.
2207 * decl.c (force_poplevels): Remove call to expand_end_bindings.
2209 2004-06-22 Ranjit Mathew <rmathew@hotmail.com>
2211 * parse.y (create_class): Correct diagnostic message about
2212 java.lang.Object extending anything else.
2214 2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2216 * class.c (build_class_ref): Add new operand for COMPONENT_REF.
2217 (build_static_field_ref): Likewise and add new operands for ARRAY_REF.
2218 * constants.c (build_ref_from_constant_pool): Likewise.
2219 * expr.c (build_java_array_length_access): Likewise.
2220 (build_get_class, build_field_ref, build_known_method_ref): Likewise.
2221 (invoke_build_dtable, build_invokevirtual): Likewise.
2222 (build_invokeinterface, java_expand_expr): Likewise.
2223 (emit_init_test_initialization): Likewise.
2224 * java-gimplify.c (java_gimplify_new_array_init): Likewise.
2225 * parse.y (make_qualifed_name, build_array_ref): Likewise.
2227 2004-06-21 Andrew Haley <aph@redhat.com>
2229 * java-gimplify.c (java_gimplify_block): set TREE_USED on the new
2232 2004-06-21 Joseph S. Myers <jsm@polyomino.org.uk>
2234 * jcf.h (struct JCF): Change java_source, right_zip and finished
2236 * lex.h (struct java_lexer): Change hit_eof, read_anything,
2237 byte_swap and use_fallback to unsigned int.
2238 * parse.h (struct _jdep): Change flag0 to unsigned int.
2240 2004-06-17 Ranjit Mathew <rmathew@hotmail.com>
2243 * parse.y (java_layout_seen_class_methods): Ensure class is loaded
2244 before trying to lay out its methods.
2245 * jcf-parse.c (read_class): Track parsed files using canonical paths
2246 obtained via lrealpath from libiberty.
2247 (java_parse_file): Likewise.
2248 (parse_source_file_1): Rename formal parameter to reflect its
2249 modified purpose. Minor formatting fix.
2251 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
2253 * class.c (emit_register_classes): Make the function uninlinable,
2254 do not set current_function_cannot_inline.
2255 * resource.c (write_resource_constructor): Do not reset
2256 flag_inline_functions around rest_of_compilation.
2258 2004-06-08 Andrew Pinski <pinskia@physics.uc.edu>
2261 * expr.c (java_truthvalue_conversion): Handle
2262 UNEQ_EXPR, UNLE_EXPR, UNGE_EXPR, UNLT_EXPR, UNGT_EXPR,
2263 ORDERED_EXPR, and UNORDERED_EXPR as comparison operators,
2264 i.e. return the expression.
2266 2004-06-03 Mark G. Adams <mark.g.adams@sympatico.ca>
2268 * gjavah.c: Include version.h
2270 2004-05-31 Bryce McKinlay <mckinlay@redhat.com>
2272 * jcf-write.c (generate_bytecode_conditional): Correct handling
2273 of unordered conditionals. Add comment.
2275 2004-05-29 Ranjit Mathew <rmathew@hotmail.com>
2276 Per Bothner <per@bothner.com>
2278 * java-tree.h (DECL_LOCAL_FINAL_IUD): New macro to test if a
2279 local variable was initialised upon declaration.
2280 * parse.y (declare_local_variables): Set DECL_LOCAL_FINAL_IUD if
2281 variable was final and initialised upon declaration.
2282 * check-init.c (check_final_reassigned): Give error only if a blank
2283 final is not definitely unassigned or if an initialised final is
2285 (check_bool_init): Respect JLS2 16.1.7 requirements for boolean
2286 assignment expressions. Remove case MODIFY_EXPR, label do_default.
2287 (check_init): Perform initialised-variable-removing-optimisation
2288 only on non-final local variables.
2290 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
2292 * jcf-write.c (generate_bytecode_conditional): Handle binops
2293 UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR,
2295 (generate_bytecode_insns): Likewise.
2297 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
2299 * check-init.c (check_init): Handle binops UNLT_EXPR, UNLE_EXPR,
2300 UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, and LTGT_EXPR.
2302 2004-05-28 Bryce McKinlay <mckinlay@redhat.com>
2304 * gcj.texi (Object allocation): Remove _Jv_AllocBytes.
2305 (Mixing with C++): Document JvAllocBytes and RawDataManaged.
2307 2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
2309 * decl.c (struct binding_level): Add GTY marker. Compile
2310 binding_depth unconditionally.
2311 (current_binding_level, free_binding_level, global_binding_level):
2313 (clear_binding_level): Unconditionally set binding_depth.
2314 (make_binding_level): Use ggc_alloc_cleared, not xmalloc.
2316 2004-05-26 Bryce McKinlay <mckinlay@redhat.com>
2318 * lex.c (java_new_lexer): Set 'encoding'.
2319 (java_read_char): Improve error message for unrecognized characters.
2320 * lex.h (struct java_lexer): New field 'encoding'.
2322 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
2324 * Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.
2326 2004-05-21 Mark Wielaard <mark@klomp.org>
2328 * gjavah.c (print_stub_or_jni): Mark functions only JNIEXPORT, not
2331 2004-05-19 Paolo Bonzini <bonzini@gnu.org>
2333 * typeck.c: Remove non-printable character 160.
2335 2004-05-17 Ranjit Mathew <rmathew@hotmail.com>
2337 * check-init.c: Correct minor typos.
2339 2004-05-13 Diego Novillo <dnovillo@redhat.com>
2341 * Make-lang.in, expr.c, java-gimplify.c: Rename
2342 tree-simple.[ch] to tree-gimple.[ch].
2344 2004-05-14 Ranjit Mathew <rmathew@hotmail.com>
2346 * java-gimplify.c (java_gimplify_expr): Correct minor typos.
2348 2004-05-13 Diego Novillo <dnovillo@redhat.com>
2350 Merge from tree-ssa-20020619-branch. See
2351 ChangeLog.tree-ssa for details.
2353 * Make-lang.in, builtins.c, check-init.c, class.c,
2354 constants.c, decl.c, except.c, expr.c, java-except.h,
2355 java-tree.def, java-tree.h, jcf-parse.c, jcf-write.c,
2356 lang.c, lang.opt, parse.y, resource.c: Merged.
2357 * java-gimplify.c: New file.
2359 2004-05-10 Andrew Haley <aph@redhat.com>
2361 * parse.y (create_class): Set TYPE_VFIELD.
2362 * decl.c (java_init_decl_processing): Likewise.
2364 * expr.c (build_invokevirtual): Remove DECL_VINDEX offset adjustment.
2365 * class.c (make_method_value): Replace DECL_VINDEX with call to
2367 (get_dispatch_vector): Likewise.
2368 (layout_class_method): Likewise.
2369 Replace set of DECL_VINDEX with call to set_method_index().
2370 (set_method_index): New function.
2371 (get_method_index): New function.
2372 * java-tree.h (set_method_index): New function decl.
2373 (get_method_index): New function decl.
2375 2004-05-10 Andrew Pinski <pinskia@physics.uc.edu>
2377 * parse.y (check_pkg_class_access): Add new argument
2378 and use it when cl is NULL to call lookup_cl on it.
2379 (parser_check_super_interface): Do not call lookup_cl.
2380 Pass this_decl to check_pkg_class_access and NULL
2381 instead of lookup_cl.
2382 (parser_check_super): Update for change in
2383 check_pkg_class_access.
2384 (do_resolve_class): Likewise.
2385 (process_imports): Likewise.
2386 (find_in_imports_on_demand): Likewise.
2387 (resolve_qualified_expression_name): Likewise.
2389 2004-05-06 Ranjit Mathew <rmathew@hotmail.com>
2391 Fixes PR java/9685, PR java/15073
2392 * parse.y (accessibility_string): New method.
2393 (not_accessible_field_error): Use accessibility_string()
2394 instead of java_accstring_lookup().
2395 (resolve_qualified_expression_name): Check with
2396 check_pkg_class_access() before allowing access using
2399 Use check_pkg_class_access() instead of not_accessible_p()
2400 for unqualified types.
2401 (not_accessible_p): Use DECL_CONTEXT (member) instead of
2402 REFERENCE for package-private access checking.
2403 (patch_method_invocation): Use accessibility_string() instead
2404 of java_accstring_lookup().
2406 2004-04-30 Ranjit Mathew <rmathew@hotmail.com>
2409 * gjavah.c (struct method_name): Add member is_native.
2410 (overloaded_jni_method_exists_p): Match candidate method only if
2412 (print_method_info): Initialise is_native flag from the method's
2415 2004-04-30 Roger Sayle <roger@eyesopen.com>
2417 * builtins.c (java_builtins): Add acos, asin, ceil and floor.
2418 (initialize_builtins): Likewise, define acos, asin, ceil and floor.
2420 2004-04-22 Roger Sayle <roger@eyesopen.com>
2422 * resource.c (write_resource_constructor): Guard call to possibly
2423 NULL targetm.asm_out.constructor with targetm.have_ctors_dtors.
2425 2004-04-19 Bryce McKinlay <mckinlay@redhat.com>
2427 * class.c (make_class_data): Add new field aux_info.
2428 * decl.c (java_init_decl_processing): Push type and decl for
2431 2004-04-15 Bryce McKinlay <mckinlay@redhat.com>
2433 * expr.c (expand_java_NEW): Don't use size argument for
2434 _Jv_AllocObject calls.
2435 * parse.y (patch_invoke): Likewise.
2437 2004-04-12 Bryce McKinlay <mckinlay@redhat.com>
2439 * expr.c (build_invokeinterface): Remove unused variables to
2442 2004-04-12 Bryce McKinlay <mckinlay@redhat.com>
2444 * class.c (get_interface_method_index): New function. Return dispatch
2445 index for interface method.
2446 (make_method_value): For interface methods, set index field to
2447 iface dispatch index, not DECL_VINDEX.
2448 * expr.c (build_invokeinterface): Use get_interface_method_index.
2450 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2452 * jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.
2454 2004-03-31 Andrew Haley <aph@redhat.com>
2457 * jcf-io.c (opendir_in_zip): Tidy up error handling.
2459 2004-03-30 Zack Weinberg <zack@codesourcery.com>
2461 * builtins.c, expr.c, jcf.h, parse.h: Use new shorter
2462 form of GTY markers.
2464 2004-03-25 Marcus Meissner <meissner@suse.de>
2467 * jcf-path.c (jcf_path_extdirs_arg): Add missing closedir.
2469 2004-03-23 Tom Tromey <tromey@redhat.com>
2472 * jcf-write.c (make_class_file_name): Don't report if mkdir
2475 2004-03-23 Tom Tromey <tromey@redhat.com>
2477 * gcj.texi (Extensions): Document GCJ_PROPERTIES.
2479 2004-03-20 Kazu Hirata <kazu@cs.umass.edu>
2481 * class.c, gjavah.c, lang.c: Fix comment typos.
2482 * gcj.texi: Fix typos.
2484 2004-03-19 Per Bothner <per@bothner.com>
2486 * gcj.texi (Code Generation): Document new flags and assert defaults.
2488 * class.c (assume_compiled_node_struct): Rename type to
2489 class_flag_node_struct, as it is now also used for enable_assertions.
2490 Rename assume_compiled_node typedef. Rename excludep field to value.
2491 (find_assume_compiled_node): Rename function to find_class_flag_node.
2492 Minor optimization - avoid needless strlen.
2493 (add_assume_compiled): Some tweaking and optimization.
2494 Rename and generalize to add_class_flag takem an extra parameter.
2495 (add_assume_compled): New just calls add_class_flag.
2496 (add_enable_assert, enable_assertions): New functions.
2497 (enable_assert_tree): New static.
2498 * java-tree.h (add_enable_assert, enable_assertions): New declarations.
2499 * lang.opt (fenable-assertions, fenable-assertions=,
2500 fdisable-assertions, fdisable-assertions=): New options.
2501 * lang.c (java_handle_option): Handle new options.
2502 * parse.y (build_incomplete_class_ref): Handle class$ in an inner
2503 class in an interface - create helper class nested in outer interface.
2504 (build_assertion): Short-circuit if enable_assertions is false.
2506 2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2508 * java-tree.h: Changes throughout to add checking to macros
2509 and numerous whitespace changes.
2510 (VAR_OR_FIELD_CHECK): New macro.
2511 * jcf-write.c (get_access_flags): Use FIELD_PUBLIC, METHOD_PUBLIC,
2512 FIELD_FINAL, and METHOD_FINAL instead of CLASS_PUBLIC and CLASS_FINAL.
2514 2004-03-16 Per Bothner <per@bothner.com>
2516 * jcf-jump.c (options): New --print-constants option.
2517 * gcj.texi (Invoking jcf-dump): Document --print-constants.
2519 * jcf-dump.c (flag_print_constant_pool): Default to off.
2520 (print_constant_terse_with_index): New helper function.
2521 (various places): Check flag_print_constant_pool where missing.
2522 (main): If verbose set flag_print_constant_pool.
2523 (HANDLE_INNERCLASSES_ATTRIBUTE): Null inner class name is anonymous.
2525 2004-03-15 Andrew Haley <aph@redhat.com>
2528 * parse.y (java_complete_lhs): Check that final variable has an
2531 2004-03-12 Andrew Haley <aph@redhat.com>
2534 * typeck.c (convert): Clear TREE_OVERFLOW after an integer
2537 2004-02-29 Roger Sayle <roger@eyesopen.com>
2539 * jcf-parse.c (java_parse_file): Handle the case that input_filename
2542 2004-02-27 Per Bothner <per@bothner.com>
2544 * parse.y (build_assertion): Re-do 02-25 change following Jeff Sturm
2545 suggestion: Use build_incomplete_class_ref.
2546 This fixes PR java/13508, java/11714.
2548 2004-02-27 Kazu Hirata <kazu@cs.umass.edu>
2550 * java/parse.h: Update copyright.
2552 2004-02-26 Andrew Haley <aph@redhat.com>
2555 * parse.y (check_interface_throws_clauses): Check for
2556 !METHOD_INVISIBLE (iface_method).
2557 * class.c (layout_class_methods): Check for CLASS_INTERFACE as
2558 well as CLASS_ABSTRACT.
2560 2004-02-25 Per Bothner <per@bothner.com>
2562 * parse.y (build_assertion): If we're in an inner class, create the
2563 class$ helper routine in the outer class.
2565 2004-02-19 Richard Henderson <rth@redhat.com>
2567 * parse.y (switch_label): Use make_node for DEFAULT_EXPR.
2569 2004-02-16 Geoffrey Keating <geoffk@apple.com>
2571 * Make-lang.in (java.install-man): Add extra dependencies.
2573 2004-02-13 Geoffrey Keating <geoffk@apple.com>
2575 * Make-lang.in: Install man pages under the same names
2576 (possibly transformed) as the program they document.
2578 2004-02-10 Joseph S. Myers <jsm@polyomino.org.uk>
2580 * gjavah.c: Include "intl.h".
2581 (error): New function.
2582 (main): Call gcc_init_libintl.
2583 (get_field_name, throwable_p, print_c_decl, print_full_cxx_name,
2584 print_stub_or_jni, process_file, main): Use error rather than
2586 (print_method_info, usage, help, version, main): Mark strings for
2587 translation with _. Avoid splitting up sentences. Send
2588 information messages to stdout.
2589 * jcf-dump.c: Include "intl.h".
2590 (main): Call gcc_init_libintl.
2591 (process_class, usage, help, version, main, CHECK_PC_IN_RANGE):
2592 Mark error, usage and version messages for translation with _.
2593 Avoid splitting up sentences.
2594 * jv-scan.c: Include "intl.h".
2595 (fatal_error, warning): Change parameter s to msgid. Translate
2597 (main): Call gcc_init_libintl.
2598 (usage, help, version): Mark error, usage and version messages for
2599 translation with _. Avoid splitting up sentences.
2600 * jvgenmain.c: Include "intl.h".
2601 (main): Call gcc_init_libintl.
2602 (usage, main): Mark error messages for translation with _.
2603 * Make-lang.in (GCJH_OBJS, JVSCAN_OBJS, JCFDUMP_OBJS,
2604 JVGENMAIN_OBJS): Add intl.o.
2605 (java/jcf-dump.o, java/gjavah.o, java/jv-scan.o,
2606 java/jvgenmain.o): Update dependencies.
2608 2004-02-08 Per Bothner <per@bothner.com>
2610 * parse.y (resolve_qualified_expression_name): In case of inaccessible
2611 class don't use not_accessible_field_error, which can get confused.
2613 2004-02-05 Kelley Cook <kcook@gcc.gnu.org>
2615 Make-lang.in (po-generated): Delete.
2617 2004-02-05 Kazu Hirata <kazu@cs.umass.edu>
2619 * Make-lang.in (java/decl.o, java/expr.o, java/parse.o):
2621 * decl.c: Include target.h.
2622 (start_java_method): Replace PROMOTE_PROTOTYPES with
2623 targetm.calls.promote_prototypes.
2624 * expr.c: Include target.h.
2625 (pop_arguments): Replace PROMOTE_PROTOTYPES with
2626 targetm.calls.promote_prototypes.
2627 * parse.y: Include target.h.
2628 (start_complete_expand_method): Replace PROMOTE_PROTOTYPES
2629 with targetm.calls.promote_prototypes.
2631 2004-02-04 Kazu Hirata <kazu@cs.umass.edu>
2633 * typeck.c: Update copyright.
2635 2004-02-02 Tom Tromey <tromey@redhat.com>
2637 * decl.c (java_init_decl_processing): Remove duplicate
2640 2004-01-30 Kelley Cook <kcook@gcc.gnu.org>
2642 * Make-lang.in (doc/gcj.dvi): Use $(abs_docdir).
2644 2004-01-28 Andrew Pinski <pinskia@physics.uc.edu>
2646 * expr.c (build_field_ref): Move variable
2649 2004-01-28 Andrew Haley <aph@redhat.com>
2651 * expr.c (build_field_ref): Widen field offset.
2653 2004-01-27 Andrew Haley <aph@redhat.com>
2656 * parse.y (check_interface_throws_clauses): Make sure class_decl
2659 2004-01-22 Jeff Sturm <jsturm@one-point.com>
2662 * parse.y (patch_assignment): Don't modify lhs_type for
2663 reference assignments.
2665 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
2667 * Make-lang.in: Replace $(docdir) with doc.
2668 (java.info, java.srcinfo, java.man, java.srcman): New rules.
2669 (java.install-man): Revamp rule.
2671 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
2673 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_TARGET_INSTALL_NAME,
2674 GCJH_TARGET_INSTALL_NAME): Define via a immediate $(shell)
2675 instead of deferred backquote.
2677 2004-01-16 Andrew Pinski <pinskia@physics.uc.edu>
2679 * typeck.c (find_method_in_interfaces): Move variable
2682 2004-01-16 Andrew Haley <aph@redhat.com>
2685 * typeck.c (shallow_find_method): New.
2686 (find_method_in_superclasses): New.
2687 (find_method_in_interfaces): New.
2688 (lookup_do): Rewrite.
2689 * java-tree.h (SEARCH_ONLY_INTERFACE): Delete.
2691 * jcf-parse.c (read_class): Save and restore output_class.
2692 * decl.c (java_expand_body): Set output_class from fndecl.
2694 2004-01-15 Michael Chastain <mec.gnu@mindspring.com>
2696 * class.c (gen_indirect_dispatch_tables): Fix string length
2699 2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
2701 * Make-lang.in (parse.c, parse-scan.c): Always build in doc directory.
2702 (java.srcextra): Copy above back to source directory if requested.
2703 (po-generated): Delete reference to $(parsedir).
2704 (java/parse.o, java/parse-scan.o): Delete reference to $(parsedir).
2707 2004-01-14 Jan Hubicka <jh@suse.cz>
2709 * lang.c (java_estimate_num_insns_1): Fix bug in MODIFY_EXPR cost
2712 2004-01-09 Mark Mitchell <mark@codesourcery.com>
2714 * java-tree.h (java_expand_expr): Change prototype.
2715 * expr.c (java_expand_expr): Add alt_rtl parameter.
2717 2004-01-09 Andrew Haley <aph@redhat.com>
2720 * parse.y (java_fix_constructors): Set output_class.
2721 (java_reorder_fields): Likewise.
2722 (java_layout_classes): Likewise.
2723 (java_expand_classes): Generate indirect dispatch tables.
2724 (java_expand_classes): Set output_class.
2725 (java_finish_classes): Likewise.
2726 * lang.c (java_init): Turn on always_initialize_class_p if we're
2727 using indirect dis[atch.
2728 (java_decl_ok_for_sibcall): Use output_class, not current_class.
2729 (java_get_callee_fndecl): Use class local atable.
2731 (always_initialize_class_p): Decl moved to java-tree.h.
2732 (HANDLE_CLASS_INFO): Set output_class.
2733 (read_class): Likewise.
2734 (parse_class_file): Call gen_indirect_dispatch_tables.
2735 (parse_zip_file_entries): Set output_class.
2736 (java_parse_file): Set output_class. Don't emit symbol tables.
2737 * java-tree.h (output_class): New.
2738 Remove global declarations for otable, atable, and ctable.
2739 (always_initialize_class_p): moved here from decl.c.
2741 (TYPE_ATABLE_METHODS, TYPE_ATABLE_SYMS_DECL, TYPE_ATABLE_DECL,
2742 TYPE_OTABLE_METHODS, TYPE_OTABLE_SYMS_DECL, TYPE_OTABLE_DECL,
2743 TYPE_CTABLE_DECL, TYPE_CATCH_CLASSES): New.
2744 (struct lang_type): Add otable_methods, otable_decl,
2745 otable_syms_decl, atable_methods, atable_decl, atable_syms_decl,
2746 ctable_decl, catch_classes, type_to_runtime_map.
2747 * expr.c (build_field_ref): Make otable, atable, and ctable class
2748 local rather than global.
2749 (build_known_method_ref): Likewise.
2750 (build_invokeinterface): Likewise.
2751 (java_expand_expr): Pass runtime type (rather than actual type) to
2753 * except.c (prepare_eh_table_type): Create TYPE_TO_RUNTIME_MAP for
2754 this class. Look up each class in that map to delete duplicates.
2755 (expand_end_java_handler): Pass runtime type (rather than actual
2756 type) to expand_start_catch.
2757 * decl.c: (always_initialize_class_p): Decl moved to java-tree.h.
2759 (java_init_decl_processing): Rearrange things. Remove global
2760 declarations of otable, atable, and ctable.
2761 (java_init_decl_processing): Make lang_eh_runtime_type do_nothing.
2762 (java_expand_body): Set output_class.
2763 * constants.c (build_constant_data_ref): Use output_class, not
2765 (alloc_name_constant): Likewise.
2766 * class.c (gen_indirect_dispatch_tables): New.
2767 (build_class_ref): Generate hard reference to superclass, even if
2768 using indirect dispatch.
2769 (build_static_field_ref): Use class local atable.
2770 (make_class_data): Generate hard reference to superclass, even if
2771 using indirect dispatch.
2772 Generate symbolic references to interfaces when using indirect
2774 (make_class_data): Emit otable, atable, and ctable.
2775 Make otable, atable, and ctable class local rather than global.
2776 (emit_catch_table): Make otable, atable, and ctable class local
2779 2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
2781 * parse.y (catch_clause_parameter): Fix typo.
2784 * parse.y: (catch_clause_parameter): Return early if $3, aka
2785 formal_parameter, is null.
2787 2003-12-20 Kazu Hirata <kazu@cs.umass.edu>
2789 * class.c: Remove uses of "register" specifier in
2790 declarations of arguments and local variables.
2793 * gjavah.c: Likewise.
2794 * jcf-dump.c: Likewise.
2795 * jcf-io.c: Likewise.
2796 * jcf-parse.c: Likewise.
2797 * jcf-write.c: Likewise.
2798 * keyword.h: Likewise.
2799 * parse.y: Likewise.
2800 * typeck.c: Likewise.
2801 * verify.c: Likewise.
2803 2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
2805 * Make-lang.in (GCJ_CROSS_NAME): Delete.
2806 (java.install_common, java.install-man): Adjust for above.
2807 (java.uninstall): Likewise.
2809 2003-12-03 Michael Koch <konqueror@gmx.de>
2811 * class.c (make_class_data):
2812 Push field value to 'hack_signers' instead of 'signers'.
2813 * decl.c (java_init_decl_processing):
2814 Push field 'hack_signers' instead of 'signers'.
2816 2003-12-03 Zack Weinberg <zack@codesourcery.com>
2818 * lex.h: Check both HAVE_ICONV and HAVE_ICONV_H before
2821 2003-12-03 Ralph Loader <rcl@ihug.co.nz>
2824 * parse.y (qualify_ambiguous_name): Remove lots of broken
2825 field access processing - there's no need to do that here,
2826 because we have resolve_field_access. Remove
2827 RESOLVE_EXPRESSION_NAME_P as it isn't used anywhere else.
2828 * java-tree.h: Remove RESOLVE_EXPRESSION_NAME_P as it isn't
2831 2003-12-01 Jeff Sturm <jsturm@one-point.com>
2834 * parse.y (java_complete_lhs): Save location prior to patching
2837 2003-11-25 Mohan Embar <gnustuff@thisiscool.com>
2840 * resource.c (write_resource_constructor): Append
2841 "_resource" to constructor identifier name.
2843 2003-11-25 Jeff Sturm <jsturm@one-point.com>
2846 * constants.c (cpool_for_class): New function.
2847 (outgoing_cpool): Remove global variable.
2848 (alloc_name_constant): Use cpool_for_class.
2849 (build_constants_constructor): Likewise.
2850 * decl.c (java_expand_body): Set current_class.
2851 * java-tree.h (outgoing_cpool) Remove declaration.
2852 (init_outgoing_cpool): Likewise.
2853 * jcf-parse.c (init_outgoing_cpool): Remove function.
2854 (parse_class_file): Don't call init_outgoing_cpool.
2855 * parse.y (java_complete_expand_methods): Don't call
2856 init_outgoing_cpool. Don't save outgoing_cpool.
2857 (java_expand_classes): Don't restore outgoing_cpool.
2858 (java_finish_classes): Likewise.
2860 2003-11-24 Mohan Embar <gnustuff@thisiscool.com>
2862 * Make-lang.in: (java.install-common) Add
2863 symlink for $(target_noncanonical)-gcjh for
2866 2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
2868 * Make-lang.in (java.extraclean): Delete.
2870 2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
2872 * Make-lang.in (check-java): Add.
2874 2003-11-19 Jeff Sturm <jsturm@one-point.com>
2877 * except.c (prepare_eh_table_type): Allocate variable-sized
2878 buffer `buf' with alloca.
2880 2003-11-17 Jeff Sturm <jsturm@one-point.com>
2884 decl.c (java_init_decl_processing): Don't initialize
2885 class_not_found_type_node, no_class_def_found_type_node.
2887 java-tree.h (JTI_CLASS_NOT_FOUND_TYPE_NODE,
2888 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE): Remove from java_tree_index.
2889 (class_not_found_type_node, no_class_def_found_type_node):
2892 parse.y (build_dot_class_method_invocation): Add this_class
2893 argument. Qualify method invocations to a different class.
2894 (create_new_parser_context): Initialize saved_data_ctx to 0.
2895 (java_parser_context_save_global): Initialize saved_data_ctx to 1.
2896 (build_dot_class_method): Don't load classes. Register
2898 (build_incomplete_class_ref): Special cases for interfaces
2899 and inner classes. Move build_dot_class_method call to here...
2900 (patch_incomplete_class_ref): ...from here. Pass current_class
2901 to build_dot_class_method_invocation.
2902 (build_assertion): Pass class_type to
2903 build_dot_class_method_invocation.
2904 (encapsulate_with_try_catch): Handle EXPR_WITH_FILE_LOCATION node.
2906 2003-11-17 Jeff Sturm <jsturm@one-point.com>
2909 * java-tree.h (BLOCK_EMPTY_P): Define.
2910 * parse.y (java_complete_lhs): Check for empty blocks
2911 in TRY_FINALLY_EXPR case.
2913 2003-11-17 Andrew Haley <aph@redhat.com>
2915 * java-tree.h (LOCAL_VAR_OUT_OF_SCOPE_P): New.
2916 (struct lang_decl_var:freed): New variable.
2917 * decl.c (poplevel): Mark local vars that have gone out of scope.
2918 (push_jvm_slot): Don't use the RTL of a var that has gone out of
2921 2003-11-16 Jason Merrill <jason@redhat.com>
2923 * Make-lang.in (java.tags): Create TAGS.sub files in each directory
2924 and TAGS files that include them for each front end.
2926 2003-11-15 Tom Tromey <tromey@redhat.com>
2928 * gjavah.c (print_stub_or_jni): Pass `env' to FatalError.
2930 2003-11-12 Jason Merrill <jason@redhat.com>
2932 PR optimization/12547
2933 * lang.c (java_tree_inlining_walk_subtrees): Just walk
2934 BLOCK_EXPR_BODY directly.
2936 2003-11-12 Andrew Haley <aph@redhat.com>
2939 * parse.y (fold_constant_for_init): Check that we really do have a
2943 * lang.c (merge_init_test_initialization): Clear DECL_INITIAL for
2944 init_test_decls being inlined.
2947 * parse.y (do_resolve_class): Check return value from
2948 breakdown_qualified().
2950 2003-11-11 Tom Tromey <tromey@redhat.com>
2953 * parse.y (merge_string_cste): Handle case where we have a
2954 pointer that happens to be zero, not null_pointer_node.
2956 2003-11-10 Tom Tromey <tromey@redhat.com>
2958 * jcf-parse.c (classify_zip_file): Correctly compare
2959 filename_length against length of manifest file's name.
2961 2003-11-08 Tom Tromey <tromey@redhat.com>
2964 * jcf-parse.c (classify_zip_file): Only skip MANIFEST.MF file.
2966 2003-11-06 Andrew Haley <aph@redhat.com>
2968 * expr.c (java_stack_swap): Make sure destination stack slots are
2969 of the correct type.
2971 2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
2973 * Make-lang.in (dvi): Move targets to $(docobjdir).
2974 (gcj.dvi): Simplify rule and adjust target.
2975 (gcj.info): Simplify rule.
2976 (gcj.pod): New intermediate rule.
2977 (gcjh.pod): Likewise.
2978 (jv-scan.pod): Likewise.
2979 (jcf-dump.pod): Likewise.
2980 (gij.pod): Likewise.
2981 (jv-convert.pod): Likewise.
2982 (rmic.pod): Likewise.
2983 (rmiregistry.pod): Likewise.
2986 (jv-scan.1): Delete.
2987 (jcf-dump.1): Delete.
2989 (jv-convert.1): Delete.
2991 (rmiregistry.1): Delete.
2993 2003-11-02 Jeff Sturm <jsturm@one-point.com>
2995 Fixes PR java/12866.
2996 * parse.y (resolve_qualified_expression_name): Move test
2997 for outer field access methods from here...
2998 (check_thrown_exceptions) ...to here.
3000 2003-11-01 Kelley Cook <kcook@gcc.gnu.org>
3002 * .cvsignore: Delete.
3004 2003-10-28 Frank Ch. Eigler <fche@redhat.com>
3006 * verify.c (verify_jvm_instructions): Don't warn about legal
3007 eh binding regions generated for example by jdk 1.4.1.
3009 2003-10-24 David S. Miller <davem@redhat.com>
3011 * jcf-parse.c (jcf_parse): Fix args to fatal_error().
3013 2003-10-22 Andrew Haley <aph@redhat.com>
3015 * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
3016 (java_get_callee_fndecl): New.
3018 * jcf-parse.c (java_parse_file): Call emit_catch_table().
3020 * java-tree.h (ctable_decl): New.
3021 (catch_classes): New.
3022 (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.
3024 * decl.c (java_init_decl_processing): Add catch_class_type.
3026 Add catch_classes field.
3028 * class.c (build_indirect_class_ref): Break out from
3030 (make_field_value): Check flag_indirect_dispatch.
3031 (make_class_data): Ditto.
3032 Tidy uses of PUSH_FIELD_VALUE.
3033 Add field catch_classes.
3034 (make_catch_class_record): New.
3036 * java-tree.h (PUSH_FIELD_VALUE): Tidy.
3038 2003-10-22 Kazu Hirata <kazu@cs.umass.edu>
3040 * jcf-write.c: Follow spelling conventions.
3041 * parse.y: Likewise.
3043 2003-10-22 Kazu Hirata <kazu@cs.umass.edu>
3045 * ChangeLog: Fix typos.
3046 * expr.c: Fix comment typos.
3047 * jcf-write.c: Likewise.
3050 * mangle.c: Likewise.
3051 * parse-scan.y: Likewise.
3052 * parse.y: Likewise.
3054 2003-10-22 Tom Tromey <tromey@redhat.com>
3056 * expr.c (expand_byte_code): Only warn about dead bytecode when
3057 extra_warnings is set.
3059 2003-10-22 Bryce McKinlay <bryce@mckinlay.net.nz>
3061 Fix for PR java/12586.
3062 * mangle.c (find_compression_record_match): Don't iterate through
3063 package namespace elements unless they all match compression_table
3066 2003-10-20 Kelley Cook <kcook@gcc.gnu.org>
3068 * Make-lang.in (info): Honor $(parsedir) and $(docobjdir).
3069 (generate-manpages): Likewise.
3070 (java.maintainer-clean): Likewise.
3071 (gcj.info): Likewise.
3074 (jv-scan.1): Likewise.
3075 (jcf-dump.1): Likewise.
3077 (jv-convert.1): Likewise.
3079 (rmiregistry.1): Likewise.
3080 (java.install-man): Likewise.
3081 (parse-scan.o): Move and define complete compile line.
3082 (parse.o): Likewise.
3083 (jcf-tree-inline.o): Move.
3085 2003-10-20 Mark Mitchell <mark@codesourcery.com>
3087 * Make-lang.in (info): Update dependencies.
3088 (java.install-info): Remove.
3089 ($(srcdir)/java/gcj.info): Replace with ...
3090 ($(docobjdir)/gcj.info): ... this.
3092 2003-10-14 Nathanael Nerode <neroden@gcc.gnu.org>
3094 * Make-lang.in: Replace uses of $(target_alias) with
3095 $(target_noncanonical).
3097 2003-10-09 Tom Tromey <tromey@redhat.com>
3099 * decl.c (java_init_decl_processing): Declare signers field.
3100 * class.c (make_class_data): Set signers field.
3102 2003-10-09 Jason Merrill <jason@redhat.com>
3104 * parse.y (patch_assignment): Use make_node to create a BLOCK.
3105 * parse.h (BUILD_PTR_FROM_NAME): Use make_node to create a
3108 2003-10-06 Mark Mitchell <mark@codesourcery.com>
3110 * Make-lang.in (java.info): Replace with ...
3112 (java.dvi): Replace with ...
3114 (java.generated-manpages): Replace with ...
3116 2003-10-03 Kelley Cook <kelleycook@wideopenwest.com>
3118 * builtins.c, jcf.h, jvspec.c: Remove PARAMS macros.
3120 2003-10-01 Andrew Haley <aph@redhat.com>
3122 * jcf-parse.c (java_parse_file): Write otable and atable.
3123 * java-tree.h (atable_methods): New.
3125 (atable_syms_decl): New.
3126 (enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL,
3127 JTI_ATABLE_SYMS_DECL. Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*.
3128 (symbol_*type): Rename method_symbol* to symbol*type.
3129 (emit_offset_symbol_table): Delete.
3130 (emit_symbol_table): New.
3131 (get_symbol_table_index): New.
3133 * expr.c (build_field_ref): Handle flag_indirect_dispatch.
3134 (build_known_method_ref): Likewise.
3135 (get_symbol_table_index): Rename from get_offset_table_index.
3136 Parameterize to allow re-use by differing types of symbol table.
3137 (build_invokevirtual): Pass table to get_offset_table_index.
3138 * decl.c (java_init_decl_processing): Push types and decls for
3139 atable and atable_syyms.
3140 * class.c (build_static_field_ref): Handle flag_indirect_dispatch.
3141 (make_class_data): Add new fields atable and atable_syms.
3142 (emit_symbol_table): Rename from emit_offset_symbol_table.
3143 Parameterize to allow re-use by different types of symbol table.
3144 (build_symbol_entry): Renamed from build_method_symbols_entry.
3146 2003-09-30 Roger Sayle <roger@eyesopen.com>
3148 * jcf-write.c (generate_bytecode_insns): Implement evaluate-once
3149 semantics for SAVE_EXPR, by caching the result in a temporary.
3151 2003-09-28 Richard Henderson <rth@redhat.com>
3153 * check-init.c (check_init): Save and restore input_location
3154 instead of file and line separately.
3155 * decl.c (java_expand_body): Likewise.
3156 * jcf-write.c (generate_bytecode_insns): Likewise.
3157 * parse.y (safe_layout_class): Likewise.
3158 * jcf-parse.c (read_class, parse_class_file): Likewise.
3159 (java_parse_file): Use %H for warning locator.
3161 2003-09-28 Roger Sayle <roger@eyesopen.com>
3163 * expr.c (java_check_reference): Use the semantics of COND_EXPRs
3164 with void-type branches instead of using a COMPOUND_EXPR.
3166 2003-09-28 Jeff Sturm <jsturm@one-point.com>
3168 * decl.c (java_optimize_inline, dump_function): Remove.
3169 * java-tree.h (java_optimize_inline): Remove declaration.
3170 * jcf-parse.c (java_parse_file): Assume flag_unit_at_a_time is set.
3171 * parse.y (source_end_java_method, java_expand_classes):
3172 Likewise. Remove dead code.
3174 2003-09-27 Roger Sayle <roger@eyesopen.com>
3176 * lang.c (java_init_options): Set flag_evaluation_order.
3177 * expr.c (force_evaluation_order): Don't attempt to force
3178 evaluation order of binary operations using save_expr.
3179 * parse.y (java_complete_lhs): No longer need to call
3180 force_evaluation_order when constructing binary operators.
3182 2003-09-27 Alexandre Petit-Bianco <apbianco@redhat.com>
3183 Bryce McKinlay <bryce@mckinlay.net.nz>
3186 * parse.y (not_accessible_field_error): New function.
3187 (resolve_expression_name): Check field access permissions.
3188 (resolve_qualified_expression_name): Use
3189 not_accessible_field_error.
3190 (resolve_qualified_expression_name): Likewise.
3192 2003-09-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3194 * class.c (build_utf8_ref): Test for HAVE_GAS_SHF_MERGE value.
3196 2003-09-23 Roger Sayle <roger@eyesopen.com>
3198 * jcf-write.c (generate_bytecode_insns): Optimize binary operations
3199 with equal operands without side-effects.
3201 2003-09-22 Jeff Sturm <jsturm@one-point.com>
3203 * decl.c (java_init_decl_processing): Don't emit otable decls
3204 if flag_indirect_dispatch is not set.
3206 2003-09-21 Richard Henderson <rth@redhat.com>
3208 * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
3211 2003-09-21 Richard Henderson <rth@redhat.com>
3213 * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
3214 resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.
3216 2003-09-20 Richard Henderson <rth@redhat.com>
3218 * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
3220 2003-09-18 Roger Sayle <roger@eyesopen.com>
3222 * expr.c (java_truthvalue_conversion): Remove FFS_EXPR case.
3223 * check-init.c (check_init): Likewise.
3225 2003-09-18 Roger Sayle <roger@eyesopen.com>
3227 * jcf-write.c (generate_bytecode_insns): Add support for fconst_2.
3229 2003-09-16 Andrew Haley <aph@redhat.com>
3231 * jcf-write.c (generate_bytecode_insns): Add MIN_EXPR and MAX_EXPR.
3233 2003-09-17 Ranjit Mathew <rmathew@hotmail.com>
3236 * mangle.c (find_compression_record_match): Skip
3237 over a "6JArray" (the array template mangled string)
3239 (mangle_array_type): Correct minor typo.
3240 (atms): Move definition to the beginning.
3242 2003-09-16 Bryce McKinlay <bryce@mckinlay.net.nz>
3244 * class.c (add_miranda_methods): Ensure super-interfaces are laid
3245 out. Fix for PR java/12254.
3247 2003-09-11 Richard Henderson <rth@redhat.com>
3249 * parse.y (source_end_java_method): Update for new
3250 cgraph_finalize_function argument.
3252 2003-09-09 Richard Henderson <rth@redhat.com>
3254 * parse.y (source_end_java_method): Update call to
3255 cgraph_finalize_function.
3257 2003-09-03 Jeff Sturm <jsturm@one-point.com>
3259 * decl.c (java_expand_body): New function.
3260 * expr.c (build_class_init): Set DECL_IGNORED_P.
3261 * java-tree.h (start_complete_expand_method,
3262 java_expand_body): Declare.
3263 * jcf-parse.c (cgraph.h): Include.
3264 (java_parse_file): Handle flag_unit_at_a_time.
3265 * lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING,
3266 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
3267 (java_estimate_num_insns): Use walk_tree_without_duplicates.
3268 (java_start_inlining): New function.
3269 * parse.h (java_finish_classes): Declare.
3270 * parse.y: Include cgraph.h.
3271 (block): Don't special-case empty block production.
3272 (craft_constructor): Set DECL_INLINE.
3273 (source_end_java_method): Handle flag_unit_at_a_time.
3274 Replace inline code with call to java_expand_body.
3275 (start_complete_expand_method): Remove static modifier.
3276 (java_expand_method_bodies): Patch function tree for
3277 class initialization and/or synchronization as needed.
3278 Don't begin RTL expansion yet.
3279 (java_expand_classes): Check flag_unit_at_a_time before
3280 calling finish_class.
3281 (java_finish_classes): New function.
3282 (java_complete_lhs): Ensure COMPOUND_EXPR has non-NULL type.
3283 (patch_assignment): Set DECL_CONTEXT on temporary variable.
3284 (emit_test_initialization): Set DECL_IGNORED_P.
3286 2003-09-03 Roger Sayle <roger@eyesopen.com>
3288 * builtins.c (enum builtin_type): Delete unused enumeration.
3289 * Make-lang.in (java/builtins.o): Remove built-types.def dependency.
3291 2003-08-28 Tom Tromey <tromey@redhat.com>
3293 * gcj.texi (Extensions): Document gcjlib URLs.
3295 2003-08-20 Tom Tromey <tromey@redhat.com>
3297 * gcj.texi (Extensions): Added xref.
3298 (libgcj Runtime Properties): Document
3299 gnu.gcj.runtime.VMClassLoader.library_control.
3301 2003-08-20 Andrew Haley <aph@redhat.com>
3303 * except.c (prepare_eh_table_type): Use new encoding for exception
3304 handlers when using -fno-assume-compiled.
3306 2003-08-13 Tom Tromey <tromey@redhat.com>
3308 * gcj.texi (Invoking gij): Document -X and -?.
3310 2003-08-13 Mohan Embar <gnustuff@thisiscool.com>
3312 * Make-lang.in: Added missing win32-host.o to JAVA_OBJS,
3313 GCJH_OBJS, JCFDUMP_OBJS
3314 * win32-host.c: Removed the unnecessary and broken dependency
3317 2003-08-11 Tom Tromey <tromey@redhat.com>
3319 * parse.y (java_check_regular_methods): Typo fixes. Call
3320 check_interface_throws_clauses. Use
3321 check_concrete_throws_clauses.
3322 (check_interface_throws_clauses): New function.
3323 (check_concrete_throws_clauses): New function.
3324 (hack_is_accessible_p): New function.
3325 (find_most_specific_methods_list): Added FIXME.
3326 * typeck.c (lookup_do): Use `flags' argument to decide what to
3328 (lookup_argument_method_generic): New function.
3329 (lookup_argument_method2): Removed.
3330 * jcf.h (ACC_INVISIBLE): New define.
3331 * jcf-write.c (generate_classfile): Skip invisible methods.
3332 * class.c (add_miranda_methods): New function.
3333 (layout_class_methods): Use it.
3334 (get_access_flags_from_decl): Use ACC_INVISIBLE.
3335 * java-tree.h (METHOD_INVISIBLE): New define.
3336 (lang_decl_func) [invisible]: New field.
3337 (lookup_argument_method_generic): Declare.
3338 (SEARCH_INTERFACE): New define.
3339 (SEARCH_SUPER): Likewise.
3340 (SEARCH_ONLY_INTERFACE): Likewise.
3341 (SEARCH_VISIBLE): Likewise.
3342 (lookup_argument_method2): Removed declaration.
3344 2003-08-05 Tom Tromey <tromey@redhat.com>
3346 Fix for PR java/11600:
3347 * parse.y (java_complete_lhs): See whether we're calling a method
3349 (check_thrown_exceptions): Added `is_array_call' argument;
3350 fixed `clone' checking; updated all callers.
3352 2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
3354 * java-tree.h (DECL_ESTIMATED_INSNS): Remove (moved to tree.h).
3356 2003-08-03 Tom Tromey <tromey@redhat.com>
3358 * java-tree.h (METHOD_TRANSIENT): Removed.
3359 * decl.c (pushdecl): Removed some dead code.
3360 * class.c (get_access_flags_from_decl): Can't have transient
3362 (add_method_1): Can't have a transient method.
3364 2003-07-28 Andreas Jaeger <aj@suse.de>
3366 * jvspec.c: Convert to ISO C90 prototypes.
3368 2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
3370 * decl.c (force_poplevels): Fix warning call.
3372 2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
3374 * expr.c (expand_java_field_op): Don't use xxx_with_decl
3375 (expand_java_field_op): Likewise.
3376 * class.c (layout_class_method): Likewise
3377 (emit_register_classes): Likewise.
3378 * decl.c (pushdecl): Likewise.
3379 (poplevel): Likewise.
3380 (force_poplevels): Likewise.
3381 (give_name_to_locals): Likewise.
3382 * check-init.c (check_for_initialization): Likewise.
3384 2003-07-24 Jason Merrill <jason@redhat.com>
3386 * java-tree.h: Move boolean_type_node et al to the back end.
3388 2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3390 * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary
3393 2003-07-19 Neil Booth <neil@daikokuya.co.uk>
3395 * lang.opt: Don't show -MD_ and -MDD_.
3397 2003-07-18 Neil Booth <neil@daikokuya.co.uk>
3399 * lang-options.h: Remove.
3400 * lang.opt: Add help text.
3402 2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
3404 * expr.c: Remove the last argument to expand_assignment().
3406 2003-07-09 Jan Hubicka <jh@suse.cz>
3408 * java-tree.h (DECL_NUM_STMTS): Rename to...
3409 (DECL_ESTIMATED_INSNS): ... this.
3410 * lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
3411 New static functions.
3412 (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
3413 * parser.y (add_stmt_to_compound): Do not account statements.
3415 2003-07-08 Mark Wielaard <mark@klomp.org>
3417 * gcj.texi: CNI now expands to Compiled Native Interface.
3419 2003-07-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3421 * Make-lang.in (java/gcj.dvi): Use PWD_COMMAND.
3423 2003-07-07 Nathan Sidwell <nathan@codesourcery.com>
3425 * expr.c (expand_byte_code): Adjist emit_line_note call.
3427 2003-07-06 Neil Booth <neil@daikokuya.co.uk>
3429 * lang.c (java_handle_option): Don't handle filenames.
3431 2003-07-02 Zack Weinberg <zack@codesourcery.com>
3433 * jcf-path.c: Don't default-define PATH_SEPARATOR nor
3436 * jcf-write.c: Don't default-define DIR_SEPARATOR.
3437 * jcf.h: Delete COMPARE_FILENAMES definition.
3439 2003-07-02 Neil Booth <neil@daikokuya.co.uk>
3441 * lang.c (java_init_options): Update prototype.
3443 2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
3445 * decl.c (poplevel): Adjust define_label call.
3447 2003-06-27 Zack Weinberg <zack@codesourcery.com>
3449 * gjavah.c (flag_jni): Make non-static.
3450 * parse-scan.y (ctxp): Make non-static.
3452 * class.c (build_method_symbols_entry)
3453 * expr.c (get_offset_table_index)
3454 * jcf-parse.c (jcf_parse):
3455 Mark the definition static, matching the forward declaration.
3457 2003-06-26 Neil Booth <neil@daikokuya.co.uk>
3459 * lang.c (java_handle_option): Don't check for missing arguments.
3461 2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
3463 * class.c (push_class): Use a location_t to save place.
3464 (emit_register_classes): Set input_location. Adjust
3465 expand_function_end call.
3466 * resource.c (write_resource_constructor): Likewise.
3467 * decl.c (end_java_method): Adjust expand_function_end call.
3468 * parse.y (source_end_java_method): Likewise.
3470 2003-06-17 Robert Abeles <rabeles@archaelogic.com>
3472 * lang.c (java_handle_option): Likewise.
3474 2003-06-16 Neil Booth <neil@daikokuya.co.uk>
3476 * lang.c (java_handle_option): Special-casing of optional
3477 joined arguments no longer needed.
3478 * lang.opt: Update switches that take optional argument.
3480 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
3482 * lang.opt: Declare Java.
3483 * lang.c (java_init_options): Update.
3485 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
3487 * lang.c (version_flag): Rename to v_flag to avoid clash w/ toplev.h.
3489 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
3491 * lang-specs.h: Rewrite -MD and -MMD to append an underscore.
3492 * lang.c (java_handle_option): -MD and -MMD have an underscore.
3493 * lang.opt: -MD and -MMD have an underscore.
3495 2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
3497 * class.c (emit_register_classes): Adjust init_function_start
3499 * decl.c (complete_start_java_method): Likewise.
3500 * resource.c (write_resource_constructor): Likewise.
3502 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
3504 * Make-lang.in: Update to use options.c and options.h.
3505 * lang.c: Include options.h not j-options.h.
3506 (java_handle_option): Abort on unrecognized option.
3507 (java_init_options): Request Java switches.
3509 2003-06-11 Neil Booth <neil@daikokuya.co.uk>
3511 * Make-lang.in: Handle mostlyclean.
3513 2003-06-11 Tom Tromey <tromey@redhat.com>
3515 * lang.c (java_handle_option): Update dependency_tracking for
3518 * lang.c (java_handle_option): OPT_fbootclasspath_ can take an
3521 2003-06-10 Andrew Haley <aph@redhat.com>
3523 * resource.c (write_resource_constructor): Use expand_expr to
3524 generate the address of the label attached to a resource.
3525 * Make-lang.in (java/resource.o): Add expr.h
3527 2003-06-10 Andrew Haley <aph@redhat.com>
3529 * lang.c (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
3530 (java_decl_ok_for_sibcall): New.
3532 2003-06-09 Neil Booth <neil@daikokuya.co.uk>
3534 * Make-lang.in (JAVA_OBJS, java/lang.o): Update.
3535 (java/j-options.c, java/j-options.h): New.
3536 * java-tree.h (resource_name, compile_resource_file,
3537 compile_resource_data): Constify.
3538 * jcf-write.c (jcf_write_base_directory): Similarly.
3539 * jcf.h (jcf_write_base_directory): Similarly.
3540 * lang.c: Include j-options.h.
3541 (cl_options_count, cl_options, string_option, java_decode_option,
3542 lang_f_options, lang_W_options, LANG_HOOKS_DECODE_OPTION,
3543 process_option_with_no): Remove.
3544 (resource_name): Constify.
3545 (LANG_HOOKS_HANDLE_OPTION): Override.
3546 (java_handle_option): New.
3547 (java_init): Don't call jcf_path_init.
3548 (java_init_options): Call jcf_path_init.
3550 * resource.c (compile_resource_data, compile_resource_file): Constify.
3552 2003-06-09 Nathan Sidwell <nathan@codesourcery.com>
3554 * java-tree.h (DECL_FUNCTION_LAST_LINE): New.
3555 (struct lang_decl_func): Add last_line field.
3556 * parse.h (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
3557 DECL_SOURCE_LINE_LAST): Remove.
3558 * parse.y (missing_return_error, finish_method_declaration,
3559 lookup_cl, start_artificial_method_body, source_end_java_method,
3560 start_complete_expand_method): Adjust.
3562 2003-06-08 Tom Tromey <tromey@redhat.com>
3564 * jvspec.c (jvgenmain_spec): Added `*' after fassume-compiled and
3565 fno-assume-compiled.
3567 2003-06-08 Roger Sayle <roger@eyesopen.com>
3569 * builtins.c (define_builtin_type, builtin_types): Delete.
3570 (define_builtin): Rewritten to take just the built-in code,
3571 the function's name, type and fallback library function name.
3572 All built-ins used by Java are implicit and BUILT_IN_NORMAL.
3573 (initialize_builtins): Overhaul to define the GCC builtins
3574 used by gcj manually, providing the Java run-time's
3575 implementations as the fallback library function.
3577 2003-06-08 Anthony Green <green@redhat.com>
3579 * parse.y (patch_cast): Fix conversions from floating-point to
3582 2003-06-08 Neil Booth <neil@daikokuya.co.uk>
3584 * Make-lang.in: Update.
3585 * lang.c: Include opts.h. Define cl_options_count and cl_options.
3587 2003-06-07 Neil Booth <neil@daikokuya.co.uk>
3589 * lang.c (java_init_options): Update.
3591 2003-06-05 Jan Hubicka <jh@suse.cz>
3593 * Make-lang.in: Add support for stageprofile and stagefeedback
3595 2003-05-31 Roger Sayle <roger@eyesopen.com>
3597 * lang.c (java_init_options): Prescribe wrap-around two's
3598 complement arithmetic overflow by setting flag_wrapv.
3600 2003-05-29 Roger Sayle <roger@eyesopen.com>
3602 * builtins.c (cos_builtin, sin_builtin, sqrt_builtin): Delete.
3603 (builtin_record): Add an additional builtin_code field to
3604 record which GCC built-in corresponds to the Java function.
3605 (java_builtins): Add new entries for atan, atan2, exp, log,
3607 (max_builtin, min_builtin, abs_builtin): Perform constant
3608 folding on the resulting tree.
3609 (java_build_function_call_expr): Likewise, perform constant
3610 folding on the resulting tree.
3611 (initialize_builtins): The NULL creators are now allowed in
3612 the java_builtins table, which is now terminated by an entry
3613 with builtin_code == END_BUILTINS.
3614 (check_for_builtin): Likewise. If the matching creator is
3615 NULL, construct the call using java_build_function_call_expr
3616 directly with the decl for the corresponding builtin_code.
3618 2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
3620 * win32-host.c: Normalize copyright boilerplate.
3622 2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3624 * parse.y (print_int_node): Use string concatentation on
3625 HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
3626 function calls into one.
3628 2003-05-13 Zack Weinberg <zack@codesourcery.com>
3630 * jcf-parse.c, jcf-write.c, lex.c: Replace all calls to
3631 fatal_io_error with calls to fatal_error; add ": %m" to the end of
3632 all the affected error messages.
3634 2003-05-13 Richard Henderson <rth@redhat.com>
3636 * class.c (layout_class_method): Set DECL_EXTERNAL.
3637 * decl.c (java_mark_decl_local, java_mark_class_local): New.
3638 * java-tree.h (java_mark_class_local): Declare.
3639 * jcf-parse.c (parse_class_file): Use it.
3640 * parse.y (java_expand_classes): Likewise.
3642 2003-05-04 Nathan Sidwell <nathan@codesourcery.com>
3644 * Make-lang.in (java/parse.o, java/parse-scan.o): Depend on input.h.
3645 * lex.h: #include input.h.
3646 * jv-scan.c (input_filename): Remove.
3648 2003-05-02 Tom Tromey <tromey@redhat.com>
3651 * gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
3652 (handle_inner_classes): New function.
3654 2003-05-01 Tom Tromey <tromey@redhat.com>
3657 * parse.y (finish_for_loop): Do nothing if update expression is a
3658 EXPR_WFL_NODE wrapping nothing.
3659 (java_complete_lhs) <COMPOUND_EXPR>: Likewise.
3661 2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
3663 * lex.h (input_lineno): Remove declaration.
3664 * parse-scan.y: #include input.h.
3665 (input_filename): Remove declaration.
3666 (input_location): Add definition.
3667 (input_line): Remove definition.
3669 2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
3671 * lex.h (lineno): Rename to ...
3672 (input_line): ... here
3673 * parse-scan.y (lineno): Rename to ...
3674 (input_line): ... here.
3675 (reset_report): Rename lineno to input_line.
3676 * check-init.c (check_init): Likewise.
3677 * class.c (push_class): Likewise.
3678 * decl.c (complete_start_java_method, end_java_method): Likewise.
3679 * expr.c (expand_byte_code): Likewise.
3680 * jcf-parse.c (give_name_to_class, parse_class_file): Likewise.
3681 * jcf-write.c (generate_bytecode_insns): Likewise.
3682 * lex.c (java_init_lex, java_allocate_new_line,
3683 do_java_lex): Likewise.
3684 * parse.h (YYNOT_TWICE): Likewise.
3685 * parse.y (empty_statement, expression_statement,
3686 java_pop_parser_context, java_parser_context_save_global,
3687 yyerror, register_fields, method_header, safe_layout_class,
3688 find_in_imports_on_demand, create_artificial_method,
3689 source_end_java_method, start_complete_expand_method,
3690 build_thisn_assign, java_complete_lhs,
3691 maybe_absorb_scoping_block): Likewise.
3693 2003-04-20 Mohan Embar <gnustuff@thisiscool.com>
3695 * jcf-io.c (find_class): use DIR_SEPARATOR instead of
3696 '/' when computing java source filename
3698 2003-04-13 Tom Tromey <tromey@redhat.com>
3700 * gjavah.c (print_c_decl): Indentation fix.
3702 2003-04-12 Zack Weinberg <zack@codesourcery.com>
3704 * class.c (make_field_value, make_method_value, get_dispatch_table)
3705 (make_class_data, emit_offset_symbol_table)
3706 * constants.c (build_constants_constructor)
3707 * java-tree.h (START_RECORD_CONSTRUCTOR)
3708 * parse.y (maybe_build_array_element_wfl):
3709 Use build_constructor.
3711 2003-04-10 Eric Blake <ebb9@email.byu.edu>
3714 * parse.y (string_convert_int_cst): Always use at least one digit
3715 in string conversion. Remove ASCII dependence.
3716 (merge_string_cste): Fix merging of 3-byte UTF-8 characters.
3718 2003-03-16 Mohan Embar <gnustuff@thisiscool.com>
3720 * Make-lang.in: added win32-host.c
3721 * jcf.h: defined macro JCF_OPEN_EXACT_CASE which
3722 resolves to open() on non-Win32 platforms and
3723 Win32-specific jcf_open_exact_case() on Win32
3724 * jcf-io.c (find_class): use JCF_OPEN_EXACT_CASE
3725 when trying .java and .class files
3726 * win32-host.c: added to repository. Defines
3727 Win32-specific jcf_open_exact_case()
3729 2003-04-10 Andrew Haley <aph@redhat.com>
3731 * jcf-write.c (struct jcf_partial): num_jsrs: new field.
3732 (maybe_free_localvar): Renamed from localvar_free.
3733 Add new arg, really.
3734 (generate_bytecode_insns): Set new variable, jsrs.
3735 Only free local vars if no jsr insns have been emittted.
3736 Call maybe_free_localvar, not localvar_free.
3738 2003-03-30 Joseph S. Myers <jsm@polyomino.org.uk>
3740 * gcj.texi: Remove @ at start of file.
3742 2003-03-25 Tom Tromey <tromey@redhat.com>
3744 * parse.y (create_interface): Call CHECK_DEPRECATED.
3746 2003-03-23 Zack Weinberg <zack@codesourcery.com>
3748 * Make-lang.in: Link jcf-dump against $(LDEXP_LIB).
3750 2003-03-21 Zack Weinberg <zack@codesourcery.com>
3752 * javaop.h (jfloat, jdouble): Make them structures mirroring
3753 the bit fields of IEEE float and double respectively.
3754 (JFLOAT_FINITE, JFLOAT_QNAN_MASK, JFLOAT_EXP_BIAS,
3755 JDOUBLE_FINITE, JDOUBLE_QNAN_MASK, JDOUBLE_EXP_BIAS): New.
3756 (union Word, union DWord): Delete.
3757 (WORD_TO_FLOAT, WORDS_TO_DOUBLE): Update to match.
3759 * gjavah.c (java_float_finite, java_double_finite, F_NAN_MASK,
3760 D_NAN_MASK): Delete.
3761 (jni_print_float, jni_print_double): New. Generate
3762 hexadecimal floating constants.
3763 (print_field_info): Use jni_print_float/double.
3765 * jcf-dump.c: Include math.h. Use ldexp/frexp to assemble
3766 finite floating point numbers for output; special case
3769 2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
3771 * lang.c (java_dump_tree): Change return type from 'int' to 'bool'.
3772 Replace 0 and 1 with true and false in return statements.
3774 2003-03-19 Tom Tromey <tromey@redhat.com>
3776 * lex.c (do_java_lex): Renamed from java_lex.
3777 (java_lex): New function.
3780 2003-03-13 Tom Tromey <tromey@redhat.com>
3782 * parse.y (resolve_inner_class): Error if qualifier is a primitive
3785 2003-03-04 Andrew Haley <aph@redhat.com>
3787 * gjavah.c (is_first_data_member): New global variable.
3788 (print_c_decl): If it's the first data member, align it as the
3790 (process_file): Set is_first_data_member.
3792 2003-03-11 Tom Tromey <tromey@redhat.com>
3794 * parse.y (resolve_field_access): Initialize class if field is
3795 found in another static field.
3796 * expr.c (build_class_init): Don't optimize out initialization of
3797 implemented interface.
3799 2003-03-11 Andrew Haley <aph@redhat.com>
3801 * jcf-io.c (caching_stat): Initialize origsep to remove compiler
3804 2003-03-10 Ranjit Mathew <rmathew@hotmail.com>
3806 * jcf-io.c (caching_stat): Account for both DIR_SEPARATOR
3807 and DIR_SEPARATOR_2 for a target.
3808 Correct minor typos.
3810 * jcf-write.c (make_class_file_name): Take both DIR_SEPARATOR
3811 and DIR_SEPARATOR_2 for a target into account.
3813 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
3815 * lang.c (java_init): Update prototype, move code to java_post_options.
3816 (java_post_options): Similarly.
3818 2003-03-05 Ranjit Mathew <rmathew@hotmail.com>
3820 * jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to
3821 compare file name components depending on the case-sensitivity
3822 or otherwise of the host file system.
3824 * jcf-path.c (add_entry): Use COMPARE_FILENAMES instead of
3825 "strcmp" to compare file name components.
3826 Use IS_DIR_SEPARATOR instead of comparing directly against
3828 (jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of
3829 comparing directly against DIR_SEPARATOR.
3831 2003-03-04 Tom Tromey <tromey@redhat.com>
3833 * Make-lang.in (java.tags): New target.
3835 2003-03-01 Roger Sayle <roger@eyesopen.com>
3837 * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3.
3838 (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3.
3840 2003-03-01 Tom Tromey <tromey@redhat.com>
3842 * parse.y (jdep_resolve_class): Only check deprecation if we found
3845 2003-02-28 Tom Tromey <tromey@redhat.com>
3848 * class.c (maybe_layout_super_class): Always pass a WFL to
3850 * parse.y (do_resolve_class): Updated comment to explain
3853 2003-02-26 Tom Tromey <tromey@redhat.com>
3855 * jcf-write.c (generate_classfile): Check whether class is
3856 deprecated before writing attribute count.
3858 2003-02-25 Roger Sayle <roger@eyesopen.com>
3860 * java/decl.c (java_init_decl_processing): Get soft_fmod_node from
3861 built_in_decls[BUILT_IN_FMOD] rather than define it ourselves.
3863 2003-02-23 Tom Tromey <tromey@redhat.com>
3865 * lang-options.h: Added -Wdeprecated.
3866 * gcj.texi (Warnings): Document -Wdeprecated.
3867 * java-tree.h (flag_deprecated): Declare.
3868 * lang.c (lang_W_options): Added deprecated.
3869 (flag_deprecated): New global.
3870 * chartables.h: Rebuilt.
3871 * gen-table.pl (process_one): Look at whitespace.
3872 (print_tables): Define LETTER_SPACE, LETTER_MASK.
3873 * parse.h (CLEAR_DEPRECATED): New macro.
3874 (CHECK_DEPRECATED_NO_RESET): New macro.
3875 * jcf-parse.c (handle_deprecated): New function.
3876 (HANDLE_DEPRECATED_ATTRIBUTE): New define.
3877 * jcf-reader.c (get_attribute): Handle Deprecated attribute.
3878 * parse.y (resolve_type_during_patch): Check deprecation.
3879 (jdep_resolve_class): Likewise.
3880 (process_imports): Likewise.
3881 (resolve_expression_name): Likewise.
3882 (check_deprecation): Strip arrays from decl. Check
3884 (patch_method_invocation): Also check the particular constructor
3886 (register_fields): Use CHECK_DEPRECATED_NO_RESET in loop.
3887 * jcf-write.c (append_deprecated_attribute): New function.
3888 (generate_classfile): Generate deprecated attribute when
3890 * lex.c (java_parse_doc_section): Return type now void. Rewrote.
3891 (java_lex) [case '*']: Simplify logic.
3892 (java_start_char_p): Use LETTER_MASK.
3893 (java_part_char_p): Likewise.
3894 (java_space_char_p): New function.
3896 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
3898 Change base class access representation.
3899 * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
3900 (add_interface_do): Likewise.
3902 2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
3904 * decl.c (java_init_decl_processing): Change
3905 soft_lookupjnimethod_node to reflect the change in
3906 signature of _Jv_LookupJNIMethod in libjava/jni.cc
3907 * expr.c (build_jni_stub): Calculate and pass the size
3908 on the stack of the arguments to a JNI function. Use
3909 new target macro MODIFY_JNI_METHOD_CALL to allow a
3910 target to modify the call to a JNI method.
3912 2003-02-08 Roger Sayle <roger@eyesopen.com>
3914 * jcf-io.c (java_or_class_file): Use libiberty's lbasename
3915 instead of basename to avoid compiler warnings on Tru64.
3917 2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
3919 * gcj.texi: Update to GFDL 1.2.
3921 2003-01-31 Andrew Haley <aph@redhat.com>
3923 * parse.y (java_expand_classes): Scan the whole class list looking
3924 for access methods that haven't yet been expanded.
3926 2003-01-31 Adrian Bunk <bunk@fs.tum.de>
3930 * jv-scan.c: Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
3931 to fix bootstrap on sparc-unknown-netbsdelf1.5.
3932 * jcf-parse.c: Likewise.
3934 2003-01-31 Mark Wielaard <mark@klomp.org>
3936 * gjavah.c (throwable_p): Allocate 1 more byte for string.
3938 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
3940 * class.c (make_class): Use BINFO_ELTS.
3941 (set_super_info): Likewse.
3942 (add_interface_do): Likewise.
3944 2003-01-30 Tom Tromey <tromey@redhat.com>
3946 * jcf-parse.c (read_class): Update identifier's class value if it
3947 changed during parsing.
3949 2003-01-30 Loren James Rittle <ljrittle@acm.org>
3951 * Make-lang.in (po-generated): Find the targets in $(parsedir).
3952 Propagate change to all other rules as required.
3953 (java/parse-scan.o): Add explicit dependency on
3954 $(parsedir)/java/parse-scan.c .
3956 2003-01-29 Tom Tromey <tromey@redhat.com>
3958 * parse.y (patch_assignment): Only transform the rhs of an
3959 assignment when compiling to native.
3961 2003-01-28 Tom Tromey <tromey@redhat.com>
3963 * jcf-write.c (generate_bytecode_conditional): Typo fixes.
3965 2003-01-28 Tom Tromey <tromey@redhat.com>
3967 * lex.c (java_lex): Don't include UEOF as part of token.
3968 (java_read_unicode): Error if \u sequence prematurely terminated.
3970 2003-01-27 Tom Tromey <tromey@redhat.com>
3972 * parse.y (java_check_regular_methods): Check for construct after
3973 checking types in throws clause.
3975 2003-01-24 Tom Tromey <tromey@redhat.com>
3977 * class.c (build_static_field_ref): Only a String or numeric field
3978 can fold to a constant.
3980 2003-01-23 Tom Tromey <tromey@redhat.com>
3982 * jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
3983 file name in resource buffer.
3985 2003-01-23 Tom Tromey <tromey@redhat.com>
3987 * expr.c (build_known_method_ref): Use method's context to find
3990 2003-01-23 Tom Tromey <tromey@redhat.com>
3992 * constants.c (set_constant_entry): Allocated cleared memory.
3994 2003-01-22 Tom Tromey <tromey@redhat.com>
3996 * java-tree.h: Don't use PARAMS.
3997 * resource.c: Add prototypes for all functions.
3998 (write_resource_constructor): Use `const char *' to avoid
4001 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
4003 * jcf-parse.c (process_zip_dir): Remove unused variable.
4005 2003-01-22 Tom Tromey <tromey@redhat.com>
4007 * expr.c (build_invokeinterface): Abort if method's context is not
4010 2003-01-22 Tom Tromey <tromey@redhat.com>
4012 * gcj.texi (Input and output files): Mention non-class entries.
4013 * decl.c (java_init_decl_processing): Call
4014 init_resource_processing.
4015 * java-tree.h (compile_resource_data, write_resource_constructor,
4016 compile_resource_file, init_resource_processing): Declare.
4017 * config-lang.in (gtfiles): Added resource.c.
4018 * Make-lang.in (gt-java-resource.h): New target.
4019 (JAVA_OBJS): Added resource.o.
4020 (java/resource.o): New target.
4021 * resource.c: New file.
4022 * class.c (compile_resource_file): Moved to resource.c.
4023 (registerResource_libfunc): Likewise.
4024 (utf8_decl_list): Mark with GTY; now static.
4025 * jcf-parse.c (classify_zip_file): New function.
4026 (parse_zip_file_entries): Use it; compile .properties files.
4027 (process_zip_dir): Use classify_zip_file and compute_class_name.
4028 Don't write class name into zip directory.
4029 (java_parse_file): Call write_resource_constructor.
4030 (compute_class_name): New function.
4031 * jcf-io.c (read_zip_member): Reindented.
4033 2003-01-21 Tom Tromey <tromey@redhat.com>
4035 * class.c (supers_all_compiled): New function.
4036 (make_class_data): Use it.
4038 2003-01-21 Tom Tromey <tromey@redhat.com>
4040 * parse.y (method_header): Native method can't be strictfp.
4041 No method can be transient or volatile.
4043 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4045 Make-lang.in (jvspec.o-warn): Add -Wno-error.
4047 2003-01-18 Kazu Hirata <kazu@cs.umass.edu>
4049 * check-init.c: Fix comment typos.
4050 * class.c: Likewise.
4051 * constants.c: Likewise.
4053 * except.c: Likewise.
4055 * java-except.h: Likewise.
4056 * java-tree.h: Likewise.
4057 * javaop.h: Likewise.
4058 * jcf-dump.c: Likewise.
4059 * jcf-io.c: Likewise.
4060 * jcf-parse.c: Likewise.
4061 * jcf-write.c: Likewise.
4063 * mangle.c: Likewise.
4064 * typeck.c: Likewise.
4065 * verify.c: Likewise.
4067 2003-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4069 * Make-lang.in (java/jcf-write.o): Depend on $(TM_P_H).
4070 * jcf-write.c: Include "tm_p.h".
4072 2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4074 * jcf-io.c (caching_stat): Cast the 3rd arg of scandir to void*.
4076 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4078 * builtins.c (java_build_function_call_expr): Renamed from
4079 build_function_call_expr. All callers changed.
4081 * Make-lang.in (java/jcf-parse.o): Depend on $(TM_P_H).
4082 * jcf-parse.c: Include tm_p.h.
4084 * jcf-write.c (generate_bytecode_insns): Avoid signed/unsigned
4087 2003-01-14 Tom Tromey <tromey@redhat.com>
4089 * class.c (make_class_data): Check that super is compiled before
4090 building class reference to it.
4092 2003-01-14 Andrew Haley <aph@redhat.com>
4094 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
4095 varargs function -- correct.
4097 2003-01-14 Andrew Haley <aph@redhat.com>
4099 * decl.c (java_init_decl_processing): Temporarily back out previous patch.
4101 2003-01-14 Andrew Haley <aph@redhat.com>
4103 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
4104 varargs function -- correct.
4106 * parse.y (patch_assignment): Copy the rhs of an assignment into a
4107 temporary if the RHS is a reference.
4109 2003-01-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4111 * Make-lang.in (keyword.h): Pass "-L ANSI-C" to gperf.
4112 * keyword.h: Regenerated.
4114 * All Files: Convert to ISO C style function definitions.
4116 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
4118 * parse.y (check_pkg_class_access): ANSIfy definition.
4120 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4122 * decl.c, parse-scan.y, parse.y: Don't cast return value of
4125 * class.c, gjavah.c, parse.y, verify.c: Don't use PTR.
4127 2003-01-09 Geoffrey Keating <geoffk@apple.com>
4129 Merge from pch-branch:
4131 2002-12-02 Geoffrey Keating <geoffk@apple.com>
4133 * Make-lang.in (java/gjavah.o): Update dependencies.
4134 * gjavah.c: Include ggc.h.
4136 2002-08-16 Geoffrey Keating <geoffk@redhat.com>
4138 * Make-lang.in (GCJH_OBJS): Add ggc-none.o.
4139 (JCFDUMP_OBJS): Add ggc-none.o.
4140 (java/jcf-dump.o): Depend on GGC_H.
4141 * jcf-reader.c (jcf_parse_constant_pool): Use ggc_alloc to allocate
4142 CPool substructures.
4143 * jcf-parse.c (process_zip_dir): Use ggc_alloc to allocate JCFs.
4144 * jcf-dump.c: Include ggc.h.
4146 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
4148 * jcf.h (union cpool_entry): New.
4149 (struct CPool): Use gengtype to mark. Change field 'data' to be
4151 (struct JCF): Use gengtype to mark.
4152 (CPOOL_UINT): Update for new cpool_entry type.
4153 (CPOOL_USHORT1): Likewise.
4154 (CPOOL_USHORT2): Likewise.
4155 (CPOOL_FINISH): Use GC to free cpool subfields.
4156 * parse.h (struct parser_ctxt): Mark field current_jcf.
4157 * lex.c (java_init_lex): Use GC to allocate struct JCF.
4158 * jcf-parse.c (HANDLE_CONSTANT_Utf8): Update for new cpool_entry type.
4159 (main_jcf): Use gengtype to mark.
4160 (ggc_mark_jcf): Delete.
4161 (get_constant): Update for new cpool_entry type.
4162 (give_name_to_class): Likewise.
4163 (get_class_constant): Likewise.
4164 (init_outgoing_cpool): Use GGC to allocate struct CPool.
4165 (java_parse_file): Use GGC to allocate struct JCF.
4166 (init_jcf_parse): Don't call ggc_add_root.
4167 * jcf-reader.c (jcf_parse_constant_pool): Update for new
4169 * java-tree.h (current_jcf): Use gengtype to mark.
4170 (CPOOL_UTF): Update for new cpool_entry type.
4171 (outgoing_cpool): Use gengtype to mark.
4172 (struct lang_type): GC struct JCF and struct CPool.
4173 * config-lang.in (gtfiles): Add jcf.h.
4174 * constants.c (find_tree_constant): New.
4175 (set_constant_entry): Allocate cpool subfields using GGC. Update
4176 for new cpool_entry type.
4177 (find_constant1): Update for new cpool_entry type.
4178 (find_constant2): Likewise.
4179 (find_utf8_constant): Use find_tree_constant.
4180 (find_class_or_string_constant): Remove unnecessary cast to jword.
4181 Update for new cpool_entry type.
4182 (count_constant_pool_bytes): Update for new cpool_entry type.
4183 (write_constant_pool): Likewise.
4184 (alloc_name_constant): Use find_tree_constant.
4185 (build_constants_constructor): Update for new cpool_entry type.
4187 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
4189 * parse.y (mark_parser_ctxt): Delete.
4190 (goal): Don't use ggc_add_root.
4191 (create_new_parser_context): Use GC to allocate struct parser_ctxt.
4192 (java_pop_parser_context): Let GC free parser_ctxt.
4193 (java_parser_context_resume): Likewise.
4194 * parse.h (struct parser_ctxt): Use gengtype to mark.
4196 (ctxp_for_generation): Likewise.
4197 * lex.h (struct java_lc_s): Mark for gengtype.
4198 (java_lexer): Rearrange for gengtype.
4199 * config-lang.in (gtfiles): Add lex.h, parse.h.
4201 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4203 * All Files: Remove PARAMS macro.
4205 * expr.c, gjavah.c, javaop.h, jcf-dump.c, jcf-io.c, jcf-reader.c,
4206 jcf-write.c, jcf.h, jv-scan.c: Don't rely on the `DEFUN', `AND' or
4209 * jv-scan.c, parse.y: Remove VPARAMS, VA_OPEN, VA_FIXEDARG and
4212 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
4214 * Make-lang.in (java.install-common, java.uninstall,
4215 java.install-info, java.install-man): Prepend $(DESTDIR)
4216 to destination paths in all (un)installation commands.
4217 (java.install-common): Rewrite $(LN) command to support
4218 DESTDIR with "ln" as well as with "ln -s".
4220 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
4222 * java-tree.h: Protect against multiple inclusion.
4224 2003-01-07 Tom Tromey <tromey@redhat.com>
4226 * class.c (add_assume_compiled): Don't adjust parent if we're
4227 already at the root of tree.
4229 2003-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4231 * lang.c (dump_compound_expr): Prototype.
4233 2003-01-03 Tom Tromey <tromey@redhat.com>
4235 Fix for PR java/8712:
4236 * expr.c (build_instanceof): Build an NE_EXPR, not a COND_EXPR,
4237 when simply checking against `null'.
4239 2003-01-03 Tom Tromey <tromey@redhat.com>
4241 * gcj.texi (Standard Properties): Document http.proxyHost and
4244 * gcj.texi (GNU Classpath Properties): Document new properties.
4246 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
4248 * java/jcf-reader.c, java/jvgenmain.c, java/keyword.gperf,
4249 java/lang-options.h, java/mangle.c, java/mangle_name.c,
4250 java/xref.c, java/zextract.c,java/zipfile.h: Fix copyright years.
4252 2003-01-01 Steven Bosscher <s.bosscher@student.tudelft.nl>
4254 * Make-lang.in, boehm.c, buffer.c,
4255 buffer.h, builtins.c, class.c,
4256 config-lang.in, constants.c,
4257 convert.h, decl.c, except.c,
4258 expr.c, java-except.h,
4259 java-tree.h, javaop.def,
4260 jcf-parse.c, jcf-write.c,
4261 jv-scan.c, jvgenmain.c,
4262 jvspec.c, keyword.gperf,
4263 keyword.h, lang-options.h,
4264 lang-specs.h, lang.c, lex.c,
4265 lex.h, mangle.c, mangle_name.c,
4266 parse-scan.y, parse.h, parse.y,
4267 typeck.c, verify.c, xref.c,
4268 xref.h: Replace "GNU CC" with
4269 "GCC" in the copyright header.
4271 * check-init.c, gjavah.c, javaop.h,
4272 jcf-depend.c, jcf-dump.c, jcf-io.c,
4273 jcf-path.c, jcf-reader.c, jcf.h,
4274 zextract.c, zipfile.h: These files are
4275 "part of GCC". Also say "GCC" not "GNU CC".
4277 2002-12-30 DJ Delorie <dj@redhat.com>
4279 * Make-lang.in: Protect against texi2pod/pod2man failing.
4281 2002-12-28 Joseph S. Myers <jsm@polyomino.org.uk>
4283 * gcj.texi: Use @copying.
4285 2002-12-27 Mark Mitchell <mark@codesourcery.com>
4287 * gjavah.c (print_name_for_stub_or_jni): Adjust call to
4288 print_cxx_classname.
4289 (print_cxx_classname): Add add_scope parameter.
4290 (print_class_decls): Do not emit a semicolon after the extern
4292 (process_file): Adjust calls to print_cxx_classname.
4294 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
4296 * gcj.texi: Include Cover Texts in man page.
4298 2002-12-23 Jeff Sturm <jsturm@one-point.com>
4300 * class.c (build_static_field_ref): Check FIELD_FINAL.
4302 * constants.c (alloc_class_constant): Use TYPE_CPOOL_DATA_REF
4303 instead of current_constant_pool_data_ref.
4304 * java-tree.h (current_constant_pool_data_ref): Undefine.
4305 (JTI_CURRENT_CONSTANT_POOL_DATA_REF): Remove.
4306 * jcf-parse.c (init_outgoing_cpool): Don't initialize
4307 current_constant_pool_data_ref.
4309 * except.c (prepare_eh_table_type ): Use DECL_NAME of class type,
4310 not build_internal_class_name.
4312 * parse.y (patch_incomplete_class_ref): Always emit `class$' method.
4313 Use it when class ref isn't certain to be compiled.
4315 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
4317 * gcj.texi: Include gcc-common.texi.
4318 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Depend on
4319 $(srcdir)/doc/include/gcc-common.texi.
4321 2002-12-22 Anthony Green <green@redhat.com>
4323 * gcj.texi (Limitations): Add note about org.xml.sax and
4326 2002-12-20 Tom Tromey <tromey@redhat.com>
4328 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Handle case
4329 where minimum case value is Integer.MIN_VALUE.
4332 2002-12-18 Andrew Haley <aph@redhat.com>
4334 * parse.y (patch_invoke): Force evaluation order when `check' is
4335 set. For PR libgcj/8945.
4337 2002-12-16 Mark Mitchell <mark@codesourcery.com>
4339 * gcj.texi: Change version number to 3.4.
4341 2002-12-05 Ranjit Mathew <rmathew@hotmail.com>
4342 Andrew Haley <aph@redhat.com>
4344 * parse.y (source_end_java_method): Remove custom encoding of line
4345 numbers for a function decl before passing it to the back end.
4347 2002-12-03 Andrew Haley <aph@redhat.com>
4349 * class.c (make_class_data): New field, "chain".
4350 * decl.c (java_init_decl_processing): Likewise.
4352 2002-12-02 Tom Tromey <tromey@redhat.com>
4355 * parse.y (do_resolve_class): Handle qualified name via
4358 2002-11-30 Zack Weinberg <zack@codesourcery.com>
4360 * boehm.c, buffer.c, builtins.c, check-init.c, class.c,
4361 constants.c, decl.c, except.c, expr.c, gjavah.c, jcf-depend.c,
4362 jcf-dump.c, jcf-io.c, jcf-parse.c, jcf-path.c, jcf-write.c,
4363 jv-scan.c, jvgenmain.c, jvspec.c, lang.c, mangle.c, mangle_name.c,
4364 parse-scan.y, parse.y, typeck.c, verify.c, xref.c, zextract.c:
4365 Include coretypes.h and tm.h.
4366 * Make-lang.in: Update dependencies.
4368 2002-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4370 * decl.c (java_init_decl_processing): Use `LL' on 64-bit constant.
4372 2002-11-25 Diego Novillo <dnovillo@redhat.com>
4374 * jcf-reader.c: Don't expand JCF_readu4 inside the
4375 expansion of JCF_SKIP.
4377 2002-11-25 Diego Novillo <dnovillo@redhat.com>
4379 * jcf-reader.c: Don't expand JCF_readu4 inside the
4380 expansion of JCF_SKIP.
4382 2002-11-22 Tom Tromey <tromey@redhat.com>
4384 * parse.y (patch_binop): Cast right hand side of shift expression
4385 to `int'. Fixes PR java/8676.
4387 2002-11-22 Ranjit Mathew <rmathew@hotmail.com>
4388 Andrew Haley <aph@redhat.com>
4390 * gcc/java/jcf-write.c (write_classfile): Remove target
4391 class file, if it exists, before renaming the temporary
4394 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
4396 * jvspec.c (lang_specific_spec_functions): New.
4398 2002-11-18 Tom Tromey <tromey@redhat.com>
4400 Fix for PR java/7912:
4401 * expr.c (can_widen_reference_to): Allow cast of array to
4402 Cloneable or Serializable.
4403 * java-tree.h (java_lang_cloneable_identifier_node): Declare.
4404 (java_io_serializable_identifier_node): Likewise.
4405 * parse.y (java_lang_cloneable, java_io_serializable): Removed.
4406 (valid_ref_assignconv_cast_p): Use new identifier nodes.
4407 * lex.c (java_init_lex): Don't initialize java_lang_cloneable and
4408 java_io_serializable.
4409 * decl.c (java_init_decl_processing): Initialize
4410 java_lang_cloneable_identifier_node and
4411 java_io_serializable_identifier_node.
4412 (java_lang_cloneable_identifier_node): New global.
4413 (java_io_serializable_identifier_node): Likewise.
4415 2002-11-14 Jens-Michael Hoffmann <jensmh@gmx.de>
4417 * buffer.c: Remove unnecessary casts.
4418 * check-init.c: Likewise.
4419 * class.c: Likewise.
4420 * constants.c: Likewise.
4422 * except.c: Likewise.
4423 * gjavah.c: Likewise.
4424 * jcf-io.c: Likewise.
4425 * jcf-parse.c: Likewise.
4426 * jcf-path.c: Likewise.
4427 * jvspec.c: Likewise.
4430 * verify.c: Likewise.
4432 2002-11-06 Tom Tromey <tromey@redhat.com>
4434 * gjavah.c (print_stub_or_jni): Include JNIEXPORT and JNICALL in
4437 2002-11-05 Tom Tromey <tromey@redhat.com>
4439 Fix for PR java/6388.
4440 * lex.h (JAVA_INTEGRAL_RANGE_ERROR): Wrap in do...while.
4441 * java-tree.h (enum java_tree_index): New values
4442 JTI_DECIMAL_INT_MAX_NODE, JTI_DECIMAL_LONG_MAX_NODE.
4443 (decimal_int_max, decimal_long_max): New defines.
4444 * lex.c (yylex): Rewrote range checking. Sign extend literals.
4445 (error_if_numeric_overflow): Rewrote range checking.
4446 * decl.c (java_init_decl_processing): Initialize decimal_int_max,
4449 2002-11-02 Tom Tromey <tromey@redhat.com>
4451 * java-tree.h: Move JV_STATE_ERROR before JV_STATE_DONE.
4453 * class.c (make_method_value): Put class name, not signature, into
4454 `throws' field. For PR java/8415.
4456 2002-10-24 Tom Tromey <tromey@redhat.com>
4458 * gcj.texi (Invoking gij): Document --showversion.
4459 (Standard Properties): java.library.path now set.
4461 2002-10-23 Tom Tromey <tromey@redhat.com>
4463 * gjavah.c (decode_signature_piece): In JNI mode, print
4464 `jobjectArray' when array depth is nonzero.
4467 2002-10-15 Andrew Haley <aph@redhat.com>
4469 * parse.y (patch_invoke): Call force_evaluation_order on a static
4471 (resolve_qualified_expression_name): Call force_evaluation_order
4472 on a arg list that is part of a Qualified Expression Name.
4474 * lang.c (dump_compound_expr): New.
4475 (java_dump_tree): New.
4477 2002-10-20 Ranjit Mathew <rmathew@hotmail.com>
4479 * gcj.texi: Added item describing the GCJ runtime property
4482 2002-10-15 Richard Henderson <rth@redhat.com>
4484 * jcf-parse.c (get_constant): Fix type warning.
4486 2002-10-15 Andrew Haley <aph@redhat.com>
4488 * java-tree.h (java_inlining_merge_static_initializers): Declare.
4489 (java_inlining_map_static_initializers): Declare.
4491 2002-10-14 Andrew Haley <aph@redhat.com>
4493 * tree-inline.c (remap_block): All local class initialization
4494 flags go in the outermost scope.
4495 (expand_call_inline): Call java_inlining_map_static_initializers.
4496 (expand_call_inline): Call java_inlining_merge_static_initializers.
4497 * java/lang.c (merge_init_test_initialization): New.
4498 (java_inlining_merge_static_initializers): New.
4499 (inline_init_test_initialization): New.
4500 (java_inlining_map_static_initializers): New.
4502 2002-10-11 Mark Wielaard <mark@klomp.org>
4504 * gcj.texi (Compatibility): Add Limitations and Extensions section.
4506 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4508 * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer.
4510 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4512 * parse.y (merge_string_cste): Add parentheses around & within |.
4514 2002-10-08 Tom Tromey <tromey@redhat.com>
4516 * parse.y (variable_declarator_id): Simplify error path for
4517 array declarator error. For PR java/8003.
4519 2002-10-08 Zack Weinberg <zack@codesourcery.com>
4521 * gjavah.c, jcf-dump.c, jv-scan.c: Globally replace GCCBUGURL with
4524 2002-10-08 Andrew Haley <aph@redhat.com>
4526 * parse.y (attach_init_test_initialization_flags): Check for
4529 2002-10-07 Anthony Green <green@redhat.com>
4531 * parse.y (merge_string_cste): Fix bug in string concatenation.
4533 2002-10-03 Michael Koch <konqueror@gmx.de>
4535 * gcj.texi (Standard properties):
4536 Change default of java.awt.toolkit to gnu.awt.gtk.GtkToolkit.
4538 2002-10-02 Roger Sayle <roger@eyesopen.com>
4540 PR optimization/6627
4541 * lang.c (java_init): If storing the vbit in function
4542 pointers, ensure that force_align_functions_log is atleast
4543 one to aid compatability with g++ vtables.
4545 2002-10-01 Nathan Sidwell <nathan@codesourcery.com>
4547 * jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
4548 foul of type-based aliasing.
4550 2002-09-30 Anthony Green <green@redhat.com>
4552 * gcj.texi (Invoking jv-scan): Fix texinfo.
4554 2002-09-28 Anthony Green <green@redhat.com>
4556 * gcj.texi (Invoking jv-scan): Add --no-assert documentation.
4557 (Code Generation): Add -fno-assert documentation.
4558 * jv-scan.c (flag_assert): New global.
4559 (options): Add assert option.
4560 (help): Add --no-assert documentation.
4561 * parse-scan.y (flag_assert): New global.
4562 * lang.c (lang_f_options): Add -fassert/-fno-assert support.
4563 (flag_assert): New global.
4564 * java-tree.h (flag_assert): New global.
4565 * lex.c (java_lex): Obey flag_assert.
4566 * jvspec.c (jvgenmain_spec): Strip -fassert/-fno-assert when
4569 2002-09-26 Andrew Haley <aph@redhat.com>
4571 * expr.c (build_java_array_length_access): Check for null pointer.
4572 * expr.c (expand_java_arrayload): Likewise.
4574 2002-09-21 Richard Henderson <rth@redhat.com>
4576 * jcf-parse.c (get_constant): Decode from IEEE no matter
4577 what the target format.
4579 2002-09-20 Kazu Hirata <kazu@cs.umass.edu>
4581 * ChangeLog: Follow spelling conventions.
4582 * class.c: Likewise.
4585 * gjavah.c: Likewise.
4586 * java-tree.h: Likewise.
4587 * jcf-dump.c: Likewise.
4588 * jcf-parse.c: Likewise.
4589 * jvspec.c: Likewise.
4591 * mangle.c: Likewise.
4592 * parse.y: Likewise.
4594 2002-09-17 Tom Tromey <tromey@redhat.com>
4596 * lex.c (java_read_unicode_collapsing_terminators): Handle case
4597 where \r appears at EOF. Fixes PR java/7950.
4599 2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
4601 * jvspec.c (lang_specific_driver): Remove unused variable.
4603 2002-09-16 Geoffrey Keating <geoffk@apple.com>
4605 * java-tree.h (union lang_tree_node): Add chain_next option.
4607 2002-09-16 Richard Henderson <rth@redhat.com>
4609 * jcf-parse.c (get_constant): Runtime check for IEEE format;
4610 use new real.h interface.
4611 * jcf-write.c (find_constant_index): Use new real.h interface.
4612 * lex.c (IS_ZERO): Use REAL_VALUES_EQUAL.
4614 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
4616 * lang.c: Follow spelling conventions.
4618 2002-09-11 Per Bothner <per@bothner.com>
4620 * parse.y (fold_constant_for_init): If a VAR_DECL, convert numerical
4621 constant to the type of the field.
4622 (java_complete_tree): Remove now-redundant code.
4624 * parse.y (fold_constant_for_init): 'null' is not a constant expr.
4626 2002-09-03 Jesse Rosenstock <jmr@ugcs.caltech.edu>
4629 * verify.c (verify_jvm_instructions) [OPCODE_jsr]: Only push the
4630 return label if a ret instruction for the jsr has been reached.
4632 2002-09-09 Ranjit Mathew <rmathew@hotmail.com>
4634 * parse.y (DIR_SEPARATOR): Don't define.
4635 (check_class_interface_creation): Use IS_DIR_SEPARATOR.
4637 2002-08-28 Andrew Haley <aph@redhat.com>
4639 * verify.c (verify_jvm_instructions): Allow exception handler
4640 inside code that is being protected, but generate a warning.
4641 * except.c (link_handler): Initialize `expanded' in new eh_range.
4642 (binding_depth, is_class_level, current_pc): Declare extern.
4644 2002-09-01 Mark Wielaard <mark@klomp.org>
4646 * gcj.texi: Add chapter about system properties.
4649 2002-08-26 Tom Tromey <tromey@redhat.com>
4651 * parse.y (try_builtin_assignconv): Allow narrowing primitive
4652 conversion if RHS_TYPE is byte, short, or char.
4654 2002-08-22 Tom Tromey <tromey@redhat.com>
4656 * gcj.texi (Invoking gij): Document -cp and -classpath.
4658 2002-08-21 Tom Tromey <tromey@redhat.com>
4660 * Make-lang.in (java/jcf-path.o): Use $(datadir), not
4661 $(prefix)/share. For PR libgcj/7633.
4663 For PR java/6005 and PR java/7611:
4664 * lang.c (LANG_HOOKS_CAN_USE_BITFIELDS_P): New define.
4665 (java_can_use_bit_fields_p): New function.
4667 2002-08-16 Tom Tromey <tromey@redhat.com>
4669 * gcj.texi (Class Initialization): Mention class initialization of
4672 2002-07-30 Andrew Haley <aph@cambridge.redhat.com>
4674 * Make-lang.in (java-tree-inline.o): New.
4675 (JAVA_OBJS): Add java-tree-inline.o.
4676 * parse.y (source_end_java_method): Call java_optimize_inline.
4677 (java_expand_method_bodies): Save method's tree in
4679 (add_stmt_to_compound): Keep track of the number of statments.
4680 * lang.c (java_init): Enable flag_inline_trees.
4681 (java_post_options): If flag_inline_functions is on, enable
4682 flag_inline_trees instread.
4683 (decl_constant_value): New.
4684 (java_tree_inlining_walk_subtrees): New.
4685 * java-tree.h (DECL_NUM_STMTS): New macro.
4686 (java_optimize_inline): Declare.
4687 * expr.c (java_expand_expr): Allow a BLOCK to return a value.
4688 Handle a LABEL_EXPR.
4689 * decl.c (build_result_decl): If we already have a DECL_RESULT
4691 (dump_function): New.
4692 (java_optimize_inline): New.
4693 (dump_function): New.
4695 2002-08-13 Jesse Rosenstock <jmr@fulcrummicro.com>
4698 * parse.y (build_assertion): Invert return from
4699 desiredAssertionStatus.
4701 2002-08-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4703 * jcf-write.c (get_access_flags): Return correct access flags for
4704 private and protected inner classes.
4706 2002-08-08 Nathan Sidwell <nathan@codesourcery.com>
4708 * java/Make-lang.in (java.mostlyclean): Remove coverage files.
4710 2002-08-05 Geoffrey Keating <geoffk@redhat.com>
4712 * mangle_name.c: Don't include obstack.h twice.
4713 * xref.c: Don't include obstack.h.
4715 2002-08-04 Geoffrey Keating <geoffk@redhat.com>
4717 * class.c: (permanent_obstack): Delete declaration.
4718 * constants.c: (permanent_obstack): Delete declaration.
4719 * except.c: (permanent_obstack): Delete declaration.
4720 * expr.c: (permanent_obstack): Delete declaration.
4721 * jcf-parse.c: (permanent_obstack): Delete declaration.
4722 (saveable_obstack): Delete declaration.
4723 * parse.h: (permanent_obstack): Delete declaration.
4724 * typeck.c: (permanent_obstack): Delete declaration.
4726 2002-08-04 Joseph S. Myers <jsm@polyomino.org.uk>
4728 * gcj.texi (version-gcc): Increase to 3.3.
4730 2002-07-22 Tom Tromey <tromey@redhat.com>
4732 * lex.c (java_lex): Check for `e' or `E' after 0.
4734 2002-07-21 Richard Henderson <rth@redhat.com>
4736 * lang.c (java_unsafe_for_reeval): New.
4737 (LANG_HOOKS_UNSAFE_FOR_REEVAL): New.
4739 2002-07-21 Neil Booth <neil@daikokuya.co.uk>
4741 * jcf-path.c (GET_ENV_PATH_LIST): Remove.
4742 (jcf_path_init): Use GET_ENVIRONMENT.
4744 2002-07-10 Roger Sayle <roger@eyesopen.com>
4745 Zack Weinberg <zack@codesourcery.com>
4747 * builtins.c (initialize_builtins): Remove defines that
4748 handled C/C++ specific junk hereby removed from builtins.def.
4750 2002-07-07 Neil Booth <neil@daikokuya.co.uk>
4752 * lang.c (java_post_options): Update prototype.
4754 2002-07-05 Roger Sayle <roger@eyesopen.com>
4756 * builtins.c (initialize_builtins): Ignore the additional
4757 parameter to DEF_BUILTIN. Handle more C/C++ specific junk in
4758 the builtins.def file.
4760 2002-07-01 Tom Tromey <tromey@redhat.com>
4763 * parse.y (patch_incomplete_class_ref): Handle VOID_TYPE
4766 2002-07-01 Roger Sayle <roger@eyesopen.com>
4768 * java/decl.c (builtin_function): Accept additional parameter.
4769 (java_init_decl_processing): Pass an additional NULL_TREE
4770 argument to builtin_function.
4772 2002-06-29 T.J. Mather <tjmather@maxmind.com>
4774 * gcj.texi: Fixed gcj invocation example so that it compiles.
4776 2002-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4778 * lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
4779 * parse.y (mark_parser_ctxt): Likewise.
4780 (check_modifiers, declare_local_variables): Avoid incorrect
4781 hardcoded constant 10.
4783 * lex.c (java_read_char): Avoid "comparison is always true"
4786 2002-06-25 Andreas Schwab <schwab@suse.de>
4788 * expr.c (JSR): Avoid undefined operation on PC.
4790 2002-06-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4792 * decl.c (clear_binding_level): Const-ify.
4794 2002-06-13 Akim Demaille <akim@epita.fr>
4796 * parse.y (class_declaration, interface_declaration): Make sure
4797 all their rules have an action, in order to avoid meaningless `$$
4798 = $1' and their type clashes.
4800 2002-06-11 Tom Tromey <tromey@redhat.com>
4802 * jcf-write.c (generate_classfile): Use FIELD_SYNTHETIC.
4803 * parse-scan.y (statement_without_trailing_substatement): Added
4805 (assert_statement): New rule.
4806 * java-tree.h (struct lang_type) [assertions]: New field.
4807 (TYPE_USES_ASSERTIONS): New macro.
4808 (CLASS_USES_ASSERTIONS): Likewise.
4809 (FIELD_SYNTHETIC): New define.
4810 * lex.c (java_lval;): Added ASSERT_TK.
4811 * parse.y (ASSERT_TK): Added.
4812 (statement_without_trailing_substatement): Added assert_statement.
4813 (assert_statement): New rule.
4814 (build_assertion): New function.
4815 (maybe_generate_pre_expand_clinit): Create and initialize
4816 $assertionsDisabled.
4817 (lookup_package_type): Removed decl.
4818 * keyword.h: Rebuilt.
4819 * keyword.gperf (assert): New token.
4821 2002-06-10 Akim Demaille <akim@epita.fr>
4823 * parse.y (interface_type_list, class_member_declaration)
4824 (unary_expression_not_plus_minus): Remove duplicate %type.
4827 2002-06-09 Tom Tromey <tromey@redhat.com>
4829 * Make-lang.in (java/lang.o): Use LANGHOOKS_DEF_H.
4831 * parse.y (method_header): Give error message in all cases.
4834 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4836 Don't use RTL inlining. Fix for PR java/6820.
4837 * lang.c (LANG_HOOKS_POST_OPTIONS): Define.
4838 (flag_really_inline): New.
4839 (java_decode_option): Set flag_really_inline if -finline-functions
4841 (java_post_options): New function. Turn off inlining unless
4842 flag_really_inline is set.
4844 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
4846 * gjavah.c (throwable_p): Accept argument as either a classname or
4847 signature fragment. Create null-terminated classname string for super
4848 when calling itself recursively.
4849 (decode_signature_piece): Skip first character from class name
4850 signature when calling throwable_p.
4852 2002-06-08 H.J. Lu (hjl@gnu.org)
4854 * jcf-path.c (jcf_path_init): Allocate 1 more byte for string.
4856 2002-06-04 Tom Tromey <tromey@redhat.com>
4858 * jcf-write.c (perform_relocations): Optmize a goto to a goto.
4860 2002-06-04 Michael Koch <konqueror@gmx.de>
4862 * gcj.texi (Input Options): Fixed typo.
4864 2002-06-04 Zack Weinberg <zack@codesourcery.com>
4866 * java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
4867 typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
4868 all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
4869 and all now-pointless local variables. Rename other local
4870 variables to reflect their not being handles.
4872 * java-tree.h, jcf-dump.c, jcf-io.c: Remove all
4873 #if JCF_USE_STDIO blocks.
4875 * parse.y: Add missing semicolon at end of rule.
4877 2002-06-03 Geoffrey Keating <geoffk@redhat.com>
4879 * check-init.c (attach_initialized_static_class): Delete, unused.
4880 * parse.y: Use htab_t instead of struct hashtable, update
4882 * java-tree.h: Include hashtab.h instead of hash.h.
4883 (struct lang_decl_func): Use htab_t, set up for gengtype.
4884 (struct init_test_hash_entry): Delete.
4885 (struct treetreehash_entry): New.
4886 (java_treetreehash_find): New
4887 (java_treetreehash_new): New prototype.
4888 (java_treetreehash_create): New prototype.
4889 (java_mark_tree): Delete prototype.
4890 (java_hash_hash_tree_node): Delete prototype.
4891 (java_hash_compare_tree_node): Delete prototype.
4892 (attach_initialized_static_class): Delete prototype.
4893 * expr.c (build_class_init): Update to use java_treetreehash
4895 (java_expand_expr): Update to use htab_t.
4896 (emit_init_test_initialization): Likewise.
4897 * decl.c (java_mark_tree): Delete.
4898 * class.c (init_test_hash_newfunc): Delete.
4899 (java_hash_hash_tree_node): Delete.
4900 (java_hash_compare_tree_node): Delete.
4901 (add_method_1): Update to use java_treetreehash functions.
4902 (JAVA_TREEHASHHASH_H): New macro.
4903 (java_treetreehash_hash): New function.
4904 (java_treetreehash_compare): New function.
4905 (java_treetreehash_find): New function.
4906 (java_treetreehash_new): New function.
4907 (java_treetreehash_create): New function.
4908 * Make-lang.in (JAVA_TREE_H): Replace hash.h by HASHTAB_H.
4910 * Make-lang.in (java/parse.o): Depend on debug.h.
4911 * java-tree.h (struct lang_identifier): Use gengtype.
4912 (union lang_tree_node): New.
4913 (struct lang_decl_func): Use gengtype.
4914 (struct lang_decl_var): Likewise.
4915 (struct lang_decl): Likewise.
4916 * parse.y: Include debug.h.
4917 * lang.c (LANG_HOOKS_MARK_TREE): Delete.
4919 * lang.c (struct language_function): New dummy structure.
4921 * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Set
4922 descriminator for DECL_LANG_SPECIFIC.
4923 (struct lang_decl_func): Rename from struct lang_decl.
4924 (enum lang_decl_desc): New.
4925 (struct lang_decl): Make it a union. Update all the accessor macros.
4926 (struct lang_type): Use gengtype.
4927 * class.c (add_method_1): Set descriminator for DECL_LANG_SPECIFIC.
4928 * decl.c (java_dup_lang_specific_decl): All lang_decl structures
4929 are now the same size.
4930 (lang_mark_tree): Use gengtype to mark TYPE_LANG_SPECIFIC;
4931 use discriminator to mark DECL_LANG_SPECIFIC.
4933 * Make-lang.in (gt-java-builtins.h): New rule.
4934 (java/builtins.o): Add dependency on gt-<filename>.h.
4935 * builtins.c: Use gengtype for roots.
4936 (union string_or_tree): Use gengtype.
4937 (struct builtin_record): Use gengtype.
4938 * config-lang.in (gtfiles): Add builtins.c.
4940 * Make-lang.in (gt-java-class.h, gt-java-constants.h,
4941 gt-java-decl.h, gt-java-expr.h, gt-java-jcf-parse.h,
4942 gt-java-jcf-write.h, gt-java-lang.h, gt-java-mangle.h,
4943 gt-java-parse.h, gtype-java.h): Add rules to generate.
4944 (parse.o): Add dependency on gt-java-parse.h, gt-java.h.
4945 (class.o): Add dependency on gt-*.h.
4946 (constants.o): Likewise.
4949 (jcf-parse.o): Likewise.
4950 (jcf-write.o): Likewise.
4952 * config-lang.in (gtfiles): New.
4953 * class.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
4954 * constants.c: Replace uses of ggc_add_* with GTY markers.
4956 * decl.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
4957 * expr.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
4958 * java-tree.h: Replace uses of ggc_add_* with GTY markers.
4959 * jcf-parse.c: Replace uses of ggc_add_* with GTY markers.
4961 * jcf-write.c: Replace uses of ggc_add_* with GTY markers.
4963 * lang.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
4964 * mangle.c: Replace uses of ggc_add_* with GTY markers. Include
4966 * parse.y: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
4967 Include gtype-java.h.
4969 2002-06-02 Tom Tromey <tromey@redhat.com>
4971 Fix for PR java/5913:
4972 * parse.y (patch_binop): Call patch_string on op1.
4974 2002-06-02 Tom Tromey <tromey@redhat.com>
4976 Fix for PR java/1343, PR java/6336:
4977 * parse.y (make_nested_class_name): Remove extraneous `else'; fix
4978 formatting. Changed return type.
4979 (anonymous_class_counter): Moved to top of file.
4980 (maybe_make_nested_class_name): Append number to class name for
4981 function-local classes.
4983 2002-05-28 Zack Weinberg <zack@codesourcery.com>
4985 * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h.
4986 * Make-lang.in: Update dependency lists.
4988 2002-05-18 Mark Mitchell <mark@codesourcery.com>
4990 * gjavah.c (throwable_p): Do not free the name of the class after
4991 passing it to find_class.
4992 * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition.
4993 * jcf-io.c (dirent.h): Include it.
4994 (fnmatch.h): Likewise.
4995 (compare_path): New function.
4996 (java_or_class_file): Likewise.
4997 (memoized_dirlist_entry): New type.
4998 (memoized_dirlist_lookup_eq): New function.
4999 (memoized_dirlists): New variable.
5000 (caching_stat): New function.
5001 (memoized_class_lookup_eq): New function.
5002 (memoized_class_lookups): Likewise.
5003 (find_class): Use memoized_class_lookups and caching_stat.
5004 * jcf.h (JCF_USE_SCANDIR): Define.
5005 * parse.y (java_expand_classes): Write the class files in reverse
5008 2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
5010 * Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
5012 2002-05-13 Mark Mitchell <mark@codesourcery.com>
5014 * jcf-write.c (write_classfile): Unlink the temporary file if it
5015 cannot be renamed. Use concat to build up the name of the
5018 2002-05-08 Mark Mitchell <mark@codesourcery.com>
5020 * jcf-write.c (write_classfile): Write the file to a
5021 temporary file and then rename it.
5023 2002-05-07 Tom Tromey <tromey@redhat.com>
5025 * gjavah.c (throwable_p): Use xstrdup, not strdup.
5027 Fix for PR java/1200:
5028 * gjavah.c (throwable_p): New function.
5029 (decode_signature_piece): Use it. A `WeakReference' isn't the
5032 (gcjh_streq): New function.
5034 2002-05-07 Andreas Jaeger <aj@suse.de>
5036 * parse.y (finish_for_loop): Fix if statement.
5038 2002-05-06 Tom Tromey <tromey@redhat.com>
5040 Fix for PR java/5941:
5041 * parse.y (finish_for_loop): Set SUPPRESS_UNREACHABLE_ERROR for
5042 loop update expression.
5043 (java_complete_lhs): Use SUPPRESS_UNREACHABLE_ERROR.
5044 * java-tree.h (SUPPRESS_UNREACHABLE_ERROR): New macro.
5046 2002-05-04 Mark Wielaard <mark@klomp.org>
5049 * parse.y (build_string_concatenation): Return just op1 only when op2
5050 is null and op1 is a STRING_CST, otherwise always construct a
5053 2002-04-27 Tom Tromey <tromey@redhat.com>
5056 * parse.y (string_convert_int_cst): New function.
5057 (merge_string_cste): Use it.
5059 2002-04-25 Neil Booth <neil@daikokuya.demon.co.uk>
5061 * java-tree.h (java_parse_file): Update.
5062 (java_set_yydebug): Remove.
5063 * jcf-parse.c (yydebug): Remove.
5064 (java_set_yydebug): Die.
5065 (java_parse_file): Update.
5066 * lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
5068 2002-04-24 Tom Tromey <tromey@redhat.com>
5071 * parse.y (qualify_ambiguous_name) [case CALL_EXPR]: Always choose
5072 EXPR_WFL_QUALIFICATION of qual_wfl.
5074 2002-04-23 Per Bothner <per@bothner.com>
5076 * expr.c (PRE_JSR): Call NOTE_LABEL for return address.
5077 * java-tree.h (BCODE_RETURN_TARGET): Removed - never set.
5078 (BCODE_TARGET): Remove BCODE_RETURN_TARGET.
5080 2002-04-23 Tom Tromey <tromey@redhat.com>
5083 * jvspec.c (lang_specific_driver): Use --resource, not -R. Also
5084 recognize `-fcompile-resource='.
5085 * gcj.texi (Invoking gcj): Use --resource, not -R. Expanded text
5088 2002-04-22 Alexandre Petit-Bianco <apbianco@redhat.com>
5090 * jcf-parse.c: (yyparse): Don't prepend "./" to relative
5091 paths. Fixes PR java/2791.
5093 2002-04-19 Andrew Haley <aph@redhat.com>
5095 * jcf-write.c (push_long_const): lo, hi: New variables.
5096 Use rshift_double to extract the high part of a 64-bit long.
5097 Use WORD_TO_INT to extract the low part.
5099 * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
5100 HOST_WIDE_INT for num. Use JPOOL_UINT to get it.
5101 CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
5103 2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
5105 * typeck.c (incomplete_type_error): Remove.
5107 2002-04-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5109 * class.c (make_class_data): Set DECL_ALIGN on static class data,
5110 for hash synchronization.
5111 * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects.
5112 * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for
5115 2002-04-16 Mark Wielaard <mark@klomp.org>
5117 * jcf-write.c (generate_bytecode_insns): Only write const_0 if not
5120 2002-04-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5122 Fix for PR java/6294:
5123 * parse.h (INNER_INTERFACE_MODIFIERS): Allow ACC_PRIVATE for inner
5126 2002-04-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5128 Fix for PR java/6085:
5129 * parse.y (patch_method_invocation): Always use build_access_to_thisn
5130 to get enclosing "this" argument for inner-class constructor
5131 invocation. Pass correct arguments to build_access_to_thisn.
5133 2002-04-10 Andreas Jaeger <aj@suse.de>
5135 * gcj.texi (Input Options): Fix extdirs patch.
5137 2002-04-10 Anthony Green <green@redhat.com>
5139 * jcf-path.c (jcf_path_init) : Clean up local extdirs declaration.
5141 2002-04-09 Anthony Green <green@redhat.com>
5143 * gcj.texi (Input Options): Add --extdirs documentation.
5144 * jcf-dump.c (OPT_extdirs): New macro.
5145 (options): Add extdirs option.
5146 (help): Describe --extdirs.
5147 (main): Handle OPT_extdirs.
5148 * gjavah.c (OPT_extdirs): New macro.
5149 (options): Add extdirs option.
5150 (help): Describe --extdirs.
5151 (main): Handle OPT_extdirs.
5152 * jcf-path.c (jcf_path_init): Add extdirs support.
5153 (jcf_path_extdirs_arg): New function.
5154 (extensions): New variable to hold extensions path entries.
5155 * jvspec.c: Remove -fextdirs= when compiling main().
5156 * lang.c (java_decode_option): Handle -fextdirs=.
5157 * jcf.h (jcf_path_extdirs_arg): Declare new function.
5158 * Make-lang.in: Compile jcf-path with version info for use in
5159 identifying the appropriate libgcj.jar.
5161 2002-04-08 Tom Tromey <tromey@redhat.com>
5164 * .cvsignore: Added rmic.1 and rmiregistry.1.
5165 * gcj.texi (Top): Link to new nodes.
5166 (Invoking rmic): New node.
5167 (Invoking rmiregistry): Likewise.
5168 * Make-lang.in (java.generated-manpages): Added rmic.1 and
5170 (java.maintainer-clean): Likewise.
5171 ($(srcdir)/java/rmic.1): New target.
5172 ($(srcdir)/java/rmiregistry.1): Likewise.
5173 (java.install-man): Handle rmic.1 and rmiregistry.1.
5175 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5177 * gcj.texi (Invocation): Update JvAttachCurrentThread documentation.
5178 Add note about handling uncaught exceptions. Add an exception handler
5181 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5183 * parse.y (resolve_qualified_expression_name): Clear "from_super" flag
5184 after using it to patch CALL_EXPR.
5186 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5188 * gcj.texi (Invocation): Document CNI invocation API.
5190 2002-04-04 Neil Booth <neil@daikokuya.demon.co.uk>
5192 * expr.c (truthvalue_conversion): Rename. Update.
5193 (expand_compare): Update.
5194 * java-tree.h (java_truthvalue_conversion): New.
5195 * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
5197 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
5199 * java-tree.h (java_mark_addressable): New.
5200 * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
5201 * typeck.c (mark_addressable): Rename, update.
5203 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
5205 * expr.c (build_java_binop): Update.
5206 * java-tree.h (java_signed_type, java_unsigned_type,
5207 java_signed_or_unsigned_type): Update.
5208 * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
5209 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
5210 * parse.y (patch_binop): Update.
5211 * typeck.c (signed_or_unsigned_type, unsigned_type,
5212 signed_type): Update.
5214 2002-03-31 Neil Booth <neil@daikokuya.demon.co.uk>
5216 * lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
5217 (java_dummy_print): Remove.
5218 (lang_print_error): Rename. Exit early if inhibiting output.
5219 (inhibit_error_printing_function): New.
5220 (java_init): Don't set hook.
5221 (lang_init_source): Use new boolean.
5223 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
5225 * parse.y (do_resolve_class): Fix infinite recursion.
5227 2002-03-29 Tom Tromey <tromey@redhat.com>
5229 * parse.y (check_inner_circular_reference): Ignore incomplete
5232 2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
5234 * Make-lang.in (builtins.o): Update.
5235 * boehm.c (get_boehm_type_descriptor): Update.
5236 * builtins.c: Include langhooks.h.
5237 * decl.c (java_init_decl_processing): Update.
5238 * java-tree.h (java_type_for_mode, java_type_for_size): New.
5239 * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
5241 * typeck.c (type_for_mode, type_for_size): Update.
5243 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
5245 * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
5247 2002-03-28 Tom Tromey <tromey@redhat.com>
5249 * except.c (expand_end_java_handler): If the handler type is NULL,
5250 use java.lang.Throwable. Fixes PR java/5986.
5252 2002-03-28 Alexandre Petit-Bianco <apbianco@redhat.com>
5254 Fix for PR java/4715:
5255 * jcf-parse.c (parse_source_file_3): New function.
5256 (read_class): Call it.
5257 (java_parse_file): Likewise.
5259 2002-03-28 Jan Hubicka <jh@suse.cz>
5261 * java/lang.c (java_init_options): Set flag_trapping_math to 0.
5263 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5265 * parse.y (resolve_package): Initialize "decl".
5266 (lookup_package_type): Remove unused function.
5268 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5270 Fix for PR java/5993:
5271 * parse.y (resolve_package): Return the decl if resolution was
5272 successful. Don't special case "java.lang" and "java.lang.reflect"
5273 packages. Set type_name to the merged identifier.
5274 (resolved_qualified_expression_name): Print error using "name" if
5275 resolve_package returns NULL_TREE.
5277 2002-03-27 Tom Tromey <tromey@redhat.com>
5279 * expr.c (expand_invoke): Don't generate null pointer check if
5280 we're calling <init>.
5282 2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
5284 * expr.c (java_lang_expand_expr): Rename java_expand_expr,
5286 * java-tree.h (java_lang_expand_expr): Similarly.
5287 * lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
5288 (java_init): Don't set hook.
5290 2002-03-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5292 Fix for PR java/5850:
5293 * parse.y (lookup_field_wrapper): Call itself recursively for enclosing
5294 context if field was not found in the current scope.
5295 * expr.c (lookup_field): Don't look in enclosing contexts.
5297 2002-03-26 Tom Tromey <tromey@redhat.com>
5299 Fix for PR java/5942:
5300 * parse.y (init_src_parse): Added sanity check.
5301 * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
5304 2002-03-26 Neil Booth <neil@daikokuya.demon.co.uk>
5306 * decl.c (lang_mark_tree): Rename java_mark_tree.
5307 * java-tree.h (java_mark_tree): New.
5308 * java-lang.c (LANG_HOOKS_MARK_TREE): Redefine.
5310 2002-03-25 Zack Weinberg <zack@codesourcery.com>
5312 * lex.c: Change java_perform_atof to take normal parameters
5313 instead of a pointer to a parameter block. Call it directly
5316 2002-03-22 Mark Wielaard <mark@klomp.org>
5318 Fix for PR java/5368:
5319 * parse.y (resolve_qualified_expression_name): Use decl not field_decl
5320 when printing error message.
5322 2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
5324 * decl.c (maybe_build_cleanup): Remove.
5326 2002-03-22 Tom Tromey <tromey@redhat.com>
5328 Andrew Haley <aph@cambridge.redhat.com>
5330 * expr.c (build_field_ref): Don't build a check if the field is a
5333 2002-03-21 Eric Blake <ebb9@email.byu.edu>
5335 Fix for PR java/6026:
5336 * lex.c (java_lex): Fix parsing of consecutive floats.
5338 2002-03-21 Tom Tromey <tromey@redhat.com>
5340 * parse.y (build_access_to_thisn): Stop when FROM is not an inner
5343 2002-03-21 Neil Booth <neil@daikokuya.demon.co.uk>
5345 * cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
5346 insert_block, getdecls, kept_level_p, global_bindings_p): New.
5348 2002-03-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
5350 * gcj.texi: @code{gcj} becomes @command{gcj}.
5351 @code{gcc} becomes @command{gcc}.
5352 GcjRaw changed to gnu.gcc.RawData.
5354 2002-03-20 Neil Booth <neil@daikokuya.demon.co.uk>
5356 * decl.c (start_java_method): Use new hook.
5357 * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
5358 (java_init): Remove old hook.
5360 2002-03-18 Alexandre Petit-Bianco <apbianco@redhat.com>
5362 * builtins.c (define_builtin): Do nothing if `type' is null.
5365 2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5367 * parse.y (parser_check_super_interface): Fix error message
5370 2002-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5372 * jcf-parse.c (get_constant): Delete unused variables.
5374 2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
5376 * java-tree.h (java_parse_file): New.
5377 * jcf-parse.c (yyparse): Rename java_parse_file.
5378 * lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
5380 2002-03-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5382 * parse.y (craft_constructor): Return the constructor decl.
5383 (java_expand_classes): Update comments.
5384 (lookup_method_invoke): Call fix_constructors immediately for
5385 anonymous class. Fixes PR java/5935.
5387 2002-03-15 Anthony Green <green@redhat.com>
5389 * jcf-parse.c (yyparse): Don't emit class registration
5390 constructor when compiling resource files.
5392 2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5394 * lang.c (java_tree_code_type, java_tree_code_length,
5395 tree_code_name): Delete.
5396 (tree_code_type, tree_code_length, tree_code_name): Define.
5397 (java_init): Don't try to copy into the various tree_code
5400 2002-03-12 Tom Tromey <tromey@redhat.com>
5402 * jcf-parse.c (get_constant) [CONSTANT_String]: String values are
5403 UTF-8, not UCS-2. Fixes PR java/5923.
5405 * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is
5406 a call_expr wrapped in a convert. Fixes PR java/5848.
5408 2002-03-12 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5410 * jcf-write.c (write_classfile): Improve error strings.
5412 2002-03-11 Eric Blake <ebb9@email.byu.edu>
5414 * lex.c: Adjust comments to GNU standards.
5416 2002-03-11 Eric Blake <ebb9@email.byu.edu>
5418 Fix for PR java/5902:
5419 * lex.c (java_lex): Fix parsing of literals.
5421 2002-03-11 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5423 * parse.y (patch_assignment): Wrap the right-hand-side with a save_expr
5424 to prevent it getting evaluated twice in the store checking case.
5425 * expr.c (build_java_arraystore_check): Unwrap SAVE_EXPR's when
5428 2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5430 * decl.c (java_init_decl_processing): Make sure class_type_node
5431 alignment is not less than 64 bits if hash synchronization is enabled.
5433 2002-03-08 Per Bothner <per@bothner.com>
5435 * parse.y (java_complete_lhs): Check if patch_assignment
5436 returned an error-mark.
5438 * parse.y (try_builtin_assignconv): Don't special-case zero.
5440 2002-03-08 Per Bothner <per@bothner.com>
5442 Fix for PR java/5812.
5443 * expr.c (build_java_jsr): Take pc arguments, and do lookup_label
5444 here instead of in JSR macro. Likewise with load_type_state call.
5445 Do the latter on if the return_pc has been verified (the jsr returns).
5446 (JSR): Now just call build_java_jsr.
5448 2002-03-07 Jeff Sturm <jsturm@one-point.com>
5450 * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define.
5451 (java.install-common): Link native driver to
5452 JAVA_TARGET_INSTALL_NAME.
5454 2002-03-05 David Billinghurst <David.Billinghurst@riotinto.com>
5456 * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED
5457 * builtins.c(sin_builtin): Likewise
5458 * builtins.c(sqrt_builtin): Likewise
5460 2002-03-03 Zack Weinberg <zack@codesourcery.com>
5462 * java/expr.c, java/jcf-parse.c, java/lex.c:
5463 Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
5464 REAL_ARITHMETIC blocks unconditional. Delete some further
5465 #ifdef blocks predicated on REAL_ARITHMETIC.
5467 2002-03-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5469 * class.c (init_class_processing): Use ARRAY_SIZE in lieu of
5470 explicit sizeof/sizeof.
5471 * decl.c (java_init_decl_processing): Likewise.
5472 * jcf-parse.c (init_jcf_parse): Likewise.
5473 * parse.y (init_src_parse): Likewise.
5475 2002-03-02 Per Bothner <per@bothner.com>
5477 Make --CLASSPATH by a synonym for --classpath and -classpath.
5478 Implement --bootclasspath.
5479 * jcf-path.c (classpath_u): Rename static variable to classpath_user.
5480 (classpath_l): Remove.
5481 (jcf_path_CLASSPATH_arg): Remove.
5482 (jcf_path_bootclasspath_arg): New function.
5483 (jcf_path_seal): Simplify accordingly.
5485 * jcf.h (jcf_path_bootclasspath_arg): New declarations.
5486 (jcf_path_CLASSPATH): Remove declaration.
5487 * jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*.
5488 (lang_specific_driver): Translate -bootclasspath.
5489 * lang-options.h: Add --bootclasspath. Update --CLASSPATH.
5490 * lang.c (decode_lang_options): Do jcf_path_init first.
5491 Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath.
5492 * gjavah.c: Also handle --bootclasspath.
5493 Handle --CLASSPATH as a synonum for --classpath.
5494 * jcf-dump.c: Likewise.
5496 "." is not part of system path, but is the default for --classpath.
5497 * jcf-path.c (jcf_path_init): Don't add "." to sys_dirs.
5498 (jcf_path_seal): Add "." if no CLASSPATH specified.
5500 * gcj.texi: Document changes.
5502 2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5504 * expr.c (build_java_arraystore_check): Fix formatting.
5506 2002-02-28 Alexandre Petit-Bianco <apbianco@redhat.com>
5508 Fix for PR java/5758, java/5632:
5509 * jcf-parse.c (load_class): Renamed local variable, consider `.' an
5510 inner-class separator too.
5511 * parse.y (do_resolve_class): New local `decl_result.'
5512 Progressively build a name for what can have been loaded.
5514 2002-02-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5516 * expr.c (java_array_data_offset): Removed function.
5517 (JAVA_ARRAY_LENGTH_OFFSET): Removed macro.
5518 (build_java_array_length_access): Obtain "length" value using a
5519 COMPONENT_REF, instead of INDIRECT_REF and arithmetic.
5520 (build_java_arrayaccess): Correct comment. Access "data" using a
5521 COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF.
5522 (build_java_arraystore_check): New function.
5523 (expand_java_arraystore): Use build_java_arraystore_check.
5524 * parse.y (patch_assignment): Simplify code to insert a store check
5525 when lvalue is an ARRAY_REF. Use build_java_arraystore_check.
5526 * check-init.c (check_init): Update to reflect that an array length
5527 access is now a COMPONENT_REF.
5528 * gcj.texi (Code Generation): Improve documentation of
5529 -fno-bounds-check. Add documentation for -fno-store-check.
5530 * java-tree.h (flag_store_check): Declare.
5531 (build_java_arraystore_check): Declare.
5532 * lang.c (flag_store_check): Initialize to 1.
5533 (lang_f_options): Add store-check option.
5534 * jvspec.c: Don't pass store-check option to jvgenmain.
5535 * lang-options.h: Add help string for -fno-store-check.
5537 2002-02-28 Neil Booth <neil@daikokuya.demon.co.uk>
5539 * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
5540 * java-tree.h (java_dup_lang_specific_decl): New.
5541 * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
5543 2002-02-27 Zack Weinberg <zack@codesourcery.com>
5545 * builtins.c, decl.c: Delete traditional-mode-related code
5546 copied from the C front end but not used, or used only to
5547 permit the compiler to link.
5549 2002-02-22 Tom Tromey <tromey@redhat.com>
5551 Fix for PR java/2369:
5552 * jvspec.c (verify_class_name): New function.
5553 (lang_specific_driver): Call it.
5554 (JAVA_START_CHAR_P): New macro.
5555 (JAVA_PART_CHAR_P): Likewise.
5557 2002-02-22 Per Bothner <per@bothner.com>
5559 * class.c: Change vtable to be more compatible with g++ v3 abi.
5560 (get_dispatch_table): Prepend offset-to-top (always 0) and
5561 type_info pointer (currently unimplemented hence NULL) to vtable.
5562 Specifically, prepend offset-to-top and typeinfo ptr (currently null).
5563 (make_class_data): Variable dtable_start_offset is sizeof 2 pointers.
5564 Adjust vtable pointers by dtable_start_offse - i.e. skip new words.
5565 (build_dtable_decl): Add declarations for new fields.
5567 2002-02-20 Per Bothner <per@bothner.com>
5569 * parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
5570 to finit$ (otherwise generate_bytecode_insns drops it). However, we
5571 don't need to set it on the COMPOUND_EXPR - the caller does that.
5573 2002-02-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
5575 * gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option
5576 `--CLASSPATH' becomes `--classpath.'
5577 * gjavah.c: Likewise.
5578 * jcf-dump.c: Likewise.
5579 * lang-options.h: Likewise.
5581 * jcf-path.c: Updated comment.
5582 (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.'
5583 (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.'
5584 * jcf.h (jcf_path_CLASSPATH_arg): Ditto.
5585 (jcf_path_CLASSPATH_arg): Ditto.
5586 (classpath_u): Updated leading comment.
5588 2002-02-20 Per Bothner <per@bothner.com>
5590 * builtins.c (check_for_builtin): New function.
5591 (build_call_or_builtin): Remove.
5592 * java-tree.h: Update accordingly.
5593 * expr.c (expand_invoke): Use build + check_for_builtin instead
5594 of build_call_or_builtin.
5595 * parse.y (patch_invoke): Likewise. This avoids needlessly creating
5596 a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER
5597 flag (which had caused jcf-write to incorrectly emit invokevirtual).
5599 2002-02-17 Tom Tromey <tromey@redhat.com>
5601 * java-tree.h (TYPE_STRICTFP): New macro.
5602 (struct lang_type) [strictfp]: New field.
5603 (CLASS_STRICTFP): New macro.
5604 (METHOD_STRICTFP): New macro.
5605 (struct lang_decl) [strictfp]: New field.
5606 * parse.y (method_header): Disallow strictfp constructor or
5608 (STRICT_TK): Move before MODIFIER_TK.
5609 * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
5610 (METHOD_MODIFIERS): Likewise.
5611 (INTERFACE_MODIFIERS): Likewise.
5612 * jcf-write.c (get_access_flags): Likewise.
5613 * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
5614 (add_method_1): Likewise.
5615 (get_access_flags_from_decl): Likewise.
5616 * jcf-dump.c (print_access_flags): Print in standard order. Also,
5617 recognize strictfp flag.
5618 * jcf.h (ACC_STRICT): New define.
5620 2002-02-12 David Billinghurst <Davod.Billinghurst@riotinto.com>
5622 * class.c(build_utf8_ref): Move declaration of decl_size
5624 2002-02-07 Tom Tromey <tromey@redhat.com>
5626 * gcj.texi (Input Options): --CLASSPATH does not suppress system
5629 2002-02-04 Anthony Green <green@redhat.com>
5631 * class.c (build_utf8_ref): Put UTF-8 constants into merged
5632 sections if available.
5634 2002-02-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5636 * parse.y (java_expand_classes): Fix typo in static field loop.
5638 2002-02-02 Richard Henderson <rth@redhat.com>
5640 * class.c (add_field): Mark static fields external.
5641 (build_class_ref): Remove redundant set.
5642 * parse.y (java_expand_classes): Mark static fields of classes
5643 to be compiled as local.
5644 * jcf-parse.c (parse_class_file): Likewise.
5646 2002-02-02 Nic Ferrier <nferrier@tapsellferrier.co.uk>
5648 * gcj.texi (About CNI): New node.
5650 2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
5653 * jcf-parse.c : Check for HAVE_LOCALE_H before using
5654 setlocale() with LC_CTYPE as a parameter.
5657 2002-01-31 Joseph S. Myers <jsm28@cam.ac.uk>
5659 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
5660 Follow GNU Coding Standards for --version.
5662 2002-01-28 Tom Tromey <tromey@redhat.com>
5664 * expr.c (build_jni_stub): Ensure storage for `meth' is
5666 * parse.y (java_complete_expand_methods): Set
5667 current_function_decl before building JNI stub.
5669 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
5671 * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not
5674 2002-01-22 Tom Tromey <tromey@redhat.com>
5676 * decl.c (java_init_decl_processing): Use add_predefined_file.
5677 Predefine RawData.java.
5678 (predef_filenames): Removed.
5679 (java_init_decl_processing): Don't register predef_filenames.
5680 * jcf-parse.c (add_predefined_file): New function.
5681 (predefined_filename_p): Rewrote.
5682 (predefined_filename_p): No longer static.
5683 * decl.c (java_init_decl_processing): Call initialize_builtins.
5684 * Make-lang.in (JAVA_OBJS): Added builtins.o.
5685 (java/builtins.o): New target.
5686 * builtins.c: New file.
5687 * parse.y (patch_invoke): Use build_call_or_builtin.
5688 * java-tree.h (build_call_or_builtin): Declare.
5689 (initialize_builtins): Declare.
5690 (java_set_exception_lang_code): Removed unused declaration.
5691 (PREDEF_FILENAMES_SIZE): Removed.
5692 (java_tree_index): Added JTI_PREDEF_FILENAMES.
5693 (predef_filenames): New define.
5694 (add_predefined_file): Declare.
5695 (predefined_filename_p): Declare.
5696 * expr.c (expand_invoke): Use build_call_or_builtin.
5698 2002-01-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5700 * parse.y (patch_switch_statement): Fix format specifier.
5702 2002-01-16 Tom Tromey <tromey@redhat.com>
5704 More for PR java/5365:
5705 * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
5707 (process_file): Generate include for
5708 java.lang.UnsupportedOperationExceptions.
5710 2002-01-15 Andreas Jaeger <aj@suse.de>
5712 * .cvsignore: Add man pages.
5714 2002-01-15 Tom Tromey <tromey@redhat.com>
5716 Fix for PR java/5365:
5717 * gjavah.c (process_file): Turn class name into a file name.
5719 2002-01-14 Matthias Klose <doko@debian.org>
5721 * gcj.texi: Fix whitespace and formatting errors in the
5722 synopsis of the man pages. Update copyright.
5724 2002-01-14 Tom Tromey <tromey@redhat.com>
5727 * Make-lang.in (java.install-man): Handle jv-convert man page.
5728 (java.generated-manpages): Added jv-convert.1.
5729 (java.uninstall): Remove jv-convert.1.
5730 (java.maintainer-clean): Likewise.
5731 ($(srcdir)/java/jv-convert.1): New target.
5732 * gcj.texi (Top): Link to jv-convert node.
5733 (Individual utilities): Likewise.
5734 (Invoking jv-convert): New node.
5736 2001-01-10 Jeff Sturm <jsturm@one-point.com>
5737 Martin Kahlert <martin.kahlert@infineon.com>
5739 * jcf-parse.c (get_constant): Don't swap lo/hi for big
5740 endian targets when HOST_BITS_PER_WIDE_INT >= 64.
5742 2002-01-03 Graham Stott <grahams@redhat.com>
5744 * class.c (compile_resource_file): Update copyright date.
5745 Constify filename parameter.
5746 (java-tree.h): Update copyright date.
5747 (compile_resource_file): Constify filename parameter.
5749 2002-01-03 Graham Stott <grahams@redhat.com>
5751 * gcc/jcf-parse.c: Update copyright date.
5752 (yyparse): Constify resource_filename.
5754 2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5756 * parse.y (src_parse_roots): Don't needlessly zero init.
5758 2001-12-31 Tom Tromey <tromey@redhat.com>
5760 * parse.y (dump_java_tree): New function.
5761 (source_end_java_method): Call it.
5762 (end_class_declaration): Likewise.
5763 * lang.c (java_decode_option): Call dump_switch_p.
5765 2001-12-28 Tom Tromey <tromey@redhat.com>
5767 * gen-table.pl: Don't process characters after \uffff. Added
5768 comment pointing to input file.
5770 2001-12-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5772 * gen-table.pl: Const-ify output. Document the location of a
5773 suitable unicode input file.
5775 * chartables.h: Regenerate.
5777 2001-12-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5779 * chartables.h: Const-ify.
5780 * gjavah.c (options): Likewise.
5781 * jcf-dump.c (options): Likewise.
5782 * jv-scan.c (options): Likewise.
5783 * lex.c (java_start_char_p, java_part_char_p): Likewise.
5784 * parse.y (binop_lookup): Likewise.
5786 2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5788 * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
5789 the static arrays that are output.
5790 * jvspec.c (jvgenmain_spec): Make static.
5791 * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
5792 * keyword.h: Regenerate.
5793 * lang.c (string_option, process_option_with_no, lang_f_options,
5794 lang_W_options): Const-ify.
5795 * lex.c (java_lex): Likewise.
5797 2001-12-21 Richard Henderson <rth@redhat.com>
5799 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
5800 (get_boehm_type_descriptor): ... here. Arrange for the
5801 TREE_TYPE to get set properly.
5803 2001-12-21 Richard Henderson <rth@redhat.com>
5805 * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
5806 only if the target requires collect2.
5808 * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
5810 2001-12-20 Tom Tromey <tromey@redhat.com>
5813 * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
5814 CAN_COMPLETE_NORMALLY for the node.
5815 * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
5816 generate code for second branch if first branch can't complete
5818 (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
5819 the loop head if the loop body can't complete normally.
5821 2001-12-20 Tom Tromey <tromey@redhat.com>
5824 * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
5825 case where `finally' clause can't complete normally.
5827 2001-12-20 Tom Tromey <tromey@redhat.com>
5830 * parse.y (analyze_clinit_body): Added this_class parameter.
5831 Check for more cases where we must keep <clinit>.
5832 (maybe_yank_clinit): Cleaned up flow control.
5834 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5836 * decl.c (java_init_decl_processing): Don't initialize
5837 finit_leg_identifier_node.
5838 * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
5839 (finit_leg_identifier_node): Remove.
5840 (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
5842 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5844 * mangle.c (mangle_member_name): Don't special-case for
5846 * mangle_name.c (unicode_mangling_length): Likewise.
5847 (append_unicode_mangled_name): Likewise.
5848 * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
5851 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5853 * expr.c (build_java_array_length_access): Don't force null pointer
5854 check unless flag_check_references is set.
5856 2001-12-20 Tom Tromey <tromey@redhat.com>
5858 Fix for PR java/3417:
5859 * parse.y (patch_assignment): Added special processing for
5861 (patch_return): Don't convert booleans to integers, and don't
5862 special-case `null'.
5864 2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
5866 * config-lang.in (diff_excludes): Remove.
5868 2001-12-17 Joseph S. Myers <jsm28@cam.ac.uk>
5870 * gcj.texi: Update link to GCC manual.
5872 2001-12-17 Tom Tromey <tromey@redhat.com>
5874 * parse.y (link_nested_class_to_enclosing): Removed useless
5877 2001-12-16 Tom Tromey <tromey@redhat.com>
5879 * mangle.c (mangle_method_decl): Never emit `C2' constructor.
5882 2001-12-16 Joseph S. Myers <jsm28@cam.ac.uk>
5884 * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
5885 jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
5888 2001-12-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5890 * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
5892 2001-12-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5894 * decl.c (java_init_decl_processing): Build otable_type correctly.
5895 otable_decl is an otable_type.
5897 2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
5899 * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
5900 otable_type, otable_ptr_type, method_symbol_type,
5901 method_symbols_array_type, method_symbols_array_ptr_type): New
5902 field/global tree definitions.
5903 (flag_indirect_dispatch): New flag.
5904 * decl.c (java_init_decl_processing): Initialize new otable and
5905 otable_syms type nodes and decls. Add new field "index" to
5907 * class.c (build_method_symbols_entry): New function.
5908 (make_method_value): Set "index" to to method's vtable index for
5909 virtual methods when indirect-dispatch is not used.
5910 (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
5911 and set vtable_method_count to -1. Set otable and otable_syms field
5912 if indirect-dispatch is used and there was something to put in them.
5913 (build_method_symbols_entry): New function.
5914 (emit_offset_symbol_table): New function.
5915 * expr.c (get_offset_table_index): New function.
5916 (build_invokevirtual): Build array reference to otable at the index
5917 returned by get_offset_table_index, and use the result as the vtable
5919 (build_invokeinterface): Similar.
5920 * jcf-parse.c (yyparse): If indirect-dispatch, call
5921 emit_offset_symbol_table at the end of compilation, after all classes
5922 have been generated.
5923 * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
5924 * lang.c (flag_indirect_dispatch): Define.
5925 (lang_f_options): Add indirect-dispatch flag.
5927 2001-12-14 Matthias Klose <doko@debian.org>
5929 * gcj.texi: Markup for man page generation. Document missing
5930 options printed by <tool> --help.
5931 Terminate description of gij's -ms option with a dot.
5932 * Make-lang.in ($(srcdir)/java/*.1): New targets.
5933 (java.generated-manpages java.install-man, java.uninstall,
5934 java-maintainer-clean) Updated.
5936 2001-12-14 Hans Boehm <Hans_Boehm@hp.com>
5938 * class.c (get_dispatch_table): Fix java vtable layout
5939 for TARGET_VTABLE_USES_DESCRIPTORS.
5940 * decl.c (java_init_decl_processing): Initialize
5941 alloc_no_finalizer_node, finalize_identifier_node.
5942 * expr.c (class_has_finalize_method): New function.
5943 (expand_java_NEW): Generate calls for finalizer-free allocation.
5944 (build_invokevirtual): Fix java vtable layout for
5945 TARGET_VTABLE_USES_DESCRIPTORS.
5946 * java-tree.h (enum java_tree_index): New entries:
5947 JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
5948 (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
5949 (class_has_finalize_method): declare.
5950 (HAS_FINALIZER_P): New macro.
5951 * parse.y (patch_invoke): Generate calls for finalizer-free
5954 2001-12-12 Matthias Klose <doko@debian.org>
5956 * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
5957 whitespace at end of line.
5959 2001-12-11 Tom Tromey <tromey@redhat.com>
5961 * lex.c (java_init_lex): Define wfl_to_string as
5962 gnu.gcj.runtime.StringBuffer unless generating bytecode.
5964 2001-12-11 Jeff Sturm <jsturm@one-point.com>
5966 * class.c (make_method_value): Use null_pointer_node to
5967 represent empty exception table.
5969 2001-12-10 Tom Tromey <tromey@redhat.com>
5971 * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
5973 2001-12-10 Douglas B. Rupp <rupp@gnat.com>
5975 * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
5977 2001-12-09 Per Bothner <per@bothner.com>
5979 * check-init.c (current_switch_has_default): New static field.
5980 (check_init): Case DEFAULT_EXPR: Set current_switch_has_default.
5981 Case SWITCH_EXPR: Save/restore current_switch_has_default. If no
5982 DEFAULT_EXPR seen, simulate a default alternative that copies state.
5984 2001-12-09 Tom Tromey <tromey@redhat.com>
5986 * check-init.c (check_init): Don't allow pre- or post- increment
5987 or decrement of final variable.
5988 (final_assign_error): Minor error message rewording.
5990 2001-12-08 Tom Tromey <tromey@redhat.com>
5992 * java-tree.h: Fixed typo.
5994 * gjavah.c (decompile_method): Don't decompile to `return this'
5997 * gjavah.c (cxx_keywords): Re-sorted.
5998 * lex.c (cxx_keywords): Re-sorted.
6000 * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
6003 * gjavah.c (print_namelet): Clear subnamelets.
6004 (HANDLE_METHOD): Set `method_printed' earlier.
6006 2001-12-07 Tom Tromey <tromey@redhat.com>
6008 * lang.c (lang_f_options): Added
6009 optimize-static-class-initialization.
6010 (java_decode_option): Removed special case.
6012 2001-12-07 Per Bothner <per@bothner.com>
6014 * check-init.c (check_init): Fix typo freeing memory twice.
6016 2001-12-05 Per Bothner <per@bothner.com>
6018 Restore support for static class initialization optimization.
6019 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
6020 * check-init.c (check_int): At end of BLOCK handle initialization
6021 blocks, which used to be done in java_complete_expand_method but did
6022 not handle the case where check_for_initialization might allocate
6023 more than a word of bits.
6024 * decl.c (lang_make_tree): The smic field is now a tree.
6025 * expr.c (build_class_init): Set DECL_FUNCTION_INIT_TEST_CLASS field.
6026 * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE): New macro.
6028 * parse.y (emit_test_initialization): Combine hash_lookup calls.
6030 * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
6031 Change from a hash table to a list.
6032 (struct_lang_decl): Change field 'smic' to match.
6033 * class.c (add_method_1): Initialize
6034 DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
6035 * parse.y (adjust_init_test_initialization): Removed - inlined into -
6036 (java_expand_method_bodies): -here, since 'smic' is now a list.
6037 (patch_invoke): Add to 'smic' list, instead of hash_lookup.
6039 * check-init.c (WORD_SIZE): Use BITS_PER_UNIT.
6041 * class.c (java_hash_compare_tree_node): Fix casts.
6043 2001-12-04 Per Bothner <per@bothner.com>
6045 * check-init.c: Handle definite unassignment to finals in addition
6046 to definite assignment.
6047 (loop_current_locals): New field.
6048 (num_current_locals, int start_current_locals, num_current_words):
6050 (SET_P, CLEAR_P, SET_BIT): Add needed but missing parentheses.
6051 (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
6052 CLEAR_ASSIGNED, CLEAR_UNASSIGNED): New macros.
6053 (get_variable_decl, check_final_reassigned): New functions.
6054 (check_init, check_bool_init): Modify as needed for checking finals.
6055 (check_for_initialization): Take extra parameter and return void.
6056 Do extra start-up logic to check final fields for assignment.
6057 * parse.y (check_static_final_variable_assignment_flag,
6058 reset_static_final_variable_assignment_flag, check_final_assignment,
6059 check_final_variable_local_assignment_flag,
6060 reset_final_variable_indirect_assignment_flag,
6061 reset_final_variable_global_assignment_flag): Remove functions.
6062 (java_complete_expand_methods, outer_field_access_fix,
6063 patch_assignment): Remove no-longer used logic.
6064 * java-tree.h (DECL_FIELD_FINAL_IUD): Change usage and comments.
6065 * parse.y (register_fields, java_complete_tree): Update accordingly.
6067 * check-init.c (ALLOC_WORDS/FREE_WORDS): Use xmalloc/free, not alloca.
6068 (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER): New.
6069 (check_cond_init, check_bool2_init): Use DECLARE_BUFFERS.
6071 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Temporarily turn off.
6073 * java-tree.h (DECL FINAL): New bit-field.
6074 (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL): Define as DECL_FINAL.
6075 (LOCAL_FINAL_P): Use DECL_FINAL rather than old LOCAL_FINAL.
6076 (DECL_INIT_CALLS_THIS): New macro.
6077 (struct lang_decl): New bit-field init_calls_this.
6078 (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
6079 DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
6080 (DECL_BIT_INDEX): Change to use pointer_alias_set since we now
6081 use it for both local variables and final fields.
6082 (struct lang_decl_var): Remove bit-fields final_liic, final_ierr,
6084 (struct lang_type): Remove hfv bit-field.
6085 (check_for_initialization): Change to return void.
6087 * java-tree.h (IS_ARRAY_LENGTH_ACCESS): New macros.
6088 * expr.c (build_java_array_length_access): Set IS_ARRAY_LENGTH_ACCESS.
6089 * check-init.c (final_assign_error): New helper function.
6090 (check_final_reassigned, check_init): Use it.
6091 (check_init): Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
6093 * java-tree.h (struct lang_decl, struct lang_decl_var): Change all
6094 bit-fields to unsigned.
6096 2001-12-03 Per Bothner <per@bothner.com>
6098 * parse.y (patch_binop): Minor constant folding.
6100 * parse.y (build_current_thisn): Shorter 'buffer'.
6102 2001-12-03 Per Bothner <per@bothner.com>
6104 * decl.c (complete_start_java_method): Now generate TRY_FINALLY_EXPR
6105 instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
6106 * jcf-write.c (generate_bytecode_insns): Remove support for
6107 CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
6108 * check-init.c (check_init): Likewise.
6110 2001-12-03 Per Bothner <per@bothner.com>
6112 * verify.c (subroutine_nesting): New function.
6113 (verify_jvm_instructions): Use it to fix logic for checking that
6114 we're done with the current subroutine.
6116 * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
6117 OPCODE_instanceof use POP_TYPE macro for better diagnostics.
6119 2001-12-03 Per Bothner <per@bothner.com>
6121 * jcf.h: Fix obvious typo in comment.
6122 * typeck.c (build_null_signature): Add comment.
6124 2001-12-03 Neil Booth <neil@daikokuya.demon.co.uk>
6126 * expr.c: Remove leading capital from diagnostic messages, as
6127 per GNU coding standards.
6128 * jcf-io.c: Similarly.
6129 * jcf-parse.c: Similarly.
6130 * jv-scan.c: Similarly.
6131 * jvspec.c: Similarly.
6132 * mangle.c: Similarly.
6134 2001-12-02 Tang Ching-Hui <nicholas@cs.nthu.edu.tw>
6135 Alexandre Petit-Bianco <apbianco@redhat.com>
6137 * expr.c (build_java_arrayaccess): Call save_expr on array for
6138 correct evaluation order, modified comment, fixed indentation.
6139 * parse.y: (patch_assignment): Correctly extract the array base
6140 from the tree generate by build_java_arrayaccess, added comments.
6141 (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
6142 Fixes PR java/3096, PR java/3803, PR java/3965.
6144 2001-12-01 Neil Booth <neil@daikokuya.demon.co.uk>
6146 * expr.c (expand_byte_code): Remove trailing periods from messages.
6147 * jcf-parse.c (load_class, jcf_parse): Similarly.
6148 * jcf-write.c (generate_classfile): Similarly.
6149 * lex.c (java_lex): Similarly.
6151 2001-11-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
6153 * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
6155 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk>
6157 * Make-lang.in (java.generated-manpages): New dummy target.
6159 2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
6161 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
6163 (lang_specific_pre_link): Use set_input to set input_filename.
6165 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
6166 (main): Fix definition.
6167 Strip `main' from classname.
6170 2001-11-18 Roger Sayle <roger@eyesopen.com>
6172 * parse.h (java_expand_switch): Remove old prototype.
6174 2001-11-18 Tom Tromey <tromey@redhat.com>
6176 Fix for PR java/1401:
6177 * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
6179 (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
6182 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk>
6184 * lang.c (finish_parse): Rename to java_finish.
6185 (LANG_HOOKS_FINISH, java_finish): New.
6187 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk>
6189 * decl.c (init_decl_processing): Rename java_init_decl_processing.
6190 * java-tree.h: New prototype.
6191 * lang.c (java_init): Update prototype. Combine with old init_parse.
6193 2001-11-13 Tom Tromey <tromey@redhat.com>
6195 * gjavah.c (method_signature): New global.
6196 (HANDLE_METHOD): Set it.
6197 (decompile_return_statement): New function.
6198 (decompile_method): Use it.
6199 (print_method_info): Removed `synth' argument.
6201 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
6203 * java-tree.h (java_set_yydebug): New.
6204 * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
6205 * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
6206 (print_lang_decl, print_lang_type, print_lang_identifier,
6207 print_lang_statistics, lang_print_xnode): Remove.
6209 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
6211 * jcf-parse.c (init_lex): Remove.
6212 * lang.c (language_string, lang_identify): Remove.
6213 (struct lang_hooks): Constify.
6214 (LANG_HOOKS_NAME): Override.
6215 (init_parse): Update.
6217 2001-11-08 Andreas Franck <afranck@gmx.de>
6219 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
6220 program_transform_name the way suggested by autoconf.
6221 (java.install-common): Also transform auxiliary program names with
6222 program_transform_name.
6224 2001-11-08 Tom Tromey <tromey@cygnus.com>
6226 * parse.y (trap_overflow_corner_case): New rule.
6227 (unary_expression): Use it.
6228 * lex.c (java_init_lex): Don't set minus_seen.
6229 (yylex): Don't use minus_seen. Communicate overflow to parser for
6231 (error_if_numeric_overflow): New function.
6232 * parse.h (minus_seen): Removed field.
6233 (JAVA_RADIX10_FLAG): New define.
6235 2001-11-07 Tom Tromey <tromey@redhat.com>
6237 Patch for PR java/1414:
6238 * parse.y (case_label_list): New global.
6239 (goal): Register case_label_list with GC.
6240 (java_complete_lhs): Save new case on case_label_list.
6241 (patch_switch_statement): Check for duplicate case labels.
6243 2001-11-07 Alexandre Petit-Bianco <apbianco@redhat.com>
6245 * parse.y (patch_assignment): Removed unused third argument.
6246 (java_complete_lhs): Removed unused third argument to patch_assignment.
6248 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk>
6250 * lang.c: Include langhooks-def.h.
6251 * Make-lang.in: Update.
6253 2001-10-31 Zack Weinberg <zack@codesourcery.com>
6255 * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
6257 2001-10-29 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
6259 * mangle.c (find_compression_record_match): Don't match compression
6260 records for package name elements unless they occur at the start of
6261 the name. Fix for PR java/4717.
6263 2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
6265 * expr.c (expand_java_field_op): Don't special-case references to
6266 java.lang.PRIMTYPE.TYPE.
6267 (build_primtype_type_ref): Removed.
6268 * java-tree.h (build_primtype_type_ref): Remove prototype.
6269 * parse.y (maybe_build_primttype_type_ref): Removed.
6270 (complete_function_arguments): Don't special-case references to
6271 java.lang.PRIMTYPE.TYPE.
6272 (patch_assignment): Likewise.
6273 (array_constructor_check_entry): Likewise.
6275 2001-10-24 Alexandre Petit-Bianco <apbianco@redhat.com>
6277 * mangle.c (static tree compression_table): Fixed leading comment.
6278 * parse.h (struct parser_ctxt): Fixed field comment.
6279 * parse.y (check_pkg_class_access): New prototype, fixed leading
6280 comment, new parameter used to emit error only if passed as true.
6281 (parse_check_super): Pass extra argument to check_pkg_class_access.
6282 (do_resolve_class): Likewise.
6283 (process_imports): Likewise.
6284 (read_import_dir): Fixed indentation.
6285 (find_in_imports_on_demand): New local class_type_name. Local
6286 node_to_use deleted. while loop changed into for loop. Report
6287 multiple definition only for accessible classes. Improved error
6289 (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
6290 assigned to parameter list, fixed indentation. while loop changed
6291 into for loop, restore TREE_CHAIN on local `tem' before the next
6294 2001-10-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6296 * lang.c (lang_get_alias_set): Deleted.
6298 2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6300 * gjavah.c (jni_print_char): Fix thinko in last change.
6302 * gjavah.c (jni_print_char, decode_signature_piece): Use
6303 safe-ctype macros and/or fold extra calls into fewer ones.
6304 * lex.c (java_read_unicode, java_lex): Likewise.
6305 * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
6306 JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
6307 * mangle_name.c (append_unicode_mangled_name,
6308 unicode_mangling_length): Likewise.
6310 2001-10-17 Richard Henderson <rth@redhat.com>
6312 * Make-lang.in (java/lang.o): Depend on langhooks.h.
6314 2001-10-15 Alexandre Petit-Bianco <apbianco@redhat.com>
6316 * lang.c (langhooks.h): Included.
6317 (LANG_HOOKS_INIT): Redefined.
6318 (LANG_HOOKS_INIT_OPTIONS): Likewise.
6319 (LANG_HOOKS_DECODE_OPTION): Likewise.
6320 (struct lang_hooks lang_hooks): New initialization.
6322 2001-10-11 Per Bothner <per@bothner.com>
6324 * parse.y (patch_synchronized_statement): Use a TRY_FINALLY_EXPR
6325 rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
6326 The former is simpler, and jcf-write.c handles it better.
6327 (java_complete_lhs): No longer need to handle CLEANUP_POINT_EXPR
6328 or WITH_CLEANUP_EXPR.
6329 * jcf-write.c: Revert Alex's change from 2000-10-18. It is no
6330 longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
6332 * parse.y (patch_if_else_statement): If the condition is constant,
6333 optimize away the test.
6335 2001-10-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6337 * parse.y (patch_cast): Call patch_string on the first operand of
6338 the incoming node, update it if necessary. Fixes PR java/4510.
6340 2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
6342 * parse.y (find_as_inner_class): Don't disregard the enclosing scope
6343 when name qualifier matches a package name.
6345 2001-10-08 Tom Tromey <tromey@redhat.com>
6347 Fix for PR java/4489:
6348 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
6349 force a new label when computing `body_block'.
6351 2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6353 * jcf-io.c (format_uint): Const-ify.
6354 * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
6355 * lex.c (java_get_line_col): Likewise.
6356 * parse.y (build_incdec): Likewise.
6358 2001-10-05 Alexandre Petit-Bianco <apbianco@redhat.com>
6360 * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
6361 a NULL enclosing context if appropriate. Fixes PR java/4466.
6363 2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
6365 * parse.y (patch_assignment): Use lvalue's original TYPE when
6366 building the final COMPOUND_EXPR.
6367 (try_reference_assignconv): Fixed leading comment.
6369 2001-09-26 Alexandre Petit-Bianco <apbianco@redhat.com>
6371 * parse.y (check_final_variable_indirect_assignment): For
6372 COMPOUND_EXPR, return only if finals were found initialized
6373 properly, if not, keep on checking.
6374 (check_final_variable_global_assignment_flag): New local
6375 error_found, set when appropriate and used to decide whether to
6376 report uninitialized finals. Fixed typo in comment.
6378 2001-09-22 Alexandre Petit-Bianco <apbianco@redhat.com>
6380 * decl.c (init_decl_processing): Fixed typo in predef_filenames
6381 last three initializations. Fixes PR java/4360.
6383 2001-09-21 Richard Henderson <rth@redhat.com>
6385 * class.c (get_dispatch_table): Handle function descriptors.
6386 (build_dtable_decl): Likewise.
6387 * expr.c (build_invokevirtual): Likewise.
6389 2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
6391 * parse.y (patch_method_invocation): Build class initialization
6392 when static finals are used to qualify method invocation.
6395 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
6397 * parse.h: (WFL_STRIP_BRACKET): Re-written using
6398 build_type_name_from_array_name.
6399 (STRING_STRIP_BRACKETS): New macro.
6400 * parse.y (build_type_name_from_array_name): New function.
6401 (array_creation_expression:): Accumulate []s instead of [s.
6402 (cast_expression:): Accumulate []s instead of [s after cast type
6404 (build_array_from_name): Local string deleted, use
6405 build_type_name_from_array_name.
6406 (build_unresolved_array_type): Accumulate []s instead of [s after
6408 (register_fields): Fixed comment.
6409 (resolve_class): Local name, base deleted, new locals tname and
6410 array_dims. Use build_type_name_from_array_name. Use array_dims to
6412 (purify_type_name): Use STRING_STRIP_BRACKETS.
6414 2001-09-18 Andreas Jaeger <aj@suse.de>
6416 * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
6417 * jv-scan.c: Likewise.
6419 2001-09-17 Alexandre Petit-Bianco <apbianco@redhat.com>
6421 * parse.y (patch_method_invocation): Inner class creation context
6422 check not enforced within constructors. Fixes PR java/1873.
6424 2001-09-16 Tom Tromey <tromey@redhat.com>
6426 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
6427 NOTE_PUSH for single-case push. Fixes PR java/4189.
6429 2001-09-13 Alexandre Petit-Bianco <apbianco@redhat.com>
6431 * java-tree.h (TYPE_IMPORT_LIST): New macro.
6432 (TYPE_IMPORT_DEMAND_LIST): Likewise.
6433 (struct lang_type): New fields import_list and import_demand_list.
6434 * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
6435 TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
6436 (do_resolve_class): New local saved_enclosing_type, initialized,
6437 passed as parameter to find_in_imports and find_in_imports_on_demand.
6438 (find_in_imports): Added paramater enclosing_type, use its
6439 TYPE_IMPORT_LIST when applicable.
6440 (find_in_imports_on_demand): Added parameter enclosing_type, use
6441 its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
6442 declaration and initialization.
6443 (fold_constant_for_init): Switch/restore current_class to the
6444 appropriate context.
6446 2001-09-13 Mark Mitchell <mark@codesourcery.com>
6448 * verify.c (verify_jvm_instructions): Fix typo.
6450 2001-09-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6452 * expr.c (expand_invoke): Const-ification.
6453 * parse.y (patch_method_invocation): Likewise.
6455 2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6457 * gjavah.c (cxx_keywords): Const-ification.
6458 * keyword.gperf (java_keyword): Likewise.
6459 * lang.c (java_tree_code_name): Likewise.
6460 * lex.c (cxx_keywords): Likewise.
6461 * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
6463 2001-09-11 Richard Henderson <rth@redhat.com>
6465 * parse.h (ctxp_for_generation): Mark extern.
6467 2001-09-10 Richard Henderson <rth@redhat.com>
6469 * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
6471 2001-09-07 Matt Kraai <kraai@alumni.carnegiemellon.edu>
6473 * typeck.c (java_array_type_length, build_prim_array_type):
6474 Represent empty arrays by NULL index.
6476 2001-09-06 Alexandre Petit-Bianco <apbianco@redhat.com>
6478 * java-tree.h (compile_resource_file): Grouped with other prototypes.
6479 * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
6481 2001-09-06 Anthony Green <green@redhat.com>
6483 * class.c (O_BINARY): Define if necessary.
6484 (registerResource_libfunc): Declare.
6485 (init_class_processing): Initilize registerResource_libfunc.
6486 (compile_resource_file): New function.
6487 * java-tree.h (resource_name): Declare.
6488 (compile_resource_file): Declare.
6489 * jcf-parse.c (yyparse): Handle compiling java resource files.
6490 * lang.c (java_decode_option): Handle -fcompile-resource option.
6491 * jvspec.c (lang_specific_driver): Handle -R flag for compiling
6493 * gcj.texi (Code Generation): Add documentation for -R flag.
6495 2001-09-05 Alexandre Petit-Bianco <apbianco@redhat.com>
6497 * jcf-write.c (generate_classfile): Issue an error in case of
6498 field/initial value mismatch.
6499 * parse.y (analyze_clinit_body): Keep <clinit> if an array is
6500 being initialized and we're generating bytecode.
6501 (java_complete_lhs): In MODIFY_EXPR section: added comments,
6502 set DECL_INITIAL properly when appropriate.
6506 2001-09-01 Per Bothner <per@bothner.com>
6508 * parse.y (maybe_yank_clinit): A field without an initializer is not
6509 relevant. All initializers except static final and constant require
6510 <clinit>, regardless of flag_emit_class_files.
6512 2001-08-31 Per Bothner <per@bothner.com>
6514 * class.c (set_constant_value): When not emitting class files, then a
6515 String ConstantValue is a utf8const_ptr_type.
6517 2001-08-30 Per Bothner <per@bothner.com>
6519 * jcf-write.c (generate_classfile): Check that field is primitive
6520 or string before emitting ConstantValue attribute.
6522 2001-08-30 Per Bothner <per@bothner.com>
6524 * parse.y (resolve_qualified_expression_name): If creating a
6525 COMPOUND_EXPR, set it's type correctly.
6527 2001-08-30 Per Bothner <per@bothner.com>
6529 * jcf-io.c (open_class): Set filename field.
6531 * jcf-parse,c (parse_class_file): Set current_function_decl
6532 for better error message when Code attribute is missing.
6534 * lang.c (put_decl_node, lang_print_error): Re-arrange for
6535 better diagnostics, especially for constructors.
6537 2001-08-30 Per Bothner <per@bothner.com>
6539 * jcf-write.c (generate_classfile): Don't write ConstantValue
6540 attribute if field is not final, for compatibility with jdk.
6542 * jcf-write.c (generate_classfile): Convert ConstantValue values
6543 to correct type. Work-around for front-end bug.
6544 * class.c (set_constant_value): Error if constant has wrong type.
6546 2001-08-30 Per Bothner <per@bothner.com>
6548 * jcf-dump.c (print_constant): Fix fencepost error so "Float" and
6549 "Double" are printed at verbosity 1.
6551 * jcf-dump.c (main): Disable flag_print_attributes if --javap.
6553 * jcf-dump.c (SPECIAL_IINC): Remove unneeded casts to long.
6555 2001-08-30 Alexandre Petit-Bianco <apbianco@redhat.com>
6557 * parse.y (patch_assignment): Don't verify final re-assignment here.
6558 (java_complete_lhs): Verify assignments to finals calling
6559 patch_assignment. Verify re-assignments to finals before calling
6562 2001-08-29 Alexandre Petit-Bianco <apbianco@redhat.com>
6564 * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
6567 2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
6569 * lex.c (java_lex): new local found_hex_digits. Set and then used
6570 in test to reject invalid hexadecimal numbers.
6571 * parse.y (java_complete_tree): Prevent unwanted cast with
6572 initialized floating point finals.
6573 (patch_binop): Emit a warning when detecting a division by zero,
6574 mark result not constant, don't simplify non integer division.
6576 2001-08-28 Per Bothner <per@bothner.com>
6578 * jcf-write.c (generate_bytecode_insns): For increments and
6579 decrements just recurse to push constant. Improvement on Mark's patch.
6581 2001-08-28 Mark Mitchell <mark@codesourcery.com>
6583 * jcf-write.c (generate_bytecode_insns): Generate an integer to
6584 real conversion for increments and decrements of reals.
6586 2001-08-27 Alexandre Petit-Bianco <apbianco@redhat.com>
6588 * parse.y (resolve_qualified_expression_name): Handle unresolved
6589 qualified expressions, prevent numerical qualifiers, fixed typo.
6592 2001-08-24 Alexandre Petit-Bianco <apbianco@redhat.com>
6594 * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
6595 don't report anything but deprecated class when marked so. Handle
6597 (patch_method_invocation): Check deprecation on methods and types.
6598 (patch_binop): code becomes an enum tree_code, added default: to
6599 switch to handle that. Detect division by zero, try to fold and
6600 return before using a subroutine.
6602 2001-08-23 Alexandre Petit-Bianco <apbianco@redhat.com>
6604 * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
6605 file smaller than 4 bytes.
6606 * parse.y (check_inner_circular_reference): New function.
6607 (check_circular_reference): Likewise.
6608 (array_initializer:): Accept {,}.
6609 (java_check_circular_reference): Rewritten using
6610 check_circular_reference and check_inner_circular_reference.
6611 (java_complete_expand_method): Unconditionally save and restore
6612 the unpurged exception list.
6613 (build_dot_class_method_invocation): Unmangle signature parameter.
6615 2001-08-21 Tom Tromey <tromey@redhat.com>
6617 * decl.c (init_decl_processing): Add `throws' field to method
6619 * class.c (make_method_value): Compute `throws' field for method.
6621 2001-08-22 Alexandre Petit-Bianco <apbianco@redhat.com>
6623 * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
6624 circularity is detected.
6625 (ctors_unchecked_throws_clause_p): Fixed leading comment.
6627 2001-08-17 Richard Henderson <rth@redhat.com>
6629 * class.c (emit_register_classes): Add align parameter to
6630 call to assemble_integer.
6632 2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com>
6634 * jcf-parse.c (load_class): New locals saved and class_loaded. If
6635 loading a class_or_name fails, try considering an innerclass name
6636 and load the enclosing context.
6637 * parse.y (resolve_inner_class): New function.
6638 (find_as_inner_class): Added leading comment.
6639 (register_incomplete_type): Keep the current context as enclosing
6640 context for JDEP_FIELD dependencies.
6641 (do_resolve_class): Locals new_class_decl and super initialized to
6642 NULL. Call resolve_inner_class, explore the enclosing context
6643 superclass if necessary.
6646 2001-08-16 Tom Tromey <tromey@redhat.com>
6648 * jcf-dump.c (main): Updated for change to jcf_path_seal.
6649 * gjavah.c (main): Updated for change to jcf_path_seal.
6650 * lang.c (version_flag): New global.
6651 (java_decode_option): Recognize `-version'.
6652 (java_init): Update for change to jcf_path_seal.
6653 * jcf.h (jcf_path_seal): Added `print' argument.
6654 * jcf-path.c (jcf_path_seal): Added `print' argument.
6656 2001-08-13 Zack Weinberg <zackw@panix.com>
6658 * Make-lang.in (java/decl.o): Update dependencies.
6659 * decl.c: Include libfuncs.h, don't include toplev.h.
6661 2001-08-12 Alexandre Petit-Bianco <apbianco@redhat.com>
6663 * decl.c (init_decl_processing): exception_type_node,
6664 class_not_found_type_node, and no_class_def_found_type_node
6665 initialized. predef_filenames augmented accordingly.
6666 instinit_identifier_node initialized.
6667 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
6668 * java-tree.h (enum java_tree_index): New entries
6669 JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
6670 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
6671 (exception_type_node): New macro.
6672 (class_not_found_type_node): Likewise.
6673 (no_class_def_found_type_node): Likewise.
6674 (instinit_identifier_node): Likewise.
6675 (PREDEF_FILENAMES_SIZE): Adjusted.
6676 (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
6677 (struct lang_type): Fixed typo in bitfield name.
6678 (DECL_INSTINIT_P): New macro.
6679 (ID_INSTINIT_P): Likewise.
6680 * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
6682 * parse.y (encapsulate_with_try_catch): New function.
6683 (generate_instinit): Likewise.
6684 (build_instinit_invocation): Likewise.
6685 (ctors_unchecked_throws_clause_p): Likewise.
6686 (add_instance_initializer): Deleted.
6687 (build_instance_initializer): Likewise.
6688 (in_instance_initializer): Likewise.
6689 (check_method_redefinition): instinit$ not to be verified.
6690 (java_complete_expand_methods): Generate instinit$, simplified code.
6691 (build_dot_class_method): Eliminated unnecessary locals. Use
6692 encapsulate_with_try_catch, removed unnecessary code.
6693 (fix_constructors): New local iii. Use build_instinit_invocation.
6694 (patch_method_invocation): Added comment.
6695 (maybe_use_access_method): Don't consider instinit$.
6696 (find_applicable_accessible_methods_list): Shorten the search for
6698 (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
6699 (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
6700 (patch_throw_statement): Likewise. Fixed typo.
6702 2001-08-12 David Edelsohn <edelsohn@gnu.org>
6705 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
6706 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
6708 (lang_specific_pre_link): Use set_input to set input_filename.
6710 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
6711 (main): Fix definition.
6712 Strip `main' from classname.
6715 2001-08-11 Zack Weinberg <zackw@panix.com>
6717 * lex.h: Don't include setjmp.h. Don't define
6718 SET_FLOAT_HANDLER or prototype set_float_handler.
6720 2001-08-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6722 * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
6723 `poplevel' in the right order.
6725 2001-08-09 Richard Henderson <rth@redhat.com>
6727 * Make-lang.in (class.o): Depend on TARGET_H.
6728 * class.c (emit_register_classes): Use target hooks instead of
6729 assemble_constructor and assemble_destructor.
6731 2001-08-08 Alexandre Petit-Bianco <apbianco@redhat.com>
6733 * check-init.c (flags.h): Include
6734 (check_init): Don't report uninitialized static class
6735 initialization flags, don't free bit index when doing static class
6736 initialization optimization.
6737 (check_for_initialization): Return type changed to `unsigned int.'
6738 (attach_initialized_static_class): New function.
6739 * class.c (add_method_1): Create the initialized static class
6741 (finish_class): Always emit deferred inline methods.
6742 * decl.c (emit_init_test_initialization): Moved to expr.c
6743 (complete_start_java_method): Don't traverse
6744 DECL_FUNCTION_INIT_TEST_TABLE.
6745 (lang_mark_tree): Mark hash tables in function decls.
6746 * expr.c (emit_init_test_initialization): Moved from decl.c.
6747 (build_class_init): Create LAG_DECL_SPECIFIC for the static class
6748 initialization flag, set DECL_CONTEXT and
6749 LOCAL_CLASS_INITIALIZATION_FLAG.
6750 (java_lang_expand_expr): Emit initialization code for static class
6751 initialized flags when entering block, if necessary.
6752 * gcj.texi (-fno-optimize-static-class-initialization): Documented.
6753 * java-tree.h (flag_optimize_sci): New global variable declaration.
6754 (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
6755 (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
6756 (LOCAL_FINAL_P): Fixed typo in comment.
6757 (FINAL_VARIABLE_P): Likewise.
6758 (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
6759 (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
6760 (struct lang_decl): New fields `ict', `smic' and `cif.'
6761 (check_for_initialization): New returned value for global.
6762 (attach_initialized_static_class): New global function.
6763 (STATIC_CLASS_INIT_OPT_P): New macro.
6764 * lang-options.h (-fno-optimize-static-class-initialization): New flag.
6765 * lang.c (java_decode_option): Handle
6766 `-fno-optimize-static-class-initialization'
6767 * parse.y (start_complete_expand_method): New function.
6768 (java_expand_method_bodies): Likewise.
6769 (attach_init_test_initialization_flags): Likewise.
6770 (adjust_init_test_initialization): Likewise.
6771 (emit_test_initialization): Likewise.
6772 (java_complete_expand_methods): Nullify abstract and native method
6774 (java_complete_expand_method): New locals `fbody', `block_body'
6775 and `exception_copy.' Reorganized: directly return on empty method
6776 bodies, call `start_complete_expand_method', remember definitely
6777 initialized static class in function, don't expand method bodies.
6778 (java_expand_classes): Call `java_expand_method_bodies' before
6779 `finish_class' when compiling to native.
6780 (resolve_expression_name): Use `orig' after building outer class
6782 (patch_invoke): Remember static method invocations.
6784 2001-08-06 Richard Henderson <rth@redhat.com>
6786 * class.c (emit_register_classes): Pass a symbol_ref and priority
6787 to assemble_constructor.
6789 2001-08-02 Alexandre Petit-Bianco <apbianco@redhat.com>
6791 * java-tree.h (all_class_filename): New macro.
6792 (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
6793 (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
6794 newly created IDENTIFIER_NODE to `all_class_filename.'
6796 2001-08-01 Jeff Sturm <jsturm@one-point.com>
6798 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
6799 Use ggc_add_tree_root to register roots.
6801 2001-07-31 Alexandre Petit-Bianco <apbianco@redhat.com>
6803 * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
6804 second operand calling check_init.
6805 * decl.c (complete_start_java_method): Swaped second and third
6806 arguments while creating WITH_CLEANUP_EXPR node.
6807 * jcf-write.c (generate_bytecode_insns): Use second operand
6808 instead of third when handling WITH_CLEANUP_EXPR.
6809 * parse.y (java_complete_lhs): Expand second operand of
6810 WITH_CLEANUP_EXPR nodes.
6811 (patch_synchronized_statement): Swaped second and third arguments
6812 while creating WITH_CLEANUP_EXPR node.
6814 2001-07-18 Alexandre Petit-Bianco <apbianco@redhat.com>
6816 * parse.y (create_interface): Avoid cyclic inheritance report when
6817 syntax error encountered during class definition.
6820 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
6822 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
6824 (lang_specific_pre_link): Use set_input to set input_filename.
6826 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
6827 (main): Fix definition.
6828 Strip `main' from classname.
6831 2001-07-18 Tom Tromey <tromey@redhat.com>
6834 * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
6835 * lex.c (java_new_lexer): Use ICONV_CONST.
6836 (java_read_char): Likewise.
6837 * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
6838 (jv-scan$(exeext)): Likewise.
6840 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
6842 * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
6843 * parse.y (check_class_interface_creation): Allow `private' if the
6844 enclosing is not an interface.
6845 (create_interface): Interface tagged public if the enclosing
6846 context is an interface.
6847 (create_class): Class tagged public if the enclosing context
6851 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
6853 * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
6856 2001-07-14 Tim Josling <tej@melbpc.org.au>
6858 * check-init.c (check_init): Remove references to EXPON_EXPR.
6860 2001-07-13 Alexandre Petit-Bianco <apbianco@redhat.com>
6862 * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
6863 TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
6866 2001-07-13 Tom Tromey <tromey@redhat.com>
6868 * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
6871 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
6873 * parse.y (patch_method_invocation): Don't override primary if one
6874 is already provided, but let this$<n> be built. Fixed comment.
6876 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
6878 * parse.y (empty_statement:): Report empty statement error only
6879 when found at class declaration level.
6882 2001-07-12 Tom Tromey <tromey@redhat.com>
6884 * expr.c (expand_load_internal): New function.
6885 (LOAD_INTERNAL): Use it.
6887 2001-07-11 Alexandre Petit-Bianco <apbianco@redhat.com>
6889 * parse.y (verify_constructor_super): Compare anonymous class ctor
6890 args with `valid_method_invocation_conversion_p.'
6893 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
6895 * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
6896 `-fsyntax-only.' Fixes PR java/3248
6898 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
6900 * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
6902 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
6904 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
6905 current function is static. Fixes PR java/1970
6907 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6909 * parse.y (patch_method_invocation): Add enclosing context to ctor
6910 calls if necessary. Fixes PR java/2953
6912 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
6914 * parse.y (resolve_package): Abort if qualified expression member
6916 (qualify_ambiguous_name): Don't qualify as type if `this' in use.
6919 2001-07-07 Zack Weinberg <zackw@stanford.edu>
6921 * verify.c: Don't use // comments.
6923 2001-07-05 Tom Tromey <tromey@redhat.com>
6925 * lang.c (flag_assume_compiled): Removed.
6926 * java-tree.h (flag_assume_compiled): Removed.
6927 * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
6928 -fhash-synchronization, -fuse-divide-subroutine,
6929 -fcheck-references, -femit-class-file, -femit-class-files,
6930 -fassume-compiled. Updated --encoding information. Changed
6931 -foutput-class-dir to `-d'.
6933 2001-07-04 Daniel Berlin <dan@cgsoftware.com>
6935 * jcf-parse.c (parse_class_file): Add lineno parameter to
6936 debug_start_source_file call.
6938 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
6940 * gcj.texi: Use gpl.texi.
6941 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
6942 dependencies and use doc/include in search path.
6944 2001-07-03 Jeff Sturm <jsturm@one-point.com>
6946 * parse.y (fix_constructors): Test if a CALL_EXPR invokes
6947 `this'. If so, don't build instance initializers.
6949 2001-07-03 Alexandre Petit-Bianco <apbianco@redhat.com>
6951 * parse.y (resolve_expression_name): Improved error message for
6952 inner class cases. Fixes PR java/1958
6954 2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
6956 * lang.c: #include diagnostic.h
6957 (lang_print_error): Add a `diagnostic_context *' parameter.
6958 (java_dummy_print): Likewise.
6959 * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
6961 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
6963 * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
6964 * jcf.h (typedef struct JCF): New bitfield `finished.'
6965 (JCF_FINISH): Set `finished.'
6966 (JCF_ZERO): Reset `finished.'
6969 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
6971 * parse.y (class_body_declaration:): Don't install empty instance
6975 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
6977 * class.c (set_super_info): Call `set_class_decl_access_flags.'
6978 (set_class_decl_access_flags): New function.
6979 * java-tree.h (set_class_decl_access_flags): New prototype.
6980 * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
6981 (parse_class_file): New local `decl_max_locals.' Take wide types
6982 into account to compute DECL_MAX_LOCALS.
6983 * parse.y (type_import_on_demand_declaration:): Ignore duplicate
6986 2001-06-22 Jan van Male <jan.vanmale@fenk.wau.nl>
6988 * zipfile.h: Use GCC_JCF_H instead of JCF_H.
6990 2001-06-20 Alexandre Petit-Bianco <apbianco@redhat.com>
6992 * class.c (java_hash_tree_node): Fixed indentation in leading comment.
6993 * parse.y (do_resolve_class): Moved comments out to leading comment
6994 section. Removed local `start', New local `_ht' and
6995 `circularity_hash.' Record `enclosing' in hash table and search
6996 it to detect circularity. Use `enclosing' as an argument to
6997 `lookup_cl.' Free the hash table when done.
6999 2001-06-19 Tom Tromey <tromey@redhat.com>
7001 * lex.c (java_read_char): Disallow invalid and overlong
7002 sequences. Fixes PR java/2319.
7004 2001-06-05 Jeff Sturm <jsturm@one-point.com>
7006 * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
7008 2001-06-04 Alexandre Petit-Bianco <apbianco@redhat.com>
7010 * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
7011 arguments accordingly.
7013 2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
7015 * gcj.texi: Move contents to just after title page.
7017 2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
7019 * parse.y (type_literals:): Use `build_incomplete_class_ref' with
7021 (patch_incomplete_class_ref): Build the class ref, build the class
7022 init if necessary, complete the tree.
7025 2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com>
7027 * parse.y (lookup_field_wrapper): Test `name' code.
7028 (resolve_qualified_expression_name): Test `qual_wfl' code.
7029 (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
7030 handle `qual_wfl' by code.
7031 (maybe_build_primttype_type_ref): Test `wfl' code.
7033 2001-05-23 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
7035 * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
7037 (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls. Create
7038 the dvi file in the java directory.
7040 2001-05-25 Sam TH <sam@uchicago.edu>
7042 * gen-table.pl javaop.h jcf.h lex.h,
7043 parse.h: Fix header include guards.
7045 2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
7047 * jv-scan.c (version): Update copyright year.
7049 2001-05-21 Per Bothner <per@bothner.com>
7051 * jcf-parse.c (read_class): If class is from .class or .zip file
7052 and it's already been read, don't push/pop parser context.
7054 2001-05-18 Per Bothner <per@bothner.com>
7056 * jvspec.c (lang_specific_pre_link): Re-arrange the linker
7057 command line so the jvgenmain-generated main program comes first.
7059 2001-05-15 Tom Tromey <tromey@redhat.com>
7061 * class.c (build_utf8_ref): Don't generate identifier based on
7064 2001-05-12 Richard Henderson <rth@redhat.com>
7066 * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
7067 * expr.c (java_lang_expand_expr): Expand it.
7068 (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
7069 calling build_exception_object_ref.
7070 * parse.y (catch_clause_parameter): Likewise.
7071 (build_dot_class_method): Likewise.
7072 (try_reference_assignconv): Likewise.
7073 * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
7074 * jcf-write.c (generate_bytecode_insns): Likewise.
7076 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
7078 * parse.y (build_unresolved_array_type): Set
7079 EXPR_WFL_QUALIFICATION on the newly created wfl.
7080 Fixes PR java/2538. Fixes PR java/2535.
7082 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
7084 * parse.y (fix_constructors): Removed unnecessary assignment to
7085 local. Moved assignment to `this$<n>', fixed comments and
7087 (build_wfl_wrap): Fixed indentation.
7088 Fixes PR java/2598, java/2579 and java/2658.
7090 2001-05-03 Mo DeJong <mdejong@redhat.com>
7092 * lex.c (java_new_lexer): Call iconv_close on temp handle used to
7093 check for byte swap.
7095 2000-05-02 Jeff Sturm <jsturm@one-point.com>
7097 * expr.c (build_class_init): Move MODIFY_EXPR
7098 outside of COND_EXPR. Remove variable `call'.
7100 2001-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7102 * decl.c: NULL_PTR -> NULL.
7103 * jcf-write.c: Likewise.
7105 2001-05-01 Tom Tromey <tromey@redhat.com>
7107 * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
7108 (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
7109 * gcj.texi: Updated copyright text. Include fdl.texi.
7110 (Top): Link to new node.
7112 2001-05-01 Per Bothner <per@bothner.com>
7114 * parse.h (REGISTER_IMPORT): Use tree_cons instead of chainon.
7116 2001-05-01 Per Bothner <per@bothner.com>
7118 * parse.y (java_pop_parser_context): The TREE_VALUE of a link in the
7119 import_list contains the name, not the TREE_PURPOSE.
7121 2001-04-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7123 * jcf-io.c (read_zip_member): Cast to long in comparison with
7126 * jvspec.c (lang_specific_driver): Initialize variables.
7128 * mangle.c (find_compression_record_match): Likewise.
7130 * typeck.c (build_null_signature): Provide static prototype. Mark
7131 parameter with ATTRIBUTE_UNUSED.
7133 * verify.c (verify_jvm_instructions): Initialize variable.
7135 2001-04-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
7137 * parse.y (do_resolve_class): Check for cyclic inheritance during
7138 inner class resolution.
7140 2001-04-27 Per Bothner <per@bothner.com>
7142 * parse.y (java_expand_classes): Don't change ctxp_for_generation
7143 while iterating, since that could cause gc to lose stuff.
7145 2001-04-26 Per Bothner <per@bothner.com>
7147 Fix method search wrt scope of inner classes to match JLS2.
7148 * typeck.c (build_null_signature): New static function.
7149 (has_method): New function. Uses build_null_signature and lookup_do.
7150 * java-tree.h (has_method): New declaration.
7151 * parse.y (find_applicable_accessible_methods_list): Do not search
7152 context of inner classes here.
7153 (patch_method_invocation): Search scope, ie. current and outer clases,
7154 for method matching simple name, to find class.
7156 2001-04-26 Per Bothner <per@bothner.com>
7158 * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
7159 Fix thinko: If a single case, use if_icmpeq, not ifeq.
7161 * constants.c (find_methodref_with_class_index): New function.
7162 (find_methodref_index): Use find_methodref_with_class_index.
7163 * java-tree.h (find_methodref_with_class_index): New declaration.
7164 * jcf-write.c (generate_bytecode_insns case CALL_EXPR): Don't change
7165 DECL_CONTEXT, instead use new find_methodref_with_class_index function.
7166 If context changed from interface to class, don't use invokeinterface.
7168 2001-04-25 Per Bothner <per@bothner.com>
7170 * verify.c (verify_jvm_instructions): For field instructions,
7171 check that field index is valid. For invoke instructions, check that
7172 method index is valid.
7174 2001-04-25 Alexandre Oliva <aoliva@redhat.com>
7176 * config-lang.in (target_libs): Copy from $libgcj_saved.
7178 2001-04-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
7180 * decl.c (init_decl_processing): Add new class "protectionDomain"
7182 * class.c (make_class_data): Set initial value for "protectionDomain".
7184 2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7186 * jvspec.c (lang_specific_driver): Fix memory allocation
7187 deficit, by using concat in lieu of xmalloc/sprintf.
7189 2001-04-20 Per Bothner <per@bothner.com>
7191 Fixes to compile multiple .class files at once.
7192 * decl.c (init_decl_processing): Don't set CLASS_LOADED_P.
7193 * java-tree.h (CLASS_PARSED_P): New macro.
7194 (CLASS_LOADED_P): Re-define to use TYPE_SIZE and CLASS_PARSED_P.
7195 * jcf-parse.c (jcf_parse_source): Inline into read_class.
7196 (read_class): Avoid some code duplication.
7197 Don't call JCF_FINISH for a .class file - might be needed later.
7198 (jcf_parse): Don't call layout_class here. Check/set CLASS_PARSED_P
7199 rather than CLASS_LOADED_P, since latter implies class laid out.
7200 (yyparse): Do layout_class and JCF_FINISh here instead, in pass 2.
7201 * parse.y: Don't need to set CLASS_LOADED_P for array types.
7203 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7205 * Make-lang.in (java/boehm.o): Depend on toplev.h.
7207 * boehm.c: Include toplev.h.
7209 2001-04-06 Tom Tromey <tromey@redhat.com>
7210 Alexandre Petit-Bianco <apbianco@redhat.com>
7212 Fix for PR gcj/1404 and PR gcj/2332:
7213 * parse.y (build_array_from_name): If we use the type_wfl then
7214 accumulate dimensions from the original type as well.
7215 (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
7217 2001-04-06 Tom Tromey <tromey@redhat.com>
7219 * parse.y (analyze_clinit_body): Return true if the second operand
7220 of a METHOD_EXPR is nonzero.
7222 2001-04-06 Tom Tromey <tromey@redhat.com>
7224 * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
7226 ($(srcdir)/java/parse.c): Likewise.
7228 2001-04-05 Alexandre Petit-Bianco <apbianco@redhat.com>
7230 * gcj.texi: Use `which-gcj' instead of `which-g77.'
7231 (version-gcc): Initialized.
7232 (which-gcj): Likewise.
7234 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
7236 * java-tree.h (struct lang_decl): New macro
7237 `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
7238 * parse.y (build_instance_initializer): New function.
7239 (add_instance_initializer): Use it.
7240 (java_fix_constructors): Set `current_class' before fix pass.
7241 (fix_constructors): Just return if already fixed. Move `super()'
7242 invocation ahead. Use `build_instance_initializer.'
7245 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
7247 * parse.y (resolve_qualified_expression_name): Pass field's
7248 DECL_CONTEXT to `not_accessible_p.'
7249 (not_accessible_p): Changed parameters order in `inherits_from_p'
7252 2001-03-27 Andrew Haley <aph@cambridge.redhat.com>
7254 * lang-options.h: Add flag_check_references.
7256 2001-04-04 Per Bothner <per@bothner.com>
7258 * java-tree.h (CONSTANT_VALUE_P): New macro.
7259 * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P.
7260 * parse.y (maybe_build_class_init_for_field): New static function.
7261 (resolve_expression_name, resolve_field_access): Use
7262 maybe_build_class_init_for_field instead of build_class_init
7263 This does not do the init if the field is compile-time-constant.
7264 (resolve_field_access): Simplify.
7266 * parse.y (fold_constant_for_init): Merge test into switch.
7268 2001-04-03 Zack Weinberg <zackw@stanford.edu>
7270 * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
7272 * buffer.c, jvgenmain.c: Don't include gansidecl.h.
7274 2001-04-02 Zack Weinberg <zackw@stanford.edu>
7276 * expr.c (pop_type_0): Save the result of the first
7277 lang_printable_name call in a scratch buffer, so it
7278 won't be clobbered by the second call.
7280 2001-03-30 Alexandre Petit-Bianco <apbianco@redhat.com>
7282 * parse-scan.y (array_type:): Rewritten.
7283 (type_declaration:): `empty_statement' replaces `SC_TK.'
7284 (class_member_declaration:): `empty statement' added.
7285 (method_body:): Simplified.
7286 (static_initializer:): Likewise.
7287 (primary_no_new_array:): Use `type_literals.'
7288 (type_literals:): New rule.
7289 (dims:): Set and update `bracket_count.'
7290 Fixes PR java/1074. Fixes PR java/2412.
7292 2001-03-28 Hans Boehm <boehm@acm.org>
7294 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
7295 (get_boehm_type_descriptor): Set type on returned value to be a
7296 pointer length integer.
7298 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7300 * expr.c (pop_type_0): Call `concat' rather than building the
7302 (pop_type): Add format specifier in call to `error'.
7304 * parse.y (patch_method_invocation): Avoid casting away
7307 2001-03-28 Jeffrey Oldham <oldham@codesourcery.com>
7309 * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
7311 2001-03-28 Richard Henderson <rth@redhat.com>
7313 IA-64 ABI Exception Handling:
7314 * Make-lang.in (except.o): Don't depend on eh-common.h.
7315 * check-init.c (check_init): Handle EXC_PTR_EXPR.
7316 * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
7317 [soft_exceptioninfo_call_node]: Remove.
7318 [eh_personality_libfunc, lang_eh_runtime_type]: New.
7319 (end_java_method): No emit_handlers.
7320 * except.c (java_set_exception_lang_code): Remove.
7321 (method_init_exceptions): Don't call it.
7322 (prepare_eh_table_type): No CATCH_ALL_TYPE.
7323 (build_exception_object_ref): New.
7324 (expand_end_java_handler): Update for except.h name changes.
7325 (emit_handlers, expand_resume_after_catch): Remove.
7326 * expr.c (java_lang_expand_expr): Update for except.h name changes.
7327 (process_jvm_instruction): Use build_exception_object_ref.
7328 * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
7329 (soft_exceptioninfo_call_node): Remove.
7330 (build_exception_object_ref): Declare.
7331 * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
7332 soft_exceptioninfo_call_node. Move processing ...
7333 [EXC_PTR_EXPR]: ... here.
7334 * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
7335 * parse.y (catch_clause_parameter): Use build_exception_object_ref.
7336 (source_end_java_method): No java_set_exception_lang_code or
7338 (build_dot_class_method): Use build_exception_object_ref.
7339 (try_reference_assignconv): Check EXC_PTR_EXPR not
7340 soft_exceptioninfo_call_node.
7342 2001-03-28 Richard Henderson <rth@redhat.com>
7344 * java-tree.h (throw_node): Define as a single member of
7345 java_global_trees instead of a separate array.
7346 (JTI_THROW_NODE): New.
7347 * decl.c (throw_node): Don't declare.
7348 (init_decl_processing): Init a scalar throw_node.
7349 Don't register it for gc.
7350 * check-init.c (check_init): Reference scalar throw_node.
7351 * expr.c (build_java_athrow): Likewise.
7352 * jcf-write.c (generate_bytecode_insns): Likewise.
7353 * parse.h (BUILD_THROW): Likewise.
7355 2001-03-28 Richard Henderson <rth@redhat.com>
7357 * decl.c (end_java_method): Do not save and restore
7358 flag_non_call_exceptions.
7359 * parse.y (source_end_java_method): Likewise.
7360 * lang.c (flag_exceptions): Don't declare.
7361 (java_init_options): Set flag_non_call_exceptions. Set
7362 flag_exceptions here ...
7363 (java_init): ... not here.
7365 2001-03-27 Richard Henderson <rth@redhat.com>
7367 * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
7368 exceptions_via_longjmp.
7370 * lang.c (flag_new_exceptions): Don't declare it.
7371 (java_init_options): Or set it.
7373 2001-03-27 Richard Henderson <rth@redhat.com>
7375 * decl.c (end_java_method): Rename asynchronous_exceptions to
7376 flag_non_call_exceptions.
7377 * parse.y (source_end_java_method): Likewise.
7379 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7381 * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
7383 2001-03-26 Mark Mitchell <mark@codesourcery.com>
7385 * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
7387 2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com>
7389 * parse.y (find_as_inner_class): Follow current package
7390 indications not to mistakingly load an unrelated class.
7392 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7394 * constants.c (PUTN): Use memcpy, not bcopy.
7396 * lex.c (java_read_char): Use memmove, not bcopy.
7398 * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
7400 2001-03-23 Per Bothner <per@bothner.com>
7402 * verify.c (verify_jvm_instructions): Replace 3 pop_type by POP_TYPE
7403 macro for better error pin-pointing.
7404 * java-tree.h: Fix typo in comment.
7406 * jcf-write.c (generate_bytecode_insns): Changes to TRY_FINALLY_EXPR.
7407 Don't include jsr/goto in exception range.
7408 Check if start and end of exception range are the same (also TRY_EXPR).
7409 Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
7410 However, do emit the following goto even if try_block is empty.
7411 Defer freeing exception_decl until after the finalizer, to make
7412 sure the local isn't reused in the finalizer. Fixes PR java/1208.
7414 * parse.y (java_complete_lhs): If the try-clause is empty, just
7415 return the finally-clause and vice versa.
7417 2001-03-23 Alexandre Petit-Bianco <apbianco@redhat.com>
7419 * gcj.texi (Input Options): documented the check for attribute
7420 `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
7421 * java-tree.h (flag_force_classes_archive_check): Declared extern.
7422 * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
7423 (jcf_parse): Check for the right classes archive if necessary.
7424 * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
7425 (jcf_parse_fields): Fixed indentation.
7426 * jcf-write.c (append_gcj_attribute): New function.
7427 (generate_classfile): Compute the attribute count, invoke
7428 `append_gcj_attribute'.
7429 * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
7430 turned into bit-fields. New bit-field `right_zip.'
7431 (JCF_ZERO): Set `right_zip' to zero.
7432 * lang-options.h (-fforce-classes-archive-check): Added flag.
7433 * lang.c (flag_force_classes_archive_check): New flag.
7434 (lang_f_options): New entry `force-classes-archive-check.'
7437 2001-02-07 Andrew Haley <aph@redhat.com>
7439 * gcj.texi (Configure-time Options): Add -fcheck-references.
7440 * expr.c (build_java_indirect_ref): New function.
7441 (java_check_reference): New function.
7442 (build_java_array_length_access): Use build_java_indirect_ref to
7443 check for null references.
7444 (build_java_arrayaccess): Likewise.
7445 (build_get_class): Likewise.
7446 (build_field_ref): Likewise.
7447 (invoke_build_dtable): Likewise.
7448 (build_invokeinterface): Likewise.
7449 * lang.c (lang_f_options): Add flag_check_references.
7450 * jvspec.c (jvgenmain_spec): Add flag_check_references.
7451 * java-tree.h (flag_check_references): New variable.
7452 * lang.c (flag_check_references): Likewise.
7453 * parse.y (patch_invoke): Use java_check_reference.
7454 (patch_assignment): Allow for extra nesting in
7455 _Jv_CheckArrayStore.
7457 2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
7459 * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
7460 * lex.c (cxx_keywords): Likewise.
7462 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
7464 * parse.y (qualify_ambiguous_name): Broaden `length'
7465 recognition. Help MODIFY_EXPR be resolved as expression names.
7466 Fixes PR java/2066. Fixes PR java/2400.
7468 2001-03-21 Bryce McKinlay <bryce@albatross.co.nz>
7470 * gjavah.c (process_file): Mark interface definitions with
7471 "__attribute__ ((java_interface))".
7473 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
7475 * class.c (layout_class): Fixed push_super_field's second
7476 argument. Fixes PR java/2333.
7477 (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
7478 too early to lay innerclasses out.
7480 2001-03-20 Tom Tromey <tromey@redhat.com>
7481 Alexandre Petit-Bianco <apbianco@redhat.com>
7483 * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
7484 inside an array reference. Insertion of the array store check
7485 rewritten. Fixes PR java/2299.
7487 2001-03-20 Tom Tromey <tromey@redhat.com>
7489 * lex.c (java_read_unicode): Only accept leading `u's.
7491 2001-03-20 Tom Tromey <tromey@redhat.com>
7493 * jcf-parse.c (read_class): Initialize `class'.
7495 2001-03-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
7497 * jcf_parse.c (jcf_parse): Eliminate unused variable.
7499 2001-03-19 Mark Mitchell <mark@codesourcery.com>
7501 * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
7502 (layout_class): Likewise.
7503 (layout_class_method): Likewise.
7504 (emit_register_classes): Likewise.
7505 * decl.c (builtin_function): Likewise.
7506 (give_name_to_locals): Likewise.
7508 2001-03-19 Per Bothner <per@bothner.com>
7510 * jcf-parse.c (load_inner_classes): Check CLASS_LOADED_P
7511 before trying to load an inner class.
7513 Fixes to process to command-line .class files in two passes.
7514 * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P): New flags.
7515 (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P): Rename to ..
7516 (CLASS_FROM_CURRENTLY_COMPILED_P): ... because it is more general now.
7517 * class.c (is_compiled_class): Fix for renamed flag.
7518 * parse.y (maybe_create_class_interface_decl): Likewise.
7519 * jcf-parse.c (yyparse): Also set if compiling .class files.
7520 * jcf-parse.c (read_class); Read current_class.
7521 (jcf_parse): Make static.
7522 (load_inner_classes): New function, with code moved from jcf_parse,
7523 because we need to inner classes after the command-line files are read.
7524 (yyparse): Set finput to NULL when it doesn't need to be closed.
7525 Reduce use of main_jcf (basically only for archive) and
7526 use finput instead of main_jcf->read_state.
7527 Inline jcf_figure_file_type into yyparse.
7528 Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
7529 Defer load_inner_classes and parse_class_file to a second pass,
7530 after we've correctly mapped command-line .clas fiels to classes.
7531 (jcf_figure_file_type): Removed.
7532 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): Removed flags.
7533 (JCF_ZERO): Also clear zipd field.
7534 * zipfile.h: Conditionalize on JCF_H insread of JCF_ZIP.
7536 2001-03-18 Matt Kraai <kraai@alumni.carnegiemellon.edu>
7538 * jcf-parse.c (yyparse): Change ch from char * to char.
7540 2001-03-19 Per Bothner <per@bothner.com>
7542 * jvspec.c (lang_specific_driver): Check for .zip and .jar files.
7543 Add constructed filelist-file at end, following -xjava. Thus any .o
7544 and library files are not affected by the -xjava. Also wrap
7545 explicit @FILE with -xjava and -xnone.
7547 2001-03-19 Andrew Haley <aph@cambridge.redhat.com>
7549 * class.c (build_static_field_ref): Call make_decl_rtl() after
7550 setting the DECL_EXTERNAL flag.
7552 2001-03-17 Per Bothner <per@bothner.com>
7554 * decl.c (clear_binding_level): Fix initializer (broke 03-15).
7556 * jcf-write.c (generate_bytecode_insns): Handle emitting iinc
7557 when result is is needed (target is STACK_TARGET).
7559 * parse.h (JDEP_SOLV): Removed.
7560 * parse.y (register_incomplete_type): Use JDEP_TO_RESOLVE instead.
7562 * parse.y (incomplete_class_list): Removed.
7563 (obtain_incomplete_type): Don't use or set incomplete_class_list.
7564 It doesn't work if resolve_class changes the name of an array type
7565 that is on the list and then someone else looks for the modified name.
7566 Also, seems liable to break when compiling multiple source files at
7567 once. So the simplest is to just remove incomplete_class_list -
7568 it is only a minor space win and it is not even clear it saves time.
7570 * parse.y (resolve_class): Remove unneeded promote_type.
7572 2001-03-15 Per Bothner <per@bothner.com>
7574 * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
7575 * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
7576 * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
7577 Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
7579 * jcf-parse.c (yyparse): Set/reset input_filename for source file.
7580 * parse.y (java_expand_classes): Likewise.
7582 * parse.y (expand_start_java_method): Was only called once and had a
7583 misleading name, so inline in caller java_complete_expand_method.
7584 (enter_a_block): Likewise inline in enter_block and remove.
7586 Remove junk from when gcc/java was created (by copying from C/C++).
7587 * decl.c (keep_next_level_flag, keep_next_if_subblocks): Remove.
7588 (struct binding_level): Remove fields keep, keep_if_subblocks,
7589 more_cleanups_ok, have_cleanups (which have never been used).
7590 (pushlevel, poplevel): Remove related useless code.
7592 * class.c (make_class_data): The class_dtable_decl (i.e. the
7593 vtable for Class) should be external, except when compiling Class.
7595 * jvspec.c (lang_specific_driver): Fix -C handling.
7596 Check -save-temps to see if temp @FILE should be deleted.
7597 Follow-up to/fix for February 16 patch.
7599 * verify.c (verify_jvm_instructions): Better error msgs for dup.
7600 (type_stack_dup): Remove no-longer neded error check.
7602 2001-03-15 Bryce McKinlay <bryce@albatross.co.nz>
7604 * mangle.c (mangle_record_type): Rename 'from_pointer' argument
7605 to 'for_pointer'. If this type is for a pointer (argument) mangling,
7606 don't surround the element with 'N..E' if the type name is
7609 2001-03-14 Mark Mitchell <mark@codesourcery.com>
7611 * class.c (build_static_field_ref): Use COPY_DECL_RTL,
7612 DECL_RTL_SET_P, etc.
7613 (make_method_value): Likewise.
7614 (get_dispatch_table): Likewise.
7616 * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
7618 2001-03-07 Tom Tromey <tromey@redhat.com>
7620 * config-lang.in (lang_requires): Define.
7622 2001-03-07 Brad Lucier <lucier@math.purdue.edu>
7624 * typeck.c (convert): Check flag_unsafe_math_optimizations,
7627 2001-03-05 Per Bothner <per@bothner.com>
7629 Fix a problem where rest_of_decl_compilation applied to
7630 class_dtable_decl causes problems because it was done too early,
7631 before output file was opened.
7632 * decl.c (init_decl_processing): Remove init of class_dtable_decl.
7633 * class.c (class_dtable_decl): Add macro - element of class_roots.
7634 (make_class_data): Define class_dtable_decl.
7635 * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl): Removed.
7637 2001-03-01 Zack Weinberg <zackw@stanford.edu>
7639 * java/class.c, java/decl.c, java/java-tree.h: Replace all
7640 uses of 'boolean' with 'bool'.
7642 2001-03-01 Zack Weinberg <zackw@stanford.edu>
7644 * lang-specs.h: Add zero initializer for cpp_spec field to all
7647 2001-02-16 Per Bothner <per@bothner.com>
7649 Handle compiling multiple input files at once, and @FILE syntax.
7650 * gcj.texi: Updated documentation to match.
7651 * java-tree.h (flag_filelist_file, init_src_parse): New declarations.
7652 * jcf-parse.c (parse_source_file): Split into ...
7653 (parse_source_file_1): New function - and:
7654 (parse_source_file_2): New function.
7655 (yyparse): On -ffilelist-file, open and scan named file.
7656 On first pass over files, only do parse_source_file_1.
7657 A new second pass calls parse_source_file_2 for each file to compile.
7658 (init_jcf_parse): Call init_src_parse.
7659 * jvspec.c (INDIRECT_FILE_ARG): New flag.
7660 (lang_specific_driver): Support @FILELIST-FILE syntax, as well
7661 as multiple input file combined in one compilation.
7662 * lang-options.h: Add -ffilelist-file
7663 * lang.c (flag_filelist_file): New flag variable.
7664 (lang_f_options): Handle -ffilelist-file.
7665 * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
7666 * parse.h (struct parse_ctxt): Remove fields incomplete_class and
7667 gclass_list - use global fields of src_parse_roots instead.
7668 * parse.y (src_parse_roots): New array.
7669 (incomplete_class_list, gclass_list): New macros.
7670 (push_parser_context, java_pop_parser_context,
7671 java_parser_context_resume): Don't fiddle with deleted fields.
7672 (various): Use incomplete_class gclass_list and global macros
7673 instead of parse_ctxt fields - the lists are global.
7674 (init_src_parse): New function.
7676 2001-02-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7678 * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
7680 2001-02-20 Alexandre Petit-Bianco <apbianco@redhat.com>
7682 * parse.y (check_inner_class_access): Moved declaration of local
7683 `enclosing_decl_type' to the right location.
7685 2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
7687 * parse.y (parser_check_super_interface): Don't call
7688 check_pkg_class_access for an inner interface.
7689 (parser_check_super): Don't call check_pkg_class_access for inner
7691 (do_resolve_class): Simplify enclosing type loop. Don't call
7692 check_pkg_class_access if CL and DECL are not set.
7693 (find_in_imports_on_demand): Set DECL if class_type needed to be
7694 loaded. Don't call check_pkg_class_access for an inner class.
7695 (check_inner_class_access): Rewritten to implement member access
7696 rules as per spec 6.6.1.
7697 (check_pkg_class_access): Handle the empty package correctly.
7698 (in_same_package): New function. Determine if two classes are in the
7701 2001-02-18 Bryce McKinlay <bryce@albatross.co.nz>
7703 * typeck.c (build_java_array_type): Don't try to poke a public `clone'
7704 method into array types.
7705 * parse.y (patch_method_invocation): Bypass access check on clone call
7708 2001-02-15 Alexandre Petit-Bianco <apbianco@redhat.com>
7710 * expr.c (build_instanceof): Check for arrays when trying fold to
7713 2001-02-15 Jim Meyering <meyering@lucent.com>
7715 * Make-lang.in (java.install-common): Depend on `installdirs'.
7716 (java.install-info): Likewise.
7718 2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
7720 * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
7722 2001-02-14 Tom Tromey <tromey@redhat.com>
7723 Alexandre Petit-Bianco <apbianco@cygnus.com>
7725 Fix for PR java/1261.
7726 * typeck.c (build_java_array_type): Add public `clone' method to
7728 * parse.y (resolve_qualified_expression_name): Use current_class
7729 when checking for inaccessibility.
7730 (patch_method_invocation): Fixed error message when accessibility
7731 denied. Added `from_super' argument.
7733 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
7735 * parse.y (resolve_class): Don't build a fake decl. Use the one
7737 * typeck.c (build_java_array_type): Build and assign decl to array
7740 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
7742 * parse.y (not_accessible_p): Changed leading comment. Added extra
7743 `where' argument. Use it to enforce protected access rules.
7744 (resolve_qualified_expression_name): Added extra argument to
7746 (patch_method_invocation): Use argument `primary' to provide
7747 not_accessible_p with an extra argument.
7748 (lookup_method_invoke): Added extra argument to not_accessible_p.
7749 (search_applicable_method_list): Likewise.
7751 2001-02-13 Alexandre Petit-Bianco <apbianco@redhat.com>
7753 * parse.y (resolve_qualified_expression_name): Try to resolve as
7754 an inner class access only if `decl' is a TYPE_DECL.
7756 2001-02-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
7758 * decl.c (classdollar_identifier_node): Initialize.
7759 * java-tree.h (enum java_tree_index): New entry
7760 `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
7761 (classdollar_identifier_node): New macro.
7762 (ID_CLASSDOLLAR_P): Likewise.
7763 * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
7764 (build_dot_class_method_invocation): Likewise.
7765 (find_applicable_accessible_methods_list): `class$' can't be
7768 2001-02-09 Raja R Harinath <harinath@cs.umn.edu>
7770 * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
7772 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
7774 * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
7775 * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
7778 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
7780 * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
7781 outside of the `__U' sequence too.
7782 (unicode_mangling_length): Count `_' or `U' outside of the `__U'
7785 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
7787 * jvgenmain.c (error): Reversed 2001-02-01 deletion.
7789 2001-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
7791 * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
7792 (JVGENMAIN_OBJS): Likewise.
7793 * java-tree.h (append_gpp_mangled_name): New prototype.
7794 * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
7795 Removed cast calling `gcc_add_root.'
7796 * jvgenmain.c (mangle_obstack): New global, initialized.
7798 (do_mangle_class): Constify local `ptr.'
7799 Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
7800 append_gpp_mangle_name and update `count' if necessary.
7801 Use `mangle_obstack.'
7802 * mangle.c (append_unicode_mangled_name): Removed.
7803 (append_gpp_mangled_name): Likewise.
7804 (unicode_mangling_length): Likewise.
7805 (mangle_member_name): Return type set to `void.'
7806 (mangle_field_decl): Don't append `U' in escaped names.
7807 (mangle_method_decl): Likewise.
7808 (mangle_member_name): Just use `append_gpp_mangled_name.'
7809 * mangle_name.c: New file.
7811 2001-02-07 Per Bothner <per@bothner.com>
7813 * check-init.c (check_init): Fix TRY_FINALLY_EXPR logic.
7815 * check-init.c (check_init): Don't call done_alternative after
7816 processing loop code, as a LOOP_EXPR never terminates normally.
7818 2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
7820 * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
7822 2001-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7824 * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
7827 2001-02-06 Tom Tromey <tromey@redhat.com>
7829 * lex.c (java_new_lexer): Longer error message.
7831 2001-02-05 Jeff Sturm <jeff.sturm@commerceone.com>
7832 Alexandre Petit-Bianco <apbianco@cygnus.com>
7834 * typeck.c (build_prim_array_type): Added leading comment.
7835 (build_java_array_type): Moved locals out of
7836 block. Always create the `data' field, fixed alignment to match
7839 2001-02-04 Tom Tromey <tromey@redhat.com>
7841 * expr.c (java_lang_expand_expr): Don't bother recomputing
7842 `length'. Use rest_of_decl_compilation, not make_decl_rtl.
7845 2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
7847 * parse.y (process_imports): Save the original name of the import
7848 for better error report.
7850 2001-02-04 Bryce McKinlay <bryce@albatross.co.nz>
7852 * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
7853 of macros used when compiling jvspec.c.
7854 * jvspec.c (lang_specific_driver): Link with the shared
7857 2001-02-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7859 * check-init.c (check_init): Call internal_error instead of fatal.
7860 * expr.c (java_lang_expand_expr): Likewise.
7861 * jcf-parse.c (get_constant): Likewise.
7862 * mangle.c (java_mangle_decl): Likewise.
7863 * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
7864 (operator_string): Likewise.
7865 * check-init.c (check_init): Call abort instead of fatal.
7866 * class.c (build_class_ref): Likewise.
7867 * constants.c (write_constant_pool): Likewise.
7868 * decl.c (start_java_method): Likewise.
7869 * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
7870 (java_stack_dup, encode_newarray_type): Likewise.
7871 (build_java_array_length_access): Likewise.
7872 (build_java_check_indexed_type, expand_java_pushc): Likewise.
7873 (build_java_soft_divmod, build_invokeinterface): Likewise.
7874 * java-tree.h (INNER_CLASS_P): Likewise.
7875 * jcf-parse.c (parse_signature, get_name_constant): Likewise.
7876 (give_name_to_class, get_class_constant): Likewise.
7877 * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
7878 (find_constant_index, generate_bytecode_conditional): Likewise.
7879 (generate_bytecode_insns, perform_relocations): Likewise.
7880 * lex.c (java_unget_unicode, java_lex): Likewise.
7881 * mangle.c (mangle_type, mangle_record_type): Likewise.
7882 (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
7883 (finish_mangling): Likewise.
7884 * parse.h (MARK_FINAL_PARMS): Likewise.
7885 * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
7886 (obtain_incomplete_type, java_complete_class): Likewise.
7887 (java_check_regular_methods, java_complete_expand_method): Likewise.
7888 (cut_identifier_in_qualified, check_deprecation): Likewise.
7889 (patch_invoke, find_applicable_accessible_methods_list): Likewise.
7890 (java_complete_lhs, lookup_name_in_blocks): Likewise.
7891 (check_final_variable_indirect_assignment, build_unaryop): Likewise.
7892 * typeck.c (set_local_type, parse_signature_type): Likewise.
7893 (parse_signature_string, build_java_signature): Likewise;
7894 (set_java_signature): Likewise.
7895 * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
7896 * class.c (add_method): Call fatal_error instead of fatal.
7897 (build_static_field_ref): Likewise.
7898 * expr.c (build_known_method_ref, expand_invoke): Likewise.
7899 * jcf-parse.c (get_constant, jcf_parse): Likewise.
7900 * lex.c (java_new_new_lexer): Likewise.
7901 * jv-scan.c (main): Likewise.
7902 (fatal_error): Renamed from fatal.
7903 * jcf-parse.c (yyparse): Call fatal_io_error instead of
7905 * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
7906 (yyparse): Likewise.
7907 * jcf-write.c (make_class_file_name, write_classfile): Likewise.
7908 * lex.c (java_get_line_col): Likewise.
7909 * jcf-parse.c (load_class): Make errors non-fatal.
7910 * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
7912 2001-02-01 Bryce McKinlay <bryce@albatross.co.nz>
7914 * jvgenmain.c (class_mangling_suffix): Remove unused string.
7915 (error): Remove unused function.
7916 (main): Don't use "__attribute__ alias" on generated class symbol.
7918 2001-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
7920 * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
7922 * parse.y (finish_method_declaration): Code accounting for WFLed
7923 method DECL_NAMEs deleted.
7924 (check_abstract_method_definitions): Likewise.
7925 (resolve_type_during_patch): Layout resolved type.
7926 * typeck.c (lookup_do): Removed unused local.
7928 2001-01-30 Bryce McKinlay <bryce@albatross.co.nz>
7930 * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
7931 * decl.c (init_decl_processing): Use integer_minus_one_node, not
7932 integer_negative_one_node.
7933 * expr.c (build_java_binop): Likewise.
7935 2001-01-24 Jeff Sturm <jeff.sturm@commerceone.com>
7937 * zextract.c (read_zip_archive): Read file_offset before writing
7938 zipd and consequently clobbering the header contents.
7940 2001-01-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7942 * Make-lang.in: Remove all dependencies on defaults.h.
7943 * decl.c: Don't include defaults.h.
7945 * parse.y: Likewise.
7947 2001-01-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
7949 * ChangeLog (2001-01-21): Fixed typo.
7950 * class.c (layout_class_method): Code accounting for WFLed
7951 method DECL_NAMEs deleted.
7952 * constant.c (find_methodref_index): Likewise.
7953 * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
7954 * java-tree.h (DECL_FUNCTION_WFL): New macro.
7955 (struct lang_decl): New field `wfl'.
7956 (java_get_real_method_name): Prototype deleted.
7957 * mangle.c (mangle_method_decl): Code accounting for WFLed
7958 method DECL_NAMEs deleted.
7959 * parse.h (GET_METHOD_NAME): Macro deleted.
7960 * parse.y (reset_method_name): Deleted.
7961 (method_header): Set DECL_FUNCTION_WFL.
7962 (check_abstract_method_header): Code accounting for WFLed method
7964 (java_get_real_method_name): Deleted.
7965 (check_method_redefinition): Code accounting for WFLed method
7966 DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
7967 (java_check_regular_methods): Likewise.
7968 (java_check_abstract_methods): Likewise.
7969 (java_expand_classes): Don't call `reset_method_name.'
7970 (search_applicable_method_list): Use DECL_NAMEs instead of
7972 * typeck.c (lookup_do): Code accounting for WFLed method
7975 2001-01-25 Richard Earnshaw <rearnsha@arm.com>
7977 * lex.c (java_read_char): Check for EOF from getc first.
7979 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
7981 * class.c (layout_class): Don't lay the superclass out if it's
7982 already being laid out.
7983 * jcf-parse.c (handle_innerclass_attribute): New function.
7984 (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
7985 handle_innerclasses_attribute.
7986 (jcf_parse): Don't load an innerclasses if it's already being
7988 * jcf-write.c (append_innerclass_attribute_entry): Static
7989 `anonymous_name' and its initialization deleted. `ocii' and `ini'
7990 to be zero for anonymous classes.
7992 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
7994 * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
7996 * jcf-parse.c (set_source_filename): Use
7997 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
7999 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
8001 * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
8002 gets a unique asm name.
8004 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
8006 * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
8007 (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
8009 (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
8010 * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
8011 * parse.y (lookup_package_type_and_set_next): Deleted.
8012 (resolve_package): Removed unnecessary code.
8013 (find_applicable_accessible_methods_list): `finit$' can't be
8015 * verify.c (pop_argument_types): Added missing prototype.
8017 2001-01-23 Bryce McKinlay <bryce@albatross.co.nz>
8019 * config-lang.in: Disable java by default.
8021 2001-01-23 Tom Tromey <tromey@redhat.com>
8023 * gcj.texi (Copying): New node.
8024 Added copyright information.
8026 2001-01-21 Per Bothner <per@bothner.com>
8028 Various fixes to allow compiling a compressed .jar/.zip archive.
8029 * zipfile.h (struct ZipFileCache): Replace by struct ZipFile.
8030 (struct ZipFile): Add fields name and next (from ZipFileCache).
8031 (struct ZipDirectory): New field zipf points to owning ZipFile.
8032 * jcf.h (struct ZipDirectory): Add forward declaration.
8033 (struct JCF): Declare zipd field to have type struct ZipDirectory.
8034 Remove seen_in_zip and zip_offset fields.
8035 (JCF_SEEN_IN_ZIP): New macro.
8036 * zextract.c (read_zip_archive): Set ZipDirectory's zipf field.
8037 * jcf-io.c: Change all ZipFileCache to ZipFile.
8038 (read_zip_member): New function.
8039 (open_in_zip): Call read_zip_member.
8040 * jcf-parse.c (find_in_current_zip): Remove function.
8041 (read_class): Merge in find_in_current_zip functionality.
8042 Call read_zip_member if needed.
8043 (parse_zip_file_entries): Use read_zip_member.
8044 (process_zip_dir): Update for removed and added JCF fields.
8045 (jcf_figure_file_type): Re-use, don't copy initial ZipFile struct.
8047 2001-01-21 Per Bothner <per@bothner.com>
8049 Minor optimization of static ggc roots.
8050 * jcf-parse.c (parse_roots): New static field.
8051 (current_field, current_method, current_file_list): Replace by macros
8052 naming fields of parse_roots.
8053 (init_jcf_parse): Combine 3 ggc_add_tree_root calls to 1.
8054 * class.c (class_roots): New static field.
8055 (registered_class, fields_ident, info_ident, class_list):
8056 New macros naming fields of parse_roots.
8057 (build_static_field_ref): Don't register roots here.
8058 (layout_class): Static field list replaced by macro class_list.
8059 (init_class_processing): Call ggc_add_tree_root for 4 roots.
8060 Initialize fields_ident and info_ident here.
8062 2001-01-21 Per Bothner <per@bothner.com>
8064 * jcf-parse.c (ggc_mark_jcf): New function.
8065 (init_jcf_parse): Register current_jcf as ggc root.
8067 2001-01-21 Per Bothner <per@bothner.com>
8069 * lang.c (put_decl_node): Print method's name.
8071 2001-01-21 Per Bothner <per@bothner.com>
8073 * verify.c (VERIFICATION_ERROR_WITH_INDEX): New macro.
8074 (verify_jvm_instructions): Use it, for better error messages on loads.
8076 2001-01-21 Per Bothner <per@bothner.com>
8078 * verify.c (merge_type_state): Still may have to merge even if
8079 LABEL_VERIFIED (label).
8081 2001-01-21 Per Bothner <per@bothner.com>
8083 * parse.y (method_header): Don't set the DECL_NAME of a FUNCTION_DECL
8084 to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
8086 2001-01-19 Per Bothner <per@bothner.com>
8088 * expr.c (pop_type_0): Only return object_ptr_type_node on mismatch
8089 if expeting an interface type. Refines Tom's change of 2000-09-12.
8091 2001-01-18 Per Bothner <per@bothner.com>
8093 * gcj.texi (Input Options): Mention .java files.
8095 2001-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8097 * lang-options.h (-Wunsupported-jdk11): Removed.
8098 * lang.c (flag_not_overriding): Deleted.
8099 (flag_static_local_jdk1_1): Likewise.
8100 (lang_W_options): Removed "unsupported-jdk11" entry.
8101 * parse.y (java_check_methods): Removed dead code.
8103 2001-01-17 Tom Tromey <tromey@redhat.com>
8105 Changes suggested by Per Bothner:
8106 * gcj.texi (Input Options): Don't mention input files.
8107 (Code Generation): Updated --main information.
8108 (Invoking jcf-dump): Mention that --javap is incomplete.
8109 From Alexandre Petit-Bianco:
8110 (Warnings): Don't mention -Wunsupported-jdk11.
8112 (Compatibility): Mention JDK 1.2-ness of libraries.
8113 (Resources): Mention resources used when writing gcj.
8115 2001-01-17 Tom Tromey <tromey@redhat.com>
8117 * gcj.texi: New file.
8118 * Make-lang.in ($(srcdir)/java/gcj.info): New target.
8119 (java.info): Depend on gcj.info.
8120 (java/gcj.dvi): New target.
8121 (java.dvi): Depend on gcj.dvi.
8122 (java.install-info): Wrote.
8124 2001-01-16 Jeff Sturm <jeff.sturm@appnet.com>
8126 * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
8127 having called make_decl_rtl.
8129 2001-01-14 Per Bothner <per@bothner.com>
8131 Various patches to emit better messages on verification errors.
8132 * expr.c (push_type_0): Return error indication on stack overflow,
8133 instead of callinfg fatal.
8134 (push_type): Now just call push_type_0 (nd fatal on overflow).
8135 (pop_type_0): Return detailed error message (in a char** argument).
8136 (pop_type): If pop_type_0 fails, print error message.
8137 (pop_argument_types): Moved to verify.c.
8138 * verify.c (pop_argument_types): Moved from expr.c.
8139 Return a (possible) error message, rather than void.
8140 (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING): New macros.
8141 (verify_jvm_instruction): Use new macros, improving error messages.
8142 For case OPCODE_astore use object_ptr_type_node.
8143 * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED): New macros.
8144 (pop_type_0, push_type_0, pop_argument_types): Update accordingly.
8146 * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
8147 constant, return body without wrapper. (Improves constant folding.)
8148 * lex.c (build_wfl_node): Clear TREE_TYPE from returned node.
8150 2001-01-13 Per Bothner <per@bothner.com>
8152 * expr.c (expand_java_field_op): Assigning to a final field outside
8153 an initializer does not violate JVM spec, so should be warning, not
8154 error. (Sun's verifier does not complain - though MicroSoft's does.)
8156 2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk>
8158 * gjavah.c (version), jcf-dump.c (version): Update copyright year
8161 2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
8163 * parse.y (resolve_expression_name): Permit instance variables from
8164 enclosing context in super constructor call.
8165 (resolve_qualified_expression_name): Permit enclosing class's qualified
8166 "this" in super constructor call.
8168 2001-01-10 Mark Mitchell <mark@codesourcery.com>
8170 * class.c (build_utf8_ref): Remove last argument in call to
8171 make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
8172 (build_class_ref): Likewise.
8173 (build_static_field_ref): Likewise.
8174 (get_dispatch_table): Likewise.
8175 (layout_class_method): Likewise.
8176 (emit_register_classes): Likewise.
8177 * constants.c (build_constant_data_ref): Likewise.
8178 * decl.c (builtin_function): Likewise.
8179 (create_primitive_vtable): Likewise.
8180 * expr.c (build_known_method_def): Likewise.
8181 (build_jni_stub): Likewise.
8182 (java_lang_expand_expr): Likewise.
8184 2001-01-10 Tom Tromey <tromey@redhat.com>
8186 * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
8188 2001-01-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
8190 * java-tree.h (lang_printable_name_wls): New prototype.
8191 * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
8192 rather than `current_class' to print type name. Don't prepend type
8193 names when printing constructor names.
8194 (lang_printable_name_wls): New function.
8195 * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
8196 `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
8197 * parse.y (patch_method_invocation): Message tuned for constructors.
8198 (not_accessible_p): Grant `private' access from within
8201 2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
8203 All files with updated copyright when applicable.
8204 * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
8205 * class.c (mangle_class_field): Function removed.
8206 (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
8207 (utf8_cmp, cxx_keyword_p): Moved to lex.c.
8208 (build_class_ref): Call `java_mangle_class_field' instead of
8209 `mangle_class_field.'
8210 (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
8211 (layout_class): Call `java_mangle_decl' instead of
8212 `mangle_static_field.'
8213 (cxx_keywords): Initialized static array moved to `lex.c.'
8214 (layout_class_method): Changed leading comment. Simplified to
8215 call `java_mangle_decl.' Local `ptr' moved in for loop body.
8216 * decl.c (lang_mark_tree): Mark field `package_list.'
8217 * java-tree.h (TYPE_PACKAGE_LIST): New macro.
8218 (struct lang_type): New field `package_list.'
8219 (unicode_mangling_length): Prototype removed.
8220 (append_gpp_mangled_name, append_gpp_mangled_classtype,
8221 emit_unicode_mangled_name): Likewise.
8222 (cxx_keyword_p): New prototype.
8223 (java_mangle_decl, java_mangle_class_field,
8224 java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
8225 * jcf-parse.c (jcf_parse_source): Constify `file' argument to
8227 * jvgenmain.c (main_method_prefix): Global variable removed.
8228 (main_method_suffix): Likewise.
8229 (do_mangle_classname): New function.
8230 (main): Call it. Format changed to accommodate new mangling scheme.
8231 * lex.c: (utf8_cmp): Conditionally prototyped.
8232 (cxx_keywords): Moved from class.c, conditionally defined.
8233 (utf8_cmp, cxx_keyword_p): Likewise.
8234 * mangle.c (obstack.h, ggc.h): Included.
8235 (mangle_field_decl): New function.
8236 (mangle_method_decl, mangle_type, mangle_pointer_type,
8237 mangle_array_type, mangle_record_type,
8238 find_compression_pointer_match, find_compression_array_match,
8239 find_compression_record_match,
8240 find_compression_array_template_match, set_type_package_list,
8241 entry_match_pointer_p, emit_compression_string, init_mangling,
8242 finish_mangling, compression_table_add, mangle_member_name): Likewise.
8243 (mangle_obstack): New global.
8244 (MANGLE_RAW_STRING): New macro.
8245 (unicode_mangling_length): Turned static.
8246 (append_unicode_mangled_name): Renamed from
8247 `emit_unicode_mangled_name.' Turned static. `mangle_obstack'
8248 replaces `obstack', removed from the parameter list.
8249 (append_gpp_mangled_name): Turned static. `mangle_obstack'
8250 replaces parameter `obstack', removed from the parameter list. Call
8251 `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
8252 (append_gpp_mangled_classtype): Removed.
8253 (compression_table, compression_next): New static variables.
8254 * parse.y (temporary_obstack): Extern declaration removed.
8256 2001-01-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
8258 * parse.y (patch_binop): Compute missing type in error situations.
8260 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
8262 * class.c (make_class_data): Push initial value for "arrayclass".
8263 * decl.c (init_decl_processing): Add new class field "arrayclass".
8265 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
8267 From patha@softlab.ericsson.se:
8268 * parse.y (switch_label): Use build, not build1, to construct
8271 2001-01-04 Neil Booth <neil@daikokuya.demon.co.uk>
8273 * lang.c (lang_decode_option): Change -MA to -MP.
8274 * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
8275 Update to new prototype; do quote targets.
8276 (jcf_dependency_write): Update.
8278 2000-12-22 Bryce McKinlay <bryce@albatross.co.nz>
8280 Shorten primitive array allocation path:
8281 * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
8282 to create new primitive arrays.
8283 * expr.c (build_newarray): If generating native code, call
8284 soft_newarray_node with a reference to the primitive TYPE identifier
8285 instead of type_value.
8287 2000-12-17 Bryce McKinlay <bryce@albatross.co.nz>
8289 Fix for PRs gcj/312 and gcj/253:
8290 * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
8291 dest if they arn't already.
8292 * class.c (layout_class): Call maybe_layout_super_class on
8293 superinterfaces also, but only if compiling from bytecode.
8296 * parse.y (create_class): Set ACC_STATIC if class is declared in an
8299 2000-12-15 Tom Tromey <tromey@redhat.com>
8301 * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
8304 2000-12-14 Andrew Haley <aph@redhat.com>
8306 * boehm.c (mark_reference_fields): Change test to correctly detect
8309 2000-12-15 Andreas Jaeger <aj@suse.de>
8311 * config-lang.in (lang_dirs): Added.
8313 2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
8315 * parse.y (end_artificial_method_body): Fixed undefined behavior.
8316 Credits go to rth for finding it.
8318 2000-12-13 Mike Stump <mrs@wrs.com>
8320 * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
8322 2000-11-07 Tom Tromey <tromey@cygnus.com>
8324 * Make-lang.in (JAVA_LEX_C): Added chartables.h.
8325 * lex.c (java_ignorable_control_p): Removed.
8326 (java_letter_or_digit_p): Removed.
8327 (java_start_char_p): New function.
8328 (java_read_char): Return `int', not `unicode_t'. Changed
8330 (java_read_unicode): Likewise.
8331 (java_read_unicode_collapsing_terminators): Likewise.
8332 (java_get_unicode): Likewise.
8333 (java_new_lexer): Initialize hit_eof.
8334 (java_parse_end_comment): Take `int' argument.
8335 (java_parse_doc_section): Likewise.
8336 (java_parse_escape_sequence): Don't allow backlash-newline.
8338 * lex.h (JAVA_DIGIT_P): Removed.
8339 (_JAVA_LETTER_OR_DIGIT_P): Removed.
8340 (_JAVA_IDENTIFIER_IGNORABLE): Removed.
8341 (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
8342 (JAVA_PART_CHAR_P): New macro.
8344 (JAVA_CHAR_ERROR): Now -2.
8345 (java_lexer): New field `hit_eof'.
8346 * chartables.h: New file.
8347 * gen-table.pl: new file.
8349 2000-11-20 Tom Tromey <tromey@cygnus.com>
8350 Alexandre Petit-Bianco <apbianco@cygnus.com>
8352 * parse.y (java_complete_lhs): Only allow compound assignment of
8353 reference type if type is String.
8355 2000-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
8357 * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
8358 jcf-path.c: Likewise.
8360 2000-12-09 Anthony Green <green@redhat.com>
8362 * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
8363 filestart and filename_length as int values.
8365 2000-12-07 Mo DeJong <mdejong@redhat.com>
8367 * jcf-io.c (find_class): Correct the logic that tests to see if a
8368 .java file is newer than its .class file. The compiler was
8369 incorrectly printing a warning when file mod times were equal.
8371 2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
8373 * jvgenmain.c: Use ISPRINT not isascii.
8375 2000-12-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
8377 * parse.y (end_artificial_method_body): Fixed typo.
8379 2000-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
8381 * parse.y (patch_method_invocation): Pick the correct enclosing
8382 context when creating inner class instances.
8385 2000-11-26 Joseph S. Myers <jsm28@cam.ac.uk>
8387 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
8388 Update copyright year to 2000.
8390 2000-11-23 Anthony Green <green@redhat.com>
8392 * jcf-parse.c (init_jcf_parse): Register current_file_list root.
8393 Move current_file_list out of yyparse and make it static.
8395 * expr.c: Declare quick_stack and tree_list_free_list as static
8396 (init_expr_processing): Register quick_stack and
8397 tree_list_free_list roots.
8399 2000-11-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
8401 * parse.y (build_outer_field_access): New local `decl_ctx', use
8402 it. Check for field's context and current class immediate outer
8403 context inheritance.
8404 (outer_field_access_p): Consider fields inherited from the last
8406 (build_access_to_thisn): Stop at the last enclosing context if
8410 2000-11-23 J"orn Rennecke <amylaar@redhat.com>
8412 * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
8414 2000-11-22 Bryce McKinlay <bryce@albatross.co.nz>
8416 * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
8419 2000-11-20 Tom Tromey <tromey@cygnus.com>
8421 * jv-scan.c (help): Document --complexity.
8422 (options): Added --complexity.
8423 (flag_complexity): New global.
8424 (main): Call `report'.
8425 * parse-scan.y (complexity): New global.
8426 (if_then_statement, if_then_else_statement,
8427 if_then_else_statement_nsi, switch_block_statement_group,
8428 while_expression, do_statement, for_begin, continue_statement,
8429 throw_statement, catch_clause, finally, method_invocation,
8430 conditional_and_expression, conditional_or_expression,
8431 conditional_expression): Update complexity.
8432 (reset_report): Reset complexity.
8433 (report): New function.
8435 2000-11-20 Tom Tromey <tromey@cygnus.com>
8437 * lex.c (yylex): Added STRICT_TK case.
8438 * parse.y (STRICT_TK): Added.
8439 * parse-scan.y (STRICT_TK): Added.
8440 * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
8441 `;'. Use 4, not 3, with -k option. Correctly rename resulting
8443 * keyword.h: Rebuilt.
8444 * keyword.gperf (strictfp): Added.
8446 2000-11-20 Tom Tromey <tromey@cygnus.com>
8448 * lex.c (yylex): Recognize floating point constants with leading
8451 2000-11-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8453 * java-tree.h (cyclic_inheritance_report): Constify.
8454 * parse.y (cyclic_inheritance_report): Likewise.
8456 2000-11-17 Zack Weinberg <zack@wolery.stanford.edu>
8458 * parse.y (goal): Remove call to ggc_add_string_root.
8460 2000-11-16 Zack Weinberg <zack@wolery.stanford.edu>
8462 * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
8463 Create string in scratch buffer, then pass to build_string.
8465 2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
8467 * parse.y (issue_warning_error_from_context): Add
8470 2000-11-11 Anthony Green <green@redhat.com>
8472 * jcf-parse.c (process_zip_dir): Add finput parameter.
8473 (jcf_figure_file_type): Call process_zip_dir with appropriate
8476 2000-11-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8478 * decl.c (copy_lang_decl): Use memcpy, not bcopy.
8479 * jcf-parse.c (jcf_figure_file_type): Likewise.
8481 2000-11-09 Joseph S. Myers <jsm28@cam.ac.uk>
8483 * parse.y (create_new_parser_context): Use memset () instead of
8486 2000-11-08 Tom Tromey <tromey@cygnus.com>
8488 * gjavah.c (process_file): Only include gcj/cni.h when generating
8491 2000-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
8493 * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
8494 (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
8495 instead of bzero ().
8497 2000-11-05 Tom Tromey <tromey@cygnus.com>
8499 * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
8500 * lex.c (IS_ZERO): New define.
8501 (java_perform_atof): Error on floating point underflow.
8503 2000-11-04 Tom Tromey <tromey@cygnus.com>
8505 * lex.c (java_parse_escape_sequence): Only read two octal
8506 characters if the first one is greater than 3. Don't allow
8507 "octal" numbers to include the digits 8 or 9.
8509 2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
8511 * Make-lang.in (java.distdir): Remove.
8513 2000-11-03 Tom Tromey <tromey@cygnus.com>
8515 * Make-lang.in (java.dvi): New target.
8516 Partial fix for PR other/567.
8518 * lang-options.h: Mention -Wout-of-date.
8519 * jcf-dump.c (flag_newer): New global.
8520 * gjavah.c (flag_newer): New global.
8521 * jcf-io.c (find_class): Only warn when flag_newer set.
8522 * lang.c (flag_newer): New global.
8523 (struct string_option): New declaration.
8524 (lang_W_options): New global.
8525 (process_option_with_no): New function.
8526 (lang_decode_option): Use it.
8528 * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
8529 * gjavah.c (cxx_keyword_subst): Handle any number of trailing
8532 * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
8533 (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
8534 * lex.c (java_read_unicode): Removed `term_context' argument.
8535 Recognize any number of `u' in `\u'.
8536 (java_read_unicode_collapsing_terminators): New function.
8537 (java_get_unicode): Use it.
8538 (java_lineterminator): Removed.
8539 (yylex): Produce error if character literal is newline or single
8540 quote. Return if eof found in middle of `//' comment. EOF in
8541 `//' comment is only an error if pedantic.
8542 (java_ignorable_control_p): New function.
8543 (java_parse_end_comment): Return if eof found in middle of
8546 * jv-scan.c (pedantic): New global.
8548 2000-10-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
8550 * parse.y (outer_field_access_p): Inherited fields aren't
8551 consider outer fields.
8552 (maybe_build_thisn_access_method): Use
8553 PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
8554 (resolve_expression_name): Trigger an error if a static field
8555 is being accessed as an outer field.
8557 2000-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8559 * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
8562 2000-10-27 Zack Weinberg <zack@wolery.stanford.edu>
8564 * Make-lang.in: Move all build rules here from Makefile.in,
8565 adapt to new context. Wrap all rules that change the current
8566 directory in parentheses. Expunge all references to $(P).
8567 When one command depends on another and they're run all at
8568 once, use && to separate them, not ;. Add OUTPUT_OPTION to
8569 all object-file generation rules. Delete obsolete variables.
8571 * Makefile.in: Delete.
8572 * config-lang.in: Delete outputs= line.
8574 2000-10-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
8576 * parse.y (patch_method_invocation): NULLify this_arg when already
8578 (maybe_use_access_method): Handle call to methods unrelated to the
8579 current class. Fixed comment.
8582 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8584 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
8587 2000-10-24 Tom Tromey <tromey@cygnus.com>
8589 * lex.c (java_new_lexer): Initialize new fields. Work around
8590 broken iconv() implementations.
8591 (java_read_char): Swap bytes if required. Use fallback decoder if
8593 (byteswap_init, need_byteswap): New globals.
8594 (java_destroy_lexer): Only close iconv handle if it is in use.
8595 * lex.h (java_lexer): New fields read_anything, byte_swap,
8597 Made out_buffer unsigned.
8599 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8601 * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
8602 where an enclosing context can be set on the jdep.
8603 (do_resolve_class): Fixed identation.
8605 2000-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8607 * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
8609 * jcf-reader.c (peek_attribute, skip_attribute): Only define
8612 * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
8614 * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
8616 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
8618 * jcf-write.c (OP1): Update `last_bc'.
8619 (struct jcf_block): Fixed indentation and typo in comments. New
8621 (generate_bytecode_insns): Insert `nop' if `jsr' immediately
8622 follows `monitorenter'.
8623 * parse.y (patch_synchronized_statement): New local `tmp'. Call
8627 2000-10-16 Tom Tromey <tromey@cygnus.com>
8629 * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
8630 * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
8631 * lang-options.h: Added -MA, -MT, -MF..
8632 * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
8633 (DEPEND_TARGET_SET): New macro.
8634 (DEPEND_FILE_ALREADY_SET): Likewise.
8635 (init_parse): Handle new flags.
8636 * jcf.h (jcf_dependency_print_dummies): Declare.
8637 * Make-lang.in (s-java): Added mkdeps.o.
8638 * Makefile.in (BACKEND): Added mkdeps.o.
8639 (../gcjh$(exeext)): Added mkdeps.o.
8640 (../jcf-dump$(exeext)): Added mkdeps.o.
8641 * jcf-depend.c: Include mkdeps.h.
8642 (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
8643 add_entry): Removed.
8644 (jcf_dependency_reset): Rewrote.
8645 (dependencies): New global.
8646 (jcf_dependency_set_target): Rewrote.
8647 (jcf_dependency_add_target): Likewise.
8648 (jcf_dependency_add_file): Likewise.
8650 (print_ents): Removed.
8651 (jcf_dependency_write): Rewrote.
8652 (print_dummies): New global.
8653 (jcf_dependency_print_dummies): New function
8654 (jcf_dependency_write): Call deps_dummy_targets if required.
8656 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
8658 * gjavah.c (add_class_decl): Removed unused variables `tname',
8659 `tlen' and `name_index'.
8660 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
8661 * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
8662 in `wfl_operator' with value.
8663 (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
8664 (jcf_figure_file_type): Fixed identation.
8665 * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
8666 * parse.y (analyze_clinit_body): New function.
8667 (static_initializer:): Reset `current_static_block'.
8668 (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
8669 `wfl_operator' with new value.
8670 (lookup_cl): Use EXPR_WFL_FILENAME.
8671 (maybe_yank_clinit): Handle bogus <clinit> bodies, call
8672 analyze_clinit_body.
8673 (build_outer_field_access): Access to this$<n> built from
8674 current_class, not its outer context.
8675 (build_access_to_thisn): Fixed leading comment. Tidied things up.
8676 (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
8677 (patch_method_invocation): Use `is_static_flag' when already
8679 (patch_newarray): Removed assignment in ternary operator.
8681 2000-10-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8683 * except.c (free_eh_ranges): Don't free `whole_range'.
8685 2000-10-15 Anthony Green <green@redhat.com>
8687 * decl.c (init_decl_processing): Call init_class_processing before
8690 2000-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8692 * check-init.c (check_init): Fixed leading comment. Use
8694 * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
8695 (give_name_to_locals): Likewise.
8696 (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
8697 fields in lang_decl_var.
8698 * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
8699 DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
8700 (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
8701 (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
8702 DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
8703 (LOCAL_FINAL): Rewritten.
8704 (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
8705 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
8706 (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
8707 `init_final' fields.
8708 (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
8709 `final_uid', `final_liic', `final_ierr' and `local_final' fields.
8710 (TYPE_HAS_FINAL_VARIABLE): New macro.
8711 (struct lang_type): Added `afv' field.
8712 * parse.y (check_static_final_variable_assignment_flag): New function.
8713 (reset_static_final_variable_assignment_flag): Likewise.
8714 (check_final_variable_local_assignment_flag): Likewise.
8715 (reset_final_variable_local_assignment_flag): Likewise.
8716 (check_final_variable_indirect_assignment): Likewise.
8717 (check_final_variable_global_assignment_flag): Likewise.
8718 (add_inner_class_fields): Use LOCAL_FINAL_P.
8719 (register_fields): Handle local finals and final variables.
8720 (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
8721 (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
8722 (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
8724 (java_complete_expand_methods): Loop to set
8725 TYPE_HAS_FINAL_VARIABLE. Call
8726 `reset_final_variable_local_assignment_flag' and
8727 `check_final_variable_local_assignment_flag' accordingly before
8728 and after constructor expansion. Call
8729 `reset_static_final_variable_assignment_flag'
8730 before expanding <clinit> and after call
8731 `check_static_final_variable_assignment_flag' if the
8732 current_class isn't an interface. After all methods have been
8733 expanded, call `check_final_variable_global_assignment_flag' and
8734 `check_static_final_variable_assignment_flag' if the current class
8736 (maybe_yank_clinit): Fixed typo in comment.
8737 (build_outer_field_access_methods): Removed old sanity check. Use
8738 FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
8739 Don't create access methods for finals.
8740 (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
8741 (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
8742 existing DECL_INIT has been processed.
8743 (java_complete_lhs): Likewise.
8744 (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
8745 Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
8747 (patch_assignment): Use LOCAL_FINAL_P.
8748 (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
8749 DECL_INITIAL is nullified.
8752 2000-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8754 * Make-lang.in (parse.c, parse-scan.c): Create atomically.
8756 * Makefile.in (parse.c, parse-scan.c): Likewise.
8758 2000-10-12 Mark Mitchell <mark@codesourcery.com>
8760 * class.c (temporary_obstack): Remove.
8761 (make_class): Don't mess with obstascks.
8762 (push_class): Likewise.
8763 (set_super_info): Likewise.
8764 (add_method_1): Likewise.
8765 (add_method): Likewise.
8766 (add_field): Likewise.
8767 (build_utf8_ref): Likewise.
8768 (build_class_ref): Likewise.
8769 (build_static_field_ref): Likewise.
8770 (finish_class): Likewise.
8771 (push_super_field): Likewise.
8772 (layout_class): Likewise.
8773 (layout_class_methods): Likewise.
8774 (init_class_processing): Likewise.
8775 * constants.c (get_tag_node): Likewise.
8776 (build_constant_data_ref): Likewise.
8777 * decl.c (ggc_p): Remove.
8778 (copy_lang_decl): Use ggc_alloc.
8779 (complete_start_java_method): Don't mess with obstacks.
8780 (start_java_method): Likewise.
8781 (end_java_method): Likewise.
8782 * except.c (link_handler): Use xmalloc.
8783 (free_eh_ranges): New function.
8784 (method_init_exceptions): Use it.
8785 (add_handler): Use xmalloc.
8786 (expand_start_java_handler): Don't mess with obstacks.
8787 (prepare_eh_table_type): Likewise.
8788 (expand_end_java_handler): Likewise.
8789 * expr.c (push_value): Likewise.
8790 (create_label_decl): Likewise.
8791 (build_jni_stub): Likewise.
8792 (java_lang_expand_expr): Likewise.
8793 (note_instructions): Use xrealloc.
8794 (java_push_constant_from_pool): Don't mess with obstacks.
8795 (process_jvm_instruction): Likewise.
8796 * java-tree.h (cyclic_inheritance_report): Remove duplicate
8798 * jcf-parse.c (get_constant): Don't mess with obstacks.
8799 (read_class): Likewise.
8800 (jcf_parse): Likewise.
8801 * lex.c (expression_obstack): Remove.
8802 (java_lex): Don't use obstack_free.
8803 * parse.h (exit_java_complete_class): Don't mess with obstacks.
8804 (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
8805 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
8806 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
8807 * parse.y (gaol): Add more GC roots.
8808 (add_inner_class_fields): Adjust calls to MANGLE_* macros.
8809 (lookup_field_wrapper): Likewise.
8810 (obtain_incomplete_type): Don't mess with obstacks.
8811 (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
8813 (craft_constructor): Don't mess with obstacks.
8814 (safe_layout_class): Likewise.
8815 (java_complete_class): Likewise.
8816 (source_end_java_method): Likewise.
8817 (build_outer_field_access_methods): Likewise.
8818 (build_outer_method_access_method): Likewise.
8819 (maybe_build_thisn_access_method): Likewise.
8820 (build_dot_class_method_invocation): Likewise.
8821 (java_complete_tree): Likewise.
8822 (java_complete_lhs): Likewise.
8823 (do_merge_string_cste): Likewise.
8824 (patch_string_cst): Likewise.
8825 (array_constructor_check_entry): Likewise.
8826 * typeck.c (build_java_array_type): Likewise.
8827 (parse_signature_string): Likewise.
8828 (build_java_signature): Likewise.
8830 2000-10-12 Tom Tromey <tromey@cygnus.com>
8833 * gjavah.c (add_class_decl): Don't special-case inner classes.
8834 (add_namelet): Likewise.
8836 2000-10-11 Rodney Brown <RodneyBrown@mynd.com>
8838 * java-tree.h: Constify current_encoding.
8839 * lang.c: Constify current_encoding.
8841 2000-10-10 Jeff Sturm <jeff.sturm@appnet.com>
8843 * jvgenmain.c (class_mangling_suffix): Omit `.'.
8844 (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
8846 2000-10-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8848 * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
8849 patch. Fixes gcj/340.
8851 2000-10-10 Tom Tromey <tromey@cygnus.com>
8853 * lex.c (java_new_lexer): Initialize out_first and out_last
8855 * lex.h (java_lexer): Added out_buffer, out_first, out_last.
8857 2000-10-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
8859 * parse.y (pop_current_osb): New function.
8860 (array_type:): Use `dims:', changed actions
8861 accordingly. Suggested by Anthony Green.
8862 (array_creation_expression:): Used pop_current_osb.
8863 (cast_expression:): Likewise.
8864 (search_applicable_method_list): Fixed indentation.
8866 2000-10-08 Anthony Green <green@redhat.com>
8868 * parse.y (array_type_literal): Remove production.
8869 (type_literals): Refer to array_type, not array_type_literal.
8871 2000-10-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
8873 Patch contributed by Corey Minyard.
8874 * decl.c (check_local_named_variable): New function.
8875 (tree check_local_unnamed_variable): Likewise.
8876 (find_local_variable): Splitted. Call check_local_{un}named_variable.
8878 2000-10-07 Anthony Green <green@redhat.com>
8880 * class.c (layout_class): Handle case where superclass can't be
8883 2000-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
8885 * Makefile.in (keyword.h): Refer to GNU FTP site for updated
8888 2000-10-05 Tom Tromey <tromey@cygnus.com>
8890 * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
8891 * jvgenmain.c (class_mangling_prefix): Removed.
8892 (class_mangling_suffix): New global.
8894 * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
8896 (print_method_info): Handle overrides for static and final
8898 (process_file): Generate declaration for class object field.
8899 * class.c (cxx_keywords): New array.
8900 (utf8_cmp): New function.
8901 (cxx_keyword_p): New function.
8902 (layout_class_method): Mangle C++ keywords by appending `$'.
8903 (mangle_field): New function.
8904 (mangle_class_field): Use mangle_field. Mangle class name as
8906 (mangle_static_field): Use mangle_field.
8908 2000-10-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
8910 * decl.c (find_local_variable): Removed uncessary type check and
8911 fixed range check typo. From Corey Minyard.
8913 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8915 * decl.c (give_name_to_locals): New local `code_offset'. Call
8916 `maybe_adjust_start_pc'.
8917 * expr.c (note_instructions): New function.
8918 (expand_byte_code): Don't collect insn starts here.
8919 (peek_opcode_at_pc): New function.
8920 (maybe_adjust_start_pc): Likewise.
8921 * java-tree.h (maybe_adjust_start_pc): Declare.
8922 (note_instructions): Likewise.
8923 * jcf-parse.c (parse_class_file): Call `note_instructions'.
8925 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
8927 * parse.y (field_access:): Fixed indentation.
8928 (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
8930 2000-09-07 Tom Tromey <tromey@cygnus.com>
8933 * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
8934 JPRIMITIVE_TYPE_P, for arithmetic operators.
8935 (patch_method_invocation): Indentation fix.
8936 (try_builtin_assignconv): Handle boolean specially. Fixed typo.
8937 (valid_builtin_assignconv_identity_widening_p): Handle boolean.
8938 (do_unary_numeric_promotion): Cleaned up code.
8939 (valid_cast_to_p): Handle boolean correctly.
8941 2000-09-27 Tom Tromey <tromey@cygnus.com>
8943 * lex.c (java_read_unicode): Reset bs_count when finished with
8946 2000-10-01 Mark Mitchell <mark@codesourcery.com>
8949 * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
8950 * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
8951 (typeck.o): Depend on ggc.h.
8952 * class.c (add_method_1): Use GC functions for allocation.
8953 (init_class_processing): Register roots.
8954 * decl.c (ggc_p): Set to 1.
8955 (pending_local_decls): Make it static.
8956 (push_jvm_slot): Use GC functions for allocation.
8957 (init_decl_processing): Register roots.
8958 (give_name_to_locals): Use GC functions for allocation.
8959 (lang_mark_tree): New function.
8960 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
8961 functions for allocation.
8962 * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
8963 * lex.c (java_lex): Use build_string, rather than replicating it
8965 * parse.y (goal): Add more roots.
8966 (mark_parser_ctxt): New function.
8967 * typeck.c: Include ggc.h.
8969 2000-09-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8971 * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
8972 contains something else than MODIFY_EXPR.
8974 2000-09-23 Mark Mitchell <mark@codesourcery.com>
8976 * Make-lang.in (JAVA_SRCS): Include java-tree.h.
8977 * Makefile.in (parse.o): Depend on ggc.h.
8978 (class.o): Likewise.
8979 (constants.o): Likewise.
8982 (jcf-parse.o): Likewise.
8983 (jcf-write.o): Likewise.
8984 (mangle.o): Likewise.
8985 * class.c: Include ggc.h.
8986 (build_static_field_ref): Register GC roots.
8987 (layout_class): Likewise.
8988 (init_class_processing): Likewise.
8989 * constants.c: Include ggc.h.
8990 (current_constant_pool_data_ref): Remove.
8991 (tag_nodes): Move it to ...
8992 (get_tag_node): ... here. Register GC roots.
8993 * decl.c: Include ggc.h. Remove many global tree definitions.
8994 (throw_node): Define.
8995 (java_global_trees): Likewise.
8996 (predef_filenames): Make the size a constant.
8997 (init_decl_processing): Adjust accordingly.
8998 (init_decl_processing): Call init_jcf_parse. Register GC roots.
8999 * expr.c: Include ggc.h.
9000 (init_expr_processing): Register GC roots.
9001 (build_invokeinterface): Likewise.
9002 * java-tree.h: Replace extern tree declarations with macros.
9003 (java_global_trees): New variable.
9004 (java_tree_index): New enumeration.
9005 (init_jcf_parse): Declare.
9006 * jcf-parse.c: Include ggc.h.
9007 (current_class): Remove declaration.
9008 (main_class): Likewise.
9009 (all_class_list): Likewise.
9010 (predefined_filename_p): Adjust for constant size of
9012 (init_jcf_parse): New function.
9013 * jcf-write.c: Include ggc.h.
9014 (generate_classfile): Register GC roots.
9015 (append_synthetic_attribute): Likewise.
9016 (append_innerclass_attribute_entry): Likewise.
9017 * lang.c: Include ggc.h.
9018 (lang_print_error): Register GC roots.
9019 * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
9021 * parse.y: Include ggc.h.
9022 (wfl_operator): Remove.
9023 (goal): Register GC roots.
9024 (java_pop_parser_context): Adjust for new field names.
9025 (java_parser_context_save_global): Likewse.
9026 (java_parser_context_restore_global): Likewise.
9027 (java_parser_context_suspend): Likewise.
9028 (java_parser_context_resume): Likewise.
9029 (verify_constructor_circularity): Register GC roots.
9030 (lookup_cl): Likewise.
9031 (java_reorder_fields): Likewise.
9032 (build_current_this): Likewise.
9033 (class_in_current_package): Likewise.
9034 (argument_types_convertible): Likewise.
9035 (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
9037 2000-09-14 Tom Tromey <tromey@cygnus.com>
9039 * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
9041 2000-09-13 Tom Tromey <tromey@cygnus.com>
9043 * jcf-parse.c: Include <locale.h>.
9044 * jv-scan.c: Include <locale.h>.
9046 2000-09-12 Tom Tromey <tromey@cygnus.com>
9048 * expr.c (pop_type_0): Return `Object' if trying to merge two
9050 * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
9051 interface types; `Object' is always a valid supertype.
9053 2000-09-12 Tom Tromey <tromey@cygnus.com>
9056 * jv-scan.c (help): Document --encoding.
9057 (options): Added `encoding' entry.
9058 (OPT_ENCODING): New define.
9059 (main): Handle --encoding.
9060 Include <langinfo.h> if nl_langinfo exists.
9061 * lang-options.h: Document --classpath, --CLASSPATH, --main, and
9063 * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
9064 (parse_source_file): Correctly call java_init_lex. Added `finput'
9065 argument. Use nl_langinfo to determine default encoding.
9066 * java-tree.h (current_encoding): Declare.
9067 * parse.y (java_parser_context_restore_global): Don't restore
9069 (java_parser_context_save_global): Don't set `finput' field.
9070 (java_pop_parser_context): Don't restore `finput'. Free old lexer
9072 * lang.c (current_encoding): New global.
9073 (lang_decode_option): Recognize `-fencoding='.
9074 (finish_parse): Don't close finput.
9075 * parse.h (struct parser_ctxt): Removed `finput' and
9076 `unget_utf8_value' fields. Added `lexer' field.
9077 (java_init_lex): Fixed declaration.
9078 * lex.c (java_new_lexer): New function.
9079 (java_destroy_lexer): Likewise.
9080 (java_read_char): Added `lex' argument. Handle iconv case.
9081 (java_read_unicode): Added `lex' argument. Count backslashes in
9083 (java_init_lex): Added `finput' and `encoding' arguments. Set
9084 `lexer' field in ctxp.
9085 (BAD_UTF8_VALUE): Removed.
9086 (java_lex): Handle seeing UEOF in the middle of a string literal.
9087 * lex.h: Include <iconv.h> if HAVE_ICONV defined.
9088 (java_lexer): New structure.
9091 (DEFAULT_ENCODING): New define.
9092 (java_destroy_lexer): Declare.
9094 2000-09-12 Tom Tromey <tromey@cygnus.com>
9097 * lex.c (java_init_lex): Initialize java_io_serializable.
9098 * parse.y (java_io_serializable): New global.
9099 (valid_ref_assignconv_cast_p): An array can be cast to
9102 2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
9104 * decl.c, expr.c: Include defaults.h if not already included.
9105 Don't define the *_TYPE_SIZE macros.
9107 2000-09-09 Geoffrey Keating <geoffk@cygnus.com>
9109 * typeck.c (build_java_array_type): Correct first parameter
9110 in ADJUST_FIELD_ALIGN invocation.
9112 2000-09-06 Tom Tromey <tromey@cygnus.com>
9114 * lang-specs.h: Also recognize `-femit-class-files'.
9116 2000-09-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
9118 * verify.c (merge_types): Load the types to merge if necessary.
9120 2000-09-02 Anthony Green <green@redhat.com>
9122 * jcf-io.c: Include zlib.h.
9123 (open_in_zip): Read compressed class file archives.
9124 * zipfile.h (ZipDirectory): Add uncompressed_size and
9125 compression_method fields.
9126 * zextract.c (read_zip_archive): Collect file compression info.
9128 2000-08-15 Bryce McKinlay <bryce@albatross.co.nz>
9130 * parse.y (do_resolve_class): Also explore superclasses of
9131 intermediate enclosing contexts when searching for inner classes.
9133 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
9135 * parse.y (variable_declarator_id:): Better error message.
9136 (expression_statement:): Use YYNOT_TWICE.
9137 (cast_expression:): Likewise.
9138 (assignment:): Likewise.
9140 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
9142 * parse.y (do_merge_string_cste): New locals. Create new
9143 STRING_CSTs each time, use memcpy. Fixes gcj/311.
9145 2000-08-07 Hans Boehm <boehm@acm.org>
9147 * boehm.c (mark_reference_fields): Set marking bits for all words in
9148 a multiple-word record.
9149 (get_boehm_type_descriptor): Use the procedure marking descriptor for
9152 2000-08-31 Mike Stump <mrs@wrs.com>
9154 * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
9155 jcf-dump$(exeext)): Make parallel safe.
9157 2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
9159 * jcf-parse.c (set_source_filename): Constify a char *.
9160 * jcf-write.c (append_innerclasses_attribute,
9161 make_class_file_name): Constify a char *. Don't recycle a
9162 variable for an unrelated purpose.
9163 * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
9164 (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
9166 2000-08-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
9168 * expr.c (can_widen_reference_to): Fixed indentation.
9169 * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
9170 * parse.y: `finit$' replaces `$finit$' in comments.
9171 (try_builtin_assignconv): Fixed leading comment.
9173 2000-08-25 Greg McGary <greg@mcgary.org>
9175 * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
9177 2000-08-24 Greg McGary <greg@mcgary.org>
9179 * lang.c (lang_decode_option): Use ARRAY_SIZE.
9180 * parse.y (BINOP_LOOKUP): Likewise.
9182 2000-08-22 Andrew Haley <aph@cygnus.com>
9184 * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
9185 sign extending. Fixes gcj/321.
9186 * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
9187 combining to make a jlong. Fixes gcj/321.
9189 2000-08-21 Nix <nix@esperi.demon.co.uk>
9191 * lang-specs.h: Do not process -o or run the assembler if
9194 2000-08-16 Andrew Haley <aph@cygnus.com>
9196 * typeck.c (build_java_array_type): Rewrite code to do array
9197 alignment. Take into account back-end macros when aligning array
9198 data. Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
9199 user to set alignment. Fixes gcj/252 and 160.
9201 2000-08-09 Tom Tromey <tromey@cygnus.com>
9203 * parse.y (check_abstract_method_definitions): Now return `int'.
9204 Check implemented interfaces. Fixes PR gcj/305.
9206 * parse.y (patch_switch_statement): Disallow `long' in switch
9207 expressions. Fixes PR gcj/310.
9209 2000-08-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
9211 * decl.c (finit_leg_identifier_node): New global.
9212 (init_decl_processing): Use `finit$' to initialize
9213 finit_identifier_node. Use `$finit$' to initialize
9214 finit_leg_identifier_node.
9215 * expr.c (expand_java_field_op): Use ID_FINIT_P.
9216 * java-tree.h (finit_identifier_node): Changed attached comment.
9217 (finit_leg_identifier_node): New declaration.
9218 (ID_FINIT_P): Take finit_identifier_node and
9219 finit_leg_identifier_node into account. This is a backward
9222 2000-08-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9224 * jcf-write.c (generate_bytecode_conditional): Re-installed lost
9226 (generate_bytecode_insns): Check `nargs' before emitting it.
9227 * verify.c (merge_type_state): Fixed typo.
9228 * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
9229 generate_bytecode_{conditional,insns}.
9231 2000-08-13 Anthony Green <green@redhat.com>
9233 * check-init.c (check_init): Add case for BIT_FIELD_REF (required
9236 2000-08-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9238 * class.c (maybe_layout_super_class): Fixed indentation.
9239 * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
9240 (java_check_methods): New function declaration.
9241 * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
9242 instead of `str_ptr'.
9243 * jcf-write.c (generate_bytecode_insns): Emit number the of args
9244 of a `invokeinterface' at the right time.
9245 * parse.h (WFL_STRIP_BRACKET): New macro.
9246 (SET_TYPE_FOR_RESOLUTION): Use it.
9247 * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
9248 (check_class_interface_creation): Don't check for cross package
9249 innerclass name clashes.
9250 (method_header): Behave properly if MDECL is `error_mark_node'.
9251 (method_declarator): Return `error_mark_node' if bogus current
9253 (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
9254 (resolve_and_layout): New local `decl_type', set and used. Call
9256 (java_check_methods): New method.
9257 (java_layout_classes): Use it.
9258 (resolve_qualified_expression_name): No EH check necessary in
9260 (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
9262 (patch_assignment): Set DECL_INITIAL on integral final local.
9264 2000-08-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
9266 * java-tree.h (flag_extraneous_semicolon): New extern.
9267 * lang-options.h: (-Wextraneous-semicolon): New option.
9268 * lang.c (flag_redundant): Fixed typo in leading comment.
9269 (flag_extraneous_semicolon): New global.
9270 (lang_decode_option): Set `flag_extraneous_semicolon' when
9271 -Wall. Decode `-Wextraneous-semicolon'.
9272 * parse.y (type_declaration:): Removed `SC_TK' hack, added
9273 `empty_statement' rule.
9274 (class_body_declaration): Likewise.
9275 (method_body:): Accept `;' as a method body.
9276 (static_initializer:): Removed `SC_TK' hack.
9277 (constructor_block_end:): Likewise.
9278 (empty_statement:): Report deprecated empty declaration. Fixes
9281 2000-08-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9283 * parse.y (build_dot_class_method_invocation): Changed parameter
9284 name to `type'. Build signature from `type' and convert it to a
9285 STRING_CST if it's an array.
9286 (patch_incomplete_class_ref): `build_dot_class_method_invocation'
9287 to use `ref_type' directly.
9289 2000-08-06 Ovidiu Predescu <ovidiu@cup.hp.com>
9291 * lang-options.h: Added a comma after the last element to avoid
9292 syntax errors when other languages define additional options.
9294 2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
9296 * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
9297 * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
9298 (jc1): Link with $(BACKEND).
9299 (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
9301 2000-08-02 Zack Weinberg <zack@wolery.cumb.org>
9303 * jvspec.c: Adjust type of second argument to
9304 lang_specific_driver, and update code as necessary.
9306 * class.c (build_dtable_decl): Initialize dummy.
9308 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9310 * parse.y (maybe_yank_clinit): When generating bytecode: non empty
9311 method bodies not to rule out discarding `<clinit>'; don't use
9312 <clinit> to initialize static fields with constant initializers.
9314 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9316 * gjavah.c (print_method_info): Added `synth' parameter. Skip
9318 (method_synthetic): New global.
9319 (HANDLE_METHOD): Recognize synthetic method and tell
9320 `print_method_info' about it.
9321 (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
9322 processing a synthetic method.
9323 * jcf-reader.c (skip_attribute): New function.
9324 ( skip_attribute): Likewise.
9326 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9328 * parse.y (build_outer_field_access): Fixed comments.
9329 (fix_constructors): Emit the initialization of this$<n> before
9331 (resolve_qualified_expression_name): Build an access to `decl' if
9334 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
9336 * parse-scan.y (curent_class): Non longer const.
9337 (inner_qualifier, inner_qualifier_length): Deleted.
9338 (current_class_length): New global.
9339 (bracket_count): Fixed typo in leading comment.
9340 (anonymous_count): New global.
9341 (class_instance_creation_expression:): Handle anonymous classes.
9342 (anonymous_class_creation:): New rule.
9343 (push_class_context): Rewritten.
9344 (pop_class_context): Likewise.
9345 (INNER_QUALIFIER): Macro deleted.
9346 (report_class_declaration): call `push_class_context' when
9347 entering the function. `fprintf' format modified not to use
9349 (report_class_declaration): Assign `package_name' and
9350 `current_class' to NULL separately.
9352 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
9354 * expr.c (build_invokeinterface): Call layout_class_methods on
9357 2000-07-27 Tom Tromey <tromey@cygnus.com>
9358 Anthony Green <green@cygnus.com>
9359 Alexandre Petit-Bianco <apbianco@cygnus.com>
9361 * class.c (make_class_data): Create vtable for abstract classes.
9362 (get_dispatch_table): Changed to cope with abstract classes.
9364 2000-07-27 Tom Tromey <tromey@cygnus.com>
9366 * parse.y (patch_method_invocation): Don't reverse the argument
9367 list when dealing with anonymous class constructors. Fixed typo in
9370 2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9372 * parse.y (build_alias_initializer_parameter_list): Reverse
9373 crafted list when building aliases for anonymous class
9376 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9378 * parse.y (jdep_resolve_class): Don't bother checking potential
9379 innerclass access if `decl' is NULL.
9380 (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
9383 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9385 * parse.c: Remove (again.)
9387 2000-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9389 * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
9390 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
9391 outside the `if' statement, alias to innerclass removed, `decl'
9392 used to mark the class complete.
9394 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
9396 * parse.y (simple_name:): Fixed typo in error message.
9398 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
9400 * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
9401 or its first operand can be error marks.
9403 2000-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
9405 * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
9406 * parse.y (method_header): Likewise.
9408 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
9410 * parse.y (process_imports): Consider that one might be trying to
9411 import an innerclass. Fixes gcj/254
9413 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
9415 * parse.y (find_as_inner_class): Handle the case where the
9416 enclosing context of an innerclass has been loaded as bytecode.
9418 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
9420 * parse.y (simple_name:): Reject `$' in type names.
9421 (resolve_type_during_patch): Use `type' as a second
9422 argument to resolve_no_layout. Fixes gcj/257.
9424 2000-07-18 Bryce McKinlay <bryce@albatross.co.nz>
9426 * parse.y (find_most_specific_methods_list): Select the only
9427 non-abstract method even if max has been set.
9428 Fixes gcj/285, gcj/298.
9430 2000-07-18 Jeff Sturm <jeff.sturm@appnet.com>
9432 * lang-specs.h: Added %(jc1) to java compiler options.
9434 2000-07-14 Zack Weinberg <zack@wolery.cumb.org>
9436 * .cvsignore: New file.
9438 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
9440 * parse.y (not_accessible_p): Access granted to innerclasses
9441 (indirectly) extending the reference type. Fixes gcj/249.
9443 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
9445 * parse.y (patch_method_invocation): Fixed comment.
9446 (maybe_use_access_method): Build this$<n>s to the context of the
9447 target method, or a type that extends it. Fixes gcj/242.
9449 2000-07-13 Mark Mitchell <mark@codesourcery.com>
9453 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
9455 * parse.y (fold_constant_for_init): Avoid bullish conversion.
9457 2000-07-13 Tom Tromey <tromey@cygnus.com>
9459 * lang-specs.h: Added %{I*}.
9461 2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
9463 * lang-specs.h: Use the new named specs. Remove unnecessary braces.
9465 2000-07-12 Mark Mitchell <mark@codesourcery.com>
9467 * parse-scan.c: Remove.
9469 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9471 * class.c (set_super_info): Handled protected inner classes.
9472 (common_enclosing_context_p): Bail early if arguments aren't both
9474 (get_access_flags_from_decl): Handle private and protected inner
9476 * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
9477 (CLASS_PROTECTED): Likewise.
9478 (struct lang_type): New bitfield `poic'.
9479 * parse.y (jdep_resolve_class): Call check_inner_class_access on
9481 (check_inner_class_access): Renamed arguments, added
9482 comments. Handles protected inner classes (fixes gcj/225)
9483 (not_accessible_p): Fixed comments. Avoid handling inner classes.
9485 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9487 * parse.y (resolve_qualified_expression_name): Verify qualified
9488 access to `this'. Fixes gcj/239.
9490 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9492 * jcf-write.c (generate_classfile): Don't install ConstantValue
9495 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9497 * parse.y (resolve_qualified_expression_name): Handle inner class
9498 access. Fixes gcj/256.
9500 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9502 * jcf-write.c (generate_classfile): Properly install the
9503 ConstantValue attribute and the initial value constant pool index
9504 on string constants.
9505 * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
9508 2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
9510 * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
9512 * parse.y (find_as_inner_class): Fixed typo.
9513 (do_resolve_class): Explore enclosing contexts when searching for
9514 innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
9515 (check_inner_class_access): Check `decl' which can be null in case
9518 2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
9520 * java-tree.h (java_debug_context): Declared `extern'.
9521 (safe_layout_class): Likewise.
9522 * parse.y (resolve_field_access): Field must be `static' in order
9523 to be replaced by its initial value. Added comments.
9524 (find_applicable_accessible_methods_list): Fixed typo.
9525 (find_most_specific_methods_list): Methods found in innerclasses
9526 take over methods founds in the enclosing contexts.
9527 (java_complete_tree): Loosen restrictions on the type of DECLs
9528 that can be replaced by their initialization values.
9529 (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
9531 2000-07-05 Tom Tromey <tromey@cygnus.com>
9533 * Make-lang.in (PARSE_DIR): New macro.
9534 (PARSE_RELDIR): Likewise.
9535 (PARSE_C): Likewise.
9536 (PARSE_SCAN_C): Likewise.
9537 ($(PARSE_C)): New target.
9538 ($(PARSE_SCAN_C)): Likewise.
9539 (SET_BISON): New macro.
9540 (BISONFLAGS): Likewise.
9541 (JAVABISONFLAGS): Likewise.
9543 2000-07-02 Bryce McKinlay <bryce@albatross.co.nz>
9545 * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
9546 argument on the first pass for CNI as well as JNI.
9547 (print_method_info): Set up method name on the first pass only.
9549 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9551 * parse.y (parser_qualified_classname): Removed parameter
9553 (create_interface): Removed first passed parameter to
9554 parser_qualified_classname.
9555 (create_class): Likewise. Don't install alias on static
9556 innerclasses. Fixes gcj/275.
9558 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9560 * parse.y (maybe_generate_pre_expand_clinit): Don't build a
9561 debugable statement with empty_stmt_node. Fixes gcj/272
9563 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9565 * expr.c (build_instanceof): Layout type after it's loaded. Fixes
9568 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
9570 * jcf-write.c (push_long_const): Appropriately cast short negative
9573 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
9575 * parse.y (verify_constructor_super): Use loop variable
9576 `m_arg_type' initialized with `mdecl_arg_type'.
9578 2000-06-29 Tom Tromey <tromey@cygnus.com>
9580 * parse.y (resolve_field_access): Handle case where `type_found'
9583 2000-06-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9585 * expr.c (lookup_field): The same field can be found through two
9586 different interface. Don't declare it ambiguous in that case.
9588 2000-06-27 Tom Tromey <tromey@cygnus.com>
9590 * lex.c (java_lineterminator): Don't recognize \r after \n. If \r
9591 follows \r, then unget it at a lower level.
9593 2000-06-26 Tom Tromey <tromey@cygnus.com>
9595 * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
9598 2000-06-25 Tom Tromey <tromey@cygnus.com>
9600 * parse.y (for_statement): Wrap expression in a WFL if it is a
9601 constant. For PR gcj/268.
9603 2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9605 * parse.y (do_resolve_class): Minor optimiztion in the package
9606 list search. Removed unnecessary test and return statement.
9607 (valid_ref_assignconv_cast_p): Order of arguments to
9608 enclosing_context_p fixed.
9610 2000-06-24 Tom Tromey <tromey@cygnus.com>
9612 * expr.c (lookup_field): Print error and return error_mark_node if
9613 field reference is ambiguous.
9615 * parse.y (check_abstract_method_definitions): Also check if
9616 `other_method' is abstract.
9618 2000-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
9620 * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
9622 * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
9623 (struct lang_type): New field `pic'.
9624 (CLASS_PRIVATE): New macro.
9625 * parse.y (check_inner_class_access): New function.
9626 (jdep_resolve_class): Call it.
9628 2000-06-23 Tom Tromey <tromey@cygnus.com>
9630 * parse.y (patch_incomplete_class_ref): Initialize the returned
9631 class. For PR gcj/260.
9633 2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
9635 * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
9637 2000-06-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
9639 * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
9640 Java specific checks.
9641 * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
9643 * java-tree.def (CASE_EXPR): Marked 'e'.
9644 (DEFAULT_EXPR): Likewise.
9645 * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
9647 * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
9648 Java specific checks.
9649 (generate_bytecode_insns): Test try_block for BLOCK before using
9651 * parse.y (build_wfl_wrap): Added `location' argument. Set
9652 EXPR_WFL_LINECOL accordingly.
9653 (dim_expr:): Wrap constants with WFLs.
9654 (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
9655 (resolve_package): Check for `stmt' not being a BLOCK before
9656 building a debuggable statement with it.
9657 (make_qualified_primary): Added extra parameter to build_wfl_wrap
9659 (resolve_field_access): Make sure `decl' is a DECL before treating
9661 (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
9662 IDENTIFIER_NODE before treating it as such.
9663 (patch_new_array_init): Make sure `elt' is a TREE_LIST before
9664 treating it as such.
9665 (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
9666 to be applied only on non array types.
9668 2000-06-16 Per Bothner <per@bothner.com>
9670 * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN): Don't
9671 define in terms of DECL_RESULT, as that fails when --enable-checking.
9673 2000-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9675 * jcf-write.c (CHECK_PUT): Add static prototype. Make pointer
9676 types the same in comparison.
9677 (CHECK_OP): Add static prototype.
9679 2000-06-13 Jakub Jelinek <jakub@redhat.com>
9681 * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
9682 * parse.y (java_complete_class): Set DECL_USER_ALIGN.
9685 2000-06-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9687 * decl.c (create_primitive_vtable): Prototype.
9689 * jcf-write.c (generate_bytecode_insns): Initialize variable
9692 * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
9694 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
9696 * parse.y (find_applicable_accessible_methods_list): Use a hashtable
9697 to track searched classes, and do not search the same class more than
9698 once. Call find_applicable_accessible_methods_list on immediate
9699 superclass, instead of search_applicable_method_list on all ancestors.
9702 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
9704 * parse.y (register_fields): Permit static fields in inner classes
9705 if they are final. Fix for PR gcj/255.
9707 2000-06-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
9709 * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
9710 * parse.y (find_in_imports): Returned type changed to void,
9711 leading comment fixed.
9712 (register_package): New function.
9713 (qualify_and_find): Likewise.
9714 (package_declaration:): Use `register_package'.
9715 (single_type_import_declaration:): Removed local variable
9716 `node'. Added missing `;' for consistency.
9717 (type_import_on_demand_declaration:): Use `chainon' to link new
9719 (lookup_field_wrapper): Lookup local variables defined in outer
9721 (java_complete_class): Don't reverse the list of imported on demand.
9722 (do_resolve_class): Reorganized. Removed local variable
9723 `original_name'. Call `qualify_and_find' with the current package
9724 name, invoke `find_in_imports_on_demand' right after. Call
9725 `qualify_and_find' with the packages we've seen so far. Fixed
9726 operations numbering in comments.
9727 (java_expand_class): Don't reverse `package_list'.
9728 (find_most_specific_methods_list): New local variables `abstract'
9729 and `candidates'. Use them to pick the right method.
9731 2000-06-06 Tom Tromey <tromey@ferrule.cygnus.com>
9733 * parse.y (check_modifiers_consistency): Don't subtract out
9734 `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
9736 2000-06-04 Philipp Thomas <pthomas@suse.de>
9738 * Makefile.in (INTLLIBS): New.
9742 2000-06-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9744 * class.c (get_dispatch_table): Build the vtable dummy entry list
9745 element with a null purpose. Fixed leading comment.
9746 (build_dtable_decl): Build an accurate dtable type when appropriate
9749 2000-06-02 Richard Henderson <rth@cygnus.com>
9751 * lang.c (lang_get_alias_set): New.
9753 2000-05-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
9755 * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
9756 before using it as the accessed field.
9758 2000-05-31 Tom Tromey <tromey@cygnus.com>
9760 * java-tree.h (boolean_array_vtable, byte_array_vtable,
9761 char_array_vtable, short_array_vtable, int_array_vtable,
9762 long_array_vtable, float_array_vtable, double_array_vtable):
9764 * expr.c (get_primitive_array_vtable): New function.
9765 (create_primitive_vtable): New function.
9766 (java_lang_expand_expr): Enable code to statically generate
9768 * decl.c (init_decl_processing): Create primitive vtables.
9769 (boolean_array_vtable, byte_array_vtable, char_array_vtable,
9770 short_array_vtable, int_array_vtable, long_array_vtable,
9771 float_array_vtable, double_array_vtable): Define.
9773 2000-05-26 Zack Weinberg <zack@wolery.cumb.org>
9775 * java/parse.y (find_applicable_accessible_methods_list):
9776 Don't add an uninitialized value to the list.
9778 2000-05-25 Tom Tromey <tromey@cygnus.com>
9780 * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
9781 when trying to see if field's class should be initialized. Always
9782 initialize field's declaring class, not qualified class.
9785 * parse.y (array_constructor_check_entry): Pass `wfl_value', not
9786 `wfl_operator', to maybe_build_primttype_type_ref.
9789 2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
9791 * parse.y (patch_method_invocation): Don't try to lookup methods
9794 2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9796 * parse.y (resolve_field_access): Call the appropriate <clinit>
9797 before accessing the length of a static array. Craft a decl for
9798 the field while its time. Fixes PR gcj/129.
9800 2000-05-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9802 * parse.y (resolve_package): Correctly set `*next' (was off by
9804 (resolve_qualified_expression_name): Fixed comment.
9806 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9808 * jcf-parse.c (jcf_parse_source): Reset current_class and
9809 current_function_decl to NULL before parsing a new file.
9811 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9813 * parse.y (block_end:): If the collected block doesn't feature a
9814 statement, insert an empty statement.
9816 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9818 * parse.y (maybe_yank_clinit): New function.
9819 (maybe_generate_pre_expand_clinit): Always link <clinit> at the
9820 end of the list of methods belonging to a class.
9821 (java_complete_expand_method): Check whether <clinit> is really
9822 necessary and expand it accordingly.
9824 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9826 * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
9827 processed by the method's switch statement.
9829 2000-05-19 Tom Tromey <tromey@cygnus.com>
9831 * java-tree.h: Added init state enum.
9832 * decl.c (emit_init_test_initialization): Initialize class
9833 initialization check variable by looking at class' state.
9835 2000-05-19 Tom Tromey <tromey@cygnus.com>
9837 * java-tree.h (build_instanceof): Declare.
9838 (build_get_class): Declare.
9839 * parse.y (patch_binop): Use build_instanceof.
9840 * expr.c (build_instanceof): New function. If class is final,
9841 don't make a function call.
9842 (expand_java_INSTANCEOF): Use it.
9843 (build_get_class): New function.
9845 2000-05-18 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
9847 * jcf-write.c (generate_classfile): Scan the source_file for
9848 slashes with the right pointer variable.
9850 2000-05-17 Andrew Cagney <cagney@b1.cygnus.com>
9852 * lang.c (lang_decode_option): Update -Wunused flags by calling
9854 * decl.c (poplevel): Replace warn_unused with warn_unused_label.
9856 2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
9858 * check_init.c (check_init): Constify local char *.
9859 * class.c (push_class): Constify local char *.
9860 * java_tree.h: Update prototypes.
9861 * jcf-io.c (open_class): Constify filename parameter and
9863 (find_class): Remove redundant string copy. Cast return from
9865 * jcf-parse.c (read_class, parse_class_file, yyparse):
9866 Constify local char *.
9867 * jcf-write.c (generate_bytecode_insns, generate_classfile):
9868 Constify local char *.
9869 * jcf.h (JCF): Constify filename and classname.
9870 (JCF_FINISH): Cast args to FREE to char * when appropriate.
9871 * lang.c (init_parse): Constify parameter and return value.
9872 * lex.c (java_get_line_col): Constify filename parameter.
9873 * parse.h: Constify parser_ctxt.filename. Update prototypes.
9874 * parse.y (java_parser_context_suspend,
9875 issue_warning_error_from_context, safe_layout_class): Constify
9877 * parse.c: Regenerate.
9879 2000-05-08 Tom Tromey <tromey@cygnus.com>
9881 * expr.c (build_jni_stub): Cache the result of
9882 _Jv_LookupJNIMethod.
9884 2000-05-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
9886 * decl.c (predef_filenames_size): Now 7.
9887 (predef_filenames): New seventh entry.
9889 2000-05-04 Tom Tromey <tromey@cygnus.com>
9891 * boehm.c (mark_reference_fields): Don't mark RawData fields.
9892 Keep track of when we've seen a reference field after a
9893 non-reference field.
9894 (get_boehm_type_descriptor): Handle case where we see
9895 non-reference fields but no trailing reference field.
9896 * decl.c (rawdata_ptr_type_node): Define.
9897 (init_decl_processing): Initialize rawdata_ptr_type_node.
9898 * java-tree.h (rawdata_ptr_type_node): Declare.
9900 2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9902 * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
9903 specifiers in calls to fprintf.
9905 2000-05-03 Andrew Haley <aph@cygnus.com>
9907 * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
9909 * javaop.h (WORD_TO_INT): New function.
9910 (IMMEDIATE_s4): Use WORD_TO_INT.
9911 * jcf.h (JPOOL_INT): Ditto.
9913 * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
9916 2000-04-19 Tom Tromey <tromey@cygnus.com>
9918 * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
9920 * jcf-parse.c (parse_class_file): Call build_jni_stub for native
9922 * expr.c (build_jni_stub): New function.
9923 * lang-specs.h: -fjni and -femit-class-file are incompatible.
9925 * parse.y (java_complete_expand_methods): Expand a native method
9926 and call build_jni_stub if -fjni given.
9927 * lang-options.h: Document -fjni.
9928 * lang.c (flag_jni): New global.
9929 (lang_f_options): Added `jni' entry.
9930 * java-tree.h (soft_lookupjnimethod_node,
9931 soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
9933 (flag_jni): Declare.
9934 (build_jni_stub): Declare.
9935 (struct lang_decl): Added `native' flag.
9936 (METHOD_NATIVE): Redefined to use `native' field of lang specific
9938 * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
9939 soft_jnipopsystemframe_node): New globals.
9940 (init_decl_processing): Set them. _Jv_InitClass only takes one
9943 * java-tree.def: Put into `C' mode.
9945 2000-04-27 Tom Tromey <tromey@cygnus.com>
9948 * expr.c (expand_invoke): Generate check to see if object pointer
9949 is null in nonvirtual invocation case.
9950 * java-tree.h (soft_nullpointer_node): Declare.
9951 * decl.c (soft_nullpointer_node): New global.
9952 (init_decl_processing): Initialize soft_nullpointer_node.
9953 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
9954 or `private' methods.
9955 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
9957 2000-04-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
9959 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
9962 2000-04-26 Tom Tromey <tromey@cygnus.com>
9964 * zextract.c (find_zip_file_start): New function.
9965 (read_zip_archive): Use it.
9967 2000-04-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9969 * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
9971 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9973 * class.c (common_enclosing_context_p): New function.
9974 * java-tree.h (common_enclosing_context_p): Added prototype.
9975 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
9976 classes sharing an outer context with the current instance.
9977 * parse.y (build_access_to_thisn): Fixed leading comment.
9978 (verify_constructor_super): New local `supper_inner'. Skip
9979 enclosing context argument in the case of inner class constructors.
9980 (patch_method_invocation): Insert proper context as second
9981 parameter to pure inner class constructor super invocations.
9983 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9985 * parse.y (end_class_declaration): Reset the interface number
9988 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9990 * parse.y (source_start_java_method): Deleted unnecessary code.
9991 (patch_method_invocation): Fixed comment.
9993 2000-04-24 Robert Lipe <robertlipe@usa.net>
9995 * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
9997 2000-04-23 Tom Tromey <tromey@cygnus.com>
9999 * boehm.c (mark_reference_fields): Use int_byte_position.
10001 2000-04-22 Tom Tromey <tromey@cygnus.com>
10003 * boehm.c (mark_reference_fields): Only call byte_position on
10006 2000-04-22 Tom Tromey <tromey@cygnus.com>
10008 * boehm.c (mark_reference_fields): Added `last_view_index'
10009 argument. Use DECL_FIELD_OFFSET to determine field's offset.
10011 2000-04-20 Mo DeJong <mdejong@cygnus.com>
10013 * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
10014 * parse.y (check_class_interface_creation): Fixed comments. Select
10015 permitted modifiers for (inner) interfaces. Changed error message
10016 to report rejected modifiers used with local classes.
10018 2000-04-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
10020 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
10021 of directly inherited type considered in scope.
10022 * parse.y (do_resolve_class): Search inherited classes for inner
10025 2000-04-20 Tom Tromey <tromey@cygnus.com>
10027 * parse.y (not_accessible_p): Use member's class, not current
10028 class, when doing inheritance check for protected reference.
10031 2000-04-20 Jason Schroeder <shrode@subnature.com>
10033 * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
10035 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
10037 * parse.y (lookup_field_wrapper): Search for final local aliases.
10038 (resolve_expression_name): Let lookup_field_wrapper search for
10039 final local aliases. Force the value of `name' if one is found.
10040 (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
10041 an expression name. Fixed comments.
10043 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
10045 * parse.y (yyerror): `msg' can be null, don't use it in that case.
10047 2000-04-19 Tom Tromey <tromey@cygnus.com>
10049 * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
10051 2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
10053 * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
10055 2000-04-18 Tom Tromey <tromey@cygnus.com>
10058 * gjavah.c (utf8_cmp): Changed return value.
10059 (cxx_keyword_subst): Handle all C++ keywords. Allocate new return
10061 (cxx_keywords): New global.
10062 (get_field_name): Handle new result of cxx_keyword_subst.
10063 (print_method_info): Likewise.
10065 2000-04-17 Bryce McKinlay <bryce@albatross.co.nz>
10067 * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
10068 with a newline, for CNI.
10069 (print_stub_or_jni): Print a space or newline before method name for
10070 CNI as well as JNI.
10071 (print_cxx_classname): Don't write leading "::" in CNI stub method.
10072 (process_file): Include gcj/cni.h if generating CNI stubs.
10074 2000-04-16 Tom Tromey <tromey@cygnus.com>
10076 * gjavah.c (decompile_method): Use print_field_name.
10079 2000-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
10081 * parse.y (java_expand_classes): Reverse the package list once.
10082 (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
10084 (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
10085 the `==' and `!=' operators.
10087 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
10089 * jcf-write.c (generate_bytecode_insns): At invocation time,
10090 always relate an interface method to the type of its selector.
10092 2000-04-05 Tom Tromey <tromey@cygnus.com>
10095 * expr.c (expand_invoke): Generate check to see if object pointer
10096 is null in nonvirtual invocation case.
10097 * java-tree.h (soft_nullpointer_node): Declare.
10098 * decl.c (soft_nullpointer_node): New global.
10099 (init_decl_processing): Initialize soft_nullpointer_node.
10100 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
10101 or `private' methods.
10102 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
10104 2000-04-05 Tom Tromey <tromey@cygnus.com>
10106 Fix for PR gcj/140:
10107 * parse.y (check_final_assignment): Recognize assignments to the
10108 `length' field of an array when generating class files.
10110 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
10112 * class.c (decl_hash): Prototype removed.
10113 (decl_compare): Likewise.
10115 2000-04-05 Tom Tromey <tromey@cygnus.com>
10117 * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
10118 * parse.y (check_modifiers_consistency): Check for final/volatile
10119 clash. Fixes PR gcj/164.
10121 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
10123 * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
10125 (java_hash_compare_tree_node): Renamed from `decl_compare, made
10127 (add_method_1): Use `java_hash_hash_tree_node' and
10128 `java_hash_compare_tree_node'.
10129 * java-tree.h: (java_hash_hash_tree_node): Prototyped.
10130 (java_hash_compare_tree_node): Likewise.
10131 * parse.y (find_applicable_accessible_methods_list): Create,
10132 delete and use a hash table to remember already searched interfaces.
10134 2000-04-03 Matt Welsh <mdw@cs.berkeley.edu>
10136 * jcf-depend.c (add_entry): Fixed bug where list was always replaced
10139 2000-04-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10141 * boehm.c (mark_reference_fields, set_bit): Prototype.
10142 (set_bit): Un-ANSI-fy definition.
10144 * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
10147 * decl.c (emit_init_test_initialization): Likewise.
10149 * gjavah.c (jni_print_char): Likewise.
10151 * parse.y (create_new_parser_context): Likewise.
10153 2000-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
10155 * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
10156 patch missing hunk. Fixed indentation.
10158 2000-03-30 Tom Tromey <tromey@cygnus.com>
10160 * gjavah.c (D_NAN_MASK): Only define as word-reversed when
10161 HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
10163 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
10165 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
10166 when negative *before* using it as an array index.
10167 * ChangeLog: Fixed typo.
10169 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
10171 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
10172 to 0 when it reaches -1.
10174 2000-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
10176 * jcf-parse.c (get_constant): Properly cast `num' during the
10177 invocation of `add_double'.
10178 * jcf-write.c (push_long_const): Properly cast `lo' before
10179 comparing it to short bounds.
10180 * parse-scan.y (interface_declaration:): Rule re-arrange so that
10181 `interface_body:' is reduced after the current interface is
10184 2000-03-26 Tom Tromey <tromey@cygnus.com>
10186 * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
10187 Java-specific `-f' option.
10189 2000-03-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10191 * decl.c (init_decl_processing): Only call initialize_sizetypes once.
10192 Adjust order of making types.
10193 Make bitsize_*_node values.
10195 2000-03-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10197 * class.c (make_field_value): Use byte_position.
10198 * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
10199 (java_array_data_offset): Likewise.
10200 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
10203 2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
10205 * parse.y (check_abstract_method_definitions): New local
10206 `end_type_reached'. Make sure we also consider `end_type'.
10207 (java_check_abstract_method_definitions): Make sure we eventually
10208 consider `java.lang.Object'.
10209 (maybe_use_access_method): Don't use access method if not in the
10210 context of a pure inner class or if the method's context is right.
10211 (find_applicable_accessible_methods_list): New static flag
10212 `object_done'. Don't search abstract classes as interfaces. Fixed
10213 indentation. Fixed the `java.lang.Object' only search. Search
10214 class interface(s) first, then fully search enclosing contexts.
10215 (find_most_specific_methods_list): Pick the closest candidate when
10216 they're all abstract.
10218 2000-03-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
10220 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
10221 properly initialize `finished_label'. Don't emit gotos for empty
10224 2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10226 * except.c (emit_handlers): Clear catch_clauses_last.
10228 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10230 * parse.y (check_method_types_complete): New function.
10231 (create_class): Reset anonymous class counter only when seeing an
10233 (java_complete_class): JDEP_METHOD: Don't recompute signature
10236 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10238 * class.c (build_static_ref): Fixed indentation in comment.
10239 * java-tree.def (TRY_EXPR): Fixed typo in name.
10240 (CLASS_LITERAL): Likewise.
10241 * java-tree.h: (TYPE_DOT_CLASS): New macro.
10242 (struct lang_type): New field `dot_class'.
10243 * jcf-write.c (generate_bytecode_insns): Fixed error message.
10244 (generate_classfile): Method `class$' is synthetic.
10245 * parse.y (build_do_class_method): New function.
10246 (build_dot_class_method_invocation): Likewise.
10247 (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
10248 (resolve_qualified_expression_name): Handle CLASS_LITERAL.
10249 (qualify_ambiguous_name): Likewise.
10250 (patch_incomplete_class_ref): Invoke synthetic method if necessary.
10251 (build_try_statement): Fixed leading comment.
10253 2000-03-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10255 * class.c (make_field_value): Properly handle sizes.
10256 (get_dispatch_vector): Use tree_low_cst and host_integerp.
10257 (layout_class_method): Count using trees.
10258 * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
10259 * expr.c (java_array_data_offset): Use int_bit_position.
10260 (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
10261 (build_invokevirtual): Use tree_low_cst and do computations with trees.
10263 2000-03-16 Tom Tromey <tromey@cygnus.com>
10265 * lang.c (flag_hash_synchronization): New global.
10266 (lang_f_options): Added `hash-synchronization'.
10267 * lang-options.h: Mention -fhash-synchronization.
10268 * java-tree.h (flag_hash_synchronization): Declare.
10269 * expr.c (java_lang_expand_expr): Only push `sync_info' value when
10270 hash table synchronization is disabled.
10271 * decl.c (init_decl_processing): Only push `sync_info' value when
10272 hash table synchronization is disabled.
10273 * class.c (make_class_data): Only push `sync_info' field when hash
10274 table synchronization is disabled. Removed dead code.
10276 2000-03-16 Tom Tromey <tromey@cygnus.com>
10278 * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
10280 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
10282 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
10284 * parse.y (patch_method_invocation): Handle anonymous classes
10285 creation in static context.
10287 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
10289 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
10290 * parse.y (resolve_qualified_expression_name): Use it.
10291 (patch_method_invocation): Likewise.
10293 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
10295 * parse.y (register_incomplete_type): JDEP_ENCLOSING set
10296 depending on the type of dependency which dictates what the
10298 (unresolved_type_p): Resolved types limited to the current class.
10300 2000-03-15 Tom Tromey <tromey@cygnus.com>
10302 * decl.c (init_decl_processing): Set type of `sync_info' to be
10305 * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
10306 Correctly compute bit number for current slot. Zero `high' and
10307 `low' in DS_LENGTH case. Don't skip inherited fields. Use
10308 mark_reference_fields.
10309 (mark_reference_fields): New function.
10311 2000-03-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
10313 * parse.y (register_incomplete_type): Fixed initialization of
10316 2000-02-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
10318 * parse-scan.y (inner_qualifier, inner_qualifier_length): New
10320 (push_class_context, pop_class_context): New function.
10321 (class_body:): Call pop_class_context.
10322 (interface_body:): Likewise.
10323 (INNER_QUALIFIER): New macro.
10324 (report_class_declaration): Changed output format and use
10325 INNER_QUALIFIER. Call push_class_context.
10327 2000-02-14 Andrew Haley <aph@cygnus.com>
10329 * check-init.c (check_init): Add new cases for unary and binary
10332 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
10334 * parse.y (resolve_package): Set `next' once a type name has been
10335 progressively discovered.
10336 (resolve_qualified_expression_name): Propagate resolution only if
10337 there are remaining qualifiers. Take into account `q' might have
10338 been cleared after re-qualification.
10339 * parse.y (patch_method_invocation): New local `resolved'.
10340 Section dealing with qualified expression rewritten to use
10341 resolve_field_access.
10343 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
10345 * parse.h (PUSH_CPC): Fixed indentation.
10346 (DEBUG_CPC): New macro.
10347 (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
10348 SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
10349 * parse.y (class_body_declaration:): Use
10350 SET_CPC_INSTANCE_INITIALIZER_STMT.
10351 (method_declaration:): Check for null current_function_decl.
10352 (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
10353 (java_parser_context_pop_initialized_field): Better handling of
10355 (maybe_make_nested_class_name): Mark nested class name as
10356 qualified when necessary.
10357 (end_class_declaration): Don't call java_parse_context_resume when
10358 one or more error occurred.
10359 (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
10360 (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
10361 SET_CPC_INITIALIZER_STMT.
10362 (method_header): Check for inner classes declaring static methods.
10363 (resolve_qualified_expression_name): Handle situation where `this'
10366 2000-03-13 Hans Boehm <boehm@acm.org>
10368 * typeck.c (build_prim_array_type): Correctly set the high word too.
10370 2000-03-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10372 * parse.y (java_complete_expand_methods): Leave <clinit> out of
10374 (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
10375 list of methods for interfaces.
10377 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
10379 * parse.y (qualify_ambiguous_name): Properly handle expressions
10382 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
10384 * parse.y (check_final_assignment): Extended to process
10386 (patch_assignment): Have check_final_assignment called only once.
10388 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
10390 * java-tree.h (IS_INIT_CHECKED): New flag.
10391 * check-init.c (check_init): Test and set IS_INIT_CHECKED.
10392 * parse.y (patch_string): Call force_evaluation_order on the
10393 completed string concatenation tree.
10394 * expr.c (force_evaluation_order): Call force_evaluation_order on
10395 function's arguments too.
10397 2000-03-06 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10399 * decl.c (emit_init_test_initialization): Mark KEY as unused.
10400 * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
10401 (build_anewarray): Likewise.
10402 * parse.y (patch_newarray): Likewise.
10403 * parse.c: Regenerated.
10405 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
10407 * decl.c (init_decl_processing): Added new class fields `depth',
10408 `ancestors', and `idt' to class_type_node. Use
10409 _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
10410 * class.c (make_class_data): Push initial values for new fields.
10411 * java-tree.h: Updated prototype for `build_invokeinterface'.
10412 * expr.c (build_invokeinterface): Changed parameters to accept
10413 `method' tree. Calculate index of `method' in its declaring
10414 interface. Build call to _Jv_LookupInterfaceMethodIdx.
10415 (expand_invoke): Call `build_invokeinterface' with new parameters.
10416 * parse.y (patch_invoke): Call `build_invokeinterface' with new
10419 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
10421 * typeck.c (lookup_do): Search superinterfaces first
10422 when looking up an interface method. From Godmar Back
10423 <gback@cs.utah.edu>
10425 2000-03-06 Tom Tromey <tromey@cygnus.com>
10427 * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
10429 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
10431 * java-tree.h (lookup_argument_method2): Declared.
10432 (safe_layout_class): Prototype moved from parse.h.
10433 * parse.h (safe_layout_class): Prototype moved to java-tree.h.
10434 * parse.y (java_check_regular_methods): Local `super_class' gone.
10435 Call lookup_argument_method2 instead of lookup_argument_method.
10436 Perform modifier match for methods found declared in implemented
10437 interfaces. Fixed indentation problem. Overriding/hiding error
10438 report to take place only for methods found in classes.
10439 * typeck.c (lookup_argument_method): Changed leading
10440 comment. Re-written by calling lookup_do.
10441 (lookup_argument_method2): New function.
10442 (lookup_java_method): Re-written by calling lookup_do.
10443 (lookup_do): New function.
10445 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
10447 * check-init.c (check_init): Removed dead code. Handle (blank)
10449 * parse.y (declare_local_variables): New local `final_p', set it
10450 and use it to initialize LOCAL_FINAL.
10451 (check_final_assignment): Only check FIELD_DECLs.
10453 2000-02-17 Tom Tromey <tromey@cygnus.com>
10455 * Makefile.in (JAVA_OBJS): Added boehm.o.
10456 (boehm.o): New target.
10457 * Make-lang.in (JAVA_SRCS): Added boehm.c.
10458 * java-tree.h (flag_use_boehm_gc): Declare.
10459 (get_boehm_type_descriptor): Declare.
10460 * lang.c (lang_f_options): Added `use-boehm-gc'.
10461 (flag_use_boehm_gc): New global.
10462 * lang-options.h: Added -fuse-boehm-gc.
10463 * boehm.c: New file.
10464 * class.c (get_dispatch_table): If class uses a Boehm type
10465 descriptor, put it in the vtable.
10466 (make_class_data): Removed dead code.
10468 2000-03-03 Per Bothner <per@bothner.com>
10470 * decl.c (init_decl_processing): Initialize sizetype properly.
10472 2000-03-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10474 * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
10475 (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
10476 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
10477 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
10478 (jcf_parse): New local `current'. Load innerclasses seen in outer
10479 context being processed.
10480 * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
10481 * jcf-write.c (append_innerclasses_attribute): New function.
10482 (append_innerclasses_attribute_entry): Likewise.
10483 (get_access_flags): Handle static classes. Set anonymous and local
10484 classes to be private.
10485 (generate_classfile): Attribute count adjusted. Call
10486 append_innerclasses_attribute.
10487 * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
10488 PURE_INNER_CLASS_TYPE_P.
10489 * parse.y (parser_qualified_classname): New parameter `is_static',
10490 produce non qualified name accordingly.
10491 (block_statement:): Set LOCAL_CLASS_P when declaring local class.
10492 (create_interface): Added argument to parser_qualified_classname.
10493 (create_class): Added argument to parser_qualified_classname. Setup
10494 alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
10495 (add_inner_class_fields): Fixed indentation.
10496 (method_declarator): Use PURE_INNER_CLASS_DECP_P.
10497 (method_declarator): Fixed typo in comment.
10498 (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
10499 (build_current_thisn): Likewise.
10500 (patch_method_invocation): Likewise.
10502 2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
10504 * decl.c (current_function_decl): Move to toplev.c.
10506 2000-02-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10508 * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
10509 (DECL_BIT_INDEX): Use underlying representation.
10510 * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
10512 2000-02-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10514 * expr.c (build_java_ret): Pass proper type to size_binop.
10516 2000-02-25 Anthony Green <green@cygnus.com>
10518 * expr.c (build_class_init): Mark the decl to be ignored by
10520 * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
10521 * check-init.c: Move DECL_BIT_INDEX to java-tree.h
10522 * class.c (init_test_hash_newfunc): New function.
10523 (decl_hash): New function.
10524 (decl_compare): New function.
10525 * decl.c (emit_init_test_initialization): New function.
10526 (complete_start_java_method): Traverse the init test hashtable,
10527 calling emit_init_test_initialization.
10528 (always_initialize_class_p): Define.
10529 * expr.c (build_class_init): Use initialization tests when
10530 emitting class initialization code.
10531 (always_initialize_class_p): Declare.
10532 * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
10534 * java-tree.h: Include hash.h.
10535 (DECL_FUNCTION_INIT_TEST_TABLE): Define.
10536 (struct lang_decl): Add init_test_table field.
10537 (init_test_hash_entry): Define.
10539 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
10541 * gjavah.c (main): Avoid using `argi' to report unimplemented
10544 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
10546 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
10547 initialize locals to avoid warnings. Local `exception_type' moved
10550 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
10552 * parse.y (resolve_expression_name): Use `orig' as a second
10553 argument to resolve_field_access.
10554 (resolve_field_access): Removed unnecessary code when dealing with
10557 2000-02-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
10559 * class.c (push_super_field): Don't push the field twice.
10560 * jcf-parse.c (parse_source_file): Call java_reorder_fields.
10561 * parse.h (java_reorder_fields): Prototyped.
10562 * parse.y (java_reorder_fields): New function.
10563 (java_layout_class): Simplified not to worry about re-ordering.
10565 2000-02-23 Tom Tromey <tromey@cygnus.com>
10567 * gjavah.c (print_name): In JNI case, correctly quote string.
10568 (print_method_info): Don't handle overrides in JNI mode.
10570 2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
10572 * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
10573 value type set to `boolean_type_node'.
10575 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
10577 * jcf-dump.c (main): Test for correct condition after
10578 output file creation.
10580 2000-02-19 Anthony Green <green@cygnus.com>
10582 * jcf-depend.c (add_entry): Fix test for first list entry.
10584 2000-02-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
10586 * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
10587 * constants.c (build_constants_constructor): Likewise.
10589 2000-02-19 Anthony Green <green@cygnus.com>
10591 * jcf-depend.c (add_entry): Add entries to the end of the list.
10593 1999-11-03 Pekka Nikander <pekka.nikander@hut.fi>
10595 * decl.c (INT_TYPE_SIZE): Define if necessary.
10596 (expand_java_return): Handle the case of a native integer smaller
10597 than a JVM integer.
10599 2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
10601 * gjavah.c (help): Use GCCBUGURL.
10602 * jv-scan.c (help): Likewise.
10603 * jcf-dump.c (help): Likewise.
10605 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10607 * jcf-write.c (generate_bytecode_insns): Don't generate empty
10610 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10612 * jcf-parse.c (load_class): Call `fatal' if no file containing
10613 the target class are found.
10615 2000-02-16 Zack Weinberg <zack@wolery.cumb.org>
10617 * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
10618 lex.c, lex.h, and PARSE_H to...
10619 (parse.o, parse-scan.o): ...here, respectively.
10621 * lex.c: Split out code that may trigger SIGFPE from yylex()
10622 to its own function.
10623 * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
10625 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10627 * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
10629 2000-02-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
10631 * parse.y (outer_field_access_p): Stop in time when outer contexts
10633 (resolve_qualified_expression_name): Properly qualify *everything*
10634 after a package.type to be resoled as expression names.
10635 (find_applicable_accessible_methods_list): Save/restore `class' to
10636 isolate it from a possible outer context search.
10638 2000-02-15 Tom Tromey <tromey@cygnus.com>
10640 * gjavah.c (jni_print_char): New function.
10641 (print_full_cxx_name): Use it.
10642 (decode_signature_piece): Likewise.
10643 (print_cxx_classname): Likewise.
10645 2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10647 * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
10649 (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
10651 * gjavah.c: Include version.h.
10653 * jcf-dump.c: Likewise.
10655 * jv-scan.c: Likewise.
10657 2000-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
10659 * parse.y (outer_field_access_fix): First parameter now a tree
10660 node. Check for assignment to final. First argument to
10661 build_outer_field_access_fix modified to accommodate prototype.
10662 (build_outer_field_access): Don't check for assignment to final
10664 (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
10665 possibly returned by outer_field_access_fix. Changed
10666 outer_field_access_fix's first argument.
10667 (check_final_assignment): $finit$'s context is OK.
10668 (patch_unaryop): Use node instead of its line/column value when
10669 calling outer_field_access_fix.
10671 2000-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
10673 * parse.y (interface_declaration:): No longer tagged
10674 <node>. Re-installed default action.
10675 (class_member_declaration:): Handle inner interfaces.
10676 (interface_member_declaration): Handle inner interfaces and
10678 (create_interface): Push error if one seen. Suspend parsing
10679 context when processing an inner interface.
10680 (register_fields): Inner class static field limitations not to
10681 apply to inner interfaces.
10683 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10685 * jcf-parse.c (load_class): Update `java_error_count' when a
10686 class' file can't be found.
10687 (parse.y): Avoid (byte)code generation when errors seen.
10689 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10691 * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
10692 decodes a valid node.
10693 (patch_binop): Handle TRUNC_DIV_EXPR.
10695 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10697 * parse.y (resolve_package): New local `acc'. Try to progressively
10698 build and guess a package and type name.
10700 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10702 * parse.y (find_applicable_accessible_methods_list): Load and
10703 layout the search class if necessary.
10704 (java_complete_tree): Keep to original type of the folded initial
10707 2000-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10709 * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
10710 Generate error message if circularity is detected. New static
10712 * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro. *
10713 * jcf-write.c (generate_bytecode_insns): Very simply handle
10715 * parse.y (java_check_circular_reference): Use
10716 `cyclic_inheritance_report' during report, if necessary.
10717 (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
10718 walking NEW_ARRAY_INIT twice.
10720 2000-02-09 Tom Tromey <tromey@cygnus.com>
10722 * parse.y (check_class_interface_creation): Allow inner classes to
10723 be `private' or `protected', check modifiers' consistency. Prevent
10724 block local classes from bearing any modifiers.
10726 2000-02-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10728 * except.c (check_start_handlers): Re-add prototype lost in last
10730 (maybe_start_try): Remove excess argument to `check_start_handlers'.
10732 2000-02-09 Andrew Haley <aph@cygnus.com>
10734 * decl.c (clear_binding_level): Remove excess initializer.
10735 (maybe_poplevels): Remove unused variable.
10736 (force_poplevels): Ditto.
10737 (struct binding_level): Add comment.
10739 2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
10741 * jcf-write.c (generate_classfile): Don't consider
10742 pre-initialization with reference value (use <clinit> instead.)
10743 * parse.y (java_fix_constructors): No generated constructor for
10745 (build_outer_field_access): Removed debug message.
10746 (outer_field_expanded_access_p): Adapted to bytecode generation.
10747 (build_outer_field_access_method): Use fix_method_argument_names.
10748 (build_outer_method_access_method): Fixed indentation. Added
10749 comment. Handle access method generation for static and also void
10751 (build_access_to_thisn): Inserted debug message.
10752 (maybe_build_thisn_access_method): Use fix_method_argument_names.
10753 (resolve_qualified_expression_name): Fixed comment.
10754 (not_accessible_p): Adapted to bytecode generation. Added comment.
10755 (patch_method_invocation): Added comment.
10756 (maybe_use_access_method): Fixed leading comment. Handle static
10758 (java_complete_lhs): Don't shortcut handling of initialized upon
10759 declaration String type static fields when generating bytecode.
10760 (patch_unaryop): Handle outer field access when generating
10763 2000-02-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
10765 * java-tree.h (FIELD_THISN): New macro.
10766 * jcf-write.c (append_synthetic_attribute): New function.
10767 (generate_classfile): Set "Synthetic" attribute on this$<n>,
10768 val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
10769 * parse.y (add_inner_class_fields): Set FIELD_THISN for created
10771 (build_outer_field_access): Turned on access functions usage and
10772 generation when compiling to bytecode.
10773 (maybe_use_access_method): Likewise.
10775 2000-01-25 Andrew Haley <aph@cygnus.com>
10777 * java-except.h (struct eh_range): Add `expanded' field.
10778 (maybe_start_try): Add end_pc arg.
10779 (maybe_end_try): Ditto.
10780 * java-tree.h (force_poplevels): new function.
10781 * expr.c (expand_byte_code): Don't call maybe_start_try or
10783 * except.c (add_handler): Reset expanded.
10784 (expand_start_java_handler): Set expanded.
10785 (check_start_handlers): Don't expand a start handler that's
10786 already been expanded.
10787 (maybe_start_try): Add end_pc arg. Only expand a handler which
10789 (expand_end_java_handler): call force_poplevels.
10790 (force_poplevels): new function.
10791 * decl.c (binding_level): Add start_pc of binding level.
10792 (maybe_pushlevels): Call maybe_start_try when pushing binding
10794 (maybe_poplevels): Call maybe_end_try when popping binding levels.
10795 (LARGEST_PC): Define.
10796 (clear_binding_level): Use LARGEST_PC.
10798 * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
10799 * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
10800 (binding_depth, is_class_level, current_pc): new variables.
10801 (struct binding_level): ditto.
10802 (indent): new function.
10803 (push_jvm_slot): add debugging info.
10804 (maybe_pushlevels): ditto.
10805 (maybe_poplevels): ditto.
10806 (pushlevel): ditto.
10808 (start_java_method): ditto.
10809 (give_name_to_locals): comment only.
10810 * except.c (binding_depth, is_class_level, current_pc):
10812 (expand_start_java_handler): add debugging info.
10813 (expand_end_java_handler): ditto.
10815 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10817 * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
10818 (print_name_for_stub_or_jni, process_file): Constify a char*.
10820 2000-02-03 Tom Tromey <tromey@cygnus.com>
10822 * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
10824 2000-01-31 Scott Bambrough <scottb@netwinder.org>
10826 * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
10827 assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
10830 2000-02-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
10832 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
10833 * java-tree.h (TYPE_II_STMT_LIST): New macro.
10834 (struct lang_type): New field `ii_block'.
10835 * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
10836 CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
10837 * parse.h (struct parser_ctxt): New field `instance_initializers'.
10838 (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
10839 CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
10840 CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
10842 * parse.y (add_instance_initializer): New function.
10843 (in_instance_initializer): New static global.
10844 (class_body_declaration:): Link instance initializer block.
10845 (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
10846 (array_creation_expression:): Remove unused local.
10847 (java_parser_context_push_initialized_field): Fixed leading
10848 comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
10849 CPC_INSTANCE_INITIALIZER_LIST.
10850 (java_parser_context_pop_initialized_field): Likewise.
10851 (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
10852 (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
10853 CPC_INITIALIZER_STMT.
10854 (fix_constructors): New local `class_type'. Use it. Call
10855 add_instance_initializer.
10856 (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
10857 (patch_return): Forbid return in instance initializers.
10858 (patch_throw_statement): Enforce exception handling in the context
10859 of instance initializers.
10861 2000-02-03 Tom Tromey <tromey@cygnus.com>
10863 * Make-lang.in (java.mostlyclean): Remove executables in
10866 2000-01-31 Scott Bambrough <scottb@netwinder.org>
10868 * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
10869 HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
10870 (java_float_finite): Convert to use union Word from javaop.h.
10871 (java_double_finite): Convert to use union DWord from javaop.h.
10873 2000-02-02 Tom Tromey <tromey@cygnus.com>
10875 * gjavah.c (options): Added `jni' entry.
10876 (help): Document -jni.
10877 (flag_jni): New global.
10878 (process_file): Handle JNI output. Don't print text from
10879 -prepend, -add, etc, when generating stubs. Only remove `.class'
10880 suffix if it actually exists.
10881 (main): Create a `.c' file when run with `--jni --stubs'. Create
10882 correct output file name with `--jni'.
10883 (print_include): Mangle header name differently in JNI case.
10884 (HANDLE_METHOD): In JNI mode, call print_method_info to generate
10886 (print_method_info): Handle JNI case. Put signature info into
10887 method name. Handle case when STREAM is NULL.
10888 (print_name_for_stub_or_jni): New function.
10889 (print_stub_or_jni): Renamed from `print_stub'. Handle JNI.
10890 (print_cxx_classname): Handle JNI.
10891 (print_full_cxx_name): Likewise.
10892 (decode_signature_piece): Likewise.
10893 (overloaded_jni_method_exists_p): New function.
10894 (struct method_name): Added `signature' and `sig_length' fields.
10895 (HANDLE_END_FIELD): Do nothing in JNI mode.
10897 2000-02-02 Tom Tromey <tromey@cygnus.com>
10899 * jv-scan.c: Include version.c, <getopt.h>.
10900 (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
10901 (options): New array.
10902 (usage): New function.
10903 (version): New function.
10904 (main): Use getopt_long to parse command line.
10905 * jcf-dump.c: Include version.c, <getopt.h>.
10906 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
10907 OPT_JAVAP): New macros.
10908 (options): New array.
10909 (usage): Return `void'. Changed message.
10910 (help): New function.
10911 (version): New function.
10912 (main): Use getopt_long_only to parse command line.
10913 * gjavah.c: Include <getopt.h>.
10914 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
10915 OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
10916 OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
10917 (options): New array.
10918 (java_no_argument): Removed.
10919 (help): Updated with missing options.
10920 (main): Use getopt_long_only to parse command line.
10921 (usage): Changed message.
10923 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10925 * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
10926 * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
10927 ANONYMOUS_ARRAY_INITIALIZER): New access macros.
10928 * parse.y (array_creation_expression:): Handle anonymous arrays.
10929 (build_array_from_name): Don't set `ret_name' if null.
10930 (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
10931 (qualify_ambiguous_name): Likewise.
10932 (java_complete_expand_class): Likewise.
10934 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
10936 * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
10937 * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
10938 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
10939 (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
10940 (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
10941 AIPL_FUNCTION_COMPLETED_INVOCATION.
10942 (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
10943 AIPL_FUNCTION_INVOCATION_READY.
10944 (AIPL_FUNCTION_DECLARATION): New enum entry.
10945 * parse.y (reorder_static_initialized): New function.
10946 (java_parser_context_pop_initialized_field): Use it.
10947 (add_inner_class_fields): Use
10948 MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
10949 augmented. Install marker after last alias initializer, if any.
10950 (generate_finit): Fixed typo. Don't try to retain only the used
10952 (method_header): Compute and set DECL_FUNCTION_NAP.
10953 (method_declarator): Fixed comment. Insert alias initializer in
10955 (build_alias_initializer_parameter_list): Fixed leading
10956 comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
10957 replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
10958 (java_complete_expand_class): Code to retain only used aliases
10960 (java_complete_expand_methods): New local `first_decl'. Generate
10961 $finit$ first, then expand the constructors, regular methods and
10963 (java_complete_expand_method): Don't report error on missing
10964 return statement if previously detected bogus.
10965 (fix_constructors): Don't patch constructor parameters list.
10966 (patch_method_invocation): Use new AIPL enum values. Reverse
10967 alias initializer list for anonymous classes.
10969 2000-01-30 Anthony Green <green@redhat.com>
10971 * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
10972 determine how many stack slots to pop.
10974 2000-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
10976 * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
10977 error handling/recovery.
10978 * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
10980 2000-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
10982 * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
10983 FIELD_LOCAL_ALIAS_USED): New macros.
10984 (DECL_FUNCTION_NAP): New macro.
10985 (struct lang_decl): New field `nap'.
10986 (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
10987 (struct lang_type): New fields `finit_stmt_list' and
10988 `clinit_stmt_list'.
10989 (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
10990 * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
10991 (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
10992 UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
10993 (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
10994 AIPL_FUNCTION_INVOCATION_READY): New enum fields.
10995 (BUILD_THROW): Macro line separator re-indented.
10996 * parse.y (end_class_declaration): New function.
10997 (maybe_generate_pre_expand_clinit): New name for
10998 java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
10999 pre-expand static fields.
11000 (maybe_generate_clinit): Function deleted.
11001 (check_for_static_method_reference): Prototype's parameter list
11003 (generate_finit): New name for maybe_generate_finit. Changed
11004 leading comment. Function rewritten to use
11005 TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
11006 (build_alias_initializer_parameter_list): New function.
11007 (java_parser_context_pop_initialized_field): Likewise.
11008 (add_inner_class_fields): Likewise.
11009 (type_declaration:): Call end_class_declaration.
11010 (class_member_declaration:): Likewise.
11011 (formal_parameter_list:): Fixed typos.
11012 (formal_parameter:): Use ARG_FINAL_P to mark created tree list
11013 element. Improved error handling.
11014 (block_statement:): Call end_class_declaration.
11015 (anonymous_class_creation:): Likewise.
11016 (create_anonymous_class): Fixed comments.
11017 (create_class): Call add_inner_class_fields.
11018 (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
11019 (method_header): Use MARK_FINAL_PARMS.
11020 (finish_method_declaration): Use UNMARK_FINAL_PARMS.
11021 (method_declarator): Propagate final argument flag.
11022 (craft_constructor): New local `artificial'. Call
11023 build_alias_initializer_parameter_list. Use
11024 CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
11025 (source_start_java_method): Mark parm decls with LOCAL_FINAL if
11027 (complete_expand_class): Get rid of unused outer context local
11029 (java_complete_expand_methods): Fixed leading
11030 comment. Generate/pre-expand <clinit> first. Changed method
11031 expansion order to regular, $finit$, constructors, <clinit>.
11032 (java_complete_expand_method): Set current_function_decl.
11033 (fix_constructors): Fix constructor parameter list to account for
11034 outer context local alias initializers.
11035 (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
11036 (resolve_expression_name): Lookup outer context local aliases. New
11037 local `access', use it.
11038 (patch_method_invocation): Patch inner class ctor invocation with
11039 outer context local aliases initialization values. $finit$
11040 invocation patching now includes things generated with
11041 build_alias_initializer_parameter_list.
11042 (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
11043 (build_super_invocation): Likewise.
11044 (patch_assignment): Changed comment.
11046 2000-01-27 Andrew Haley <aph@cygnus.com>
11048 * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
11052 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11054 * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
11056 (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
11058 * parse.y (register_fields): Don't pass a format specifier to
11059 OBSOLETE_MODIFIER_WARNING.
11060 (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
11061 instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
11063 (check_modifiers): Change function into a macro.
11064 (check_class_interface_creation): Pass a literal format string.
11066 2000-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11068 * buffer.h: PROTO -> PARAMS.
11069 * check-init.c: Likewise.
11070 * class.c: Likewise.
11071 * constants.c: Likewise.
11072 * convert.h: Likewise.
11073 * decl.c: Likewise.
11074 * except.c: Likewise.
11075 * expr.c: Likewise.
11076 * gjavah.c: Likewise.
11077 * java-except.h: Likewise.
11078 * java-tree.h: Likewise.
11079 * jcf-depend.c: Likewise.
11080 * jcf-dump.c: Likewise.
11081 * jcf-parse.c: Likewise.
11082 * jcf-path.c: Likewise.
11083 * jcf-reader.c: Likewise.
11084 * jcf-write.c: Likewise.
11086 * jv-scan.c: Likewise.
11087 * jvgenmain.c: Likewise.
11088 * jvspec.c: Likewise.
11089 * lang.c: Likewise.
11092 * parse-scan.y: Likewise.
11093 * parse.h: Likewise.
11094 * parse.y: Likewise.
11095 * typeck.c: Likewise.
11096 * verify.c: Likewise.
11097 * xref.c: Likewise.
11098 * xref.h: Likewise.
11099 * zextract.c: Likewise.
11100 * zipfile.h: Likewise.
11102 2000-01-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
11104 * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
11105 (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
11106 * constants.c (build_constant_data_ref): Check for cached
11107 current_constant_pool_data_ref. Cache current_constant_pool_data_ref
11108 in TYPE_CPOOL_DATE_REF.
11109 * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
11110 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
11111 (struct lang_type): New fields `cpool' and `cpool_data_ref'.
11112 (LOCAL_FINAL): New macro.
11113 * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
11114 constant pool -- don't try to reuse.
11115 (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
11116 TYPE_LANG_SPECIFIC.
11117 (find_in_current_zip): Use TYPE_JCF.
11118 * parse.h (java_check_final): Prototype removed.
11119 * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
11120 (maybe_create_class_interface_decl,
11121 check_class_interface_creation): Likewise.
11122 (java_expand_finals): Function removed.
11123 (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
11124 (block_statement:): Fixed comment.
11125 (anonymous_class_creation:): Likewise.
11126 (check_class_interface_creation): Reversed Jan 12, 2000 extra
11128 (check_class_interface_creation): Loosened error report on (inner)
11129 public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
11130 (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
11131 (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
11133 (create_interface): Likewise.
11134 (anonymous_class_counter): New static global.
11135 (create_anonymous_class): Reversed Jan 12, 2000 extra argument
11136 patch. Fixed comments.
11137 (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
11138 anonymous_class_counter when declaring a toplevel class.
11139 (craft_constructor): Fixed constructor name when handling
11140 anonymous classes. Anonymous class constructors to feature hidden
11141 this$<n> parameter.
11142 (java_fix_constructors): Added comment.
11143 (java_check_final): Function removed.
11144 (java_complete_expand_methods): Fixed comment. Don't generate
11145 class data, save its outgoing constant pool instead.
11146 (verify_constructor_super): Skip anonymous class constructor
11147 hidden this$<n> parameter.
11148 (java_expand_classes): New local `saved_ctxp'. Removed call to
11149 java_expand_finals and java_check_final. Expand anonymous class
11150 constructors. Generate class data.
11151 (build_super_invocation): Skip anonymous class hidden this$<n>
11153 * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
11154 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
11155 (set_java_signature): Likewise.
11157 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
11159 * gjavah.c: Delete ACC_VISIBILITY define.
11160 * jcf.h: Add ACC_VISIBILITY define.
11161 * parse.y: final: rule tagged <value>.
11162 (java_check_regular_methods): Use ACC_VISIBILITY define for
11163 default package access check.
11164 (local_variable_declaration_statement): Use final: rule.
11166 2000-01-17 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
11168 * parse.y (format_parameter:): Use final: rule instead of modifiers:.
11169 (final:): New rule.
11171 2000-01-17 Tom Tromey <tromey@cygnus.com>
11173 * gjavah.c (print_field_info): Allow non-static final fields.
11175 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11177 * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
11178 * parse.y (patch_anonymous_class): New function.
11179 (create_anonymous_class): Register incomplete type when the
11180 class/interface to extends/implement isn't known yet.
11181 (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
11182 (verify_constructor_super): Tuned error message.
11184 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11186 * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
11187 (ANONYMOUS_CLASS_P): New macro.
11188 (TYPE_SIGNATURE, TYPE_JCF): New macros.
11189 (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
11190 * parse.y (create_class): Added leading argument.
11191 (maybe_create_class_interface_decl,
11192 check_class_interface_creation): Likewise.
11193 (craft_constructor): New function.
11194 (verify_constructor_super): Added argument in prototype.
11195 (class_declaration:): Inserted leading argument.
11196 (for_begin:): Use FOR_LOOP_P.
11197 (anonymous_class_creation): Create WFL of the anonymous class to
11198 instantiate. Call build_new_invocation. Added comments.
11199 (check_class_interface_creation): Handle parameter `anonymous' in
11200 verbose mode class creation announce.
11201 (link_nested_class_to_enclosing): Exclude anonymous classes.
11202 (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
11203 anonymous class, even though they appear to have an enclosing
11205 (create_interface): Pass extra argument to
11206 check_class_interface_creation.
11207 (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
11208 (create_class): Call check_class_interface_creation and
11209 maybe_create_class_interface_decl with extra new argument. Don't
11210 add private this$<n> to anonymous classes.
11211 (method_declarator): Insert hidden this$<n> to anonymous class
11213 (java_fix_constructors): Deleted code creating default
11214 constructor. Call craft_constructor instead.
11215 (java_check_regular_methods): Set `saw_constructor' to 1 for
11217 (fix_constructors): Pass extra argument to verify_constructor_super.
11218 (verify_constructor_super): New local `sdecl', use it. Search for
11219 matching constructor (possibly featuring arguments) in super
11221 (lookup_method_invoke): Craft constructor according to arguments
11222 list when dealing with anonymous class constructors.
11223 (build_super_invocation): Pass arguments to anonymous class super
11225 (search_loop): Use FOR_LOOP_P.
11226 (labeled_block_contains_loop_p): Likewise.
11228 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11230 * class.c (set_super_info): Set CLASS_STATIC when appropriate.
11231 (enclosing_context_p): New function.
11232 (get_access_flags_from_decl): Handle CLASS_STATIC.
11233 (maybe_layout_super_class): Extra first argument passed to
11235 (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
11237 * decl.c (access0_identifier_node): New global.
11238 (init_decl_processing): access0_identifier_node initialized.
11239 (pushdecl): Set DECL_CONTEXT only on non type decls.
11240 * expr.c (lookup_field): Lookup inner class fields in enclosing
11242 (expand_invoke): Use ID_INIT_P.
11243 (expand_java_field_op): Use DECL_CLINIT_P.
11244 * java-tree.def (CLASS_LITERAL): New tree code.
11245 * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
11246 DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
11247 (struct lang_decl): New field `inner_access'.
11248 (enclosing_context_p): Prototyped.
11249 (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
11250 ID_CLINIT_P): New macros.
11251 (CLASS_STATIC): New macro.
11252 (CLASS_ACCESS0_GENERATED_P): New macro.
11253 (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
11254 TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
11255 INNER_CLASS_P): New macros.
11256 (DECL_INNER_CLASS_LIST): New macro.
11257 * jcf-parse.c (yyparse): Avoid the use of ANSI string
11259 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
11260 the shift value to int. Fixed typo in comment.
11261 * lex.c (inst_id, wpv_id): Initialize.
11262 * mangle.c (unicode_mangling_length): Take `$' into account.
11263 * parse.h (DRECOVER, RECOVER): Terminate properly.
11264 (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
11265 (typedef struct _jdep): New field `enclosing'.
11266 (JDEP_ENCLOSING): New macro.
11267 (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
11268 (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
11269 (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
11270 GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
11271 GET_ENCLOSING_CPC_CONTEXT): New macros.
11272 (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
11273 (do_resolve_class): Added extra argument in prototype.
11274 * parse.y (resolve_class): Added extra argument in prototype.
11275 (maybe_create_class_interface_decl): Likewise.
11276 (maybe_use_access_method, build_wfl_wrap): New functions.
11277 (java_complete_expand_classes, java_complete_expand_class):
11279 (java_parser_context_push_initialized_field,
11280 java_parser_context_suspend, java_parser_context_resume):
11282 (maybe_make_nested_class_name, make_nested_class_name,
11283 set_nested_class_simple_name_value,
11284 link_nested_class_to_enclosing, find_as_inner_class,
11285 find_as_inner_class_do, check_inner_class_redefinition,
11286 build_thisn_assign, build_current_thisn, build_access_to_thisn,
11287 maybe_build_thisn_access_method, build_outer_field_access,
11288 build_outer_field_access_methods, build_outer_field_access_expr,
11289 build_outer_method_access_method, build_new_access_id,
11290 build_outer_field_access_method, outer_field_access_p,
11291 outer_field_expanded_access_p, outer_field_access_fix,
11292 build_incomplete_class_ref, patch_incomplete_class_ref,
11293 create_anonymous_class): Likewise.
11294 (inst_id, wpv_id): New static global variables.
11295 (synchronized:): New rule, tagged <node>.
11296 (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
11298 (anonymous_class_creation:): New rule, tagged <node>.
11299 (NEW_TK): Tagged <node>.
11300 (type_literals, array_type_literal): New rules, tagged <node>.
11301 (class_declaration:): Removed action when reducing by class_body:
11302 (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
11303 using GET_CPC in sub-rules.
11304 (class_member_declaration): Handle inner classes.
11305 (method_declaration): When reducing method_header:, reset
11306 current_function_decl when appropriate.
11307 (method_declarator:): Set the number of formal parameter to 0 for
11308 method declared without arguments.
11309 (constructor_declarator:): Likewise.
11310 (static_initializer:): List of elements kept in a list.
11311 (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
11312 use of the keyword `static' for type declarations.
11313 (block_statement:): Handle inner class declarations.
11314 (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
11315 type qualified `this'.
11316 (class_instance_creation_expression): Use anonymous_class_creation:
11317 to handle inner class instances creation. Handle qualified `new'.
11318 (something_dot_new): Added appropriate actions.
11319 (create_new_parser_context): New function.
11320 (java_push_parser_context, java_parser_context_save_global,
11321 java_parser_context_suspend): Use create_new_parser_context.
11322 (check_modifiers): Changed leading comment.
11323 (check_class_interface_creation): Handle interclasses.
11324 (add_superinterfaces): Fixed comment.
11325 (create_interface): Build qualified name from the raw_name instead
11326 of its matching WFL. Push the initialized fields list. raw_name added
11327 as an extra argument to maybe_create_class_interface_decl.
11328 (create_class): Build qualified name from the raw_name instead of
11329 its matching WFL. Removed assignment to current_parsed_class_un.
11330 Call PUSH_ERROR before returning an error. Suspend the current
11331 parser context when processing an inner class. Push the
11332 initialized fields list. raw_name added as an extra argument to
11333 maybe_create_class_interface_decl. Add the private this$<n>
11335 (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
11336 (register_fields): Get the class type from GET_CPC and handle
11337 previous errors. Added code to handle the creation of static
11338 fields in inner classes. Initialized fields initialization
11339 statements kept in a list of lists.
11340 (maybe_generate_finit): Initialized fields initialization
11341 statements kept in a list of lists. Use GET_CPC.
11342 (maybe_generate_clinit): Likewise.
11343 (method_header): Use GET_CPC and GET_CPC_UN.
11344 (parser_qualified_classname): Handle inner classes.
11345 (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
11346 (java_fix_constructors): Hide pointer to enclosing context
11347 instance in constructor list when dealing with inner classes.
11348 (jdep_resolve_class): Call resolve_class with extra first argument
11350 (resolve_class): Add enclosing context as a first extra argument
11351 to do_resolve_class.
11352 (do_resolve_class): Call find_as_inner_class. Handle WFLs
11354 (resolve_no_layout): Extra argument added to resolve_class
11356 (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
11357 (java_get_real_method_name): Use GET_CPC_UN.
11358 (check_abstract_method_definitions): Use DECL_CLINIT_P.
11359 (java_check_abstract_methods): Handle static method declared in
11360 inner classes by an error.
11361 (java_check_regular_methods): Use DECL_CLINIT_P.
11362 (source_start_java_method): Also set DECL_MAX_LOCALS.
11363 (create_artificial_method): Call java_parser_context_save_global
11364 and java_parser_context_restore_global instead of saving/restoring
11365 the context by hand.
11366 (expand_start_java_method): Improved verbose mode message.
11367 (java_complete_expand_methods): Fixed leading comment. Use
11369 (fix_constructors): Added assignment to this$<n> if necessary.
11370 (java_expand_classes): Call java_complete_expand_classes instead
11371 of java_complete_expand_methods.
11372 (make_qualified_primary): Simplified.
11373 (merge_qualified_name): Optimized for missing left or right parts.
11374 (resolve_expression_name): Handle access to outer class fields from
11376 (resolve_qualified_expression_name): New macro
11377 RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
11378 classes. Report error on non appropriate qualification of
11379 `new'. Handle qualified `this'.
11380 (not_accessible_p): Allow access to outer class private fields from
11382 (patch_method_invocation): Handle method invocations through
11383 access methods and inner class constructor invocations.
11384 (find_applicable_accessible_methods_list): Search enclosing
11385 contexts of an inner class.
11386 (search_applicable_methods_list): Fixed typo.
11387 (argument_types_convertible): Handle inner class constructors'
11388 hidden outer context reference argument.
11389 (qualify_ambiguous_name): Handle qualified `this'.
11390 (java_complete_lhs): Handle use of field accessed through
11391 artificial access methods in various cases of assignments. Handle
11392 CLASS_LITERAL node.
11393 (check_final_assignment): Use DECL_CLINIT_P.
11394 (valid_ref_assignconv_cast_p): Handle the destination being an
11395 enclosing context of the source.
11396 (patch_unaryop): Handle use of field accessed through artificial
11398 (patch_return): Use DECL_CLINIT_P.
11399 (patch_throw_statement): Use DECL_CLINIT_P.
11400 (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
11401 * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
11404 2000-01-16 Anthony Green <green@cygnus.com>
11406 * parse.y (build_string_concatenation): Only use
11407 StringBuffer(String) shortcut if String arg is constant.
11409 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11411 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
11412 the shift value to int. Fixed typo in comment.
11414 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
11416 * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
11417 * jcf-write.c: Likewise.
11418 * parse.y: Likewise.
11419 * parse.c: Regenerate.
11421 2000-01-09 Anthony Green <green@cygnus.com>
11423 * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
11424 bytecodes in the correct order.
11426 2000-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11428 * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
11430 2000-01-06 Anthony Green <green@cygnus.com>
11432 * expr.c (java_lang_expand_expr): Switch to permanent obstack
11433 before building constant array decl.
11435 2000-01-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
11437 * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
11438 method invocation and typo in conditional expression.
11439 (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
11440 the appropriate NOTE_POP.
11441 * parse.y (patch_binop): Shift value mask to feature the right
11444 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11446 * class.c (assume_compiled, assume_compiled_node): Add static
11448 (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
11450 * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
11452 * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
11454 * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
11455 to `__modifier' to avoid stringifying it.
11457 * parse.y (verify_constructor_circularity): Don't call a variadic
11458 function with a non-literal format string.
11459 (java_check_abstract_methods): Move unreachable code inside
11460 `continue' statement.
11461 (lookup_method_invoke): Call xstrdup, not strdup.
11463 * expr.c (expand_java_field_op): Avoid the use of ANSI string
11466 * jcf-parse.c (yyparse): Likewise.
11468 * jv-scan.c (main): Likewise.
11470 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11472 * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
11473 ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
11474 ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
11477 * parse.y (synchronized, variable_redefinition_error,
11478 check_class_interface_creation, create_interface, create_class,
11479 method_header, finish_method_declaration,
11480 check_modifiers_consistency, method_declarator,
11481 complete_class_report_errors, check_abstract_method_definitions,
11482 java_check_regular_methods, check_throws_clauses,
11483 java_check_abstract_methods, read_import_dir,
11484 check_pkg_class_access, declare_local_variables, fix_constructors,
11485 cut_identifier_in_qualified, resolve_expression_name,
11486 resolve_qualified_expression_name, patch_method_invocation,
11487 java_complete_lhs, patch_assignment, try_builtin_assignconv,
11488 patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
11489 patch_exit_expr, patch_exit_expr, patch_switch_statement,
11490 patch_try_statement, patch_synchronized_statement,
11491 patch_throw_statement, check_thrown_exceptions,
11492 patch_conditional_expr): Likewise.
11494 1999-12-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11496 * Makefile.in (LIBDEPS): Added gcc's errors.o
11497 (../jcf-dump$(exeext):): Link with gcc's errors.o
11498 (../gcjh$(exeext):): Likewise.
11499 * expr.c (expand_java_NEW): Layout the entire target type instead of
11500 laying out its methods only.
11501 (lookup_field): Layout the class after having loaded it.
11502 * java-tree.h (java_debug_context): Declared.
11503 * jcf-io.c (toplev.h): Included.
11504 (find_class): Removed assignment to jcf's outofsynch
11505 field. Force source file to be read if newer than its matching
11506 class file. Tweaked debug messages.
11507 * jcf-parse.c (jcf_out_of_synch): Deleted.
11508 (read_class): Call to jcf_out_of_synch removed.
11509 * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
11510 (jcf_out_of_synch): Prototype deleted.
11511 * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
11512 `deprecated' and `class_err': integer turned into bit-fields.
11513 New bit-fields `saved_data_ctx' and `saved_data'. Fixed comments.
11514 * parse.y (package_list): New global.
11515 (package_declaration:): Record newly parsed package name.
11516 (extra_ctxp_pushed_p): Static global deleted.
11517 (java_parser_context_save_global): Create buffer context for the
11518 purpose of saving globals, if necessary.
11519 (java_parser_context_restore_global): Pop context pushed for the
11520 purpose of saving globals, if necessary.
11521 (java_debug_context_do): New prototype and function.
11522 (java_debug_context): Likewise.
11523 (do_resolve_class): Use already parsed package names to qualify
11524 and lookup class candidate.
11525 (java_pre_expand_clinit): Removed unnecessary local variable.
11527 1999-12-17 Tom Tromey <tromey@cygnus.com>
11529 * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
11531 (process_file): Use `\n\' at end of each line in string.
11533 1999-12-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
11535 * expr.c (expand_invoke): Layout the loaded class before
11536 attempting to use it.
11537 (expand_java_field_op): Allow final field assignments to take
11539 * typeck.c (convert): Return error_mark_node if expr is null.
11541 1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11543 * class.c (class_depth): Return -1 if the class doesn't load
11545 * expr.c (can_widen_reference_to): Check for errors during depth
11546 computation and return 0 accordingly.
11547 * jcf-parse.c (parse_source_file): Call java_fix_constructors to
11548 create default constructors and add an other error check.
11549 * parse.h (java_fix_constructors): Prototyped.
11550 * parse.y (java_pre_expand_clinit): Likewise.
11551 (build_super_invocation): Re-prototyped to feature one argument.
11552 (java_check_circular_reference): Directly use `current'.
11553 (java_fix_constructors): New function.
11554 (java_check_regular_methods): Don't create default constructors
11555 here, but abort if none were found.
11556 (java_complete_expand_methods): Pre-process <clinit> calling
11557 java_pre_expand_clinit.
11558 (java_pre_expand_clinit): New function.
11559 (fix_constructors): build_super_invocation invoked with the
11560 current method declaration as an argument.
11561 (build_super_invocation): Use the context of the processed method
11562 decl argument instead of current_class.
11563 * typeck.c (lookup_java_method): Take WFLs in method names into
11566 1999-12-14 Per Bothner <per@bothner.com>
11568 * class.c (make_class_data): flag_keep_inline_functions to keep
11569 private methods in the method array.
11571 1999-12-15 Anthony Green <green@cygnus.com>
11573 * check-init.c (check_init): Take into account both types of
11574 `throw's when checking for uninitialized variables.
11576 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
11578 * parse.y (java_complete_lhs): Force conversion of array
11579 dimensions to int_type_node, that's what runtime's ABI expects.
11581 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
11583 * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
11584 operand of a WFL, until the Java front-end gets fixed with regard
11585 to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
11587 1999-12-10 Andrew Haley <aph@cygnus.com>
11589 * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
11590 decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
11591 expr.c (build_java_athrow): Add support for sjlj-exceptions.
11592 java-tree.h: Ditto.
11593 jcf-write.c: Ditto.
11595 1999-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
11597 * expr.c (java_lang_expand_expr): Switch to permanent obstack
11598 before calling expand_eh_region_start and expand_start_all_catch.
11599 * except.c (expand_start_java_handler): Switch to permanent
11600 obstack before calling expand_eh_region_start.
11601 (expand_end_java_handler): Switch to permanent obstack before
11602 calling expand_start_all_catch.
11604 1999-12-5 Anthony Green <green@cygnus.com>
11606 * decl.c (init_decl_processing): Mark throw_node as a noreturn
11607 function with side effects.
11608 (init_decl_processing): Mark all memory allocating DECLs with
11611 1999-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
11613 * except.c (expand_end_java_handler): Call
11614 expand_resume_after_catch and end_catch_handler.
11616 1999-11-30 Anthony Green <green@cygnus.com>
11618 * verify.c (verify_jvm_instructions): Create new return label
11619 chain if non existent (don't rely on the verified state of the jsr
11622 1999-11-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
11624 * jcf-write.c (generate_bytecode_insns): Fixed indentation for
11625 COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
11627 * parse.y (patch_assignment): Removed bogus final class test on
11628 lhs when checking on whether to emit an ArrayStoreException runtime
11630 * expr.c (expand_java_arraystore): Likewise.
11632 1999-11-28 Anthony Green <green@cygnus.com>
11634 * decl.c (find_local_variable): Reuse single slot decls when
11637 1999-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11639 * jcf-parse.c (saw_java_source): Global variable removed.
11640 (read_class): Don't use `saw_java_source'. Added extra braces.
11641 (yyparse): Code setting `saw_java_source' removed.
11643 1999-11-24 Mark Mitchell <mark@codesourcery.com>
11645 * except.c (emit_handlers): Zero catch_clauses after emitting them.
11647 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
11649 * verify.c (merge_type_state): Non verified subroutines being
11650 considered more than once to trigger passive type merge.
11652 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
11654 * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
11655 in case of error. Error message tuned.
11657 1999-11-21 Anthony Green <green@cygnus.com>
11659 * constants.c (find_methodref_index): Unwrap method names before
11660 inserting them in the constant pool.
11662 * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
11664 * class.c (assume_compiled_node): New typedef.
11665 (assume_compiled_tree): New static data.
11666 (find_assume_compiled_node): New function.
11667 (add_assume_compiled): New function.
11668 (assume_compiled): New function.
11669 * class.c (make_class_data): Use assume_compiled.
11670 (is_compiled_class): Use assume_compiled.
11672 * java-tree.h (add_assume_compiled): Declare.
11674 * lang.c (lang_decode_option): Parse new options.
11676 1999-11-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
11678 * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
11679 int_type_node: that's what `_Jv_AllocObject' expects.
11681 1999-11-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
11683 * parse.y (lookup_method_invoke): Use lang_printable_name to
11684 reliably build the type name during error report. Fixes PR gcj/97.
11686 1999-11-09 Tom Tromey <tromey@cygnus.com>
11688 * jcf-path.c: Include <sys/stat.h>.
11689 (jcf_path_init): Search for libjava.zip. Fixes PR gcj/84.
11690 (DIR_UP): New macro.
11692 1999-11-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
11694 * parse.y (source_end_java_method): Resume permanent allocation,
11695 reversing Apr 27 1998 patch.
11696 (patch_string_cst): Pop obstacks after having pushed the permanent
11699 1999-11-05 Tom Tromey <tromey@cygnus.com>
11701 * class.c (finish_class): Emit inlined methods if any native
11702 methods exist in the class. Fixes PR gcj/85.
11704 1999-11-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
11706 * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
11707 (qualify_ambiguous_name): Likewise.
11709 1999-11-03 Godmar Back <gback@cs.utah.edu>
11711 * typeck.c: (lookup_java_method): search all inherited
11712 interfaces when looking up interface method.
11714 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
11716 * parse.y (method_header:): Issue error message for rule `type
11718 (synchronized:): Error report when not using synchronized.
11720 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
11722 * parse.y (resolve_qualified_expression_name): Prevent `this' from
11723 being used before the superclass constructor has been called.
11724 (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
11725 instead of `CALL_THIS_CONSTRUCTOR_P'.
11727 1999-10-30 Todd T. Fries <todd@lighthouse.fries.net>
11729 * check-init.c: Fix typo in comment.
11731 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
11733 * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
11736 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
11738 * parse.y (expression_statement:): Call function to report
11739 improper invocation of a constructor.
11740 (parse_ctor_invocation_error): New function.
11742 1999-10-26 Mark Mitchell <mark@codesourcery.com>
11744 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
11747 1999-10-21 Tom Tromey <tromey@cygnus.com>
11749 * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
11750 in generated `main'.
11752 1999-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
11754 * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
11755 (qualify_ambiguous_name): Likewise.
11757 1999-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
11759 * parse.y (java_complete_tree): fold_constant_for_init to work on
11761 (java_complete_lhs): Likewise.
11762 (array_constructor_check_entry): Complete an initializer element
11763 on permanent_obstack.
11765 1999-10-19 Tom Tromey <tromey@cygnus.com>
11767 * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
11768 From Mike Moreton <mike@pillim.demon.co.uk>.
11770 1999-10-15 Greg McGary <gkm@gnu.org>
11772 * java-tree.h (flag_bounds_check): Remove extern decl.
11773 * lang.c (flag_bounds_check): Remove global variable.
11774 (lang_f_options): Remove "bounds-check" entry.
11775 (lang_init_options): Default flag_bounds_check to "on".
11777 1999-10-14 Tom Tromey <tromey@cygnus.com>
11779 * jvgenmain.c (usage): New function.
11780 (main): Use it. Also, handle `-D' options.
11781 * jvspec.c (lang_specific_driver): Recognize -D.
11782 (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
11784 * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
11786 1999-10-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11788 * jcf-dump.c (print_constant, disassemble_method): Don't call a
11789 variadic function with a non-literal format string.
11791 * parse-scan.y (report_main_declaration): Likewise.
11793 * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
11795 * parse.y (read_import_dir, patch_assignment, patch_binop,
11796 patch_array_ref): Likewise.
11798 * typeck.c (build_java_array_type): Likewise.
11800 * verify.c (verify_jvm_instructions): Likewise.
11802 1999-10-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
11804 * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
11806 1999-10-07 Anthony Green <green@cygnus.com>
11808 * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
11809 where CHECK_PUT may fail for valid reasons.
11811 * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
11812 UNSAFE_PUTN): New macros.
11814 1999-10-04 Tom Tromey <tromey@cygnus.com>
11816 * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
11817 well. Fixes Java PR gcj/59.
11818 * parse-scan.y (yyerror): Report errors.
11820 1999-09-24 Glenn Chambers <GChambers@provsol.com>
11822 * decl.c (insert_block): Remove unconditional `abort'.
11824 1999-09-24 Bernd Schmidt <bernds@cygnus.co.uk>
11826 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
11827 FUNCTION_CODE now of type int. All callers changed.
11828 Set the builtin's DECL_BUILT_IN_CLASS.
11830 1999-09-23 Tom Tromey <tromey@cygnus.com>
11832 * jvspec.c (lang_specific_driver): Don't read spec file if
11833 -fsyntax-only given.
11835 1999-09-22 Tom Tromey <tromey@cygnus.com>
11837 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
11839 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
11840 (WORDS_TO_LONG): Likewise.
11841 (WORDS_TO_DOUBLE): Likewise.
11843 1999-09-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
11845 * jcf-write.c (RELOCATION_VALUE_0): New macro.
11846 (RELOCATION_VALUE_1): Likewise.
11847 (emit_iinc, emit_reloc, push_constant1, push_constant2,
11848 push_in_const, push_long_const): Prototyped.
11849 (push_constant1): Argument `index' is of type HOST_WIDE_INT.
11850 (push_constant2): Likewise.
11851 (push_int_const): Cast find_constant1's integer arguments to `jword'.
11852 (find_constant_wide): Cast find_constant2's integer arguments to
11854 (find_constant_index): Cast find_constant2's and find_constant2's
11855 integer arguments to `jword'.
11856 (emit_pop): Argument `value' is of type HOST_WIDE_INT.
11857 (emit_switch_reloc): Use RELOCATION_VALUE_0.
11858 (emit_if): Use RELOCATION_VALUE_1.
11859 (emit_goto): Likewise.
11860 (emit_jsr): Likewise.
11861 (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
11862 argument to push_long_const to HOST_WIDE_INT.
11864 1999-09-15 Andreas Schwab <schwab@suse.de>
11866 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
11868 1999-09-20 Nick Clifton <nickc@cygnus.com>
11870 * lang.c (lang_decode_option): Extend comment.
11872 1999-09-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
11874 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
11877 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11879 * gjavah.c (get_field_name, print_method_info, print_include,
11880 add_namelet): Use xmalloc, not malloc.
11882 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
11883 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
11886 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
11888 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
11890 * jcf-path.c (add_entry): Likewise.
11892 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
11894 * jv-scan.c (xmalloc): Remove definition.
11896 * jvgenmain.c (xmalloc): Likewise.
11898 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
11900 * lex.c (java_store_unicode): Use xrealloc, not realloc.
11902 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
11903 concat, not xmalloc/sprintf.
11904 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
11905 (xstrdup): Remove definition.
11907 * parse.y (duplicate_declaration_error_p,
11908 constructor_circularity_msg, verify_constructor_circularity,
11909 check_abstract_method_definitions, java_check_regular_methods,
11910 java_check_abstract_methods, patch_method_invocation,
11911 check_for_static_method_reference, patch_assignment, patch_binop,
11912 patch_cast, array_constructor_check_entry, patch_return,
11913 patch_conditional_expr): Use xstrdup, not strdup.
11915 * zextract.c (ALLOC): Use xmalloc, not malloc.
11917 1999-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11919 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
11921 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
11922 (do_spec, lang_specific_pre_link, lang_specific_driver,
11923 input_filename, input_filename_length): Don't declare.
11924 (main_class_name, jvgenmain_spec, lang_specific_driver):
11926 (lang_specific_driver): All calls to the function pointer
11927 parameter now explicitly call `fatal'.
11929 1999-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
11931 * parse.y (find_applicable_accessible_methods_list): Search
11932 abstract classes as interfaces.
11934 1999-09-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
11936 * class.c (finish_class): We're now outside a valid method
11937 declaration. Tell the rest of gcc so.
11939 1999-09-08 Bruce Korb autogen@linuxbox.com
11941 * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
11943 1999-09-07 Tom Tromey <tromey@cygnus.com>
11945 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
11947 (decode_signature_piece): Don't emit "::" in JArray<>.
11948 (print_namelet): Only print trailing `;' when printing a class.
11950 1999-09-10 Bernd Schmidt <bernds@cygnus.co.uk>
11952 * java-tree.h: Delete declarations for all tree nodes now moved to
11954 * decl.c: Delete their definitions.
11956 1999-09-04 Mark Mitchell <mark@codesourcery.com>
11958 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
11959 * Makefile.in (OBJS): Add ggc-callbacks.o.
11960 (OBJDEPS): Likewise.
11962 1999-09-03 Tom Tromey <tromey@cygnus.com>
11964 * parse.y (strip_out_static_field_access_decl): Return operand if
11965 it satisfies JDECL_P.
11967 1999-09-02 Tom Tromey <tromey@cygnus.com>
11969 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
11970 Handle nested arrays, like `[[I'.
11972 1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11974 * class.c (finish_class): Remove unused parameter, all callers
11977 * expr.c (build_java_athrow): Change return type to void.
11978 (java_lang_expand_expr): Make sure each case in switch returns a
11981 * java-tree.h (finish_class): Fix prototype to take void args.
11983 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
11984 (main): Issue return from main, not exit.
11986 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
11988 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
11990 * jv-scan.c (main): Issue return from main, not exit.
11992 * parse.y (check_abstract_method_definitions,
11993 java_check_abstract_method_definitions): Add static prototypes.
11994 (java_complete_expand_methods): Fix call to `finish_class'.
11996 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
11999 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12001 * lang.c (language_string): Constify.
12003 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12005 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
12006 Remove hacks for stuff which comes from libiberty.
12008 * Make-lang.in: Likewise.
12010 1999-08-30 Hans-Peter Nilsson <hp@axis.se>
12012 * Makefile.in (xref.o): Depend on xref.c explicitly.
12014 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12016 * java-tree.h (lang_printable_name): Constify a char*.
12018 * lang.c (lang_printable_name): Likewise.
12020 1999-08-27 Jeffrey A Law (law@cygnus.com)
12022 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
12023 comments in C code.
12025 1999-08-26 Tom Tromey <tromey@cygnus.com>
12027 * gjavah.c (print_cxx_classname): Print "::" before qualified
12030 1999-08-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
12032 * parse.y (lookup_cl): Changed leading comment. Now does its best
12033 to set the column number.
12034 (qualify_ambiguous_name): Take WFL wrappers into account.
12036 1999-08-25 Gregg Townsend <gmt@cs.arizona.edu>
12038 * verify.c (verify_jvm_instructions): Don't check instruction
12039 validity beyond end of method.
12041 1999-08-25 Tom Tromey <tromey@cygnus.com>
12043 * jvspec.c (lang_specific_driver): Correctly handle --help again.
12045 1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12047 * gjavah.c (print_name, print_base_classname, utf8_cmp,
12048 cxx_keyword_subst, generate_access, name_is_method_p,
12049 get_field_name, print_field_name, super_class_name, print_include,
12050 decode_signature_piece, print_class_decls, usage, help,
12051 java_no_argument, version, add_namelet, print_namelet): Add static
12053 (print_base_classname, utf8_cmp, cxx_keyword_subst,
12054 name_is_method_p): Constify a char*.
12055 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
12056 Provide a final else clause in an if-else-if.
12057 (print_field_info): Add missing final arg in function call to
12058 `print_field_name'.
12059 (print_method_info, decompile_method, decode_signature_piece,
12060 print_c_decl, print_full_cxx_name, print_stub,
12061 print_mangled_classname, super_class_name, print_include,
12062 add_namelet, add_class_decl, print_class_decls, process_file,
12063 help): Constify a char*.
12065 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
12066 push_int_const, find_constant_wide, find_constant_index,
12067 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
12068 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
12069 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
12070 emit_if, emit_goto, emit_jsr, call_cleanups,
12071 make_class_file_name): Add static prototypes.
12072 (generate_bytecode_return, generate_bytecode_insns): Pass a
12073 NULL_PTR, not a NULL_TREE.
12075 * jv-scan.c: Include "jcf.h".
12076 (main): Declare using DEFUN macro.
12078 * jvspec.c (find_spec_file, lang_specific_pre_link,
12079 lang_specific_driver): Add prototypes.
12080 (find_spec_file): Constify a char*.
12082 * keyword.gperf (hash, java_keyword): Add prototypes.
12084 * lang.c (lang_print_error): Add static prototype.
12085 (lang_init): Prefer memcpy over bcopy to avoid casts.
12087 * lex.c (yylex): Add static prototype.
12089 * parse-scan.y: Include "lex.c" earlier.
12091 * parse.h: Remove redundant declaration for `yylex'.
12093 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
12094 labeled_block_contains_loop_p): Add static prototypes.
12095 (not_accessible_p): Make static to match prototype.
12097 * verify.c (start_pc_cmp): Don't needlessly cast away const.
12099 1999-08-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
12101 * parse.y (check_method_redefinition): Changed leading comment.
12102 (check_abstract_method_definitions): New function.
12103 (java_check_abstract_method_definitions): New function.
12104 (java_check_regular_methods): Call it.
12105 (verify_constructor_super): Fixed indentation.
12106 (lookup_method_invoke): Likewise.
12108 1999-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
12110 * parse.y (method_header): Return a null pointer if the current
12111 class node is null.
12112 (finish_method_declaration): Return if the current function decl
12114 (source_start_java_method): Likewise.
12115 (java_method_add_stmt): Likewise.
12117 1999-08-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
12119 * class.c (emit_register_class): Removed unnecessary call to
12121 * parse.y (labeled_block_contains_loop_p): Removed unused local
12124 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12126 * parse.y (java_refold): Added prototype.
12128 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12130 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
12131 (java_stabilize_reference): Removed unnecessary `else'.
12132 (java_complete_lhs): Set flag to remember boolean. Call
12133 java_refold. Added comments.
12134 (java_decl_equiv): New function.
12135 (binop_compound_p): Likewise.
12136 (java_refold): Likewise.
12137 (patch_unaryop): Striped static field access assigned to decl and
12138 op. Changed promotion scheme for ++/-- operators.
12139 (search_loop): New function.
12140 (labeled_block_contains_loop_p): Likewise.
12141 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
12143 (patch_bc_statement): Call search_loop. Fixed comment.
12145 1999-08-14 Anthony Green <green@cygnus.com>
12147 * expr.c (java_lang_expand_expr): Mark static array data as
12150 1999-08-10 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
12152 * jvgenmain.c (main): NUL-terminate name_obstack.
12154 1999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12156 * check-init.c (check_bool2_init, done_alternative): Add static
12159 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
12160 (add_method, build_utf8_ref, build_class_ref,
12161 append_gpp_mangled_type, layout_class_method): Constify a char*.
12163 * decl.c (push_promoted_type, make_binding_level): Add static
12165 (push_promoted_type, pushdecl): Constify a char*.
12167 * except.c (find_handler_in_range, link_handler,
12168 check_start_handlers): Add static prototypes.
12170 * expr.c (process_jvm_instruction): Constify a char*.
12172 * gjavah.c (main): Constify a char*.
12174 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
12177 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
12179 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
12180 munge, print_ents): Constify a char*.
12182 * jcf-dump.c (disassemble_method): Constify a char*.
12183 (print_constant_pool, print_exception_table): Add static prototypes.
12184 (print_constant, print_exception_table, main, disassemble_method):
12187 * jcf-io.c (find_classfile, find_class): Likewise.
12189 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
12190 (set_source_filename, predefined_filename_p): Add static prototypes.
12191 (set_source_filename, get_constant, get_class_constant,
12192 find_in_current_zip): Constify a char*.
12194 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
12196 (add_entry, add_path, jcf_path_classpath_arg,
12197 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
12199 * jcf-reader.c (get_attribute, jcf_parse_preamble,
12200 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
12201 jcf_parse_one_method, jcf_parse_methods,
12202 jcf_parse_final_attributes): Add static prototypes.
12203 (get_attribute): Constify a char*.
12205 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
12206 jcf_dependency_add_target, jcf_path_classpath_arg,
12207 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
12209 * jv-scan.c (main): Constify a char*.
12210 (gcc_obstack_init): Add prototype arguments.
12212 * jvgenmain.c (gcc_obstack_init): Likewise.
12213 (main): Constify a char*.
12215 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
12217 (put_decl_string, lang_print_error): Constify a char*.
12218 (lang_init): Remove redundant extern prototype.
12220 * mangle.c (emit_unicode_mangled_name): Constify a char*.
12222 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
12223 Add static prototypes.
12224 (get_type_from_signature): Constify a char*.
12226 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
12227 Add static prototypes.
12228 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
12229 (verify_jvm_instructions): Constify a char*.
12231 * xref.c (xref_flag_value): Likewise.
12233 * xref.h (xref_flag_value): Likewise.
12235 * zextract.c (makeword, makelong): Add static prototypes.
12236 (makeword, makelong): Constify a uch*.
12238 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12240 * lang.c (java_dummy_print): Constify a char*.
12241 (lang_print_error): Likewise.
12242 (lang_init): Remove redundant prototype for `print_error_function'.
12243 (lang_init_source): Likewise.
12244 (lang_identify): Constify a char*.
12246 1999-08-09 Tom Tromey <tromey@cygnus.com>
12248 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
12249 (WORDS_TO_LONG): Likewise.
12250 (WORDS_TO_DOUBLE): Likewise.
12252 1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12254 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
12256 * expr.c (java_stack_pop, java_array_data_offset,
12257 build_java_throw_out_of_bounds_exception, case_identity,
12258 build_java_check_indexed_type): Add static prototypes.
12259 (linenumber_table, expand_invoke, expand_java_field_op,
12260 build_primtype_type_ref, expand_byte_code): Constify a char*.
12262 * java-tree.h (build_primtype_type_ref, linenumber_table):
12264 (java_lang_expand_expr): Add prototype.
12266 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
12267 `java_lang_expand_expr'.
12269 * lex.c (java_lex_error): Constify a char*.
12270 (java_get_unicode, java_read_char, java_allocate_new_line,
12271 java_unget_unicode, java_sneak_unicode): Prototype.
12273 * parse-scan.y (current_class, package_name, method_declarator,
12274 report_class_declaration, yyerror): Constify a char*.
12276 * parse.h (java_report_errors): Prototype.
12277 (yyerror): Constify a char*.
12279 * parse.y (classitf_redefinition_error, check_modifiers,
12280 parse_jdk1_1_error, lookup_package_type,
12281 lookup_package_type_and_set_next, get_printable_method_name,
12282 purify_type_name): Constify a char*.
12283 (build_super_invocation, maybe_generate_finit,
12284 verify_constructor_super, parser_add_interface,
12285 add_superinterfaces, jdep_resolve_class, note_possible_classname,
12286 java_complete_expand_methods, java_expand_finals,
12287 cut_identifier_in_qualified, java_stabilize_reference,
12288 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
12289 merge_string_cste): Prototype.
12290 (single_type_import_declaration, yyerror,
12291 variable_redefinition_error, build_array_from_name,
12292 build_unresolved_array_type, check_class_interface_creation,
12293 resolve_class, complete_class_report_errors,
12294 note_possible_classname, read_import_dir,
12295 find_in_imports_on_demand, resolve_package, fix_constructors,
12296 check_deprecation, lookup_method_invoke,
12297 maybe_build_primttype_type_ref, array_constructor_check_entry):
12299 (java_complete_expand_methods, java_expand_finals): Make static.
12300 (convert_narrow): Remove static prototype.
12302 1999-08-03 J"orn Rennecke <amylaar@cygnus.co.uk>
12304 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
12306 1999-08-02 Richard Henderson <rth@cygnus.com>
12308 * decl.c: Include defaults.h instead of expr.h.
12309 * parse.y: Likewise.
12311 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
12313 * java/decl.c (start_java_method): Change all uses of
12314 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
12315 Ensure expr.h is included.
12316 * java/expr.c (pop_arguments): Ditto.
12317 * java/parse.y (expand_start_java_method): Ditto.
12319 1999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12321 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
12323 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
12325 * decl.c: Include "function.h".
12326 * except.c: Likewise.
12327 * parse.y: Likewise.
12328 * Makefile.in: Update dependencies.
12330 1999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12332 * expr.c (build_java_soft_divmod): Provide a default case in switch.
12333 (java_lang_expand_expr): Mark parameters `target', `tmode' and
12334 `modifier' with ATTRIBUTE_UNUSED.
12336 * gjavah.c (process_file): Add braces around ambiguous `else'.
12338 * jcf-dump.c (print_access_flags, localvar_free): Change return
12341 * parse.y (java_complete_expand_method): Initialize variable
12343 (resolve_qualified_expression_name): Likewise for `field_decl'.
12344 (patch_method_invocation): Likewise for `class_to_search'.
12345 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
12346 (patch_assignment): Likewise for `lhs_type'.
12348 * verify.c (verify_jvm_instructions): Remove unused variable
12351 1999-07-25 Richard Henderson <rth@cygnus.com>
12353 * decl.c (va_list_type_node): New.
12355 1999-07-25 Anthony Green <green@cygnus.com>
12357 * gjavah.c (print_stub): New function.
12358 (METHOD_IS_NATIVE): New macro.
12359 (print_mangled_classname): Make static.
12360 (HANDLE_END_FIELD): Don't emit fields during stub generation.
12361 (process_file): Perform stub generation.
12362 (HANDLE_METHOD): Don't emit class decls during stub
12364 (HANDLE_END_METHOD): Take into account stub generation.
12365 (print_method_info): Handle stub generation.
12366 (print_stub): New function.
12367 (print_cxx_classname): Make signature consistant with others.
12368 (help): Describe -stubs option.
12369 (main): Create stub file.
12370 (version): Use version.c.
12371 (print_full_cxx_name): New function.
12372 (print_c_decl): Use print_full_cxx_name.
12374 1999-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
12376 * check-init.c (check_init): Handle MAX_EXPR.
12378 1999-07-15 Andrew Haley <aph@cygnus.com>
12380 * lang.c (flag_use_divide_subroutine): New variable.
12381 * typeck.c: (convert_ieee_real_to_integer): Bounds check
12382 fp-to-integer conversion.
12383 (convert): Call convert_ieee_real_to_integer when flag_fast_math
12386 * expr.c (build_java_soft_divmod): New function.
12387 (build_java_binop): Call build_java_soft_divmod if
12388 flag_use_divide_subroutine is set.
12389 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
12390 soft_lrem_node: new builtin functions.
12391 (init_decl_processing) Initialize the new builtins.
12392 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
12393 soft_lrem_node: new builtin functions.
12394 (build_java_soft_divmod): New function.
12395 * parse.y: Call build_java_soft_divmod if
12396 flag_use_divide_subroutine is set.
12397 * parse.c: Rebuilt.
12399 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
12400 a --specs= arg) even if not linking.
12401 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
12402 -fuse-divide-subroutine
12404 1999-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
12406 * parse.y (resolve_and_layout): Check methods only once.
12407 (resolve_qualified_expression_name): Verify thrown exceptions
12409 (check_thrown_exceptions): Reject exceptions thrown in
12410 initializer. Error message tuned.
12412 1999-07-14 Andrew Haley <aph@cygnus.com>
12414 * expr.c (expand_expr): Do not return the last statement in a
12415 block as the block's value.
12417 1999-07-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
12419 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
12420 CALL_EXPR, to avoid order of evaluation changes.
12422 1999-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
12424 * parse.y (qualify_ambiguous_name): Do not use
12425 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
12427 1999-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
12429 * check-init.c (check_init): Handle MAX_EXPR.
12430 * expr.c (force_evaluation_order): Force method call arguments to
12431 be evaluated in left-to-right order.
12432 * parse.y (qualify_ambiguous_name): Loop again to qualify
12433 NEW_ARRAY_EXPR properly.
12435 1999-06-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
12437 * parse.y (patch_invoke): Resolve unresolved invoked method
12439 (qualify_ambiguous_name): STRING_CST to qualify expression for
12440 type name resolution.
12442 1999-06-24 Andrew Haley <aph@cygnus.com>
12444 * class.c (finish_class): Whenever a deferred method is
12445 output, rescan the list of methods to see if a new candidate for
12446 output can be found.
12448 1999-06-28 Tom Tromey <tromey@cygnus.com>
12450 * jvspec.c (lang_specific_driver): Recognize --help.
12452 1999-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
12454 * parse.y (resolve_package): Fixed bogus return statement.
12455 (patch_method_invocation): Resolve method invocation beginning with
12456 a package name qualifier.
12458 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12460 * Make-lang.in (java.stage1): Depend on stage1-start.
12461 (java.stage2): Likewise for stage2-start.
12462 (java.stage3): Likewise for stage3-start.
12463 (java.stage4): Likewise for stage4-start.
12465 1999-06-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
12467 * parse.y (java_complete_lhs): When doing cross referencing, don't
12468 try to keep file location on a WFL expanded as a CALL_EXPR.
12470 1999-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
12472 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
12473 compiling to class file a void method with an empty method body.
12474 As a side effect, the bytecode backend will generate the
12475 appropriate `return' instruction.
12477 1999-06-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
12479 * parse.y (lookup_package_type_and_set_next): New function prototype.
12480 (resolve_package): Search current and imported packages.
12481 (lookup_package_type_and_set_next): New function.
12483 1999-06-22 Andrew Haley <aph@cygnus.com>
12485 * verify.c (verify_jvm_instructions): Check for pending blocks
12486 before invalid PC test and opcode switch, not after.
12488 1999-06-21 Andrew Haley <aph@cygnus.com>
12490 * except.c (find_handler_in_range): The upper limit for exception
12491 ranges is exclusive, not inclusive: (start <= pc < end).
12492 (link_handler): find child pointer which points to outer by
12493 searching sibling list: previous code incorrectly assumed that
12494 outer->outer->first_child must point to outer.
12495 * verify.c (verify_jvm_instructions): FIXME added to code for
12497 (verify_jvm_instructions): Do not assume that the last block
12498 processed in a subroutine is a block which ends with a `ret'
12499 instruction. With some control flows it is possible that the last
12500 block ends with an `athrow'.
12502 1999-06-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
12504 * parse.y (qualify_ambiguous_name): Reorganized the post
12505 evaluation of non WFL leading expression nodes.
12507 1999-06-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
12509 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
12512 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
12514 * parse.y (qualify_ambiguous_name): Handle qualified expression
12515 beginning with a STRING_CST.
12517 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
12519 * parse.y (register_fields): Set DECL_INITIAL on both
12520 pre-initialized static and public fields.
12521 (resolve_field_access): Static field access expressions to always
12523 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
12524 qualification. CONVERT_EXPR to be resolved as an expression name.
12525 (java_complete_lhs): Identify and access qualified final
12526 initialized field in switch statement case expression.
12527 (fold_constant_for_init): Pre-initialized field decl constant to
12530 1999-06-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
12532 * parse.y (note_possible_classname): Mark returned node with
12533 QUALIFIED_P only if the original class name contained a '/'.
12535 1999-06-05 Anthony Green <green@cygnus.com>
12537 * Make-lang.in (gcjh): More parallel build fixes.
12539 1999-06-03 Mike Stump <mrs@wrs.com>
12541 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
12543 1999-06-02 Anthony Green <green@cygnus.com>
12545 * except.c (link_handler): Chain exception handlers in order.
12547 1999-06-02 Anthony Green <green@cygnus.com>
12549 * expr.c (expand_byte_code): Fill unreachable bytecode regions
12550 with nops and process as usual in order to always set correct EH
12551 ranges. Emit detailed warnings about unreachable bytecodes.
12553 1999-06-02 Anthony Green <green@cygnus.com>
12555 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
12558 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
12560 * parse.y (lookup_field_wrapper): Unified returned value to NULL
12561 or the searched field decl.
12563 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
12565 * parse.y (fold_constant_for_init): Convert numerical constant
12566 values to the type of the assigned field.
12568 1999-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
12570 * expr.c (lookup_field): Relaxed the test on class loading error
12572 * parse.y (fold_constant_for_init): Enabeled old code.
12574 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
12576 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
12577 decide the validity of the cast of a java.lang.Cloneable reference
12579 (patch_conditional_expr): Fixed first argument passed to
12580 binary_numeric_promotion.
12582 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
12584 * parse.y (qualify_ambiguous_name): Take into account that a
12585 CONVERT_EXPR might specify a type as a WFL.
12587 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
12589 * parse.y (patch_assignment): Save the rhs before using it as an
12590 argument to _Jv_CheckArrayStore.
12592 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
12594 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
12596 1999-05-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
12598 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
12599 floating point literal only when the exponent indicator has been
12602 1999-05-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
12604 * parse.y (formal_parameter:): Construct argument tree list
12605 element even if a yet unsupported final parameter was encountered.
12607 1999-05-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
12609 * parse.y (finish_method_declaration): Issue errors for native or
12610 abstract methods declared with a method body, as well as for non
12611 native or non abstract methods with no method body.
12613 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12615 * class.c (build_utf8_ref): Initialize variable `field'.
12617 * decl.c (init_decl_processing): Initialize variable `field'.
12619 * expr.c (build_known_method_ref): Mark parameters `method_type',
12620 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
12621 (process_jvm_instruction): Likewise for parameter `length'.
12623 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
12624 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
12627 * parse.y (maybe_generate_clinit): Remove unused variable
12628 `has_non_primitive_fields'.
12629 (find_in_imports_on_demand): Initialize variables `node_to_use'
12631 (patch_binop): Likewise for variable `prom_type'.
12632 (patch_unaryop): Likewise for variable `prom_type'.
12634 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
12636 * xref.c (xref_table): Add missing initializer.
12638 1999-05-14 Tom Tromey <tromey@cygnus.com>
12640 * java-except.h (struct eh_range): Removed unused `next' member.
12641 * verify.c (verify_jvm_instructions): Call check_nested_ranges
12642 after adding all exception handlers. Sort exception ranges in
12644 (struct pc_index): New structure.
12645 (start_pc_cmp): New function.
12646 * except.c (add_handler): Return `void'. Don't call link_handler;
12647 instead construct an ordinary linked list and do range
12649 (check_nested_ranges): New function.
12650 (link_handler): Changed interface to allow merging of eh_ranges.
12651 Split overlapping ranges. Return `void'.
12653 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12655 * parse.y (constructor_block_end:): New rule, tagged <node>.
12656 (constructor_body:): Use `constructor_block_end' instead of
12659 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
12661 * parse.y (statement_nsi:): Pop `for' statement block.
12662 (java_complete_lhs): Labeled blocks containing no statement are
12663 marked as completing normally.
12665 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
12667 * xref.c (xref_set_current_fp): New function, defined.
12668 * xref.h (xref_set_current_fp): New function, prototyped.
12670 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
12672 * check-init.c (check_init): Take into account that
12673 LABELED_BLOCK_STMT can be empty.
12675 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
12677 * parse.y (java_check_regular_methods): Warning check on not
12678 overriding methods with default access in other packages does not
12679 apply to `<clinit>'.
12680 (java_complete_lhs): If block body is an empty_stmt_node, replace
12681 it by NULL_TREE. This prevents gcc from generating an irrelevant
12684 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
12686 * check-init.c (check_init): Removed code accepting to see things
12687 falling through default:, when doing xrefs.
12688 * java-tree.h (do_not_fold): New global variable, declared.
12689 * parse.y (do_not_fold): New global variable, defined.
12690 (java_complete_expand_method): Set `do_not_fold' to the value of
12691 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
12692 and reinstall them after them have been purged; do not check for
12693 initializations; do not issue missing return errors.
12694 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
12696 (patch_binop): Skip the fold part when doing xrefs.
12697 (build_string_concatenation): Skip the concatenation part when
12699 (patch_synchronized_statement): Do not generate a try-finally when
12701 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
12702 and keep the location where the throw was seen.
12703 * typeck.c (convert): When `do_not_fold' is set, do not attempt
12704 any treatment on the converted node an simply return a NOP_EXPR of
12706 * xref.c (xref_get_data): New function, defined.
12707 * xref.h (xref_get_data): New function, declared.
12708 (XREF_GET_DATA): Use xref_get_data.
12710 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12712 * gjavah.c (print_include): Cast the result of `strlen' to int
12713 when comparing against a signed value.
12714 (add_namelet): Likewise.
12716 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12718 * expr.c (expand_invoke): Mark parameter `nargs' with
12720 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
12722 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
12725 * jcf-reader.c (get_attribute): Cast a value to long
12726 when comparing against a signed expression. Likewise.
12728 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
12729 HOST_BITS_PER_CHAR.
12731 1999-05-11 Andrew Haley <aph@cygnus.com>
12733 * parse.y (source_end_java_method): If the current method contains
12734 any exception handlers, force asynchronous_exceptions: this is
12735 necessary because signal handlers in libjava may throw exceptions.
12736 * decl.c (end_java_method): Ditto.
12738 1999-05-11 Tom Tromey <tromey@cygnus.com>
12740 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
12742 * jvspec.c (THREAD_NAME): Removed.
12743 (GC_NAME): Likewise.
12744 (MATHLIB): Likewise.
12745 (WITHLIBC): Likewise.
12747 (THREADLIB): Likewise.
12748 (MATH_LIBRARY): Likewise.
12749 (lang_specific_driver): Don't add `-l' options to command line.
12750 Instead, add a single --specs option. Recognize `-L' options and
12751 use them to search for spec file.
12752 (find_spec_file): New function.
12753 (SPEC_FILE): New define.
12755 1999-05-11 Dave Brolley <brolley@cygnus.com>
12757 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
12758 cpplib-enabled build.
12760 1999-05-05 Per Bothner <bothner@cygnus.com>
12762 * class.c (make_field_value): DECL_INITIAL may be a string literal;
12763 temporarily zero it while calling rest_of_decl_compilation.
12765 * java-tree.h (string_ptr_type_node): Add declaration.
12766 * decl.c: Define and initialize string_ptr_type_node.
12767 * parse.y (patch_string_cst): Use string_ptr_type_node.
12769 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
12770 * parse.y (for_statement): Now unconditionally exit_block.
12771 (finish_labeled_statement): No longer exit_block if for-loop.
12772 (patch_loop_statement): Check harder if the loop is already labeled.
12774 * parse.y (patch_initialized_static_field): Removed function.
12775 (maybe_generate_clinit): Removed special handling for interfaces.
12776 (java_complete_expand_methods): Do a preliminary java_complete_tree
12777 on <clinit> to determine if it can be removed.
12778 (java_complete_expand_method): Remove special handling for <clinit>.
12779 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
12780 optimize if we get back empty_stmt_node.
12781 For MODIFY_EXPR, re-do checking of static initializers.
12782 (fold_constant_for_init): Don't return immediate if VAR_DECL.
12783 For VAR_DECL, pass correct context.
12785 * verify.c (verify_jvm_instructions): Better error messages.
12787 1999-05-03 Tom Tromey <tromey@cygnus.com>
12789 * parse-scan.y (interface_declaration): Call
12790 report_class_declaration for interfaces.
12792 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
12794 * Makefile.in: Remove -v from bison command lines.
12796 1999-04-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
12798 * check-init.c (check_init): Exclude a case of error when doing
12800 * class.c (layout_class_method): Don't generate the error message
12801 twice when compiling from source.
12802 * lang-options.h: Added `-Wredundant-modifers' and
12803 `-Wunusupported-jdk11' flags and help text.
12804 * lang.c (lang_decode_option): Added support for
12805 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
12806 flag_static_local_jdk11 and flag_redundant set accordingly.
12807 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
12808 * parse.h (EXPR_WFL_ADD_COL): New macro.
12809 (DECL_END_SOURCE_LINE): Likewise.
12810 (DECL_INHERITED_SOURCE_LINE): Likewise.
12811 * parse.y (static_ref_err): New function, prototyped.
12812 (CCB_TK): Now tagged <operator>.
12813 (class_body:): Remember the location of the closing '}' of a class
12814 definition when doing xrefs.
12815 (block:): Likewise.
12816 (block_end:): Likewise.
12817 (create_class): Remember the location of the inherited class
12818 identifier when doing xrefs.
12819 (register_fields): Added test on first operand of `init' before
12820 testing it TREE_CODE.
12821 (method_header): Store the location of the class identifier in the
12822 class decl when doing xrefs.
12823 (finish_method_declaration): Don't combine first/last method line
12825 (java_check_regular_methods): Warning check on not overriding
12826 methods with default access on other packages move before check on
12827 static methods. Initialization of `aflags' also moved up.
12828 (resolve_expression_name): Call static_ref_err to report the error.
12829 (static_ref_err): New function, implemented.
12830 (resolve_field_access): Returned simplified static field access
12832 (resolve_qualified_expression_name): Check for illegal use of
12833 static fields in a non static context. Call static_ref_err to
12834 report error in various places.
12835 (java_complete_tree): Do not fold initialized static fields when
12837 (java_complete_lhs): Likewise.
12839 1999-04-29 Anthony Green <green@cygnus.com>
12841 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
12842 create internal labels.
12843 (lookup_label): Ditto.
12845 1999-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
12847 * class.c (layout_class_method): Generate <clinit>'s rtl for
12849 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
12850 for interfaces' <clinit>.
12851 * expr.c (lookup_field): Search for fields in interfaces.
12852 (expand_invoke): Fixed indentation.
12853 (expand_java_field_op): Likewise. Use IS_CLINIT.
12854 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
12855 (IS_CLINIT): New macro.
12856 * parse.y (type_declaration:): Call maybe_generate_clinit after an
12857 interface was parsed.
12858 (maybe_generate_clinit): Don't generate if the current class is an
12859 interface with only fields of primitive types.
12860 (reset_method_name): Use IS_CLINIT.
12861 (java_complete_expand_method): Expand <clinit> when it exists for
12862 interfaces. Use IS_CLINIT.
12863 (resolve_expression_name): Use DECL_CONTEXT instead of
12864 current_class to build static field references.
12865 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
12866 ARRAY_REF when doing xreferencing.
12867 (check_final_assignment): Fixed typo in leading comment. Use
12869 (patch_array_ref): Don't fully expand array references when
12871 (patch_return): Use IS_CLINIT.
12872 (patch_throw_statement): Likewise.
12874 1999-04-22 Tom Tromey <tromey@cygnus.com>
12876 * Make-lang.in (JAVA_SRCS): Added check-init.c.
12878 1999-04-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
12880 * decl.c (predef_filenames, predef_filenames_size): New globals
12881 (init_decl_processing): predef_filenames and predef_filenames_size
12883 * java-tree.h (predef_filenames, predef_filenames_size): Declared
12885 * jcf-parse.c (predefined_filename_p): New function.
12886 (yyparse): Check that files on the command line are specified only
12887 once and issue a warning otherwise.
12888 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
12889 * parse.y (source_end_java_method): Nullify NOP method bodies, to
12890 avoid a gcc warning with -W -Wall turned on.
12891 (java_expand_classes): Abort if errors were encountered.
12892 (java_complete_lhs): If the cross reference flag is set, wrap
12893 field DECL node around a WFL when resolving expression name.
12895 1999-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
12897 * lang.c (lang_decode_option): Fixed returned value when parsing
12898 `-fxref=...' and `-Wall'.
12899 * parse.y (source_end_java_method): Do not generate code when
12900 flag_emit_xref is set.
12901 (resolve_expression_name): Do not build static field access when
12902 flag_emit_xref is set.
12903 (resolve_field_access): No special treatment on `length' when
12904 flag_emit_xref is set. Do not build qualified static field access
12905 when flag_emit_xref is set.
12906 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
12907 when flag_emit_xref is set.
12908 (patch_assignment): Do not generate array store runtime check when
12909 flag_emit_xref is set.
12910 * xref.c (xref_flag_value): Fixed function declaration
12912 (xset_set_data): New function.
12913 * xref.h (xref_set_data): Added prototype for new function.
12914 (typedef struct xref_flag_table): New field data.
12915 (XREF_GET_DATA): New macro.
12917 1999-04-19 Tom Tromey <tromey@cygnus.com>
12919 * xref.h (enum): Removed trailing comma.
12921 * parse.y (resolve_qualified_expression_name): Added missing
12924 1999-04-15 Anthony Green <green@cygnus.com>
12926 * gjavah.c: New prototypes for java_float_finite and
12927 java_double_finite.
12929 1999-04-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
12931 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
12934 1999-04-06 Jeffrey A Law (law@cygnus.com)
12936 * Makefile.in (TREE_H): Add tree-check.h.
12937 (RTL_H): Add genrtl.h.
12939 1999-04-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
12941 * parse.y (patch_assignment): Added ArrayStoreException runtime
12944 1999-04-06 Per Bothner <bothner@cygnus.com>
12946 * expr.c (pop_type_0): New function.
12947 (pop_type): Use pop_type_0.
12948 * java-tree.h (pop_type_0): New declaration.
12949 * verify.c (verify_jvm_instructions): Check return instructions.
12951 * parse.y (patch_binop): Don't fold if non-constant and emiting
12954 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12956 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
12958 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
12959 (main_jcf): Don't define.
12960 (process_file): Don't set `main_jcf'.
12962 * java-tree.h (main_jcf): Don't declare.
12964 * jcf-parse.c (main_jcf): Add static definition.
12966 * lang.c (main_jcf): Don't define.
12968 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12970 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
12972 * decl.c (copy_lang_decl): Likewise for `bcopy'.
12974 * jcf-depend.c: Include "config.h", not <config.h>.
12976 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
12979 * jcf-path.c: Include "config.h", not <config.h>.
12981 * lex.c: Don't include various system header files.
12982 (java_init_lex): Cast the argument of `bzero' to PTR
12984 * parse-scan.y (java_push_parser_context): Likewise.
12986 * parse.y (java_push_parser_context): Likewise.
12987 (patch_bc_statement): Match format specifier to variable argument.
12989 * xref.c: Don't include <stdio.h>.
12991 1999-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
12993 * parse.y (struct parser_ctxt *ctxp): Now global.
12994 (declare_local_variables): Use WFL compound value for the
12995 declaration source line value, when doing cross-referencing.
12997 1999-03-31 Tom Tromey <tromey@cygnus.com>
12999 * gjavah.c (print_field_info): Allow constants of other types.
13000 (print_include): Generate include when new name is proper prefix
13001 of already printed name.
13002 (add_namelet): Likewise.
13003 (cxx_keyword_subst): New function.
13004 (print_method_info): Use it.
13005 (print_field_name): New function.
13006 (get_field_name): New function.
13007 (print_field_info): Use get_field_name and print_field_name.
13009 1999-03-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13011 * Makefile.in (keyword.h): Generate using gperf language 'C', not
13012 'KR-C', so gperf uses the `const' keyword on strings.
13014 * keyword.gperf (java_keyword): Const-ify a char*.
13016 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
13018 * parse.y (patch_bc_statement): Fixed identation and a bogus
13021 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
13023 * parse.y (patch_assignment): Allow static variables in other
13024 classes to be assigned.
13026 1999-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13028 * class.c (maybe_add_interface): Remove unused variable
13030 (make_class_data): Use = for assignment, not ==. Likewise.
13031 (emit_register_classes): Remove unused variable `decl'.
13033 * lex.c: Fix comment so as not to contain an embedded `/*'.
13035 * verify.c (verify_jvm_instructions): Remove unused variable
13038 1999-03-27 Per Bothner <bothner@cygnus.com>
13040 * parse.y (complete_loop_body): Rename to finish_loop_body.
13041 (complete_labeled_statement): Rename to finish_labeled_statement.
13042 (complete_for_loop): Rename to finish_for_loop.
13043 (complete_method_declaration): Rename to finish_method_declaration.
13045 * java-tree.h (continue_identifier_node): New global node.
13046 * decl.c: Define and initialize continue_identifier_node.
13047 * parse.y (generate_labeled_block): Remove - no longer needed.
13048 (build_loop_body): Use continue_identifier_node for continue block.
13049 (finish_labeled_statement): Also do pop_labeled_block actions.
13050 (java_complete_lhs): POP_LOOP even if error.
13051 (build_labeled_block): Special handling for continue_identifier_node.
13052 (patch_loop_statement): Re-organize.
13053 (patch_bc_statement): Re-write.
13055 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
13057 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
13058 using a WFL compound value.
13059 * parse.y (xref.h): Include.
13060 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
13061 WFL compound value.
13062 (register_fields): Set WFL compound value to lineno if doing
13064 (java_complete_expand_method): Call expand_xref if flag_emit_xref
13066 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
13067 * xref.h (expand_xref): Prototype renamed from xref_generate.
13069 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
13071 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
13072 (GET_CURRENT_BLOCK): New macro.
13073 * parse.y (current_static_block): New global variable.
13074 (method_body:): Define action.
13075 (complete_method_declaration): Set current_function_decl to NULL
13076 when work on the current method is done.
13077 (declare_local_variables): Use GET_CURRENT_BLOCK.
13078 (java_method_add_stmt): Likewise.
13079 (java_complete_expand_method): Disable the use of `this' when
13080 expanding <clinit>.
13081 (enter_a_block): If no current method exist, use
13082 current_static_block to link static initializer blocks.
13083 (exit_block): Rewritten to use current_static_block when no current
13084 method decl exists.
13085 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
13086 (patch_return): Forbid the use of `return' in static initializers.
13087 (patch_throw_statement): Fixed indentation. Issue specific error
13088 for uncaught thrown checked exception in static initializer
13089 blocks. Removed FIXME.
13091 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
13093 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
13094 Link gcj from gcc.o.
13096 1999-03-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
13098 * parse.y (find_applicable_accessible_methods_list): When dealing
13099 with interface: ensure that a given interface or java.lang.Object
13100 are searched only once.
13102 1999-03-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13104 * gjavah.c (print_c_decl): Remove unused argument `flags'.
13106 * jcf-dump.c (print_access_flags): Add braces around if-else.
13108 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
13111 * lex.c (build_wfl_node): Add static prototype.
13113 * lex.h (build_wfl_node): Remove static prototype.
13115 * parse.y: Include lex.c early enough to declare everything needed.
13116 Ensure calls to `build_wfl_node' pass the proper arguments.
13117 (create_class): Remove unused variable `super_decl'.
13118 (get_printable_method_name): Initialize variable `name'.
13120 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
13122 * Changelog: Fixed 1999-03-22 typos.
13123 * lang.c (lang_decode_option): Fixed typo in error string in the
13126 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
13128 * Makefile.in (JAVA_OBJS): Added entry xref.o.
13129 (xref.o): New rule.
13130 * java-tree.h (flag_emit_xref): Declared extern.
13131 * lang.c (xref.h): Included.
13132 (flag_emit_xref): New global variable.
13133 (lang_decode_option): Added support for -fxref.
13135 * xref.h: Likewise.
13137 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
13139 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
13142 1999-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13144 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
13145 $(srcdir)/../system.h and $(JAVA_TREE_H).
13146 (jcf-io.o): Depend on $(JAVA_TREE_H).
13147 (mangle.o): Likewise.
13149 * check-init.c (check_cond_init): Add static prototype.
13151 * class.c (build_java_method_type, hashUtf8String,
13152 make_field_value, get_dispatch_vector, get_dispatch_table,
13153 append_gpp_mangled_type, mangle_static_field): Likewise.
13154 (strLengthUtf8): Hide unused definition.
13155 (hashUtf8String): Const-ify.
13156 (make_field_value): Un-ANSI-fy.
13158 * constants.c: Move inclusion of jcf.h above java-tree.h.
13159 (set_constant_entry, find_class_or_string_constant,
13160 find_name_and_type_constant, get_tag_node,
13161 build_constant_data_ref): Add static prototype.
13163 * decl.c (push_jvm_slot, builtin_function,
13164 lookup_name_current_level): Likewise.
13165 (builtin_function): Const-ify.
13167 * except.c (expand_start_java_handler, expand_end_java_handler):
13168 Add static prototype.
13170 * expr.c (flush_quick_stack, push_value, pop_value,
13171 java_stack_swap, java_stack_dup, build_java_athrow,
13172 build_java_jsr, build_java_ret, expand_java_multianewarray,
13173 expand_java_arraystore, expand_java_arrayload,
13174 expand_java_array_length, build_java_monitor, expand_java_pushc,
13175 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
13176 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
13177 expand_compare, expand_test, expand_cond, expand_java_goto,
13178 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
13179 expand_java_field_op, java_push_constant_from_pool): Likewise.
13181 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
13182 (build_java_arraynull_check): Mark parameters `node' and `type'
13183 with ATTRIBUTE_UNUSED.
13184 (note_label): Likewise for parameter `current_pc'.
13185 (expand_java_call, expand_java_ret): Hide unused definition.
13187 * java-tree.h (make_class, build_constants_constructor,
13188 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
13189 init_outgoing_cpool, register_class, emit_register_classes,
13190 java_layout_seen_class_methods): Prototype.
13191 (unicode_mangling_length): Const-ify.
13192 (append_gpp_mangled_name, append_gpp_mangled_classtype,
13193 emit_unicode_mangled_name, format_int, format_uint,
13194 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
13195 jcf_print_utf8_replace, open_class): Prototype.
13197 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
13198 <stdio.h>. Include tree.h/java-tree.h.
13199 (utf8_equal_string usage, process_class): Add static prototype.
13200 (open_class): Don't prototype this here.
13201 (utf8_equal_string): Match arguments to format specifiers.
13202 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
13203 TABLE_SWITCH, disassemble_method): Likewise.
13205 * jcf-io.c: Include tree.h/java-tree.h.
13206 (open_class, find_classfile, jcf_print_utf8,
13207 jcf_print_utf8_replace): Const-ify.
13209 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
13210 parse_class_file): Add static prototype.
13211 (find_in_current_zip): Match definition to existing static
13214 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
13215 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
13216 finish_jcf_block, define_jcf_label, get_jcf_label_here,
13217 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
13218 write_chunks, adjust_typed_op, generate_bytecode_conditional,
13219 generate_bytecode_return, perform_relocations, init_jcf_state,
13220 init_jcf_method, release_jcf_state, generate_classfile):
13221 Add static prototype.
13222 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
13223 (make_class_file_name): Const-ify.
13225 * jcf.h (find_classfile): Const-ify.
13227 * jv-scan.c (reset_report): Remove prototype.
13229 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
13230 (error): Rewrite to allow varargs.
13232 * lang.c (lang_f_options): Const-ify.
13234 * lex.c (java_parse_escape_sequence): Add static prototype.
13235 (java_allocate_new_line): Match definition to existing static
13238 * mangle.c Include tree.h/java-tree.h.
13239 (unicode_mangling_length, emit_unicode_mangled_name,
13240 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
13242 * parse.h (jdep_code): Remove trailing comma in enumeration.
13243 (java_get_line_col): Move prototype outside of !JC1_LITE test.
13244 (reset_report): Add prototype.
13246 * verify.c (push_pending_label, merge_types): Add static
13249 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
13251 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
13253 * parse.y (find_applicable_accessible_methods_list): Extend the
13254 search to superinterfaces when relevant.
13255 (search_applicable_methods_list): New function.
13257 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
13259 * class.c (unmangle_classname): Implemented stricter testing
13260 before setting the QUALIFIED_P flag on an identifier.
13262 1999-03-16 Per Bothner <bothner@cygnus.com>
13264 * parse.y (java_complete_lhs): Call force_evaluation_order
13265 after patch_newarray.
13266 (patch_binop): Don't call fold if there are side effects.
13268 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
13270 * parse.y (java_stabilize_reference): Use save_expr instead of
13271 building a SAVE_EXPR node.
13272 (java_complete_lhs): Patch the resulting string of the `+='
13273 operator (if necessary) and complete the RHS after having built
13276 1999-03-15 Per Bothner <bothner@cygnus.com>
13278 * class.c (make_class): Don't set CLASS_P here (because
13279 this function is also called by build_java_array_type).
13280 (push_class): Set CLASS_P here instead.
13281 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
13283 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
13284 context. If the context is class, perfer "super" over "synchronized".
13285 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
13287 * parse.y (create_class): Don't call parser_check_super here;
13288 it is not robust. Always wait until later.
13290 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
13291 match what JDK 1.2 does), but don't set ACC_PUBLIC.
13293 1999-03-13 Per Bothner <bothner@cygnus.com>
13295 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
13296 * lex.h (UNGETC): Change misleading macro.
13298 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
13300 * parse.y (java_stabilize_reference): Return NODE when patching a
13302 (java_complete_lhs): Put parenthesis around truth values.
13304 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
13306 * class.c (layout_class_method): Don't make rtl for interface
13308 * parse.h (GET_TYPE_NAME): New macro.
13309 * parse.y (if_then_statement:): Fixed indentation.
13310 (if_then_else_statement:): Likewise.
13311 (for_statement:): Fixed spacing.
13312 (try_statement:): Fixed indentation.
13313 (create_interface): Don't force interfaces to be abstract.
13314 (method_header): Abstract methods are OK in interfaces.
13315 (declare_local_variables): Fixed typo in comment.
13316 (java_complete_expand_method): Fixed indentation.
13317 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
13318 non accessible fields.
13319 (java_stabilize_reference): New function.
13320 (java_complete_lhs): Fixed indentation. Use
13321 java_stabilize_reference in compound assignment. Insert the
13322 cast. If not processing `+' fix string constants before processing
13325 1999-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13327 * constants.c (find_class_or_string_constant): Cast variable `j'
13328 to a `jword' when comparing against one.
13330 * expr.c (java_lang_expand_expr): Remove unused variables
13331 `has_finally_p' and `op0'.
13333 * gjavah.c (print_field_info): Cast a value to jint when comparing
13334 against one. Likewise for a jlong.
13335 (add_namelet): Likewise cast a `sizeof' to an int when comparing
13336 against a signed quantity.
13338 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
13339 (print_signature): Don't needlessly dereference variable `str'
13341 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
13342 `max_locals' with ATTRIBUTE_UNUSED.
13343 (jcf_parse_class): Likewise for variable `index'.
13345 * parse.h (reverse_jdep_list): Remove static prototype.
13347 * parse.y (build_jump_to_finally): Remove prototype and definition.
13348 (reverse_jdep_list): Add static prototype.
13350 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
13351 `assignment' and `expr_decl'.
13353 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
13355 1999-03-12 Andrew Haley <aph@cygnus.com>
13357 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
13358 we'll need a directory separator and a null character.
13360 1999-03-10 Per Bothner <bothner@cygnus.com>
13362 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
13364 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
13366 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
13369 1999-03-05 Per Bothner <bothner@cygnus.com>
13371 * lex.c (java_parse_end_comment): Take extra parameter (next char).
13373 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
13375 * class.c (layout_class_method): A static method in a base class
13376 is never overridden, so treat it like it doesn't exist.
13377 However, do complain about private non-static method overriding
13378 public static method.
13380 * parse.y: Don't set unused INITIALIZED_P flag.
13381 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
13383 * parse.y (find_expr_with_wfl): Optimize tail-calls.
13384 (build_array_from_name): Re-order &index[string] to &string[index].
13386 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
13387 error_mark (it might catch more errors, but it is more likely to lose).
13389 1999-03-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13391 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
13392 (parse-scan.o): Depend on toplev.h.
13394 * class.c (make_method_value): Add prototype. Make it static.
13395 Remove unused second argument, caller changed.
13397 * expr.c (java_lang_expand_expr): Remove unused variable
13400 * java-tree.h: Don't prototype find_in_current_zip.
13401 Add prototypes for verify_constant_pool, start_java_method,
13402 end_java_method, give_name_to_locals, expand_byte_code,
13403 open_in_zip, set_constant_value, find_constant1, find_constant2,
13404 find_utf8_constant, find_string_constant, find_class_constant,
13405 find_fieldref_index, find_methodref_index, write_constant_pool,
13406 count_constant_pool_bytes and encode_newarray_type.
13408 * jcf-dump.c: Remove unused variable `LONG_temp'.
13410 * jcf-parse.c: Include parse.h.
13411 (jcf_parse_source): Remove unused parameter, all callers changed.
13412 (jcf_figure_file_type): Add static prototype.
13413 (find_in_current_zip): Likewise. Also remove unused parameter,
13414 all callers changed.
13415 (read_class): Initialize variable `saved_pos'.
13417 * jcf-reader.c (jcf_parse_preamble): Mark variables
13418 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
13420 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
13421 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
13422 (java_parse_doc_section): Initialize variable `seen_star'.
13423 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
13424 (java_lex_error): Mark parameters `msg' and `forward' with
13426 (java_get_line_col): Mark parameters `filename' and `line' with
13429 * parse-scan.y: Include toplev.h.
13430 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
13432 * parse.h: use `struct JCF', not plain `JCF'.
13433 (java_parser_context_save_global, java_expand_classes
13434 java_parser_context_restore_global, java_parse): Add prototypes.
13436 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
13439 1999-02-24 Per Bothner <bothner@deneb.cygnus.com>
13441 * check-init.c (check_init): COPYN takes word count, not bit count.
13443 1999-02-26 Per Bothner <bothner@cygnus.com>
13445 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
13446 explicit build_decl. (Avoids crash in reload when optimizing.)
13448 1999-02-25 Per Bothner <bothner@cygnus.com>
13450 * decl.c (complete_start_java_method): Handle synchronized method
13451 even when compiling from bytecode.
13453 1999-02-26 Tom Tromey <tromey@cygnus.com>
13455 * gjavah.c (add_class_decl): Only generate `#include' if outer
13456 class is not the name of the class we are processing. Correctly
13457 append `.h' in #include.
13458 (process_file): Clean up newlines around generated `#include's.
13459 (decode_signature_piece): Correctly handle inner classes.
13460 (struct include): New structure.
13461 (all_includes): New global.
13462 (print_include): New function.
13463 (add_class_decl): Use it.
13464 (process_file): Likewise.
13465 (add_class_decl): Generate include for java-array.h if array
13467 (process_file): Don't generate java-array.h include.
13469 * gjavah.c (add_namelet): Check for standard package names here.
13470 (add_class_decl): Don't check for standard package names here.
13472 1999-02-25 Tom Tromey <tromey@cygnus.com>
13474 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
13475 When reading a zip file, only use strncmp if both strings are
13476 bigger than the buffer length. Initialize `k' when looping
13479 1999-02-24 Tom Tromey <tromey@cygnus.com>
13481 * gjavah.c (struct namelet): New structure.
13482 (add_namelet): New function.
13483 (print_namelet): New function.
13484 (print_class_decls): Use add_namelet and print_namelet to generate
13485 namespaces and not classes.
13486 (method_printed): New global.
13487 (HANDLE_END_METHOD): Examine method_printed.
13488 (print_method_info): Set method_printed when required. Print
13489 error if function to be ignored is marked virtual. Handle $finit$
13491 (METHOD_IS_FINAL): New macro.
13492 (print_field_info): Use it.
13493 (HANDLE_METHOD): Clear method_printed.
13494 (method_pass): New global.
13495 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
13496 (process_file): Do two passes over both fields and methods.
13497 (HANDLE_METHOD): Examine method_pass.
13498 (root): New global.
13499 (add_class_decl): New function.
13500 (print_class_decls): Don't scan over entire constant pool.
13502 1999-02-23 Tom Tromey <tromey@cygnus.com>
13504 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
13505 disable linking in that case.
13507 1999-02-20 Tom Tromey <tromey@cygnus.com>
13509 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
13512 1999-02-21 Per Bothner <bothner@cygnus.com>
13514 * decl.c (build_result_decl), java-tree.h: New method.
13515 (complete_start_java_method): Handle synchronized methods.
13516 Don't build DECL_RESULT here. (Ordering dependency problem.)
13517 (start_java_method): Call build_result_decl here instead ...
13518 * parse.y (java_complete_expand_method): ... and here.
13519 (expand_start_java_method): Don't call complete_start_java_method here.
13520 (java_complete_expand_method): Call it here instead.
13521 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
13522 * java-tree.h: ... here.
13524 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
13525 * parse.y (java_complete_lhs): Don't call force_evaluation_order
13526 for ARRAY_REF - it doesn't work when array bounds are checked.
13527 (patch_array_ref): Handle it here instead.
13529 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
13531 1999-02-19 Per Bothner <bothner@cygnus.com>
13533 Force left-to-right evaluation of binary operations etc.
13534 * expr.c (force_evaluation_order), java-tree.h: New function.
13535 * parse.y (java_complete_lhs): Pass binary operations, procedure
13536 calls, and ARRAY_REFs to force_evaluation_order.
13537 (various): Set TREE_SIDE_EFFECTS more carefully.
13539 Tolerate random (non-UTF8) encoding in comments without complaining.
13540 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
13541 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
13543 * parse.y (resolve_qualified_expression_name): Handle error_mark.
13544 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
13546 * parse.y (java_complete_lhs): Ignore an empty statement in a
13547 COMPOUND_EXPR. Don't complain about empty statement after return.
13549 1999-02-19 Per Bothner <bothner@cygnus.com>
13551 * parse.y (obtain_incomplete_type): Don't wrap unknown types
13552 in TREE_LIST - just chain the POINTER_TYPEs together.
13553 (resolve_class): If type already resolved, return decl.
13554 After resolving, update TREE_TYPE(class_type), and name (if array).
13555 * parse.h (do_resolve_class), parse.y: Make non-static.
13556 * class.c (maybe_layout_super_class): Take this_class argument.
13557 Do do_resolve_class if necessary.
13558 (layout_class, layout_class_methods): Adjust calls appropriately.
13559 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
13560 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
13561 * typeck.c (build_java_array_type): Don't call layout_class.
13563 1999-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
13565 * parse.y (check_pkg_class_access): Allow private class access
13566 within the same package.
13567 (strip_out_static_field_access_decl): New function.
13568 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
13569 operator argument before testing its nature.
13571 1999-02-03 Per Bothner <bothner@cygnus.com>
13573 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
13574 (TRY_EXPR): Simplify - it no longer has a finally clause.
13575 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
13576 Simpler handling of TRY_EXPR, which no longer has a finally clause.
13577 * expr.c (java_lang_expand_expr): Likewise.
13578 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
13579 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
13580 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
13581 (build_try_statement): Remove finally parameter and handling.
13582 (build_try_finally_statement): New function.
13583 (patch_try_statement): No longer need to support finally clause.
13584 (try_statement): Update grammar action rules.
13585 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
13586 Simpler handling of TRY_EXPR, which no longer has a finally clause.
13588 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
13590 * jcf-parse.c (get_constant): Add braces around computation of 'd'
13591 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
13593 1999-02-17 Andrew Haley <aph@cygnus.com>
13595 * class.c (build_utf8_ref): Back out broken patch which was
13596 intended to to output signatures using '.' as a separator.
13598 * class.c (make_class_data): Output signatures using '.' as a
13599 separator, rather than '/'.
13600 (mangled_classname): Likewise.
13601 (make_field_value): Likewise.
13602 (make_method_value): Likewise.
13603 * constants.c (alloc_class_constant): Likewise.
13604 * expr.c (build_invokeinterface): Likewise.
13606 1999-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
13608 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
13609 of an ancient workaround.
13611 1999-02-10 Jeffrey A Law (law@cygnus.com)
13613 * jvspec.c (xmalloc): Kill the prototype. It does not belong
13616 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
13618 * lex.c (yylex): Encode \0 as UTF8.
13620 1999-02-10 Tom Tromey <tromey@cygnus.com>
13622 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
13623 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
13624 (libgcj_zip): Renamed.
13625 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
13627 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
13629 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
13630 (GC_NAME): Renamed -lgc to -lgcjgc.
13632 1999-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
13634 * lex.c (java_lang_cloneable): Initialize.
13635 * parse.y (java_lang_cloneable): New static variable.
13636 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
13637 doing one more qualification round.
13638 (valid_ref_assignconv_cast_p): Reject null source or
13639 destination. Allow an array to be cast into java.lang.Cloneable.
13640 (patch_cast): Swapped two first arguments to first call to
13641 valid_ref_assignconv_cast_p.
13643 1999-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
13645 * parse.h: DECL_P renamed JDECL_P.
13646 * parse.y: DECL_P replaced by JDECL_P.
13647 (build_array_from_name): Always use pointer's type.
13648 (patch_bc_statement): Extra code to search continue target in a
13649 for loop. Fixed comments. Continue target is current loop when
13652 1999-02-05 Andrew Haley <aph@cygnus.com>
13654 * class.c (make_class_data): The superclass of an interface should
13655 be null, not class Object.
13657 * lex.c (java_lex): Sign extend hex literals.
13659 1999-02-04 Andrew Haley <aph@cygnus.com>
13661 * class.c (build_utf8_ref): Output signatures using '.' as a
13662 separator, rather than '/'.
13663 (make_class_data): Likewise.
13665 1999-02-03 Marc Espie <Marc.Espie@liafa.jussieu.fr>
13667 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
13668 mkstemp.o. Get them from libiberty now.
13670 1999-02-02 Jeffrey A Law (law@cygnus.com)
13672 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
13674 1999-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13676 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
13679 1999-02-02 Per Bothner <bothner@cygnus.com>
13681 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
13682 * jcf-write.c (generate_bytecode_return): New function.
13683 (generate_bytecode_insns): Use it, for RETURN_EXPR.
13685 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
13686 generate special [fd]const_[01] instructions.
13688 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
13690 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
13691 handling OPCODE_lookupswitch or OPCODE_tableswitch.
13693 1999-02-01 Per Bothner <bothner@cygnus.com>
13695 * parse.y (patch_method_invocation): Handle calling static methods,
13696 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
13698 * parse.y (java_complete_lhs): Don't complain about unreachable
13699 exit condition in a do-while statement.
13701 1999-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
13703 * lex.c (java_read_char): Fixed utf8 decoding.
13704 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
13706 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
13707 comments. Local variable `all_primitive' is gone. Broadened
13708 acceptance of `0' to floating point targets. `long' can now be
13709 widened to `double' or `float'.
13710 (valid_method_invocation_conversion_p): Added leading
13711 comment. Fixed tabulation.
13712 (build_string_concatenation): Optimize out left or right empty
13715 1999-01-28 Per Bothner <bothner@cygnus.com>
13717 * jcf-write.c (localvar_alloc): Only emit entry for
13718 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
13719 (generate_bytecode_insns): Only call put_linenumber if
13720 debug_info_level > DINFO_LEVEL_NONE.
13721 * jvspec.c (lang_specific_driver): If no -O* or -g* option
13722 is specified, add -g1 (for compatibility wih javac).
13724 1999-01-28 Hans-Peter Nilsson <hp@axis.se>
13726 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
13727 gjavah.o, check-init.o, jv-scan.o
13729 1999-02-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13731 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
13733 * gjavah.c: Include config.h and system.h.
13735 * javaop.h (inline): Don't define, its handled by system.h.
13736 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
13737 from `inline' to `static inline'.
13739 * jcf.h (inline): Don't define, its handled by system.h.
13741 * lex.c (inline): Likewise.
13743 1999-01-31 Zack Weinberg <zack@rabi.columbia.edu>
13745 * lang-specs.h: Map -Qn to -fno-ident.
13747 1999-01-29 Richard Henderson <rth@cygnus.com>
13749 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
13751 1999-01-29 Tom Tromey <tromey@cygnus.com>
13753 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
13754 then cast it to Object before calling `append' method.
13756 1999-01-28 Per Bothner <bothner@cygnus.com>
13758 * check-init.c (check_bool2_init, check_bool_init, check_init):
13759 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
13760 * jcf-write.c (generate_bytecode_insns): Likewise.
13762 1999-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
13764 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
13765 * parse.y (patch_cast): Allow a boolean to be cast into a
13768 1999-01-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
13770 * parse.y: (class_declaration:): Fixed indentation.
13771 (class_member_declaration:): Extra `;' after field declaration now
13773 (interface_declaration:): Removed debug messages in error reports.
13774 (patch_binop): Nodes created and returned inherit the orignal
13775 node's COMPOUND_ASSIGN_P flag value.
13776 (patch_cast): Fix cast from char to floating point.
13778 1999-01-25 Andrew Haley <aph@cygnus.com>
13780 * except.c, java-except.h (expand_resume_after_catch): new
13782 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
13783 to branch back to main flow of control after a catch block.
13785 1999-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13787 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
13788 $(srcdir)/../system.h.
13789 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
13790 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
13791 (jcf-write.o): Likewise.
13792 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
13793 (mangle.o): Depend on $(srcdir)/../toplev.h.
13794 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
13795 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
13797 * class.c: Include output.h and parse.h.
13798 (mangled_classname): Add the `const' keyword to a char*.
13799 (find_named_method): Hide unused function definition.
13800 (build_utf8_ref): Change type of variable `c' to unsigned char.
13801 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
13802 (build_class_ref): Add the `const' keyword to a char*.
13803 (layout_class_method): Remove unused variable `buf'.
13805 * decl.c (find_local_variable): Remove unused variable `rtl'.
13806 (pushdecl): Likewise for variables `different_binding_level' and
13808 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
13809 (maybe_build_cleanup): Likewise for parameter `decl'.
13811 * except.c (expand_start_java_handler): Mark parameter `range'
13812 with ATTRIBUTE_UNUSED.
13814 * expr.c: Include except.h.
13815 (pop_type): Remove unused variable `i'.
13816 (pop_value): Likewise for variables `n_words' and `i'.
13817 (expand_java_arrayload): Likewise for variable `convert'.
13818 (java_lang_expand_expr): Likewise for variables `op0', `type',
13819 `mode', `unsignedp', `node' and `elements'.
13820 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
13822 (process_jvm_instruction): Add a `const' qualifier to a char*.
13824 * gjavah.c (output_directory): Add the `const' keyword to a char*.
13825 (temp_directory): Likewise.
13826 (print_c_decl): Likewise.
13827 (print_method_info): Likewise.
13828 (decode_signature_piece): Likewise.
13829 (print_mangled_classname): Likewise.
13831 * java-except.h: Provide prototypes for maybe_start_try,
13832 maybe_end_try and add_handler.
13834 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
13835 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
13836 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
13837 init_expr_processing, push_super_field, init_class_processing,
13838 can_widen_reference_to, class_depth, verify_jvm_instructions,
13839 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
13840 set_local_type, merge_type_state, push_type, load_type_state,
13841 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
13842 emit_unicode_mangled_name): Add prototypes.
13844 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
13845 (print_signature_type): Use ISDIGIT, not isdigit.
13846 (print_signature): Remove unused variable `j'.
13848 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
13849 int when comparing against one.
13851 * jcf-parse.c: Include toplev.h.
13853 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
13854 (localvar_free): Remove unused variable `i'.
13855 (generate_bytecode_conditional): Likewise for variable `kind'.
13857 * jv-scan.c: Include config.h and system.h. Remove redundant
13858 OS header and gansidecl.h includes.
13859 (warning): Add the `const' keyword to a char*. Also add
13860 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
13861 __STDC__, when determining whether to use ANSI-isms.
13862 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
13863 (xmalloc): Don't redundantly prototype here.
13864 (main): Remove unused parameter `envp'. Also fix the arguments
13865 passed to function `fatal' to match the format specifier.
13867 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
13869 * mangle.c: Include toplev.h.
13870 (emit_unicode_mangled_name): Declare parameter `len'.
13872 * parse.y (parse_warning_context): Add the `const' keyword to a
13873 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
13874 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
13875 (issue_warning_error_from_context): Add the `const' keyword to
13877 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
13878 not `__STDC__' for whether to use ANSI-isms.
13880 * typeck.c (incomplete_type_error): Mark parameters `value' and
13881 `type' with ATTRIBUTE_UNUSED.
13882 (parse_signature_type): Use ISDIGIT, not isdigit.
13884 * verify.c (check_pending_block): Add the `const' keyword to a char*.
13885 (verify_jvm_instructions): Likewise. Remove unused variables
13886 `field_name' and `default_val'.
13888 * zextract.c: Include config.h and system.h. Remove redundant
13889 OS header includes.
13891 * zipfile.h: Prototype `read_zip_archive'.
13893 1999-01-21 Andrew Haley <aph@cygnus.com>
13895 * typeck.c (convert): Allow conversions to void type: some
13896 optimizations in gcc do this.
13898 1999-01-21 Andrew Haley <aph@cygnus.com>
13900 * typeck.c (convert_ieee_real_to_integer): New function.
13901 (convert): When not using fast-math and using hardware fp, convert
13902 an IEEE NaN to zero.
13904 1999-01-18 Andrew Haley <aph@cygnus.com>
13906 * parse.y (patch_binop): Do a type conversion from signed to
13907 unsigned and then back to signed when a ">>>" is found.
13909 1999-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
13911 * java-tree.h: (check_for_initialization): Added prototype.
13912 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
13913 * parse.y (do_resolve_class): Removed unused locals.
13914 (read_import_dir): Likewise.
13915 (resolve_qualified_expression_name): Array creation
13916 expressions are valid primary expressions.
13917 (qualify_ambiguous_name): Likewise.
13918 (patch_synchronized_statement): Removed unused local.
13920 1999-01-17 Jeffrey A Law (law@cygnus.com)
13922 * Makefile.in (zextract.o): Add dependencies.
13924 * Makefile.in: Do not put ^Ls at the start of a line.
13926 1999-01-15 Per Bothner <bothner@cygnus.com>
13928 * expr.c (process_jvm_instruction): Coerce to correct Throwable
13929 sub-type the result of the call that gets the exception value.
13931 * parse.y (java_complete_expand_methods): If flags_syntax_only,
13932 don't call finish_class.
13934 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
13935 clear found before continuing.
13937 * verify.c (verify_jvm_instructions): On an array load, allow
13938 and handle top of stack to be TYPE_NULL.
13940 * gjavah.c (generate_access): Translate Java package private or
13941 protected access to C++ public, but with a comment.
13943 1999-01-13 Andrew Haley <aph@cygnus.com>
13945 * expr.c (generate_name): Name prefix changed to avoid clashes
13946 with assembler temp labels.
13948 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
13949 MODIFY_EXPR. Without this, code for the assignment may not be
13950 generated at all and the synchronized statement will read an
13951 uninitialized variable.
13953 1999-01-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
13955 * class.c (maybe_layout_super_class): Fixed returned value.
13956 * lex.c: Added 1999 to the copyright.
13957 (java_init_lex): Initialize java_lang_imported.
13958 * lex.h: Added 1999 to the copyright.
13959 * parse.h: Added 1999 to the copyright.
13960 (REGISTER_IMPORT): Fixed typo in trailing macro.
13961 (CURRENT_OSB): New macro.
13962 (struct parser_ctxt): New fields osb_depth, osb_limit.
13963 * parse.y (java_lang_id): New global variable.
13964 (type_import_on_demand_declaration): Don't import java.lang.* twice.
13965 (array_creation_expression:): Use CURRENT_OSB.
13966 (dims:): Uses a stack to keep track of array dimensions.
13967 (cast_expression:): Use CURRENT_OSB.
13968 (find_expr_with_wfl): Return NULL if node found doesn't meet the
13970 (register_fields): Fixed typos in comment.
13971 (check_method_redefinition): Fixed comment indentation.
13972 (java_check_regular_methods): Set saved found wfl to NULL after
13973 having reinstalled it in the previously found DECL_NAME.
13975 1999-01-10 Richard Henderson <rth@cygnus.com>
13977 * gjavah.c (java_float_finite): Use a union to do type punning.
13978 (java_double_finite): Likewise.
13980 1999-01-09 Per Bothner <bothner@cygnus.com>
13982 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
13983 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
13984 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
13985 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
13986 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
13987 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
13989 1999-01-08 Per Bothner <bothner@cygnus.com>
13991 * check-init.c (check_init): If compiling to native, we don't
13992 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
13994 1999-01-08 Tom Tromey <tromey@cygnus.com>
13996 * parse-scan.y (variable_declarator_id): Set or increment
13998 (bracket_count): New global.
13999 (formal_parameter): Handle case where bracket pairs trail variable
14002 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
14004 * jcf-parse.c (yyparse): variable len changed from a char to an
14005 int to prevent overflow.
14007 1999-01-06 Per Bothner <bothner@cygnus.com>
14009 * java-tree.h: Declare read_class.
14010 * jcf-parse.c (read_class): New function.
14011 (load_class): Now just call read_class.
14013 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
14014 * jcf-parse.c (parse_source_file): Declare save_error_count,
14015 which is needed by java_parse_abort_on_error macro,
14016 * parse.y (java_layout_classes, java_expand_classes): Likewise.
14018 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
14019 constructor, if initializing a static field.
14020 (patch_new_array_init): Set TREE_CONSTANT if it is.
14021 * expr.c (java_lang_expand_expr): For a static array constructor
14022 of primitive elements, allocate the array itself statically.
14023 Disabled until we can set the vtable field statically.
14025 * check-init.c: New file. Checks for definite assignment.
14026 * Makefile.in (JAVA_OBJS): Add check-init.o.
14027 * parse.y (java_complete_expand_method): Call check_for_initialization.
14028 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
14030 1999-01-06 Graham <grahams@rcp.co.uk>
14032 * parse.y : include system.h instead of including
14033 standard headers directly with the exception of <dirent.h>.
14035 1999-01-06 Per Bothner <bothner@cygnus.com>
14037 * lex.h: Moved static function declarations to lex.c,
14038 to shut up some -Wall warnings.
14039 * lex.c: Static function declarations moved here.
14040 * jcf-dump.c: Small fixes to shut up -Wall warnings.
14042 1999-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
14044 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
14046 1998-12-22 Per Bothner <bothner@cygnus.com>
14048 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
14049 * verify.c (verify_jvm_instructions): Fix off-by-one error.
14051 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
14052 (localvar_alloc): Change return type to void,
14053 (emit_unop): Remove unused variable size.
14055 * jcf-write.c (struct jcf_block): Add new union.
14056 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
14057 (call_cleanups): New functions.
14058 (struct jcf_partial): New fields num_finalizers and return_value_decl.
14059 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
14060 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
14061 * lang.c (lang_init): Call using_eh_for_cleanups.
14062 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
14063 completing operands to patch_synchronized_statement.
14064 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
14065 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
14066 WITH_CLEANUP_EXPR instead of TRY_EXPR.
14068 1998-12-20 John F. Carr <jfc@mit.edu>
14070 * Make-lang.in: Comment out control-Ls; they upset some makes.
14072 1998-12-18 Tom Tromey <tromey@cygnus.com>
14074 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
14077 1998-12-17 Tom Tromey <tromey@cygnus.com>
14079 * parse.y (DIR_SEPARATOR): New define.
14080 (check_class_interface_creation): Use it.
14082 * parse-scan.y (report_main_declaration): Recognize
14083 `java.lang.String' in argument to main.
14085 1998-12-16 Per Bothner <bothner@cygnus.com>
14087 * parse.y (create_interface): Remove bogus test.
14089 1998-12-16 Per Bothner <bothner@cygnus.com>
14091 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
14092 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
14094 1998-12-16 Tom Tromey <tromey@cygnus.com>
14096 * parse-scan.y (qualified_name): Use correct sprintf format.
14098 1998-12-15 Tom Tromey <tromey@cygnus.com>
14100 * gjavah.c (print_field_info): Changed how most negative number is
14103 1998-12-14 Per Bothner <bothner@cygnus.com>
14105 * parse.y (fold_constant_for_init): New function.
14106 (resolve_expression_name): Don't replace static final
14107 constant-initialized fields by its value.
14108 (java_complete_lhs): New. Same as java_complete_tree, except does
14109 not replace static final constant-initialized fields by their values.
14110 (register_fields): If there is an initializer, set DECL_INITIAL and
14111 MODIFY_EXPR_FROM_INITIALIZATION_P.
14112 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
14113 Only call patch_initialized_static_field if
14114 MODIFY_EXPR_FROM_INITIALIZATION_P.
14115 (patch_initialized_static_field): If not valid constant, clear
14118 * parse.y (lookup_field_wrapper): Fix thinko.
14120 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
14121 set and restore global lineno.
14123 1998-12-14 Tom Tromey <tromey@cygnus.com>
14125 * gjavah.c (print_field_info): If value to print is the smallest
14126 value of its size, then print as hex to avoid later warnings from
14129 1998-12-14 Tom Tromey <tromey@cygnus.com>
14131 * gjavah.c (decompile_method): Decompile `return null'.
14132 (process_file): Generate `#pragma interface'.
14133 (method_declared): New global.
14134 (print_method_info): Set it.
14135 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
14136 (print_method_info): Handle abstract methods.
14138 1998-12-13 Per Bothner <bothner@cygnus.com>
14140 * parse.y (patch_method_invocation): If class_decl is null
14141 (e.g. an array type), use original type.
14143 * parse.y (check_thrown_exceptions): Temporary hack to suppress
14144 errors about uncaught exception from clone (of array, specifically).
14146 1998-12-13 Tom Tromey <tromey@cygnus.com>
14148 * gjavah.c (decompile_method): Handle all types of `return'
14149 opcode. Decompile `return this' and `return'.
14150 (method_access): New global.
14151 (print_method_info): Set it.
14152 (decompile_method): Don't decompile a synchronized method.
14154 1998-12-13 Tom Tromey <tromey@cygnus.com>
14156 * jcf-reader.c (jcf_parse_one_method): Recognize
14158 * gjavah.c (HANDLE_END_METHOD): New macro.
14159 (HANDLE_CODE_ATTRIBUTE): New macro.
14160 (decompile_method): New function.
14161 (print_method_info): Don't print `;\n' at end of function decl.
14162 Include java-opcodes.h.
14163 (decompiled): New global.
14165 1998-12-12 Per Bothner <bothner@cygnus.com>
14167 * class.c (build_class_ref): Handle PRIMTYPE.class if
14168 flag_emit_class_files.
14169 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
14170 if flag_emit_class_files.
14171 * parse.y (java_complete_tree): Pre-liminary support for
14172 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
14174 * parse.y (patch_synchronized_statement): Don't call monitorexit
14175 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
14177 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
14179 * zipfile.h (opendir_in_zip): New declaration.
14180 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
14181 (opendir_in_zip): New function, using code from open_in_zip.
14182 (open_in_zip): Call opendir_in_zip.
14183 (find_class): Remove no-longer-used do_class_file parameter,
14184 but add source_ok parameter. Change logic so if we find a .java file,
14185 we don't look for .class in later classpath emtries.
14186 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
14187 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
14188 * gjavah.c: Update call to find_class.
14189 * jcf-dump.c: Likewise.
14191 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
14192 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
14193 nothing if body is empty_stmt_node.
14194 Various little fixes so SP gets correctly adjusted.
14195 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
14196 For CALL_EXPR, test if static first.
14197 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
14198 such as the ones we create for Object and Class.
14199 Set and restore current_function_decl.
14200 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
14201 (note_possible_classname): New function.
14202 (read_import_entry): Removed. Merged with read_import_dir.
14203 (read_import_dir): Don't call find_class - that only gives us
14204 the first classpath entry having the needed package.
14205 Use the struct buffer data structure from buffer.h.
14206 (read_import_dir, find_in_imports_on_demand): The remembered
14207 class names now use '.' (not '/') as package separator.
14209 * parse.y (java_complete_expand_methods): Call write_classfile
14210 here, and not in java_expand_classes (which only gets first class).
14212 1998-12-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
14214 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
14215 (register_fields): If a static fields has an initializer, just
14216 chain it on ctxp->static_initialized, and handle later.
14217 (java_complete_expand_methods): Force <clinit> first.
14218 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
14219 - it's already been completed.
14220 (patch_initialized_static_field): New function.
14221 (java_complete_field): Call it.
14223 1998-12-12 Per Bothner <bothner@cygnus.com>
14225 * expr.c (encode_newarray_type, build_new_array): New functions.
14226 * java-tree.h: Declare build_new_array.
14227 * jcf-write.c (patch_newarray): Use build_new_array.
14229 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
14230 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
14232 * parse.y (patch_new_array_init): Re-organize.
14233 Now is passed the actual array (pointer) type of the value.
14234 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
14235 (patch_array_constructor): Removed - merged into patch_new_array_init.
14236 (java_complete_tree): Update patch_new_array_init.
14238 * jcf-write.c (find_constant_index): New function.
14239 (generate_bytecode_insns): Use find_constant_index.
14240 (generate_classfile): Use find_constant_index for ConstantValue.
14242 1998-12-11 Tom Tromey <tromey@cygnus.com>
14244 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
14245 * decl.c (init_decl_processing): Renamed dtable -> vtable.
14246 * class.c (make_class_data): Renamed dtable -> vtable, and
14247 dtable_method_count -> vtable_method_count.
14249 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
14251 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
14252 global variables, initialized.
14253 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
14254 Declared new global variables.
14255 * lex.c (java_lex): Return long_zero_node, float_zero_node,
14256 double_zero_node, integer_zero_node upon direct matching.
14257 * parse.y (purify_type_name): Added function prototype.
14258 (duplicate_declaration_error_p): Consider new_type as potentially
14259 being a incomplete type. Use purify_type_name on type string.
14260 (method_header): saved_type: unused variable removed. Don't figure
14261 return type if method name is invalid.
14262 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
14263 processed by patch_unaryop.
14264 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
14265 increment/decrement node into its original type after binary
14266 numeric promotion on its operands.
14268 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
14270 * parse.y (array_initializer:): Array init operand is NULL_TREE
14271 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
14272 now an error. Fixed indentation problems.
14273 (patch_string): Handle error_mark_node as an argument.
14274 (patch_new_array_init): Fixed indentation problems.
14275 (array_constructor_check_entry): Removed check on null wfl_value.
14276 Return an error if wfl_value's walk returns an error.
14278 1998-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
14280 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
14281 * lex.c (java_lex): Remember column position before advancing one
14282 token. Retain location information on OCB_TK.
14283 * lex.h (typedef struct java_lc): Added new field.
14284 * parse.h (GET_SKIP_TYPE): New macro.
14285 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
14286 * parse.y (build_new_array_init, patch_new_array_init,
14287 patch_array_constructor, maybe_build_array_element_wfl,
14288 array_constructor_check_entry): New function prototypes.
14289 (switch_block:): Tagged <node>.
14290 (OCB_TK): Tagged <operator>.
14291 (array_initializer:): Installed actions.
14292 (variable_initializer): Build location information on element if
14294 (switch_statement:): Fixed indentation typo.
14295 (switch_block:): Redefined default action.
14296 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
14297 (patch_assignment): Removed duplicate code.
14298 (maybe_build_array_element_wfl, build_new_array_init,
14299 patch_new_array_init, patch_array_constructor,
14300 array_constructor_check_entry): New functions.
14302 1998-12-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
14304 * parse.y (array_initializer): Tagged <node>.
14305 (variable_initializer:): Use default rule.
14306 (array_initializer:): Defined actions.
14307 (variable_initializers:): Likewise.
14308 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
14309 non-static field accesses.
14310 (patch_invoke): Fixed indentation typo.
14311 (java_complete_tree): Likewise.
14312 (build_labeled_block): Changed leading comment. Generate an error
14313 in case of duplicate loop labels.
14314 (patch_conditional_expr): Patch results of string concatenation
14317 1998-12-06 Per Bothner <bothner@cygnus.com>
14319 * constants.c (find_methodref_index): When the class is an interface,
14320 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
14322 * decl.c (finit_identifier_node): Use "$finit$", rather than
14323 "<finit>" (which Sun's verifier rejects).
14324 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
14325 (generate_field_initialization_code): Removed.
14326 (fix_constructors) Don't add call to $finit$ here (wrong order).
14327 (patch_method_invocation): Add $finit$ call here.
14329 * java-tree.h (CALL_USING_SUPER): New macro.
14330 * parse.y (patch_invoke): Remove im local variable.
14331 (patch_method_invocation, patch_invoke): Don't pass super parameter.
14332 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
14333 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
14335 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
14337 * parse.y (java_complete_tree): Don't complain about unreachable
14338 statement if it is empty_stmt_node.
14340 * jcf-write.c (find_constant_wide): New function.
14341 (push_long_const): Use find_constant_wide.
14343 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
14344 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
14345 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
14346 Emit invokeinterface when calling an interface method.
14347 Emit invokespecial also when calling super or private methods.
14349 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
14351 1998-12-06 Per Bothner <bothner@cygnus.com>
14353 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
14355 1998-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
14357 * java-tree.h (java_layout_seen_class_methods): New function
14359 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
14360 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
14361 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
14362 * parse.y (method_declarator:): Defined action.
14363 (issue_warning_error_from_context): input_filename saved, set to
14364 the appropriate value and restored after java_error is called.
14365 (build_unresolved_array_type): Fixed comment.
14366 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
14367 (method_header): Deal with return type the same way type are
14368 handled for fields and method's parameters and local variables
14370 (check_method_redefinition): Removed extra CR.
14371 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
14372 (java_layout_seen_class_methods): New function.
14373 (java_layout_classes): Call java_layout_seen_class_methods.
14375 1998-12-03 Per Bothner <bothner@cygnus.com>
14377 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
14379 1998-12-03 Per Bothner <bothner@cygnus.com>
14381 * jcf-dump.c (main): Fix error message.
14382 * jcf-path.c (add_entry): Style fix.
14384 1998-12-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
14386 * class.c (layout_class_method): Call build_java_argument_signature
14387 on constructors too.
14388 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
14389 (patch_method_invocation): Define a primary when resolving an
14390 expression name. Augmented comment on code checking illegal `this'
14391 usage. Loosened it test by accepting NEW_CLASS_EXPR.
14393 1998-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
14395 * class.c (layout_class_method): Don't report error on non-static
14396 overriding static if the method is private.
14397 * java-tree.h (finish_class): Prototype added.
14398 * lex.c (java_get_line_col): Handle col argument -2 value.
14399 * parse.h: All static method declarations moved to parse.y.
14400 * parse.y: Now contains all static method declarations previously
14402 (find_expr_with_wfl, missing_return_error,
14403 unreachable_stmt_error): New functions.
14404 (java_get_real_method_name): Identify constructors bearing class
14405 names in source code compiled classes only.
14406 (java_complete_expand_methods): Call missing_return_error.
14407 (invocation_mode): Private methods invoked as static methods.
14408 (java_complete_tree): Call unreachable_stmt_error.
14410 1998-12-01 Tom Tromey <tromey@cygnus.com>
14412 * Makefile.in (+target): Removed.
14413 (+xmake_file): Likewise.
14414 (+tmake_file): Likewise.
14415 (.NOEXPORT): Removed duplicate.
14417 1998-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
14419 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
14421 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
14423 * jvgenmain.c: Remove the xmalloc prototype, we get it from
14424 libiberty.h. Provide an xmalloc definition.
14426 * jvspec.c: Remove the xmalloc prototype.
14428 * parse-scan.y: Include config.h and system.h. Don't include
14429 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
14430 Provide an xstrdup definition.
14432 1998-11-26 Alexandre Oliva <oliva@dcc.unicamp.br>
14434 * jcf-path.c (add_entry): Recognize ".jar" too.
14435 * lang-specs.h: Likewise.
14437 1998-11-26 Per Bothner <bothner@cygnus.com>
14439 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
14440 soft_monitorenter_node, soft_monitorexit_node, throw_node.
14442 * jcf-write.c (generate_bytecode_insns):
14443 Handle pre/post-increment/decrement of long.
14445 * jcf-write.c (generate_bytecode_insns):
14446 Handle missing exception handler (finally for synchronized).
14448 1998-11-25 Per Bothner <bothner@cygnus.com>
14450 * java-tree.h (end_params_node): Declare global.
14451 * decl.c (end_params_node): New global.
14452 (init_decl_processing, start_java_method): Use end_params_node for
14453 end of list of parameter types. Follows correct gcc conventions.
14454 * expr.c (pop_argument_types, pop_arguments): Likewise.
14455 * lang.c (put_decl_node): Likewise.
14456 * typeck.c (various places): Likewise.
14457 * class.y (various places): Likewise.
14458 * parse.y (various places): Likewise.
14460 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
14461 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
14463 * class.c: Add #include flags.h, remove no-longer needed declaration.
14465 * class.c (layout_class_method): Remove commented-out code, re-format.
14466 Don't add vtable entry (or index) for private methods.
14467 * expr.c (expand_invoke): A private method is implicitly final.
14468 * class.c (make_class_data): If inlining or optimizing,
14469 skip private methods.
14471 * class.c (finish_class): New function. Calls existing methods,
14472 but alls emits deferred inline functions.
14473 * jcf-parse.c (parse_class_file): Call finish_class.
14474 * parse.y (java_complete_expand_methods): Likewise.
14476 * expr.c (build_java_binop): Explicit default, to silence -Wall.
14478 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
14480 1998-11-25 Marc Espie <espie@quatramaran.ens.fr>
14482 * jcf-write.c (generate_bytecode_conditional): Fix typo.
14484 1998-11-24 Per Bothner <bothner@cygnus.com>
14486 * (generate_classfile): Always write class access flag with
14489 1998-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
14491 * class.c (maybe_layout_super_class): New function.
14492 (layout_class): Reorganized. Loop on class methods dispatched into
14493 a new function. Call maybe_layout_super_class.
14494 (layout_class_methods, layout_class_method): New functions.
14495 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
14497 (expand_invoke): Likewise.
14498 * java-tree.h (all_class_list): New global variable declared.
14499 (layout_class_methods, layout_class_method): New function
14501 (LAYOUT_SEEN_CLASS_METHODS): New macro.
14502 * jcf-parse.c (all_class_list): New global variable.
14503 (load_class): Extended what class_or_name can be. Use parser
14504 context mechanism to save globals before calling jcf_parse.
14505 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
14506 is set on the file name.
14507 (jcf_parse): Layout class methods when Object is loaded, otherwise
14508 record class in all_class_list for delayed method layout.
14509 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
14510 * lang.c (put_decl_node): Decode <init> into the decl context
14512 * lex.c (java_allocate_new_line): Use xmalloc.
14513 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
14514 pointers, not TREE_LIST elements.
14515 (struct parser_ctxt): Fixed comment indentations, added comments
14516 and reordered some fields.
14517 (java_check_methods): Function prototype removed.
14518 * parse.y (java_push_parser_context): Use xmalloc.
14519 (java_parser_context_restore_global): Pop extra pushed ctxp only
14520 when there's nothing next.
14521 (maybe_create_class_interface_decl): Fixed comment, add new
14522 created class decl to all_class_list.
14523 (method_header): Use GET_REAL_TYPE on argument's types.
14524 (method_declarator): Use GET_REAL_TYPE, change type to the real
14525 type in TREE_LIST dependency node. Build argument list with the
14527 (create_jdep_list): Use xmalloc. Removed allocation error message.
14528 (obtain_incomplete_type): Fixed leading comment. Broadened
14529 incoming argument meaning.
14530 (register_incomplete_type): Use xmalloc. Removed allocation error
14532 (safe_layout_class): Fixed leading comment.
14533 (jdep_resolve_class): Reversed if statement condition and switch
14534 if and else bodies.
14535 (resolve_and_layout): Fixed leading comment. Broadened incoming
14537 (complete_class_report_errors): New local variable name, for
14538 clarity. purify_type_name used for all error cases.
14539 (java_get_real_method_name): Stricter check on constructors.
14540 (java_check_regular_methods): Reverse methods list only if not
14541 already laid out. Layout artificial constructor.
14542 (java_check_methods): Deleted.
14543 (source_start_java_method): Obtain incomplete type for patchable
14545 (java_layout_classes): Fixed leading comment. Use
14546 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
14547 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
14548 before returning. Fixed comments.
14549 (java_expand_classes): Check for errors up front.
14550 (patch_method_invocation): Class to search is resolved and laid
14553 1998-11-24 Per Bothner <bothner@cygnus.com>
14555 * expr.c (java_lang_expand_expr): Add missing emit_queue.
14557 * javaop.h (int8): Removed - not used.
14558 (jbyte): Redefine portably with correct signedness.
14560 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
14562 * jcf-write.c (generate_bytecode_insns): Fix typo
14563 OPCODE_getstatic to OPCODE_getfield.
14565 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
14566 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
14567 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
14569 1998-11-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
14571 * jcf-parse.c (jcf_parse_source): Function returned type is
14572 void. Added prototype.
14573 (jcf_parse): Function returned type is void.
14574 (yyparse): Remove call to fclose on the last parsed file.
14576 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
14578 1998-11-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
14580 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
14581 (layout_class): Cope with methods featuring WFL in decl names.
14582 * decl.c (unqualified_object_id_node): New global variable,
14584 (build_decl_no_layout): Removed.
14585 * expr.c (build_primtype_type_ref): Handle Double.
14586 (java_lang_expand_expr): Fixed indentations.
14587 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
14588 (flag_wall, flag_redundant, flag_not_overriding,
14589 flag_static_local_jdk1_1, unqualified_object_id_node): Global
14590 variable declarations.
14591 (build_decl_no_layout): Removed prototype.
14592 (java_get_real_method_name): Added prototype.
14593 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
14594 (java_parse_abort_on_error): Macro now just returns.
14595 * jcf-parse.c (jcf_parse_source): Check fclose returned
14596 value. Call emit_register_classes if java_report_errors returns
14598 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
14599 flag_static_local_jdk1_1): New integer flags.
14600 (lang_decode_option): New flags set here.
14601 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
14602 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
14603 the flag_redundant variable.
14604 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
14605 when parsing java.lang.Object class.
14606 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
14607 NULL_TREE to build.
14608 (resolve_qualified_expression_name): Fixed indentation.
14609 (patch_array_ref): Changed prototype.
14610 (not_initialized_as_it_should_p): Prototype removed.
14611 (java_report_errors): Added function prototype.
14612 * parse.y (formal_parameter:): Changed error message for not yet
14613 supported final parameters.
14614 (class_type_list:): Set both PURPOSE and VALUE of created
14615 TREE_LIST to be class_type.
14616 (primary_no_new_array:): Handle class literals on primitive types.
14617 (parse_warning_context): Reinstalled correct force_error and
14618 do_warning flags setups.
14619 (java_report_errors): Changed prototype. Return java_error_count
14621 (variable_redefinition_error): Consider treating variable type as
14623 (create_interface): Warn about redundant abstract modifier if
14624 flag_redundant is set. Changed error message.
14625 (lookup_field_wrapper): Save/restore globals before/after looking
14627 (duplicate_declaration_error_p): Consider treating declaration
14628 type as a fake pointer.
14629 (register_fields): Extract real type from dependency node. Check
14630 for duplicate field declaration after type adjustment. Use
14631 DECL_INITIAL to store static final initialized values.
14632 (method_header): Extract real function type from dependency node.
14633 (check_abstract_method_header): Use GET_METHOD_NAME.
14634 (obtain_incomplete_type): Layout fake pointer type.
14635 (safe_layout_class): Don't try to check for methods before layout.
14636 (java_complete_class): Don't check for correct throws clause
14637 elements inheritance here.
14638 (resolve_and_layout): Broadened name parameter meaning.
14639 (reset_method_name): Use GET_METHOD_NAME.
14640 (java_get_real_method_name): New function.
14641 (java_check_regular_methods): Don't check methods in
14642 java.lang.Object. Verify lineage of throws clause elements. Use
14643 flag_no_overriding in warning report.
14644 (check_throws_clauses): Don't check if class was from
14645 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
14646 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
14647 (declare_local_variables): Use flag_static_local_jdk1_1 to report
14648 warning on unsupported final local variables. Use build_decl
14649 instead of build_decl_no_layout. Get real local variable type from
14651 (source_start_java_method): Get real parameter type from
14652 dependency node. Call build_decl instead of build_decl_no_layout.
14653 (java_layout_classes): Reverse tree and layout type and class as
14654 required. Mark class as loaded when done.
14655 (resolve_field_access): Fixed indentation. Restricted condition
14656 leading to static field access code generation. Set field_type
14657 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
14658 (resolve_qualified_expression_name): Initialize type_found to
14659 null. Handle static field resolved during qualification. Fixed
14660 layout on non primitive field decl types.
14661 (not_accessible_p): Fixed typo in comment.
14662 (patch_method_invocation): Resolve and layout class to search from
14664 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
14665 layout non primitive type, if necessary. Make method node only to
14667 (find_applicable_accessible_methods_list): Consider WFL'ed method
14668 decl names. Fixed indentation.
14669 (argument_types_convertible): Resolve and layout target type if
14671 (java_complete_tree): Fixed indentation problems. Rewrote
14672 CALL_EXPR thrown exceptions check. Re-installed further processing
14673 of the assignment in certain cases.
14674 (patch_assignment): Call maybe_build_primttype_type_ref to perform
14675 inlining on class literals.
14676 (valid_builtin_assignconv_identity_widening_p): Cope with constant
14678 (valid_method_invocation_conversion_p): Likewise.
14679 (patch_string): Temporary disable forbidden use of `this' in
14680 explicit constructor invocations when doing string concatenation
14681 within their scope.
14682 (patch_unaryop): Added comment. Reinstalled code to disable
14683 further check on assignment operation with cast expression RHS.
14684 (patch_switch_statement): Fixed indentation.
14685 (build_try_statement): Call build_decl instead of
14686 build_decl_no_layout.
14687 (patch_synchronized_statement): Likewise.
14688 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
14689 IS_UNCHECKED_EXPRESSION_P.
14690 (check_thrown_exceptions_do): Changed leading comment. Resolve and
14691 layout argument exception type.
14692 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
14693 of IS_UNCHECKED_EXPRESSION_P.
14695 1998-11-18 Anthony Green <green@cygnus.com>
14697 * jcf-parse.c (yyparse): Open class file in binary mode.
14699 1998-11-15 Per Bothner <bothner@cygnus.com>
14701 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
14703 * jcf-write.c (perform_relocations): Move check out one loop.
14705 1998-11-15 Anthony Green <green@hoser.cygnus.com>
14707 * Make-lang.in: Fix reference to srcdir.
14708 * jv-scan.c: Add missing xmalloc prototype.
14709 * jvgenmain.c: Ditto.
14711 1998-11-15 Per Bothner <bothner@cygnus.com>
14713 * decl.c (error_mark_node), java-tree.h: New global.
14714 * parse.y: Use empty_stmt_node instead of size_zero_node.
14715 (build_if_else_statement): If missing else, use empty_stmt_node.
14717 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
14718 (java_complete_expand_method): Complain if return is missing.
14719 (java_check_regular_methods): Comment out incorrect error check.
14720 (not_accessible_p): Fix incorrect handling of protected methods.
14721 (patch_method_invocation): Pass correct context to not_accessible_p.
14722 (find_applicable_accessible_methods_list): Likewise.
14723 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
14724 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
14725 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
14726 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
14728 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
14729 (push_int_const): Remove reundant NOTE_PUSH.
14730 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
14731 (- case SWITCH_EXPR): Fix code generation bug.
14732 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
14733 (generate_classfile): More robust for abstract methods.
14735 1998-11-15 Anthony Green <green@cygnus.com>
14737 * Makefile.in: jv-scan and jvgenmain all require libiberty.
14738 * Make-lang.in: Ditto.
14740 * jv-scan.c: Remove xmalloc and xstrdup definitions.
14741 * jvgenmain: Ditto.
14743 1998-11-15 Per Bothner <bothner@cygnus.com>
14745 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
14747 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
14749 1998-11-14 Per Bothner <bothner@cygnus.com>
14751 Allow uses of interface types to verify. This is not really
14752 type-safe, but it matches what Sun does, and is OK as long as
14753 there are appropriate run-time checks.
14754 * verify.c (merge_types): If merging two interface types,
14755 just set the result to java.lang.Object.
14756 * expr.c (pop_type): Any interface is matches by java.lang.Object.
14758 1998-11-13 Tom Tromey <tromey@cygnus.com>
14760 * gjavah.c (main): Handle --output-class-directory argument.
14761 * jvspec.c (lang_specific_driver): Translate `-d' into
14762 -foutput-class-dir.
14763 * jcf.h (jcf_write_base_directory): Declare.
14764 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
14765 * lang-options.h: Mention -foutput-class-dir.
14766 * jcf-write.c (jcf_write_base_directory): New global.
14767 (make_class_file_name): Put generated .class file into `-d'
14768 directory, or into source directory if -d not given. Function now
14770 (write_classfile): Free class file name. Handle case where class
14772 (DIR_SEPARATOR): New macro.
14773 Include <sys/stat.h>
14775 * Makefile.in (prefix): New macro.
14777 1998-11-12 Per Bothner <bothner@cygnus.com>
14779 * parse.y (patch_invoke): Do less if flag_emit_class_files.
14780 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
14781 here (done in patch_invoke instead).
14782 (case_identity): Moved here from parse.y.
14784 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
14785 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
14786 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
14787 so they can be efficiently scanned without recursion.
14788 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
14789 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
14790 in BLOCK iteratively, rather than recursively.
14792 * parse.y (do_unary_numeric_promotion): New function.
14793 (patch_unaryop, patch_binop, patch_array_ref): Use it.
14795 * parse.y (patch_newarray): Various fixes.
14797 Re-do handling of switch statements (for proper block scoping).
14798 * parse.y: Add just a single block for the enture switch block,
14799 but don't create any "case blocks".
14800 (group_of_labels): Rmeoved unneeded non-terminal.
14801 CASE_EXPR and DEFAULT_EXPR are added to current block.
14802 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
14803 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
14804 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
14805 * parse.y (wfl_operator, print_int_node): Make non-static.
14806 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
14807 as part of recursive scan of block.
14808 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
14809 (patch_switch_statement): Most tests move dinto java_complete_tree.
14811 * parse.y: Make various production be non-typed (void).
14812 * parse.y (parse_error): Merged into issue_warning_error_from_context.
14813 * parse.y (add_stmt_to_compound): Don't create/change extra node.
14814 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
14816 * jcf-write.c (struct jcf_handler): New type.
14817 (struct jcf_switch_state): New type.
14818 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
14819 (alloc_handler, emit_unop, emit_reloc): New functions.
14820 (adjust_typed_op): Add extra parameter ("max type" offset).
14821 (emit_switch_reloc, emit_case-reloc): New function.
14822 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
14823 (generate_bytecode_insns): Support REAL_CST, switch statements,
14824 exception handling, method calls, object/array creation, and more.
14826 * class.c: Remove some unused variables.
14827 * constants.c (find_string_constant): New function.
14828 (count_constant_pool_bytes): Fix to correctly handle wide constants.
14829 * decl.c (complete_start_java_method): Don't _Jv_InitClass
14830 if flag_emit_class_files.
14832 1998-11-12 Tom Tromey <tromey@cygnus.com>
14834 * jcf-io.c (find_class): Added explanatory comment.
14836 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
14837 trailing slash to `.zip' entries.
14839 * jvspec.c (lang_specific_driver): Correctly handle case where
14840 GC_NAME not defined.
14842 1998-11-11 Tom Tromey <tromey@cygnus.com>
14844 * jvspec.c (GC_NAME): New define.
14845 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
14847 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
14849 1998-11-11 Per Bothner <bothner@cygnus.com>
14851 * jcf-dump.c (TABLE_SWITCH): Fix typos.
14853 1998-11-11 Tom Tromey <tromey@cygnus.com>
14855 * jcf-dump.c (main): Correctly recognize `--'-style long options.
14857 1998-11-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
14859 * class.c (is_compiled_class): Call safe_layout_class for class
14860 compiled from source.
14861 * conver.h (convert_to_integer, convert_to_real,
14862 convert_to_pointer): Added prototypes.
14863 * decl.c (init_decl_processing): Non longer push the decls of
14864 `methodtable', `constants', `Class', `Field', `dispatchTable'
14865 `jexception' and `Method'.
14866 * expr.c (build_invokeinterface): New function.
14867 (expand_invoke): static variable CLASS_IDENT now in
14868 build_invokeinterface. Use build_invokeinterface.
14869 (expand_java_field_op): Moved code to inline
14870 java.lang.PRIMTYPE.TYPE into a function.
14871 (build_primtype_type_ref): New function.
14872 * java-tree.def (INSTANCEOF_EXPR): New tree code.
14873 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
14874 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
14875 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
14876 (DECL_LOCAL_STATIC_VALUE): New macro.
14877 (build_invokeinterface, build_primtype_type_ref): New function
14879 (java_parse_abort_on_error): Macro rewritten.
14880 * jcf-parse.c (current_method): Add comment to declaration.
14881 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
14882 Function prototypes fixed.
14883 (jcf_parse_source): push/pop parser context. save/restore global.
14884 (parse_source_file): Fixed leading comment. Now take a
14885 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
14886 classes and pop the parser context anymore.
14887 (yyparse): Push parser context, save globals, parse the source
14888 file, restore globals and pop the parser context when processing a
14890 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
14891 * lex.c (java_parse_doc_section): New function.
14892 (java_lex): Call java_parse_doc_section when appropriate. Build an
14893 operator around INSTANCEOF_TK.
14894 * lex.h (java_lineterminator, java_sprint_unicode,
14895 java_unicode_2_utf8, java_lex_error, java_store_unicode):
14896 Prototypes rewritten.
14897 (java_parse_escape_sequence, java_letter_or_digit_p,
14898 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
14899 java_read_unicode, java_store_unicode, java_read_char,
14900 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
14901 Added function prototypes.
14902 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
14904 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
14906 (struct parser_ctxt): New fields: deprecated,
14907 current_parsed_class_un, gclass_list.
14908 (fix_method_argument_names, issue_warning_error_from_context,
14909 resolve_package, lookup_package_type): New function prototypes.
14910 (resolve_expression_name): Fixed function prototype.
14911 (find_applicable_accessible_methods_list): Fixed indentation, added
14912 extra argument in prototype.
14913 (check_final_assignment, build_null_of_type, check_deprecation,
14914 check_method_redefinition, reset_method_name,
14915 java_check_regular_methods, java_check_abstract_methods,
14916 maybe_build_primttype_type_ref): New function prototype.
14917 * parse.y (conver.h): Include.
14918 (INSTANCEOF_TK): Tagged <operator>.
14919 (single_type_import_declaration): Use REGISTER_IMPORT macro.
14920 (relational_expression:): Build binop for instanceof.
14921 (java_push_parser_context): Remember ctxp->gclass_list across
14923 (java_pop_parser_context): Simply return if no context
14924 exists. Remember gclass_list across contexts.
14925 (issue_warning_error_from_context): New function.
14926 (parse_error_context): Don't setup ctxp->elc here. Call
14927 issue_warning_error_from_context instead.
14928 (parse_warning_context): Likewise.
14929 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
14930 setup. Link new class/interface to ctxp->gclass_list.
14931 (add_superinterfaces): Register interface as incomplete if not
14933 (create_class): Remember class unqualified name in
14934 ctxp->current_parsed_class_un. Check class deprecation.
14935 (register_fields): Check field deprecation. Remember static final
14936 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
14938 (method_header): New local variable ORIG_ARG. Use unqualified
14939 current class name for check on constructor errors. Promote return
14940 type if of record type. Argument list fix moved in
14941 fix_method_argument_names, called here. Check method deprecation.
14942 (fix_method_argument_names): New function.
14943 (method_declarator): Promote record typed arguments.
14944 (safe_layout_class): Check class methods before layout.
14945 (java_complete_class): Compute field layout when patched.
14946 (do_resolve_class): Try to load class after having it renamed
14947 after the package name.
14948 (get_printable_method_name): Use DECL_CONTEXT.
14949 (reset_method_name): New function.
14950 (check_method_redefinition): Use reset_method_name.
14951 (java_check_regular_methods): New local variable
14952 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
14953 names for error report. Check for compile-time error when method
14954 found has default (package) access.
14955 (java_check_abstract_methods): Now takes an interface DECL node as
14956 an argument. Also reinstall real name on unchecked
14957 overriding/hiding methods for error report.
14958 (java_check_methods): Fixed leading comment. Get classes to verify
14959 from ctxp->gclass_list. Use CHECK_METHODS macro and set
14960 CLASS_METHOD_CHECKED_P on class verification.
14961 (lookup_java_method2): Get real method name if necessary.
14962 (find_in_imports): Don't check package class access here.
14963 (resolve_package, lookup_package_type): New functions.
14964 (java_layout_classes): Fixed leading comment. Take classes to be
14965 laid out from ctxp->gclass_list.
14966 (java_complete_expand_methods): Don't expand native and abstract
14968 (java_expand_classes): New function.
14969 (resolve_expression_name): Use additional argument ORIG. Retrieve
14970 values of static final field of primitive types.
14971 (resolve_field_access): Handles static final field of promotive
14973 (resolve_qualified_expression_name): Handle STRING_CST as
14974 primaries and package name resolution. Check deprecation on found
14975 decls. Set where_found and type_found on non static field resolved
14976 during qualification. Layout non primitive field decl types.
14977 (check_deprecation): New function.
14978 (maybe_access_field): Simplified.
14979 (patch_method_invocation_stmt): Local variable CLASS_TYPE
14980 removed. Reverse method's argument when primary is a type. Don't
14981 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
14982 instead. Include abstract class in the list of class searchable
14983 for constructors. Use DECL_CONTEXT of found method for access
14984 checks. Check method deprecation.
14985 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
14986 converting arguments. Handle INVOKE_INTERFACE.
14987 (lookup_method_invoke): Search constructor using existing
14988 infrastructure (don't rely on lookup_java_constructor anymore).
14989 (find_applicable_accessible_methods_list): Extra argument flag
14990 LC. Now include constructor in the search.
14991 (qualify_ambiguous_name): Conditional expression are primaries.
14992 (not_initialized_as_it_should_p): static final are always
14994 (java_complete_tree): Pass extra NULL argument to
14995 resolve_expression_name. Stricter test to carry on patching
14996 assignments. New case for INSTANCEOF_EXPR.
14997 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
14998 (check_final_assignment, maybe_build_primttype_type_ref): New
15000 (patch_assignment): Detect resolved static finals and carry normal
15001 assignment error check on them. Inline PRIMTYPE.TYPE read access.
15002 (try_builtin_assignconv): Access constant 0 on all primitive
15004 (valid_builtin_assignconv_identity_widening_p): Accept identical
15005 types. Accept all promoted type on int type.
15006 (valid_ref_assignconv_cast_p): Accept a null pointer to be
15007 assigned to a reference.
15008 (valid_method_invocation_conversion_p): Accept to check null
15010 (build_binop): Merge declaration and initialization of local
15012 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
15013 numeric types. Improved validity test for qualify operators on
15015 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
15016 and PREINCREMENT_EXPR. Also detect resolved static finals of a
15017 primitive type and issue the appropriate error message.
15018 (resolve_type_during_patch): Mark class loaded when resolved.
15019 (patch_cast): Allow null to be cased to reference types.
15020 (build_null_of_type): New function.
15021 (patch_array_ref): Handle array on references correctly.
15022 (patch_return): Removed unused local variable MODIFY. Force
15023 boolean to be returned as integers. Allows null to be returned by
15024 a function returning a reference.
15025 * typeck.c (convert_to_integer, convert_to_real,
15026 convert_to_pointer): Prototypes moved to convert.h
15027 (lookup_argument_method): Use method real name, if necessary.
15029 1998-10-30 Tom Tromey <tromey@cygnus.com>
15031 * class.c (build_class_ref): Changed name of primitive classes to
15034 * class.c (make_class_data): Renamed fields: nmethods to
15035 method_count, method_count to dtable_method_count. Always set
15036 `state' field to 0.
15037 * decl.c (init_decl_processing): Likewise.
15039 1998-10-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
15041 * class.c (layout_class): Don't mangle <finit>, produce
15042 __finit<class> instead. Don't verify artificial methods.
15043 * decl.c (finit_identifier_node): New declared global.
15044 (init_decl_processing): finit_identifier_node initialized.
15045 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
15046 * java-tree.h (finit_identifier_node): Declared as extern.
15047 (struct lang_decl): New field called_constructor.
15048 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
15049 (CLASS_HAS_FINIT_P): New macro.
15050 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
15051 explicit constructor invocation.
15052 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
15053 CALL_SUPER_CONSTRUCTOR_P): New macros.
15054 (write_classfile): Added prototype.
15055 * jcf-parse.c (jcf_parse_source): Parse and remember for
15056 generation if the file was seen on the command line.
15057 (parse_source_file): Don't write the class file here.
15058 (yyparse): Loop on files rewritten. Set current_jcf.
15059 (parse_zip_file_entries): Parse class file only if it was found.
15060 * lang.c (init_parse): Don't open command line provided filename
15062 (lang_parse): Don't set main_jcf anymore.
15063 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
15064 (JCONSTRUCTOR_CHECK): New macro.
15065 (JBSC_TYPE_P): New macro.
15066 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
15067 (COMPLETE_CHECK_OP_2): New macro.
15068 (struct parse_ctxt): New field explicit_constructor_p.
15069 (check_class_interface_creation): Fixed prototype indentation.
15070 (patch_method_invocation_stmt): Prototype reflects added argument.
15071 (patch_invoke): Likewise.
15072 (complete_method_declaration, build_super_invocation,
15073 verify_constructor_circularity,
15074 build_this_super_qualified_invocation, get_printable_method_name,
15075 patch_conditional_expr, maybe_generate_finit, fix_constructors,
15076 verify_constructor_super, create_artificial_method,
15077 start_artificial_method_body, end_artificial_method_body,
15078 generate_field_initialization_code): New function prototypes.
15079 * parse.y: Fixed leading comment
15080 (constructor_header:, constructor_body:, block_end:): Rules tagged
15082 (type_declaration:): Call maybe_generate_finit.
15083 (method_declaration:): Action for method_body: placed in new
15084 function complete_method_declaration, called here.
15085 (constructor_declaration:): Defined actions. Removed leading
15087 (constructor_header:): New rule with action.
15088 (constructor_body:): Rule rewritten using block_begin: and
15089 block_end:. Defined actions.
15090 (constructor_declarator:, explicit_constructor_invocation:):
15092 (block:): Use new rules block_begin: block_end:.
15093 (block_begin:, block_end:): New rules and actions.
15094 (block_statements:): Fixed error message for explicit
15096 (method_invocation:): Call build_this_super_qualified_invocation
15097 if primary is `this' or `super' was seen.
15098 (conditional_expression:): Action defined.
15099 (extra_ctxp_pushed_p): New static global flag.
15100 (java_parser_context_save_global): Create parser context if
15101 necessary. Use extra_ctxp_pushed_p to remember it.
15102 (java_parser_context_restore_global): Pop extra parser context if
15104 (build_array_from_name): Array on primitive types are marked
15106 (register_fields): Restore new name in field initializer
15107 expression if type was altered. Non static fields initialized upon
15108 declaration marked initialized.
15109 (maybe_generate_finit): New function.
15110 (maybe_generate_clinit): Use create_artificial_method,
15111 start_artificial_method_body, end_artificial_method_body. Generate
15112 debug info for enclosed initialization statements.
15113 (method_header): Fixed leading comment. Check constructor
15114 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
15116 (complete_method_declaration, constructor_circularity_msg,
15117 verify_constructor_circularity): New functions.
15118 (get_printable_method_name): New function.
15119 (check_method_redefinition): Don't rename <finit> methods. Fix
15120 declared constructor names. Error message for
15121 constructors modified.
15122 (java_check_regular_methods): Local variable seen_constructor
15123 renamed saw_constructor. Skip verification on constructors. Create
15124 default constructor with create_artificial_method.
15125 (java_check_methods): Removed unnecessary empty line.
15126 (create_artificial_method, start_artificial_method_body,
15127 end_artificial_method_body): New functions.
15128 (java_layout_classes): Changed leading comment. Reverse fields
15129 list if necessary. Always layout java.lang.Object if being
15131 (java_complete_expand_methods): Verify constructor circularity.
15132 (java_complete_expand_method): Call fix_constructor on
15133 constructors. Local variable no_ac_found removed. Restore
15134 bindings if method body expansion failed.
15135 (fix_constructors, verify_constructor_super,
15136 generate_field_initialization_code): New function.
15137 (java_expand_classes): Fixed leading comment. Write class file
15139 (resolve_expression_name): Check for illegal instance variable
15140 usage within the argument scope of an explicit constructor
15142 (resolve_qualified_expression_name): Pass extra from_super flag
15143 when invoking patch_method_invocation_stmt. New case for
15144 conditional expression when used as a primary. Check for error
15145 when acquiring super.
15146 (patch_method_invocation_stmt): Added extra argument super. New
15147 local variable is_static_flag. Set class_to_search according to
15148 the nature of the constructor invocation. Don't add `this'
15149 argument when expanding NEW_CLASS_EXPR. Check for illegal method
15150 invocation within the argument scope of explicit constructor
15151 invocation. Set is_static according to is_static_flag. Provide
15152 extra `super' argument to patch_invoke invocation.
15153 (patch_invoke): New argument from_super. Loop on arguments
15154 indentation fixed. Pass from_super to invocation_mode. New switch
15155 case INVOKE_SUPER. Fixed error message in switch default case.
15156 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
15158 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
15159 (lookup_method_invoke): Fixed prototypes in candidates list. Error
15160 message takes constructors into account.
15161 (find_applicable_accessible_methods_list): Fixed indentation.
15162 (qualify_ambiguous_name): Take explicit constructor invocation
15163 into account. Deal with a conditional expression as a primary to
15165 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
15166 case. Added extra argument to patch_method_invocation_stmt.
15167 Register calls made to explicit constructor `this'. Don't call
15168 save_expr in ARRAY_REF case when emitting class files. Check for
15169 illegal use of this when expanding explicit constructor invocation
15171 (complete_function_arguments): Set and reset parser context
15172 explicit_constructor_p field value when appropriate.
15173 (build_super_invocation, build_this_super_qualified_invocation):
15175 (patch_assignment): Fixed typo.
15176 (patch_unaryop): Check on final fields occurs only when a decl
15178 (patch_return): Take constructors into account.
15179 (patch_conditional_expr): New function.
15180 * typeck.c (build_java_signature): Removed unnecessary empty line.
15182 1998-10-28 Jeffrey A Law (law@cygnus.com)
15184 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
15186 1998-10-28 Tom Tromey <tromey@cygnus.com>
15188 * decl.c (init_decl_processing): Renamed fields.
15189 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
15190 interface_len, msize fields.
15192 * class.c (make_class_data): Removed subclass_head and
15193 subclass_next fields.
15194 * decl.c (init_decl_processing): Removed subclass_head and
15195 subclass_next fields.
15197 1998-10-28 Jeffrey A Law (law@cygnus.com)
15199 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
15200 * mangle.c (emit_unicode_mangled_name): Similarly.
15202 1998-10-26 Nick Clifton <nickc@cygnus.com>
15204 * jcf-parse.c (get_constant): Place braces around code to compute
15205 'd' when REAL_ARITHMETIC is not defined.
15207 1998-10-25 H.J. Lu (hjl@gnu.org)
15209 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
15212 1998-10-23 Tom Tromey <tromey@cygnus.com>
15214 * lang-specs.h: `.zip' files are input to jc1.
15216 1998-10-22 Per Bothner <bothner@cygnus.com>
15218 * jvspecs.c: Add (but don't enable) support for combining multiple
15219 .class and .java input filenames to a single jc1 invocation.
15220 Add support for -C flag (copile to .class files).
15221 Translate -classpath and -CLASSPATH arguments.
15222 * lang-specs.h: Don't set %2 spec.
15224 1998-10-22 Tom Tromey <tromey@cygnus.com>
15226 * jcf-path.c (add_entry): Don't add trailing separator if entry is
15228 (add_path): Don't add trailing separator to non-empty path
15231 * lang.c (lang_decode_option): Check for -fclasspath and
15232 -fCLASSPATH before examining other `-f' options.
15234 * java-tree.h (finalize_identifier_node): Don't declare.
15235 * class.c (make_class_data): Don't push "final" field.
15236 * decl.c (init_decl_processing): Don't push "final" field.
15237 (finalize_identifier_node): Removed.
15238 (init_decl_processing): Don't set finalize_identifier_node.
15240 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
15242 1998-10-11 Anthony Green <green@cygnus.com>
15244 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
15245 (JV_SCAN_SOURCES): New macro.
15246 (JCF_DUMP_SOURCES): Likewise.
15247 (jcf-dump$(exeext)): New target.
15248 (jv-scan$(exeext)): New target.
15250 1998-10-22 Tom Tromey <tromey@cygnus.com>
15252 * Makefile.in (LEX): Removed.
15253 (LEXFLAGS): Likewise.
15254 (SET_BISON): New macro.
15256 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
15257 spurious diffs in parse.c.
15258 ($(PARSE_SCAN_C)): Likewise.
15259 (PARSE_DIR): New macro.
15261 (PARSE_SCAN_C): Likewise.
15262 (PARSE_RELDIR): New macro.
15264 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
15266 * jcf-io.c (find_class): Use saw_java_source to determine when to
15267 look for `.java' file.
15268 * jcf-parse.c (saw_java_source): New global.
15269 (yyparse): Set it if `.java' file seen.
15271 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
15272 (GCJH_SOURCES): Likewise.
15273 * Makefile.in (datadir): New macro.
15274 (libjava_zip): Likewise.
15275 (JAVA_OBJS): Added jcf-path.o.
15276 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
15277 (../gcjh$(exeext)): Likewise.
15278 (jcf-path.o): New target.
15279 * java-tree.h (fix_classpath): Removed decl.
15280 * jcf-parse.c (fix_classpath): Removed.
15281 (load_class): Don't call fix_classpath.
15282 * parse.y (read_import_dir): Don't call fix_classpath.
15283 * lex.h: Don't mention classpath.
15284 * lex.c (java_init_lex): Don't initialize classpath.
15285 * jcf-io.c (classpath): Removed global.
15286 (find_class): Use jcf_path iteration functions. Correctly search
15287 class path for .java file.
15288 (open_in_zip): New argument `is_system'.
15289 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
15290 classpath-related options.
15291 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
15293 (lang_init): Call jcf_path_init.
15294 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
15295 * lang-specs.h: Handle -I. Minor cleanup to -M options.
15296 Correctly put braces around second string in each entry.
15297 * gjavah.c (main): Call jcf_path_init. Recognize all the new
15298 classpath-related options.
15299 (help): Updated for new options.
15300 * jcf.h: Declare functions from jcf-path.c. Don't mention
15301 `classpath' global.
15302 * jcf-path.c: New file.
15304 * jcf-depend.c: Include jcf.h.
15306 * jcf-write.c (localvar_alloc): Returns `void'.
15307 (localvar_free): Removed unused variable.
15309 * lang.c (OBJECT_SUFFIX): Define if not already defined.
15310 (init_parse): Use OBJECT_SUFFIX, not ".o".
15312 1998-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
15314 * class.c (emit_register_classes): Renamed from
15315 emit_register_class.
15316 * java-tree.h (emit_register_classes): Prototype renamed from
15317 emit_register_class.
15318 * jcf-parse.c (yyparse): Call emit_register_classes once before
15320 * parse.y (java_expand_classes): No longer register classes.
15322 1998-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
15324 * class.c (is_compiled_class): New local variable
15325 seen_in_zip. Identify classes found in currently compiled source
15327 * decl.c (complete_start_java_method): Fixed typo.
15328 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
15329 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
15330 (CLASS_P): Moved around.
15331 (java_parse_abort_on_error): Macro moved from jcf-parse.c
15332 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
15334 (jcf_parse_source): Changed leading comment. Removed unnecessary
15335 fclose and CLASS_FROM_SOURCE_P marking.
15336 (parse_source_file): New local variables remember_for_generation
15337 and filename. Mark parsed file name identifier node. Removed block
15338 executed when parse_only was null. Set remember_for_generation.
15339 Use it as an argument to java_pop_parser_context.
15340 (yyparse): New local variables several_files, list, next node and
15341 current_file_list. Split ampersand separated file names into
15342 current_file_list. Iterate through the list and parse accordingly.
15343 * parse.h (java_pop_parser_context): New function prototype.
15344 * parse.y (ctxp_for_generation): New static global variable.
15345 (java_pop_parser_context): New argument generate. Link popped ctxp
15346 to ctxp_for_generation list accordingly.
15347 (java_complete_expand_methods): Fixed indentation.
15348 (java_expand_classes): New function.
15350 1998-10-17 Per Bothner <bothner@cygnus.com>
15352 * Makefile.in: Link with libiberty.a instead of memmove.o.
15354 1998-10-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
15356 * lex.c (setjmp.h): No longer included.
15357 * lex.h (setjmp.h): Included.
15358 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
15359 (duplicate_declaration_error_p): Renamed from
15360 duplicate_declaration_error.
15361 (build_array_from_name): New function prototype.
15362 * parse.y (setjmp.h): No longer included.
15363 (variable_declarator_id): Define action.
15364 (build_array_from_name): New function.
15365 (duplicate_declaration_error_p): Renamed from
15366 duplicate_declaration_error. Fixed leading comment.
15367 (register_fields): Main `for' loop reorganized. Uses
15368 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
15369 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
15370 build_array_from_name.
15371 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
15373 (read_import_dir): Don't try to skip `.' and `..'.
15374 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
15375 build_array_from_name. Main `for' loop reorganized.
15376 (resolve_qualified_expression_name): When building access to a
15377 field, use the type where the field was found, not its own type.
15378 (maybe_access_field): Use field DECL_CONTEXT if the type where the
15379 field was found is null.
15380 (qualify_ambiguous_name): Sweep through all successive array
15383 1998-10-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
15385 * java-tree.h (pop_labeled_block, lang_printable_name,
15386 maybe_add_interface, set_super_info, get_access_flags_from_decl,
15387 interface_of_p, inherits_from_p, fix_classpath,
15388 complete_start_java_method, emit_handlers, init_outgoing_cpool,
15389 make_class_data, register_class, alloc_name_constant): New
15390 function prototypes.
15391 * lang.c (lang_decode_option): Set argc argument unused. Fixed
15392 indentation. Added cast to remove warning.
15393 (lang_printable_name): Set v argument unused.
15394 (lang_print_error): Added argument to lang_printable_name call.
15395 (java_dummy_print, print_lang_decl, print_lang_type,
15396 print_lang_identifier, lang_print_xnode): All argument marked
15398 * lex.c (java_unget_unicode): Removed unnecessary argument.
15399 (java_allocate_new_line): Unused local variable is gone.
15400 (java_read_char): Added parenthesis in expressions to remove
15401 warnings. Added final return statement.
15402 (java_read_unicode): Added parenthesis in expression to remove
15404 (java_parse_end_comment): Fixed java_unget_unicode invocation.
15405 (java_parse_escape_sequence): Likewise.
15406 (java_lex): Unused local variables are gone. Fixed
15407 java_unget_unicode invocation.
15408 * lex.h (set_float_handler): Prototype added when JC1_LITE not
15410 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
15411 lang_printable_name invocation in macro.
15412 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
15414 (duplicate_declaration_error): Suppressed unused argument in
15416 (identical_subpath_p): Function declaration is gone.
15417 (patch_invoke): Suppressed unused argument in prototype.
15418 (patch_cast, build_labeled_block, check_thrown_exceptions):
15420 * parse.y (setjmp.h): Included
15421 (toplev.h): Likewise.
15422 (field_declaration:): Suppressed unused local
15423 (label_decl:): Fixed build_labeled_block invocation.
15424 (java_pop_parser_context): Put extra parenthesis around assignment
15426 (yyerror): Suppressed unused local variables.
15427 (variable_redefinition_error): Fixed lang_printable_name
15429 (create_interface): Suppressed unused local variables.
15430 (create_class): Likewise.
15431 (duplicate_declaration_error): Suppressed unused argument. Fixed
15432 lang_printable_name invocation.
15433 (register_fields): Suppressed unused local variable. Fixed
15434 duplicate_declaration_error invocation.
15435 (method_header): Suppressed unused local variable.
15436 (method_declarator, parser_check_super): Likewise.
15437 (java_complete_class): Suppressed unused local variable. Fixed
15438 fatal error message.
15439 (complete_class_report_errors): Added default: in switch.
15440 (java_check_regular_methods): Fixed lang_printable_name
15442 (check_throws_clauses): Likewise.
15443 (java_check_abstract_methods): Suppressed unused local
15444 variable. Fixed lang_printable_name invocation.
15445 (read_import_entry): Added supplemental return statement.
15446 (read_import_dir): Suppressed unused local variables.
15447 (check_pkg_class_access, declare_local_variables): Likewise.
15448 (source_start_java_method): Suppressed unused extern variable
15450 (expand_start_java_method): Suppressed unused extern and local
15451 variable declarations.
15452 (java_complete_expand_methods): Likewise.
15453 (java_complete_expand_method): Suppressed unused local variables.
15454 (make_qualified_name): Likewise.
15455 (resolve_qualified_expression_name): Added default: in
15456 switch. Fixed lang_printable_name invocation.
15457 (class_instance_creation_expression): Added parenthesis around
15459 (patch_method_invocation_stmt): Fixed lang_printable_name and
15460 patch_invoke invocations.
15461 (check_for_static_method_reference): Fixed lang_printable_name
15463 (patch_invoke): Suppressed unused arguments and local variables.
15464 (lookup_method_invoke): Suppressed unused local variables.
15465 (qualify_ambiguous_name): Added default: in switch.
15466 (identical_subpath_p): Function removed.
15467 (patch_assignment): Suppressed unused local variables. Suppressed
15468 unnecessary if statement. Fixed lang_printable_name invocations.
15469 (try_builtin_assignconv): Fixed lang_printable_name invocations.
15470 (valid_ref_assignconv_cast_p): Parenthesis around
15471 expression. Suppressed unused local variables.
15472 (build_binop): Suppressed unused local variables. fixed
15473 lang_printable_name invocations.
15474 (string_constant_concatenation): Suppressed unused local
15476 (patch_unaryop): Fixed lang_printable_name invocation.
15477 (patch_cast): Suppressed unnecessary argument. Fixed
15478 lang_printable_name invocation.
15479 (patch_array_ref): Fixed lang_printable_name invocation.
15480 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
15481 (build_labeled_block): Suppressed unused argument.
15482 (generate_labeled_block): Fixed build_labeled_block invocation.
15483 (build_loop_body): Suppressed unused local variables.
15484 (patch_loop_statement): Likewise.
15485 (patch_exit): Fixed lang_printable_name invocation.
15486 (patch_switch_statement): Likewise.
15487 (case_identity): First argument marked unused.
15488 (patch_try_statement): Fixed lang_printable_name invocations.
15489 (patch_synchronized_statement, patch_throw_statement): Likewise.
15490 (check_thrown_exceptions): Fixed check_thrown_exceptions and
15491 lang_printable_name invocations.
15492 (check_thrown_exceptions_do): Suppressed unused argument.
15494 1998-10-14 Tom Tromey <tromey@cygnus.com>
15496 * jcf-write.c (write_classfile): Add output class file as target.
15497 * lang-options.h: Added -MD, -MMD, -M, and -MM.
15498 * jcf.h: Added declarations for dependency-tracking functions.
15499 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
15500 * lang.c (lang_decode_option): Recognize -MD and -MMD.
15501 (finish_parse): Call jcf_dependency_write.
15502 (dependency_tracking): New global.
15503 (DEPEND_SET_FILE): New define.
15504 (DEPEND_ENABLE): New define.
15505 (init_parse): Enable dependency tracking if required.
15507 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
15508 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
15509 (../gcjh$(exeext)): Likewise.
15510 (jcf-depend.o): New target.
15511 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
15512 (GCJH_SOURCES): Likewise.
15513 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
15515 (find_classfile): Added dep_name argument.
15516 (find_class): Compute name of dependency.
15517 (open_in_zip): Call jcf_dependency_add_file.
15518 * gjavah.c (output_file): No longer global.
15519 (usage): Don't mention "gjavah".
15521 (java_no_argument): Likewise.
15522 (version): Likewise.
15523 (main): Recognize and handle -M family of options.
15524 (print_mangled_classname): Return is void.
15525 (process_file): Handle case where output is suppressed.
15526 (HANDLE_END_FIELD): Likewise.
15527 (HANDLE_METHOD): Likewise.
15528 * jcf-depend.c: New file.
15530 1998-10-13 Jeffrey A Law (law@cygnus.com)
15532 * java-tree.def: Add missing newline at EOF.
15534 1998-10-13 Tom Tromey <tromey@cygnus.com>
15536 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
15537 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
15539 Include <config.h> and "system.h".
15540 (disassemble_method): Undefine RET to avoid clash with
15541 config/i386/i386.h.
15543 1998-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
15545 * decl.c (runtime_exception_type_node, error_exception_type_node):
15546 New global variables.
15547 (init_decl_processing): Initialized.
15548 * expr.c (java_lang_expand_expr): Set caught exception type to
15549 null if catch handler argument doesn't exit.
15550 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
15552 * java-tree.h (runtime_exception_type_node,
15553 error_exception_type_node): Global variables declared.
15554 (DECL_FUNCTION_THROWS): New macro.
15555 (DECL_FUNCTION_BODY): Modified comment.
15556 (DECL_SPECIFIC_COUNT): Likewise.
15557 (struct lang_decl): New field throws_list.
15558 (IS_UNCHECKED_EXPRESSION_P): New macro.
15559 * lex.c (java_lex): Generate location information for THROW_TK.
15560 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
15561 EXCEPTIONS_P): New macros.
15562 (enum jdep_code): New value JDEP_EXCEPTION.
15563 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
15564 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
15565 PATCH_METHOD_RETURN_ERROR): New macros.
15566 (patch_method_invocation_stmt): Added new argument to prototype.
15567 (patch_synchronized_statement, patch_throw_statement,
15568 check_thrown_exceptions, check_thrown_exceptions_do,
15569 purge_unchecked_exceptions, check_throws_clauses): New function
15571 * parse.y Fixed typo in keyword section.
15572 (throw:): Rule tagged <node>.
15573 (THROW_TK): Keyword tagged <operator>.
15574 (method_header:): Last argument to call to method_header passed
15576 (throws:, class_type_list:, throw_statement:,
15577 synchronized_statement:, synchronized:): Defined actions.
15578 (method_header): New local variable current. Register exceptions
15579 from throws clause.
15580 (java_complete_tree): Complete and verify exceptions from throws
15582 (complete_class_report_errors): Error message on exceptions not
15584 (java_check_regular_methods): Fixed typo. Shortcut on private
15585 overriding methods. Changed error message on method
15586 redefinition. Check for throws clause compatibility.
15587 (check_throws_clauses): New function.
15588 (java_check_abstract_methods): Use DECL_NAME for wfl or current
15589 method. Changed error message on method redefinition.
15590 (currently_caught_type_list): New static variable.
15591 (java_complete_expand_methods): Purge unchecked exceptions from
15592 throws clause list. Call PUSH_EXCEPTIONS before walk and
15593 POP_EXCEPTIONS after.
15594 (resolve_qualified_expression_name): Pass new argument as NULL to
15595 patch_method_invocation_stmt.
15596 (patch_method_invocation_stmt): New argument ref_decl. Invoke
15597 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
15598 argument list when appropriate. Use new argument if non null to
15599 store selected method decl.
15600 (patch_invoke): Convert if necessary args of builtin types before
15601 forming CALL_EXPR. Argument list no longer reversed here.
15602 (invocation_mode): Treat final methods as static methods.
15603 (java_complete_tree): New cases for THROW_EXPR: and
15604 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
15606 (complete_function_arguments): No more RECORD_TYPE
15607 conversion. Function parameter nodes no longer saved.
15608 (valid_ref_assignconv_cast_p): Avoid handling null type.
15609 (patch_binop): Fixed null constant reference handling.
15610 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
15611 BUILD_THROW macros.
15612 (patch_try_statement): Fixed comments. Record caught types in
15613 list, push the list, expand try block and pop the list.
15614 (patch_synchronized_statement, patch_throw_statement,
15615 check_thrown_exceptions, check_thrown_exceptions_do,
15616 purge_unchecked_exceptions): New functions.
15617 * typeck.c (lookup_argument_method): Allow WFL in place of method
15618 DECL_NAME during method definition check
15620 1998-10-09 Tom Tromey <tromey@cygnus.com>
15622 * gjavah.c (decode_signature_piece): New function.
15623 (print_c_decl): Use it. Added `name_override' argument.
15624 (print_method_info): Use name_override argument to print_c_decl.
15625 (seen_fields): Removed.
15626 (print_field_info): Don't update seen_fields.
15627 (struct method_name): New structure.
15628 (method_name_list): New global.
15629 (print_method_info): Add new method to list of methods.
15630 (name_is_method_p): New function.
15631 (print_field_info): If field name has same name as method, then
15633 (process_file): Parse methods before fields.
15634 (field_pass): New global.
15635 (HANDLE_END_FIELD): Take field_pass into account.
15637 1998-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
15639 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
15640 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
15642 1998-10-03 Anthony Green <green@cygnus.com>
15644 * jvspec.c: Fix bug in jvgenmain_spec patch.
15646 1998-10-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
15648 * Makefile.in (lang.o:): Install dependency on java-tree.def.
15649 * decl.c (soft_exceptioninfo_call_node): New global variable.
15650 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
15651 takes extra integer argument. soft_exceptioninfo_call_node
15653 * except.c (java_set_exception_lang_code): New function
15654 (method_init_exceptions): Called here.
15655 (prepare_eh_table_type): New function.
15656 (expand_end_java_handler): Called here.
15657 * expr.c (build_java_throw_out_of_bounds_exception): Now features
15658 one argument. Modified generation of call to
15659 soft_badarrayindex_node to use new argument.
15660 (build_java_arrayaccess): Pass faulty index value to
15661 build_java_throw_out_of_bounds_exception.
15662 (generate_name): New function.
15663 (java_lang_expand_expr): New local variables node, current,
15664 has_finally_p. Expand TRY_EXPR node.
15665 (process_jvm_instruction): Replace top of the stack with thrown
15666 object reference when entering exception handler.
15667 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
15668 specific tree codes.
15669 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
15671 (DECL_SPECIFIC_COUNT): New macro.
15672 (prepare_eh_table_type, java_set_exception_lang_code,
15673 generate_name): New function declarations.
15674 (match_java_method): Declaration deleted.
15675 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
15677 * lex.c (TRY_TK, CATCH_TK): Generate location information.
15678 * parse.h (redefinition_error, refine_accessible_methods_list,
15679 can_cast_to_p): Function declaration removed.
15680 (classitf_redefinition_error, variable_redefinition_error,
15681 parse_jdk1_1_error, find_applicable_accessible_methods_list,
15682 find_most_specific_methods_list, argument_types_convertible,
15683 enter_a_block, valid_builtin_assignconv_identity_widening_p,
15684 valid_cast_to_p, valid_method_invocation_conversion_p,
15685 try_reference_assignconv, add_stmt_to_compound,
15686 build_jump_to_finally, build_tree_list, patch_try_statement,
15687 java_get_catch_block): New function declarations.
15688 * parse.y (string_buffer_type): Global variable deleted.
15689 (group_of_labels, catches, catch_clause, catch_clause_parameter,
15690 finally): Rules tagged <node>.
15691 (TRY_TK, CATCH_TK): Token tagged <operator>.
15692 (class_body_declaration:, class_member_declaration:,
15693 formal_parameter:, explicit_constructor_invocation:,
15694 interface_member_declaration:, constant_declaration:,
15695 primary_no_new_array:, class_instance_creation_expression:,
15696 array_creation_expression:): Issue error on unsuported JDK1.1
15698 (try_statement:, catches:, finally:): Define actions.
15699 (catch_clause_parameter): New rule.
15700 (catch_clause:): Use new rule catch_clause_parameter.
15701 (parse_jdk1_1_error): New function.
15702 (redefinition_error): Renamed classitf_redefinition_error.
15703 (variable_redefinition_error): New function.
15704 (check_class_interface_creation): Call
15705 classitf_redefinition_error.
15706 (java_complete_tree): Added error message on JDEP_TYPE: case.
15707 (complete_class_report_errors): Fixed indentation.
15708 (declare_local_variables): Call variable_redefinition_error.
15709 (source_end_java_method): Call java_set_exception_lang_code and
15710 emit_handlers where appropriate.
15711 (java_method_add_stmt): Call add_stmt_to_block.
15712 (add_stmt_to_block): New function.
15713 (lookup_method_invoke): Fixed outside comment. new local variable
15714 candicates. Call find_applicable_accessible_methods_list and
15715 find_most_specific_methods_list when searching for a
15716 method. Modified error report to list possible candidates when
15718 (find_applicable_accessible_methods_list,
15719 find_most_specific_methods_list, argument_types_convertible): New
15721 (refine_accessible_methods_list): Function deleted.
15722 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
15723 expr (if applicable) before calling patch_array_ref.
15724 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
15725 (enter_block): Fixed comment.
15726 (enter_a_block): New function.
15727 (patch_assignment): Reorganized. Call try_reference_assignconv for
15728 references. Call valid_cast_to_p instead of can_cast_to_p.
15729 (try_reference_assignconv,
15730 valid_builtin_assignconv_identity_widening_p): New functions.
15731 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
15732 (valid_cast_to_p, valid_method_invocation_conversion_p): New
15734 (build_string_concatenation): Don't resolve StringBuffer.
15735 (patch_cast): Fixed inverted arguments.
15736 (patch_array_ref): Code to save array expr deleted. Call
15737 valid_cast_to_p instead of can_cast_to_p.
15738 (generate_labeled_block): Call generate_name.
15739 (build_jump_to_finally, build_try_statement, java_get_catch_block,
15740 patch_try_statement): New functions.
15741 * typeck.c (match_java_method): Function deleted.
15743 1998-10-02 Anthony Green <green@cygnus.com>
15745 * jvspec.c: jvgenmain_spec uses different temporary file names.
15747 1998-10-02 Anthony Green <green@cygnus.com>
15749 * jvspec.c (lang_specific_driver): Fail if user specifies
15750 --main= when not linking.
15752 1998-09-28 Tom Tromey <tromey@cygnus.com>
15754 * class.c (make_class_data): Push value for `thread' field.
15755 * decl.c (init_decl_processing): Added `thread' field to class.
15757 * class.c (add_field): Always make static fields externally
15760 1998-09-26 Anthony Green <green@cygnus.com>
15762 * expr.c (build_java_athrow,
15763 build_java_throw_out_of_bounds_exception, expand_invoke,
15764 build_newarray, expand_java_multianewarray, build_java_monitor):
15765 Update comments to reflect _Jv_* function names.
15767 1998-09-25 Per Bothner <bothner@cygnus.com>
15769 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
15770 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
15771 * parse.y (expand_start_java_method): Likewise.
15773 1998-09-24 Per Bothner <bothner@cygnus.com>
15775 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
15777 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
15778 (add_field): No longer need to convert from RECORD_TYPE to pointer,
15779 * expr.c: Remove no-longer-needed calls to promote_type.
15780 * decl.c (give_name_to_locals): Liekwise.
15781 * jcf-parse.c (get_class_constant): Compensate for new signatures.
15782 * parse.y: Add/remove promote_type calls as appropriate.
15783 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
15784 (parse_signature_string): Likewise.
15785 (build_java_array_type): Fix for now signature convenions.
15787 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
15789 1998-09-23 Tom Tromey <tromey@cygnus.com>
15791 * class.c (init_class_processing): libjava function renamed to
15794 1998-09-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
15796 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
15797 * java-tree.def: Fixed DEFTREECODE third argument.
15798 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
15799 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
15800 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
15801 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
15802 JAVA_THIS_EXPR): Now replaced by tree code definitions.
15803 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
15804 * lang.c (java_tree_code_type, java_tree_code_length,
15805 java_tree_code_name): New arrays.
15806 (lang_init): Append Java tree node definitions to Gcc ones.
15807 * lex.c (expression_obstack): Declared as extern when JC1_LITE
15809 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
15811 (java_lex): Allow declaration of empty string constants. Retain
15812 location information on CASE_TK and DEFAULT_TK.
15813 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
15814 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
15815 Modified to be more robust.
15816 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
15817 (build_new_invocation, try_builtin_assignconv,
15818 patch_switch_statement, string_constant_concatenation,
15819 build_string_concatenation, patch_string_cst, patch_string,
15820 java_expand_switch): New function declarations.
15821 * parse.y: Rules related to switch and EH tagged <node>.
15822 (label_id): Set to NULL_TREE
15823 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
15825 (this_or_super:): Fixed indentation.
15826 (statement:, statement_nsi:, statement_without_trailing_substatement:,
15827 statement_expression:): Removed call to RULE on all sub-rules.
15828 (switch_expression:, switch_labels:): New rules.
15829 (switch_statement:, switch_block:, switch_block_statement_groups:,
15830 switch_block_statement_group:, switch_labels:, switch_label:):
15832 (throw_statement:, synchronized_statement:, try_statement:):
15833 Defined temporary actions.
15834 (class_instance_creation_expression:): Call
15835 build_new_invocation. Fixed indentation.
15836 (field_access): Fixed indentation.
15837 (method_invocation): Likewise.
15838 (make_qualified_primary): Use THIS_EXPR.
15839 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
15840 resolving from SUPER, set *type_found.
15841 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
15842 (java_complete_tree): Removed unused local variable `location'. Case
15843 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
15844 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
15845 on MODIFY_EXPR: and all binary operator tree code cases. Removed
15846 STRING_CST: case. default: checks for patchable strings.
15847 (complete_function_arguments): Transform string constant or
15848 crafted StringBuffer if necessary.
15849 (build_method_invocation): Fixed comments.
15850 (build_new_invocation): New function.
15851 (patch_assignment): Call try_builtin_assignconv to figure a valid
15852 assignment conversion between builtin types.
15853 (try_builtin_assignconv): New function.
15854 (build_binop): Use URSHIFT_EXPR directly to call build.
15855 (operator_string): Use UNARY_PLUS_EXPR.
15856 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
15858 (do_merge_string_cste, merge_string_cste,
15859 string_constant_concatenation, build_string_concatenation,
15860 patch_string, patch_string_cst): New function.
15861 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
15862 (patch_unaryop): Likewise. New test of valid ++/-- operands.
15863 (build_newarray_node): Use NEW_ARRAY_EXPR.
15864 (build_this): Use THIS_EXPR.
15865 (build_return): Enable debug information on return statement.
15866 (build_if_else_statement): Likewise.
15867 (complete_labeled_statement): Fixed related comment.
15868 (build_loop_body): Fixed comment.
15869 (build_bc_statement): Enable debug information on break/continue
15871 (patch_bc_statement): Fixed typos. Handle SWITCH statement
15873 (patch_switch_statement, case_identity, java_expand_switch): New
15876 1998-09-21 Per Bothner <bothner@cygnus.com>
15878 * buffer.h (BUFFER_INIT): New macro.
15879 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
15880 Pass (struct jcf_partial *state) to most functions.
15881 (jcf_block, jcf_relocation): New types.
15882 Support labels, branches, conditionals, loops.
15884 1998-09-21 Tom Tromey <tromey@cygnus.com>
15886 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
15888 1998-09-21 Per Bothner <bothner@cygnus.com>
15890 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
15891 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
15892 not integer_type_node (INT_TYPE_SIZ bits).
15894 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
15896 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
15897 * jcf-dump.c (print_exception_table): New function.
15898 (disassemble_method): Better handling of wide instructions.
15899 Make more robust for bad input.
15901 1998-09-30 Jeffrey A Law (law@cygnus.com)
15903 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
15906 1998-09-17 Jeffrey A Law (law@cygnus.com)
15908 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
15910 1998-09-17 Tom Tromey <tromey@cygnus.com>
15912 * Makefile.in ($(PARSE_H)): Removed target.
15914 1998-09-17 Jeffrey A Law (law@cygnus.com)
15916 * Makefile.in (JAVA_OBJS): Add memmove.o
15917 (memmove.o): New target & rules.
15919 1998-09-15 Tom Tromey <tromey@cygnus.com>
15921 * expr.c (expand_invoke): Don't generate a call to the class init
15924 1998-09-14 Jeffrey A Law (law@cygnus.com)
15926 * Makefile.in: Add many missing dependencies.
15927 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
15929 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
15930 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
15932 1998-09-11 Per Bothner <bothner@cygnus.com>
15934 * decl.c (complete_start_java_method): If method is static (and
15935 not private) call _Jv_InitClass.
15936 * expr.c (expand_invoke): Don't call build_class_init.
15938 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
15940 1998-09-10 Jeffrey A Law (law@cygnus.com)
15942 * Make-lang.in (GCJ): Define before using.
15944 1998-09-09 Jeffrey A Law (law@cygnus.com)
15946 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
15947 losing due to namespace pollution in GNU getopt.h
15949 1998-09-09 Tom Tromey <tromey@cygnus.com>
15951 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
15952 (java.all.cross): Likewise.
15953 (java.rest.encap): Likewise.
15955 1998-09-08 Jeffrey A Law (law@cygnus.com)
15957 * gjavah.c (print_class_decls): Fix thinko in arglist
15958 * jcv-io.c (find_classfile): Similarly.
15960 1998-09-07 Jeffrey A Law (law@cygnus.com)
15962 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
15964 1998-09-05 Tom Tromey <tromey@cygnus.com>
15966 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
15967 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
15968 * Makefile.in (PARSE_C): New macro.
15969 (PARSE_H): Likewise.
15970 (PARSE_SCAN_C): Likewise.
15971 ($(PARSE_C)): Target renamed from parse.c.
15972 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
15973 (clean): Remove parse-scan.c as well.
15974 (parse.o): Depend on $(PARSE_C).
15976 1998-09-05 Anthony Green <green@cygnus.com>
15978 * README, license.terms: Removed.
15980 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
15981 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
15982 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
15983 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
15984 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
15985 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
15986 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
15987 and Java trademark attribution.
15989 1998-09-04 Tom Tromey <tromey@cygnus.com>
15991 * Makefile.in: Use gcjh, not gjavah.
15992 * config-lang.in (stagestuff): Use gcjh, not gjavah.
15993 * Make-lang.in: Changed gjavah to gcjh everywhere.
15995 1998-09-03 Per Bothner <bothner@cygnus.com>
15997 * gjavah.c: Support new -prepend -add -append flags.
15998 (print_method_info): Method is not virtual if class is final.
16000 1998-09-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
16002 * jv-scan.c: Fixed copyright assignment.
16003 * keyword.gperf: Likewise.
16004 * keyword.h: Likewise.
16005 * lex.c: Fixed copyright assignment.
16006 (java_lex): Push unicode back when parsing '<'.
16007 * lex.h: Fixed copyright assignment.
16008 * parse-scan.y: Likewise.
16009 * parse.h: Fixed copyright assignment.
16010 (build_debugable_stmt, complete_for_loop): New function prototypes.
16011 * parse.y: Fixed copyright assignment.
16012 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
16013 size_zero_node when completing a loop with no exit condition.
16014 (for_statement_nsi:): Define action.
16015 (for_init:, for_update:): Return size_zero_node when empty.
16016 (declare_local_variables): Call build_debugable_stmt.
16017 (build_debugable_stmt): New function.
16018 (build_loop_body): Build debugable statement around loop
16020 (complete_loop_body): Take into account the debugable statement
16021 around the EXIT_EXPR.
16022 (complete_loop_body): New function.
16023 (patch_exit_expr): Fixed condition inversion.
16025 1998-09-02 Tom Tromey <tromey@cygnus.com>
16027 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
16028 name of thread define.
16029 * jvspec.c (THREAD_NAME): New macro.
16031 (THREADLIB): Likewise.
16032 (lang_specific_driver): Recognize attempt to link with thread
16033 library or gc library. Recognize -ljava on command line so it
16034 isn't linked against more than once.
16036 1998-09-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
16038 * parse-scan.y (report_main_declaration): Name of the class
16039 containing `main' can be a qualified name.
16041 1998-08-31 Tom Tromey <tromey@cygnus.com>
16043 * config-lang.in: Changed gjavac to gjc everywhere.
16044 * Make-lang.in: Changed gjavac to gjc everywhere.
16046 1998-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
16048 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
16049 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
16050 and install the files.
16051 * Makefile.in (JAVA_OBJS_LITE): New variable.
16052 (compiler:): Now include jv-scan as a dependency.
16053 (../jv-scan$(exeext), parse-scan.c): New targets.
16054 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
16055 * config-lang.in (compilers): Removed gcj, gjavah from the list.
16056 * jcf-parse.c (parse_source_file): Call java_layout_classes and
16057 check for errors even if parse_only.
16058 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
16060 (yylex): New function. Uses java_lex body.
16061 (java_lex): Removed commented out statement. Remove local variable
16062 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
16063 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
16064 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
16065 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
16066 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
16067 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
16069 (java_lex_error): Empty if JC1_LITE is defined.
16070 (java_get_line_col): Return 0 if JC1_LITE is defined.
16071 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
16072 SET_MODIFIER_CTX): Moved into the section containing the macros
16073 conditionally defined by JC1_LITE.
16074 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
16075 argument if JC1_LITE is defined.
16076 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
16077 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
16079 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
16080 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
16081 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
16082 to different values according to JC1_LITE.
16083 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
16084 declared if JC1_LITE set.
16085 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
16086 defined if JC1_LITE not set.
16087 (struct parser_ctx): Reorganized and skip the jc1 front end part
16089 (java_layout_classes): New function definition.
16090 (java_push_parser_context, java_init_lex, yyparse, yylex,
16091 yyerror): Prototype always declared. All other static function
16092 prototypes declared only if JC1_LITE is not set.
16093 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
16094 declared in parse.h.
16095 (java_layout_classes): New function.
16096 (java_complete_expand_methods): No longer layout the class here.
16097 * parse-scan.y: New file.
16098 * jv-scan.c: New file.
16100 1998-08-25 Tom Tromey <tromey@cygnus.com>
16102 * gjavah.c (main): Handle -friend option.
16103 (friend_specs): New global.
16104 (generate_access): Handle friend_specs.
16105 (process_file): Likewise.
16106 (MAX_FRIENDS): New macro.
16107 (friend_count): New global.
16108 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
16109 Changed all callers.
16111 1998-08-24 Per Bothner <bothner@cygnus.com>
16113 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
16114 (main): Handle processing all the entries of a named .zip archive.
16115 * jcf-io.c (jcf_trim_old_input): New function.
16116 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
16118 1998-08-24 Per Bothner <bothner@cygnus.com>
16120 * lang.c (flag_assume_compiled): Make default be on.
16122 1998-08-21 Per Bothner <bothner@cygnus.com>
16124 * jcf-dump.c: Add bunches of flags to control output more.
16125 (process_class): New function; support printing more than one class.
16126 (main): Support new --print-main and --javap flags.
16127 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
16128 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
16130 1998-08-20 Per Bothner <bothner@cygnus.com>
16132 Change mangling of dispatch table to match C++ vtable (w/thunks).
16133 * class.c (build_dtable_decl), java-tree.h: New function.
16134 (make_class_data): Call it.
16135 * decl.c (init_decl_processing): Likewise.
16137 1998-08-19 Warren Levy <warrenl@cygnus.com>
16139 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
16140 soft_anewarray; adjust args passed.
16141 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
16142 match _Jv_NewObjectArray.
16144 1998-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
16146 * decl.c (push_labeled_block, pop_labeled_block): New functions.
16147 * expr.c (loopup_label): Call create_label_decl.
16148 (create_label_decl): New function.
16149 (java_lang_expand_expr): Call expand_start_bindings with argument
16151 * java-tree.h Added space after PROTO in function declarations
16153 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
16154 (create_label_decl, push_labeled_block): New function
16156 * lex.c (label_id): Initialize.
16157 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
16159 * parse.h Added space after PROTO in function declarations when
16161 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
16162 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
16163 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
16164 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
16166 (struct parser_ctxt): New fields current_loop,
16167 current_labeled_block.
16168 (build_if_else_statement, patch_if_else_statement,
16169 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
16170 generate_labeled_block, complete_labeled_statement,
16171 build_bc_statement, patch_bc_statement, patch_loop_statement,
16172 build_new_loop, build_loop_body, complete_loop_body): New function
16174 * parse.y (java_warning_count): New global variable.
16175 (label_id): New static variable.
16176 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
16177 (block:): Return size_zero_node when block is empty.
16178 (empty_statement:): Return size_zero_node.
16179 (statement:): Implement supplemental action when for_statement: is
16181 (label_decl:): New rule.
16182 (labeled_statement:): Rewritten using label_decl. Actions
16184 (labeled_statement_nsi:): Likewise.
16185 (if_then_statement): Actions implemented.
16186 (while_expression): New rule.
16187 (while_statement:): Rewritten using while_expression. Actions
16189 (while_statement_nsi:): Likewise.
16190 (do_statement_begin:): New rule.
16191 (do_statement:): Rewritten using do_statement_begin. Actions
16193 (for_statement:): Rewritten using for_begin. Actions implemented.
16194 (for_statement_nsi:): Likewise.
16195 (for_header:, for_begin:): New rules.
16196 (for_init:): Actions implemented.
16197 (statement_expression_list:, break_statement:,
16198 continue_statement:): Likewise.
16199 (yyerror): Count number of issued warning(s).
16200 (java_report_errors): Report error(s) and/or warning(s).
16201 (java_complete_class): Use build_java_argument_signature to
16202 recompute completed method signature.
16203 (java_check_regular_methods): New locals method_wfl and aflags.
16204 Use method_wfl instead of lookup_cl during error reports. Fixed
16205 indentation and modified some error messages. Use
16206 lang_printable_name in method instead of the DECL_NAME. New code
16207 to issue warnings on methods not overriding corresponding methods
16208 private to a different package.
16209 (java_method_add_stmt): Call add_stmt_to_compound.
16210 (add_stmt_to_compound): New function.
16211 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
16212 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
16213 (build_if_else_statement, patch_if_else_statement,
16214 build_labeled_block, generate_labeled_block,
16215 complete_labeled_statement, build_new_loop, build_loop_body,
16216 complete_loop_body, patch_loop_statement, build_bc_statement,
16217 patch_bc_statement, patch_exit_expr): New functions.
16218 * typeck.c (build_java_signature): Build argument signature before
16219 enclosing it in between parenthesis.
16221 1998-08-17 Warren Levy <warrenl@cygnus.com>
16223 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
16224 (JAVA_OBJS): Added reminder comment
16226 1998-08-13 Nick Clifton <nickc@cygnus.com>
16228 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
16229 be interpreted as a long long.
16231 1998-08-13 Warren Levy <warrenl@cygnus.com>
16233 * decl.c (init_decl_processing): Use _Jv_InitClass, not
16234 soft_initialise_class. Use _Jv_NewMultiArray, not
16235 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
16236 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
16237 _Jv_CheckArrayStore, not soft_checkarraystore. Use
16238 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
16240 1998-08-12 Per Bothner <bothner@cygnus.com>
16242 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
16243 length_identifier_node): New global tree node constants.
16244 * parse.y (kw_super, kw_this, kw_length): Removed globals.
16245 Replace uses by super_identifier_node etc.
16246 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
16248 * parse.y (resolve_field_access): Don't special-case ".length" if
16249 flag_emit_class_files.
16250 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
16251 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
16254 1998-08-11 Per Bothner <bothner@cygnus.com>
16256 * decl.c (init_decl_processing): Remove unused method_type_node fields.
16257 * class.c (make_method_value): Remove init for removed fields.
16259 * class.c (layout_class): Use build_java_argument_signature.
16260 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
16262 * typeck.c (push_java_argument_signature): Removed. Merged into ...
16263 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
16264 (build_java_signature): Don't use push_java_argument_signature.
16266 * typeck.c (lookup_argument_method): New function.
16267 * parse.y (java_check_regular_methods): Use lookup_argument_method
16268 instead of lookup_java_method2 followed by lookup_java_method.
16270 * parse.y (check_method_redefinition): Minor optimization.
16272 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
16273 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
16275 1998-08-10 Tom Tromey <tromey@cygnus.com>
16277 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
16280 * gjavah.c (java_float_finite): Use K&R-style definition.
16281 (java_double_finite): Likewise.
16282 (generate_access): Now returns void. Changed all callers.
16283 (last_access_generated): Removed.
16284 (process_file): Only make a single pass over the .class file.
16286 1998-07-29 Per Bothner <bothner@cygnus.com>
16288 * class.c (get_dispatch_table): Add extra dummy vtable entry,
16289 for compatibility for G++ (with -fvtable-thunks).
16290 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
16292 * gjavah.c (process_file): Use public inheritance for super-class.
16294 1998-07-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
16296 * lex.c (java_init_lex): Initialize ctxp->package.
16297 * parse.h (struct parser_ctxt): package and package_len replaced
16298 by tree package, an identifier node. Field method_decl_list is
16299 gone. Fixed comments.
16300 (lookup_field_wrapper, merge_qualified_name, not_accessible,
16301 class_in_current_package): New function prototypes.
16302 * parse.y (array_type:): Set class loaded flag on primitive type
16304 (package_declaration:): Assign ctxp->package to the
16306 (method_invocation:): Handle invocation of method qualified by
16308 (single_type_import_declaration:): Removed ambiguity check.
16309 (java_pop_parser_context): New local variable `next'. Reset and
16310 set IMPORT_CLASSFILE_NAME flags on current and previous import
16312 (java_accstring_lookup): Use new local macro COPY_RETURN.
16313 (lookup_field_wrapper): New function.
16314 (parser_qualified_classname): Use merge_qualified_name.
16315 (parser_check_super_interface): Broaden error message.
16316 (do_resolve_class): Check for qualified class name in the current
16317 compilation unit if appropriate.
16318 (process_imports): Check for already defined classes.
16319 (check_pkg_class_access): Got rid of call to
16320 get_access_flags_from_decl.
16321 (java_complete_expand_methods): Call safe_layout_class based on
16322 the current class size.
16323 (make_qualified_primary): Build a WFL qualification on primary if
16325 (merge_qualified_name): New function.
16326 (make_qualified_name): Use merge_qualified_name.
16327 (resolve_expression_name): Use safe_lookup_field.
16328 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
16329 (resolve_qualified_expression_name): Likewise. Check on resolved
16330 element accessibility.
16331 (not_accessible_p, class_in_current_package): New functions.
16332 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
16333 (patch_method_invocation_stmt): Merged common pieces. Check
16334 accessibility of invoked method.
16335 (check_for_static_method_reference): Add returned type in error
16337 (invocation_mode): Get rid of bogus check on PRIVATE methods.
16338 (refine_accessible_methods_list): Merged two conditions in test.
16339 (java_complete_class): Sanity check on stabilize_ref gone.
16340 * zextract.c (read_zip_archive): Cast lseek second argument to long.
16342 1998-07-28 Per Bothner <bothner@cygnus.com>
16344 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
16346 1998-07-24 Tom Tromey <tromey@cygnus.com>
16348 * gjavah.c (F_NAN): Removed.
16349 (F_NAN_MASK): New macro.
16350 (F_POSITIVE_INFINITY): Removed.
16351 (F_NEGATIVE_INFINITY): Likewise.
16352 (java_float_finite): Rewrote.
16353 (D_NAN_MASK): Renamed.
16354 (java_double_finite): Rewrote.
16355 (D_POSITIVE_INFINITY): Removed.
16356 (D_NEGATIVE_INFINITY): Likewise.
16358 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
16359 If verbose, print underlying representation of value in hex.
16361 1998-07-24 Per Bothner <bothner@cygnus.com>
16363 * buffer.h, buffer.c: New files.
16364 * Makefile.in (JAVA_OBJS): Add buffer.o.
16366 Support locals variables and writing their debug entries to .class.
16367 * jcf-write.c: Simplify some by user new buffer type.
16368 (vode_buffer_grow): Removed.
16369 (struct localvar_info): New type.
16370 (localsvars, localvartable): New buffers.
16371 (localvar_alloc, localvar_free): New functions.
16372 (generate_bytecode_insns): Handle local variables.
16373 (generate_classfile): Write LocalVariableTable attribute.
16375 1998-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
16377 * jcf-io.c (open_in_zip): Check the zipfile magic number.
16378 * zipfile.h (ZIPMAGIC): New macro.
16380 1998-07-24 Tom Tromey <tromey@cygnus.com>
16382 * Makefile.in (gjavah.o): Updated dependencies.
16383 (jcf-dump.o): Likewise.
16384 (all.indirect): Use ../gjavah.
16385 (../gjavah$(exeext)): Likewise.
16386 (clean): Don't remove gjavah.
16387 (clean): Remove parse.c, not java/parse.c.
16388 * Make-lang.in (java): Added gjavah.
16389 (gjavah$(exeext)): New target.
16390 (GJAVAH_SOURCES): New macro.
16391 (java.all.build): Added gjavah.
16392 (java.all.cross): Likewise.
16393 (java.rest.encap): Likewise.
16394 * config-lang.in (compilers, stagestuff): Added gjavah.
16396 1998-07-23 Tom Tromey <tromey@cygnus.com>
16398 * gjavah.c (java_float_finite): New function.
16399 (java_double_finite): Likewise.
16400 (F_POSITIVE_INFINITY): New macro.
16401 (F_NEGATIVE_INFINITY): Likewise.
16403 (D_POSITIVE_INFINITY): Likewise.
16404 (D_NEGATIVE_INFINITY): Likewise.
16406 (print_field_info): Use java_float_finite and java_double_finite.
16408 1998-07-23 Per Bothner <bothner@cygnus.com>
16410 * parse.y (method_header): Name "this" implicit argument.
16412 1998-07-22 Per Bothner <bothner@cygnus.com>
16414 * jcf-write.c: Write out LineNumberTable attribute in .class file.
16415 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
16416 (put_linenumber): New function.
16417 (generate_bytecode_insns, generate_classfile): Write line numbers.
16419 1998-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
16421 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
16422 (lookup_name, build_known_method_ref, build_class_init,
16423 build_invokevirtual, invoke_build_dtable, match_java_method,
16424 build_field_ref, pushdecl_force_head, build_java_binop,
16425 binary_numeric_promotion, build_decl_no_layout,
16426 build_java_arrayaccess, build_newarray, build_anewarray,
16427 build_java_array_length_access, build_java_arraynull_check): New
16428 extern function prototypes.
16429 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
16430 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
16432 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
16434 * jcf.h (jcf_out_of_synch): New extern function prototype.
16435 * parse.h: Static/global function implemented in parse.y
16436 prototyped and declarations moved at the end of the file.
16437 (DECL_P): Check that the argument isn't null.
16438 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
16439 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
16440 (QUAL_DECL_TYPE): New macro.
16441 (PARAMS): Macro definition removed.
16442 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
16443 (return_statement:): Call build_return.
16444 (field_access:): Call make_qualified_primary in sub rule.
16445 (method_invocation:): Build method invocation and call
16446 make_qualified_primary when processing primaries.
16447 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
16448 get_type_from_signature.
16449 (java_check_regular_method): Extra integer 0 argument when calling
16450 lookup_java_method2.
16451 (lookup_java_interface_method2): Extra method DECL argument when
16452 calling lookup_java_interface_method2.
16453 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
16454 COMPOUND_EXPR node.
16455 (java_complete_expand_method): Layout current class iff not
16456 already done. Don't process interface's methods.
16457 (java_complete_expand_method): Use super class only if it
16458 exists. Use current class otherwise.
16459 (make_qualified_primary): New function.
16460 (resolve_expression_name): Process qualified expression or
16461 expression from primary the same way.
16462 (resolve_expression_name): Two last arguments to
16463 resolve_field_access are now NULL_TREEs.
16464 (resolve_field_access): New variable is_static. Local field must
16465 be DECLs. is_static computed on field DECLs only. Append code in
16466 where_found to the field access if necessary. Use QUAL_DECL_TYPE
16467 to initialize field_type.
16468 (resolve_qualified_expression_name): New local variable,
16469 previous_call_static and is_static. Handle primaries with function
16470 calls, casts, array references and `this'. `super' now handled as
16471 `(super_class)this'. Use is_static to clarify boolean expressions.
16472 Added code to handle case where a proper handle is required to
16473 access a field. Use QUAL_DECL_TYPE where applicable.
16474 (maybe_access_field): New function.
16475 (patch_method_invocation_stmt): New arguments primary, where,
16476 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
16477 deleted. Use `where' as a type to search from if specified. Check
16478 for static method reference where forbidden. Append primary or
16479 current_this to the argument list if not calling constructor nor
16481 (check_for_static_method_reference): New function.
16482 (patch_invoke): Layout the class on which new is done if
16484 (lookup_method_invoke): Changed format to report errors on
16486 (qualify_ambiguous_name): New local variable this_found. Now
16487 handle things from primaries. Method call are considered
16489 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
16490 changed into NULLs.
16491 (not_initialized_as_it_should_p): Comply with the new DECL_P.
16492 (java_complete_tree): New case fo RETURN_EXPR. Process function
16493 call arguments in separate function.
16494 (complete_function_arguments): New function.
16495 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
16497 (patch_assignment): Take the return function slot into account as
16498 a RHS. Distinguish assignment from a return.
16499 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
16500 when checking methods in interfaces.
16501 (resolve_type_during_patch): NULL argument to unresolve_type_p
16502 instead of NULL_TREE.
16503 (patch_newarray): Fixed typo in comment.
16504 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
16505 (build_return, patch_return): New functions.
16506 * typeck.c (lookup_java_constructor): Fixed typo in comment.
16508 1998-07-21 Per Bothner <bothner@cygnus.com>
16510 * constants.c (find_name_and_type_constant, find_fieldref_index,
16511 find_methodref_index): New methods.
16512 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
16513 just return given method. Also, rename to build_known_method_ref.
16514 (expand_invoke): Rename call to build_invoke_non_interface.
16515 * java-tree.h, parse.h: Update prototype.
16516 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
16517 (such as expand_expr_stmt) if flag_emit_class_files.
16518 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
16519 STACK_TARGET, IGNORE_TARGET): New macros.
16520 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
16521 (generate_bytecode_insn): New function to generate method's bytecode.
16522 (generate_classfile): Node generate Code attribute for a method.
16523 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
16524 push_long_const, field_op, adjust_typed_op, maybe_wide):
16525 New functions used by generate_bytecode_insn.
16527 * typeck.c (signature_include_return): Remove variable.
16528 (push_java_argument_signature, build_java_argument_signature): New.
16529 (build_java_signature): Use push_java_argument_signature.
16530 * parse.y: Use build_java_argument_signature instead of fiddling
16531 with signature_include_return.
16533 1998-07-17 Tom Tromey <tromey@cygnus.com>
16535 * gjavah.c (print_c_decl): Always generate JArray<>* for array
16538 * Makefile.in (all.indirect): Added gjavah$(exeext).
16539 (gjavah$(exeext)): Added $(exeext).
16542 1998-07-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
16544 * class.c (layout_class): Call to java_layout_parsed_class replace
16545 by safe_layout_class.
16546 * expr.c (build_java_array_length_access): Removed static storage
16547 class in the function definition.
16548 (build_java_arraynull_check): Likewise.
16549 Also fixed typos in two comments.
16550 * lex.c (java_init_lex): Initialize static global kw_length.
16551 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
16552 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
16554 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
16555 * parse.h (resolve_no_layout): New static function declaration.
16556 (get_identifier_in_static): Declaration removed.
16557 (java_layout_parsed_class): Function name declaration changed to
16559 (build_newarray_node, patch_newarray, resolve_type_during_patch,
16560 not_initialized_as_it_should_p, build_this): New static function
16562 (pushdecl_force_head, build_java_binop, int_fits_type_p,
16563 binary_numeric_promotion, stabilize_reference,
16564 build_decl_no_layout, build_java_arrayaccess): Extern function
16565 declarations moved into their own section.
16566 (build_newarray, build_anewarray, build_java_array_length_access,
16567 build_java_arraynull_check): New extern function declarations.
16568 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
16569 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
16571 (CALL_CONSTRUCTOR_P): New macro.
16572 * parse.y (kw_length): New static global tree node.
16573 (return_statement): Tagged <node>.
16574 (RETURN_TK): Tagged <operator>.
16575 (variable_declarator_id:): Build variable declaration with an
16576 empty initialization value if a syntax error was found in the
16577 initialization part of the variable declaration.
16578 (statement_without_trailing_substatement:): return_statement: now
16579 uses the default rule.
16580 (return_statement:): Temporarily fixed to return NULL_TREE.
16581 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
16582 (class_instance_creation_expression:): Class creation rules now
16583 call build_method_invocation upon reduction.
16584 (array_creation_expression:): Rules call build_newarray_node upon
16586 (dim_exprs:): Build a list of dimension expressions.
16587 (dim_expr:): Store location of the OSB_TK in the dimension
16589 (method_invocation:): Added a new error rule.
16590 (build_unresolved_array_type): WFL argument may also be an array
16591 on a primitive type. Name of the argument changed to reflect this.
16592 (method_declarator): Insert argument type at the beginning of the
16593 argument type list and later reverse the list.
16594 (unresolved_type_p): Argument 'returned' may be optionally
16596 (java_layout_class_from_source): Function renamed
16598 (resolve_and_layout): Now call resolve_no_layout and
16600 (resolve_no_layout): New function.
16601 (purify_type_name): New function.
16602 (complete_class_report_errors): Call purify_type_name during error
16603 report on a type not found.
16604 (process_imports): error_found local variable doesn't need to be
16605 initialized to zero.
16606 (declare_local_variables): New local type_wfl. Fixed typo in error
16607 message. type_wfl assigned to unresolved type and used to register
16608 incomplete type. Build a WFL around the variable initialization
16609 statement so that debug info can be generated on it.
16610 (source_start_java_method): Reverse argument list after they've
16612 (current_this): New static global variable.
16613 (java_complete_expand_methods): Set current_this when appropriate.
16614 (resolve_expression_name): Build correct static and non static
16615 field access bearing a simple name.
16616 (resolve_field_access): Resolve the length field of arrays. Handle
16618 (patch_method_invocation_stmt): Set the type of the method
16619 invocation to error_mark_node. This value is later overridden by a
16620 valid type, if any. Don't handle qualified constructor invocation
16621 as qualified method invocation. Call lookup_method_invoke with its
16622 new flag. It's no longer necessary to access the selected method
16623 as the value of a tree list. Handle constructor invocation.
16624 (patch_invoke): Reverse argument list when invoking non interface
16625 methods. Insert call to new as the first argument of the
16627 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
16628 defined within a final class. Return INVOKE_STATIC if the invoked
16629 method is a constructor.
16630 (lookup_method_invoke): New lc argument is a flag to indicate a
16631 constructor lookup. Now handle constructor lookup. Choose the most
16632 specific method in case several were matching the invocation
16633 requirements. Return a method decl instead of a tree list featuring
16634 one single method decl element.
16635 (refine_accessible_methods_list): New lc flag argument to
16636 indicate that a constructor is being looked up.
16637 (not_initialized_as_it_should_p): New function.
16638 (java_complete_tree): Now process fake tree codes
16639 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
16640 save_expr on resolved function call arguments. Case on
16641 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
16642 (patch_assignment): LHS can be a field access expression. When
16643 dealing with reference, lhs_type is the promoted type of the
16644 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
16646 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
16647 (patch_binop): Use not_initialized_as_it_should_p where
16649 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
16650 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
16652 (resolve_type_during_patch): New function.
16653 (patch_cast): Call resolve_type_during_patch to resolve type and
16654 report error accordingly.
16655 (patch_array_ref): Use not_initialized_as_it_should_p where
16656 applicable. Array base expression is saved before being
16657 used. Promote the type of an array elements if it contains non
16659 (build_newarray_node, patch_newarray, build_this): New functions.
16661 1998-07-16 Tom Tromey <tromey@cygnus.com>
16663 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
16664 increment it in `for' statement.
16665 (print_field_info): If number is inf or nan, don't print it.
16666 (print_method_info): If method name is `delete', just ignore it.
16667 (print_c_decl): Special-case jstringArray.
16669 * gjavah.c (help): New function.
16670 (no_argument): New function.
16671 (usage): Changed text.
16672 (main): Rewrote argument handling. Now handles -v, --help,
16674 (version): New function.
16675 (found_error): New global.
16676 (main): Return found_error.
16677 (generate_access): Set found_error.
16678 (print_c_decl): Likewise.
16680 1998-07-15 Tom Tromey <tromey@cygnus.com>
16682 * gjavah.c (print_c_decl): Don't print "," when examining field.
16683 Skip type name when looking at "[L" types.
16684 (process_file): Now static.
16685 (generate_access): Now returns int.
16686 (last_access_generated): New global.
16687 (process_file): Clear last_access_generated; make multiple passes
16689 (print_field_info): Just return if generate_access returns true.
16690 (print_method_info): Likewise. Also, allow <init> functions to
16692 (print_c_decl): Added is_init argument. Print constructors
16694 (print_cxx_classname): Use UTF8_GET to extract characters from
16696 (print_base_classname): New function.
16697 (print_class_decls): New function.
16698 (process_file): Use it.
16699 (utf8_cmp): New function.
16701 1998-07-13 Nick Clifton <nickc@cygnus.com>
16703 * lang-options.h: Format changed to match changes in gcc/toplev.c
16704 to implement a --help option.
16706 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
16708 * decl.c (init_decl_processing): Revert change to dtable_type.
16710 1998-07-09 Per Bothner <bothner@cygnus.com>
16712 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
16714 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
16716 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
16718 * lang.c (lang_init): Default flag_exceptions to 1, without
16719 checking to see if it's 2 first.
16721 1998-07-08 Jeffrey A Law (law@cygnus.com)
16723 * constants.c: Include "system.h".
16724 * decl.c: Likewise.
16725 * lang.c (flag_new_exceptions): Get via extern now.
16726 (lang_init_options): New functions. Turn on flag_new_exceptions.
16728 1998-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
16730 * lex.c (java_lex): Return 0 when we see an invalid character in
16733 * lex.c (java_read_char): Specify extra argument when calling
16735 (java_read_unicode, java_parse_end_comment,
16736 java_parse_escape_sequence): Likewise,
16737 (java_lex): Specify extra argument when calling
16738 java_lex_error. Test that IDs are beginning with a legal character
16739 for IDs. Handle invalid characters with an error message and a
16740 call to java_lex_error.
16741 (java_lex_error): Adjust column position by new argument
16742 `forward'. Issue an error even if in the middle of reporting an
16745 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
16747 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
16748 we don't explicitly put a null pointer when we're copying it.
16750 1998-07-07 Tom Tromey <tromey@cygnus.com>
16752 * gjavah.c (print_cxx_classname): New function.
16753 (super_class_name): Likewise.
16754 (print_super_fields): Removed.
16755 (in_super): Removed.
16756 (print_field_info): Never generate #defines.
16757 (print_c_decl): Changed generated types to match JNI. No longer
16758 print class name before method name.
16759 (print_method_info): Print "static" before static methods.
16760 Print "virtual" before non-final methods.
16761 (usage): Use exit(1), not exit(-1).
16763 (print_field_info): Use %.17g to print a double.
16764 (last_access): New globals.
16765 (process_file): Initialize last_access.
16766 (usage): Now static.
16767 (ACC_VISIBILITY): New define.
16768 (generate_access): New function.
16769 (print_field_info): Call it.
16770 (print_method_info): Likewise. Also, generate information for all
16771 methods, not just native methods. Return void.
16772 (print_c_decl): Return void.
16773 (print_field_info): Return void.
16775 1998-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
16777 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
16778 processing the jc1 grammar file. Prefix bison functions and
16779 variables with java_.
16780 (parse.c): Dependencies on parse.h and lex.h
16781 * expr.c (build_java_arrayaccess): Function now global.
16782 * java-tree.h: Comment reorganized to carry on previous
16783 classification effort.
16784 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
16785 RESOLVE_TYPE_NAME_P): New flags on WFLs.
16786 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
16787 java_parse (new prefix java_ generated by bison).
16788 (java_layout_parsed_class, java_register_parsed_class): Function
16790 (yyparse): Removed unnecessary call to init_outgoing_cpool.
16791 * lex.c (static tree wfl_op): Variable deleted.
16792 (java_init_lex): Initialize kw_super and kw_this. Initialize more
16793 ctxp fields to NULL_TREE.
16794 (java_lex): No longer create WFL for operators. Filename caching
16795 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
16796 created as STRING_CST and later expanded. Removed extra argument
16797 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
16799 (build_wfl_node): Removed code in comments.
16800 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
16801 store token and location data in the current bison token.
16802 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
16803 static/extern function declaration at the beginning of the file.
16804 (struct qualification): Data structure definition deleted.
16805 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
16806 (qualify_ambiguous_name): Function declaration modified. Function
16807 now returns nothing.
16808 (build_array_ref, patch_array_ref, make_qualified_name,
16809 resolve_qualified_expression_name, maybe_generate_clinit,
16810 resolve_field_access): New static function declarations.
16811 (build_java_arrayaccess): New extern function declaration.
16812 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
16813 (CALL_EXPR_PRIMARY): Macro deleted.
16814 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
16815 (struct parser_ctxt): Field initialized_final
16816 removed. non_static_initialized, static_initialized: New fields.
16817 * parse.y (static tree kw_super, static tree kw_this): New global
16819 (%union): tree wfl field of operator member replaced by int
16820 location. WFLs are non longer created for operators.
16821 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
16822 (qualified_name:): Now calls make_qualified_name to build the
16824 (type_declaration:): Consider generating <clinit> when class
16826 (variable_declarator:): Directly build an assignment node when the
16827 variable is initialized when declared.
16828 (this_or_super:): Build a WFL and set current location when THIS
16829 or SUPER are parsed.
16830 (expression_statement:): Wrap statement around a WFL.
16831 (primary_no_new_array:): Fixed typo. Changed value returned by
16832 THIS_TK because of its new type (temporary).
16833 (dim_exprs:): Temporary fix because of OSB_TK's new type.
16834 (field_access:): Build qualified name with SUPER.
16835 (method_invocation:): Fixed returned value because of SUPER's new
16837 (array_access:): Use OSB_TK location information.
16838 (post_increment_expression:, post_decrement_expression:,
16839 unary_expression:, pre_increment_expression:,
16840 pre_decrement_expression:, unary_expression_not_plus_minus:,
16841 cast_expression:, multiplicative_expression:,
16842 additive_expression:, shift_expression:, relational_expression:,
16843 equality_expression:, and_expression:, exclusive_or_expression:,
16844 inclusive_or_expression:, conditional_and_expression:,
16845 conditional_or_expression:, assignment:): Use new location/token
16846 information available on operators.
16847 (create_class): Set super_decl_type to NULL_TREE when processing
16849 (register_fields): Field initialization is now a MODIFY_EXPR
16850 node. Chain initialization code to the matching lists (according
16851 to the field declaration modifiers).
16852 (maybe_generate_clinit): New function.
16853 (method_header): Don't set method's DECL_NAME to a WFL when adding
16854 methods to java.lang.Object.
16855 (resolve_and_layout): Now can return NULL_TREE if the type
16856 resolution fails. Otherwise, return the class DECL instead of its
16858 (check_method_redefinition): Don't patch method DECL_NAME if it
16859 belongs to java.lang.Object.
16860 (process_imports): Simply assign error_found to the value returned
16861 by check_pkg_class_access.
16862 (declare_local_variables): Don't use their init statements (if
16863 any) when parsing error were previously found. Reuse MODIFY_EXPR
16864 build during parsing as an init statement.
16865 (java_method_add_stmt): Now return the current method body.
16866 (java_layout_parsed_class, java_register_parsed_class): Functions
16868 (java_complete_expand_methods): Initialize the constant pool on a
16869 per class basis. Layout the classes before expanding their method
16870 bodies. Don't try expand artificial constructor code if error were
16871 found. Make the classes data and register them if no error were
16873 (java_complete_expand_method): Retrieve an artificial constructor
16874 argument list before entering its body. Assign the top block to
16875 the artificial constructor function body and set types of declared
16876 blocks and compound statements to void. Walk method body if not an
16877 artificial constructor.
16878 (make_qualified_name, cut_identifier_in_qualified): New functions.
16879 (resolve_expression_name): Fixed comments. Save/restore the
16880 current class CLASS_LOADED_P flag value. Build non qualified
16881 static field access and handle qualified expression names.
16882 (resolve_field_access, resolve_qualified_expression_name): New
16884 (patch_method_invocation_stmt): Use the new expression resolution
16885 scheme, calling resolve_field_access when the function call is
16886 resolved as an expression.
16887 (qualify_ambiguous_name): Function rewritten to work on qualified
16888 expression produced by make_qualified_name.
16889 (java_complete_tree): Promote type when function's argument are
16890 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
16891 the assignment to discover further errors if RHS is a expression
16892 name that fails to evaluate. Declare LHS initialized even though
16893 the assignment failed. Don't use the location variable and removed
16894 extra argument in patch function calls. Now handle the ARRAY_REF
16895 case and build internal string representation when STRING_CSTs are
16897 (build_method_invocation): Don't wrap function call around a WFL.
16898 (build_assignment): Likewise. Use the operator location
16900 (patch_assignment): Handle array access LHSs. Handle error
16901 provenance, resulting in a better error report.
16902 (build_binop): Use op_location from operator as binop location
16904 (build_unaryop, build_incdec, build_cast): Likewise.
16905 (patch_binop): Extract location information from the node. Fixed
16906 typo in error message.
16907 (patch_unary_op): Extract location information from the node.
16908 (build_array_ref, patch_array_ref): New functions.
16910 1998-07-01 Tom Tromey <tromey@cygnus.com>
16912 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
16913 match _Jv_IsInstanceOf.
16914 * decl.c (init_decl_processing): Use _Jv_NewArray, not
16915 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
16917 1998-06-30 Tom Tromey <tromey@cygnus.com>
16919 * decl.c (init_decl_processing): Functions are now named
16920 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
16922 1998-06-29 Per Bothner <bothner@cygnus.com>
16924 * java-tree.h (load_class): Add prototype.
16925 * class.c (is_compiled_class): Add missing arg to load_class.
16926 * expr.c (expand_java_NEW): Call load_class.
16927 * parse.y (process_import): Removed bogus use of void return value.
16929 1998-06-25 Per Bothner <bothner@cygnus.com>
16931 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
16932 Function name is "_Jv_Throw" instead of "soft_athrow".
16933 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
16934 Function name is "_Jv_AllocObject" instead of "soft_new".
16935 Takes an extra parameter (object size).
16936 * expr.c: Update calls.
16938 1998-06-24 Per Bothner <bothner@cygnus.com>
16940 * lex.c (java_get_line_col): Handle end-of-file.
16941 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
16943 1998-06-24 Andrew MacLeod <amacleod@cygnus.com>
16945 * lang.c (lang_init): Make -fexceptions the default.
16946 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
16947 exception handling is not turned on.
16949 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
16951 * lang.c (flag_new_exceptions): Make this this default.
16952 * decl.c (end_java_method): Call emit_handlers.
16953 * except.c (method_init_exceptions): Set language code and version.
16954 (expand_start_java_handler): Enable exception, and call
16955 expand_eh_region_start.
16956 (expand_end_java_handler): Enable exception, and set up catch blocks.
16957 (emit_handlers): New routine to generate the saved handlers.
16958 * java-except.h (emit_handlers): Add prototype.
16960 1998-06-12 Per Bothner <bothner@cygnus.com>
16962 We used to have three different representations of the constant pool:
16963 the CPool structure, the tree_constant_pool, and the constructures
16964 used to build the Class object (which may need class and string
16965 constants) in compiled code. None were appropriate for compiling
16966 to .class files, so I did a major overhaul.
16968 First, the tree_constant_pool array was removed. Things were
16969 modified to the CPool structure in the JCF could be used.
16970 Second, a "capacity" field was added to the CPool, and functions
16971 written to search for a matching constant, adding one if not found.
16972 The code that generated the Class object was changed to use a CPool.
16973 The actual TREE_LISTs used to build the CONSTRUCTORs used for
16974 the static Class object are now only in build_constants_constructor.
16975 Finally, I wrote code which can generate a .class file (including its
16976 constant pool) from the RECORD_TYPE of a class. This is a big step
16977 on the way to compiling Java source into .class files.
16979 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
16980 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
16982 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
16983 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
16984 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
16985 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
16986 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
16987 (lang_type): Removed constant_pool field.
16988 * jcf.h (CPool): Renamed size to count. Added field capacity.
16989 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
16990 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
16991 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
16993 * constants.c (current_constant_pool_tags, current_constant_pool_data,
16994 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
16995 * constants.c (build_constants_constructor): Use new outgoing_cpool.
16996 (set_constant_entry, find_constant1, find_constant2,
16997 find_class_constant, count_constant_pool_bytes, write_constant_pool,
16998 find_utf8_constant, find_class_or_string_constant): New functions.
17000 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
17001 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
17002 (give_name_to_class, get_class_constant): Likewise.
17003 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
17004 (get_name_and_type_constant, get_ref_constant): Removed.
17005 * parse.h (parser_ctxt): Remove field tree_constant_pool.
17006 * parse.y: Don't save/restore tree_constant_pool.
17007 * verify.c (verify_jvm_instructions): Update for new approach.
17008 * expr.c (expand_invoke, expand_java_field_op): Likewise.
17010 * lang-options.h: Added -femit-class-file, -femit-class-files.
17011 * lang.c (flag_emit_class_files), java-tree.h: New flag.
17012 (lang_f_options): Added "emit-class-file(s)".
17014 * expr.c (build_java_arrayaccess): Generate more efficient array
17015 bounds checking, by using unsigned compare.
17017 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
17019 1998-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
17021 * parse.h: New comment on the handling of unresolved type
17022 identifiers. JDEPs are now part of the jdep_code enum.
17023 (typedef struct jdep): Now use enum jdep_code or int, depending on
17024 availability. Both are narrowed down to an 8 bits bitfield.
17025 (CALL_EXPR_PRIMARY): Fixed comment.
17027 1998-06-10 Tom Tromey <tromey@cygnus.com>
17029 * Make-lang.in (java): Added gjavac and jvgenmain.
17030 (java.start.encap): Depend on gjavac.
17031 (java.rest.encap): Depend on jvgenmain.
17033 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
17034 (JAVA_CROSS_NAME): Likewise.
17035 (java.all.build): Depend on jvgenmain and gjavac.
17036 (java.all.cross): Depend on jvgenmain and gjavac-cross.
17037 (jvgenmain$(exeext)): New target.
17038 (java.install-common): Wrote.
17039 * config-lang.in (compilers, stagestuff): Added gjavac and
17042 1998-06-10 Dave Brolley <brolley@cygnus.com>
17044 * lang.c (lang_decode_option): New argc/argv interface.
17046 1998-06-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
17048 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
17049 * decl.c (build_decl_no_layout): New function.
17050 * expr.c (java_lang_expand_expr): Layout declarations found in
17051 blocks before they're pushed.
17052 * jcf-parse.c (load_class): Save current line when parsing class
17054 (parse_source_file): Register class before expanding their
17056 * lang.c (put_decl_node): Produce `null' when `void *' is
17058 * lex.c (static tree wfl_op): New static global, for error report
17060 (java_init_lex): wfl_operator and wfl_op initialized
17061 here. Filename caching added for wfl_op. Return wfl_op when `(' is
17063 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
17064 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
17065 build_unresolved_array_type): New static function definitions.
17066 (build_decl_no_layout): New extern function declared.
17067 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
17068 faulty modifier exists.
17069 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
17070 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
17071 (UNARY_PLUS_EXPR): New fake operator.
17072 (struct parser_ctxt): New field osb_number.
17073 * parse.y (static tree wfl_operator): New static WFL for operator
17074 bound error messages.
17075 (DECR_TK, INCR_TK): Moved.
17076 (OP_TK): Tagged <operator>.
17077 (array_type:): Now call build_unresolved_array_type.
17078 (dim_expr:): Count the number of '[' seen.
17079 (post_increment_expression, post_decrement_expression,
17080 pre_increment_expression, pre_decrement_expression,
17081 unary_expression_not_plus_minus, unary_expression:): Actions are
17082 now building the corresponding unary expressions.
17083 (cast_expression:): Actions are now building cast expressions.
17084 (build_unresolved_array_type): New function.
17085 (create_interface): Reset the number of declared interfaces.
17086 (create_class): Likewise.
17087 (method_header): Methods declared within the scope of an interface
17088 are now implicitly set public and abstract.
17089 (java_complete_class): Variable's and parameter's type are patched
17090 with a promoted type.
17091 (declare_local_variables): Resolved non builtin types are promoted
17092 before being used to build a variable decl. Removed type patch
17093 posted on variable initialization statement.
17094 (source_start_java_method): Use build_decl_no_layout to build the
17095 decl of a parameter of incomplete type.
17096 (java_register_parsed_class): Process interfaces too. Call
17097 rest_of_decl_compilation on each processed class declarations.
17098 (java_complete_expand_methods): Don't attempt to expand things in
17100 (java_complete_tree): Process CONVERT_EXPR, even though it always
17101 has a type. Propagate error_mark_node to node's type too. Promote
17102 method's call argument type and return error_mark_node if
17103 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
17104 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
17105 handle unary operator nodes.
17106 (build_assignment): Added comment.
17107 (print_int_node): New function.
17108 (patch_assignment): New second argument. New error handling. Use
17109 print_int_node. Handle references. Use can_cast_to_p to issue
17110 different error message according to the context and check upon
17111 the initialization of the RHS.
17112 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
17113 (operator_string): Handle more operators.
17114 (patch_binop): No longer use a function static
17115 wfl_operator. Improved error message on shift distance.
17116 (build_unaryop, build_incdec, build_cast, patch_unaryop,
17117 patch_cast): New functions.
17119 1998-06-05 Per Bothner <bothner@cygnus.com>
17121 * jvspec.c: New file.
17122 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
17124 * java-tree.h (identifier_subst): Add declaration.
17126 1998-06-04 Tom Tromey <tromey@cygnus.com>
17128 * jvgenmain.c (main): Generate call to JvRunMain.
17130 * class.c (make_class_data): Push value for "sync_info" field.
17131 * decl.c (init_decl_processing): Push "sync_info" field.
17133 1998-06-03 Per Bothner <bothner@cygnus.com>
17135 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
17136 Java (source) name, not signature.
17137 Set TYPE_ALIGN to (at least) that of element_type.
17139 1998-06-02 Per Bothner <bothner@cygnus.com>
17141 * class.c: Moved classname-mangling-rekated code to ...
17142 * mangle.c: ... this new file.
17143 * jvgenmain.c: New program (needs mangle.c) to generate main program.
17144 * Makefile.in: Update for above changes.
17146 1998-06-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
17148 * expr.c (truthvalue_conversion): Convert integer and floating
17149 point value to their truth value.
17150 * lex.c (java_lex): Handle the `null' literal.
17151 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
17152 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
17153 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
17156 * parse.y: Reorganization/documentation on token declaration.
17157 (binop_lookup[]): New added new tree codes.
17158 (relational_expression): Build corresponding binary operators.
17159 (equality_expression, conditional_and_expression,
17160 conditional_or_expression): Likewise.
17161 (java_complete_class): Fix crash in debug message.
17162 (java_complete_tree): Check initialization of method call
17163 arguments. Further bogus node evaluation to detect more error
17164 during assignments. Handles more binary operators.
17165 (patch_assignment): Use DECL_P.
17166 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
17168 (operator_string): Handle more case. Compacted source.
17169 (patch_binop): Changed function comment. Checking for
17170 uninitialized first operand takes the compound assignment into
17171 account and uses DECL_P. Checking for uninitialized second operand
17172 delayed to routine's end. Use macros to issue type bound error
17173 messages and issue messages on both operands if their types are
17174 different. Force fixed type into node. Handle all binary
17177 1998-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
17179 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
17180 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
17181 build operator node and return tokens.
17182 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
17183 * parse.h (java_complete_tree): Changed returned type in prototype.
17184 (build_method_invocation, build_assignment, patch_assignment,
17185 patch_binop): New static function declarations.
17186 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
17187 BUILD_EXPR_WFL): New macros.
17188 * parse.y (enum tree_code binop_lookup[]): New static for token to
17190 (%union): Parser union has new sub-structure `operator'.
17191 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
17192 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
17193 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
17194 ASSIGN_ANY_TK): Tokens tagged `operator'.
17195 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
17196 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
17197 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
17198 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
17199 (assignment_operator:): Rule tagged `operator'.
17200 (expression_statement:): Re-installed default rule.
17201 (method_invocation:): Sub rules call build_method_invocation.
17202 (postfix_expression:): Don't attempt to resolve name here. Just
17204 (multiplicative_expression:): Sub-rules build corresponding binop
17206 (additive_expression:, shift_expression:, and_expression:,
17207 exclusive_or_expression:, inclusive_or_expression:): Likewise.
17208 (assignment:): Sub rule invoke build_assignment.
17209 (assignment_operator:): Default rules on sub rules.
17210 (force_error): Added documentation on this variable.
17211 (declare_local_variables): Build initialization calling
17213 (expand_start_java_method): Removed unused rtx declaration. Mark
17214 arguments as already initialized.
17215 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
17216 (java_complete_expand_methods): Don't process next method if
17217 completion of the previous one triggered errors.
17218 (java_complete_expand_method): Call source_end_java_method if no
17219 error were found during completion.
17220 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
17221 locals declaratilon. Handle names found within a class. Return
17222 error_mark_node when things aren't found.
17223 (patch_method_invocation_stmt): Return error_mark_node on failures.
17224 (patch_invoke): Removed unused local. Return the correct node.
17225 (java_complete_tree): Now returns a value. The BLOCK section binds
17226 local identifiers and the type of a BLOCK is now void. Assign the
17227 result of operand completion on COMPOUND_EXPR. Assign the
17228 encapsulated node of a WFL to the result of its completion, except
17229 when the node is an identifier. Now handle MODIFY_EXPR and several
17230 binary operators. Return error_mark_node on errors.
17231 (build_method_invocation, build_assignment, patch_assignment,
17232 build_binop, operator_string, patch_binop): New functions.
17233 * typeck.c (binary_numeric_promotion): New function.
17235 1998-05-21 Per Bothner <bothner@cygnus.com>
17237 * class.c (identifier_subst): New convenience wrapper for ident_subst.
17238 Replace most uses of ident_subst by identifier_subst.
17240 * class.c (push_class_static_dummy_field): Removed function.
17241 (build_class_ref): Find Class object decl by looking up "CNAME.class",
17242 instead of looking got "class" static field. Create that decl here.
17243 (class_identifier_node): Removed; no longer needed.
17244 (init_class_processing): Don't init class_identifier_node.
17245 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
17246 Do nreverse 0 times (instead of twice) for Object and Class.
17247 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
17249 1998-05-20 Per Bothner <bothner@cygnus.com>
17251 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
17252 while initializing linenumber_count and linenumber_table.
17253 Do it before init_function_start (which calls emit_line_note).
17254 * expr.c (expand_byte_code): Don't need to clear lineno here.
17256 1998-05-18 Tom Tromey <tromey@cygnus.com>
17258 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
17259 then mangle number as _N_.
17261 * class.c (mangle_class_field): New function.
17262 (build_class_ref): Set assembler name of class reference using
17263 mangle_class_field.
17264 (push_class_static_dummy_field): Likewise.
17266 1998-05-17 Michael Tiemann <tiemann@cygnus.com>
17268 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
17269 of assigning to TREE_CODE. The latter method exploits a feature
17270 of GCC that is not ANSI compliant.
17272 1998-05-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
17274 * decl.c (pushdecl_force_head): New function.
17275 (pushlevel): Removed conditional printf.
17276 (complete_start_java_method): Don't enter local variable scope if
17277 function is compiled from source code.
17278 * expr.c: parse.h now included
17279 (java_lang_expand_expr): New function.
17280 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
17281 printf. Terminate buffer when doing directories.
17282 * jcf-parse.c (parse_source_file): Call lang_init_source before
17283 parsing and before code generation.
17284 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
17285 use printf if the macro is defined.
17286 * lang.c (lang_init): Install lang_expand_expr hook on
17287 java_lang_expand_expr.
17288 (java_dummy_print): New function.
17289 (lang_init_source): New function.
17290 * lex.c (java_lex): Remember location of an opening brace at the
17291 second nesting level.
17292 (java_is_eol): Unget character seen after a CR if it is EOF.
17293 * parse.h: Now includes lex.h
17294 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
17295 printf if the macro is defined.
17296 (expand_start_java_method, build_expr_block, enter_block,
17297 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
17298 New static function declarations.
17299 (pushdecl_force_head): New extern function declaration.
17300 (INCOMPLETE_TYPE_P): New macro.
17301 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
17302 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
17303 BLOCK_EXPR_ORIGIN): New macros.
17304 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
17305 DECL_SOURCE_LINE_LAST): New macros.
17306 (struct parser_ctxt): Removed field current_method_decl, redundant
17307 with the field current_function_decl. Added fields
17308 first_ccb_indent1 and pending_block.
17309 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
17310 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
17312 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
17313 (compilation_unit:): Cosmetic on sub rule.
17314 (type_declaration:): Cosmetic on sub rules. Added an error rule.
17315 (variable_initializer:): Installed default rule on expression:.
17316 (method_declaration:): method_header: starts a new
17317 method. method_body: installs the function body, absorbs blocks
17318 emitted for temporary variable scopings, pops function's body block
17319 and merges function's last statement lineno in DECL_SOURCE_LINE.
17320 (method_body:): Installed default rules.
17321 (block:): Call enter_block when an opening brace is seen. Absorb
17322 scoping blocks and call exit_block when a closing brace is seen.
17323 (block_statement:): Cosmetic changes.
17324 (method_invocation:): Create WFL around CALL_EXPR node.
17325 (patch_stage): Added comment around definition.
17326 (method_header): Try to use first_ccb_indent1 as the first line of
17327 the method, so BP debug info are emitted at the first opening
17328 brace of the function. If the function has no body, use the
17329 location of the function's name. Override currently defined method
17330 name with the matching WFL so we can point redefinition errors
17331 using the location where the function's name was declared.
17332 (check_abstract_method_header): Interprets DECL_NAME as an
17333 identifier or as a WFL, accordingly.
17334 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
17335 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
17336 location and name information out of it and reinstall DECL_NAME to
17337 its original identifier node value.
17338 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
17339 function's source code).
17340 (read_import_dir): Test the value returned by find_class and issue
17341 a fatal accordingly.
17342 (declare_local_variables): Push a new block for the scope of the
17343 new variable(s) if code has been already generated at that nesting
17344 level. Pinpoint redefinition errors using the variable id
17345 WFLs. Generate initialization code if necessary. If the variable
17346 type is incomplete, register a patch on its decl.
17347 (source_start_java_method): Rewritten. Define a new block for the
17348 function's parameters. Build parameter decl out of function's
17349 arguments and register them for a patch if their types are
17351 (expand_start_java_method): Includes the part of
17352 source_start_java_method that was pushing the parameter decls and
17353 completing the method start code.
17354 (source_end_java_method): Removed call the expand_end_bindings and
17355 poplevel (already taken care of). Reinstall function's arguments
17356 and get function's last line of code before calling
17357 expand_function_end.
17358 (java_method_add_stmt): New comment before the function's
17359 code. Complement the second operand of the current COMPOUND_EXPR
17361 (java_complete_expand_methods): Don't generate debug info on line
17362 zero when expanding a generated constructor.
17363 (java_complete_expand_method): Set start and end line numbers for
17364 a artificially generated constructor to one and manually call
17365 enter_block and exit_block when defining it. For all methods:
17366 expand function's start calling the new expand_start_java_method
17367 and invoke java_complete_tree on the effective method's body, if
17369 (resolve_expression_name): Now use lookup_name_in_blocks to search
17370 local variable decls and print out an error when variables are
17372 (patch_method_invocation_stmt): Inserted comment before the
17374 (lookup_method_invoke): Chain method's arguments using chainon
17375 with the current arg list as a second argument. Inserted missing
17376 IDENTIFIER_POINTER when reporting an error on methods not found.
17377 (refine_accessible_methods_list): Don't retain constructors.
17378 (patch_arguments): Function removed.
17379 (java_complete_tree): Inserted comment before the function's
17380 code. New case for BLOCKs. Moved the WFL case a bit
17381 further. Complete function's arguments.
17382 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
17383 maybe_absorb_scoping_blocks): New functions.
17385 1998-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
17387 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
17389 * jcf-parse.c (parse_source_file, java_error_count): New forward
17390 and extern declarations.
17391 (java_parse_abort_on_error): Macro moved.
17392 (jcf_parse_source): fatal called if fopen fails. Now calls
17394 (parse_source_file): New parse_only parameter. Reflects the
17395 elimination of the second pass.
17396 (yyparse): parse_source_file called with argument set to 0.
17397 * jcf.h (JCF_ZERO): Sets java_source to zero.
17398 * lex.c (java_init_lex): pass argument is gone. Function modified
17399 to be called once during the analysis of a file.
17400 (java_unget_unicode): Fixed typo in fatal message.
17401 (java_get_line_col): Likewise.
17402 (java_lval): Likewise. String literals no longer built during
17404 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
17406 * parse.h (MODIFIER_WFL): New macro.
17407 (parse_check_super, parser_check_super_interface): Now return int.
17408 (parser_chain_incomplete_item, not_builtin_p,
17409 complete_method_decl): Declarations removed.
17410 (build_method_invocation_stmt, build_invoke): Renamed using the
17411 `patch' instead of `build'
17412 (register-incomplete_type, obtain_incomplete_type,
17413 java_complete_tree, java_complete_expand_method,
17414 unresolved_type_p, create_jdep_list): New function declarations.
17415 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
17416 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
17417 (jdep): New typedef on new struct _jdep.
17418 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
17419 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
17420 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
17421 JDEP_RESOLVED_P): New macros.
17422 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
17423 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
17424 JDEP_VARIABLE): New enum values and jdep kinds.
17425 (jdeplist): New typedef on struct _jdeplist.
17426 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
17428 (CALL_EXPR_PRIMARY): New macro.
17429 (struct parser_ctxt): Fields java_pass, current_method_decl,
17430 method_decl_list deleted. New field jdeplist.
17431 (INCOMPLETE_P): Macro deleted.
17432 * parse.y (single_type_import_declaration:): Removed pass switch.
17433 (type_import_on_demand_declaration): Likewise.
17434 (field_declaration:): Removed pass switch on all sub rules.
17435 (class_declaration:): Call the complete_class_decl removed on
17437 (method_declaration:): Removed second pass switch. No longer chain
17438 methods decl when method_header reduced.
17439 (method_header:): Sub rules no longer depend on pass switch.
17440 (method_declarator:): Likewise.
17441 (method_body:): Likewise.
17442 (abstract_method_declaration:): Likewise.
17443 (block_statement:): Likewise.
17444 (local_variable_declaration:): Likewise.
17445 (argument_list:): Likewise.
17446 (method_invocation:): Likewise. Call to build_method_invocation_stmt
17447 removed. Partial CLASS_EXPR tree node built instead.
17448 (postfix_expression:): Removed pass switch on all sub rules.
17449 (java_pop_parser_context): Free classd_list content.
17450 (yyerror): Call obstrack_grow0 to finalize error message.
17451 (check_class_interface_creation): Comment modified to reflect new
17452 returned value meaning. Removed second pass switch. Return 1 if an
17453 error was found, 0 otherwise. Adjust pointer on filename if a
17454 leading path separator was found.
17455 (maybe_create_class_interface_decl): Removed first pass switch
17456 when linking the class decl to the class_list. Install a new
17457 jdep_list for the class.
17458 (add_superinterfaces): List of unresolved interfaces is
17459 gone. Unresolved interfaces are directly added to the current
17461 (create_interface): Second pass shortcut removed.
17462 ctpx->modifier_ctx access through MODIFIER_WFL.
17463 (create_class): Second pass shortcut removed. Call to
17464 register_incomplete_type replaces the call to
17465 parser_chain_incomplete_item.
17466 (complete_class_decl): Function removed.
17467 (duplicate_declaration_error): New way of retrieving redeclared
17469 (register_fields): Call to lookup_modifier_cl replaced by
17470 MODIFIER_WFL. New way of handling unresolved type, using
17471 unresolved_type_p and obtain_incomplete_type.
17472 register_incomplete_type replaces call to parser_chain_incomplete_item.
17473 (patch_stage): New static global variable.
17474 (method_header): New way of handling unresolved type, using
17475 unresolved_type_p and obtain_incomplete_type. patch_stage used to
17476 indicates that the method decl needs to be patched.
17477 (check_abstract_method_header): Call to lookup_modifier_cl
17478 replaced by MODIFIER_WFL.
17479 (method_declarator): Incomplete argument type are registered
17480 calling register_incomplete_type. Patch on the declared method is
17481 issued in that case.
17482 (unresolved_type_p): New function.
17483 (parser_check_super_interface): New comment to reflect function's
17484 modified returned type (int). Function and has a new argument
17485 this_wfl. Call to parse_error_context uses this_wfl instead of
17486 relying on lookup_cl.
17487 (parser_check_super): Comment reflects function's new returned
17488 type (int). Function returns nonzero value on error.
17489 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
17490 register_incomplete_type, jdep_resolve_class): New functions to
17491 handle incomplete types in declarations.
17492 (java_complete_class): Rewritten to work with the new incomplete
17493 type handling scheme.
17494 (complete_class_report_errors): Likewise.
17495 (complete_method_decl): Removed: it jobs is now handled by
17496 java_complete_class.
17497 (do_resolve_class): Class loaded in not already loaded and not
17498 found in Java source code.
17499 (java_check_regular_methods, java_check_abstract_methods): Don't
17500 call complete_method_decl anymore.
17501 (lookup_modifier_cl, not_builtin_p): Functions deleted.
17502 (read_import_dir): Got rid of the pass number dependency.
17503 (declare_local_variables): New handling of unresolved types (patch
17505 (source_start_java_method): New parameter level. Function called
17506 with level set to 1 when argument types are potentially
17507 unresolved. Called to complete the job with level set to 2 once
17508 types are complete.
17509 (source_end_java_method): Call to permanent_allocation
17510 removed. Waiting to be replaced by a more suitable obstack
17512 (java_complete_expand_methods, java_complete_expand_method,
17513 java_expand_finals): New functions.
17514 (build_method_invocation_stmt): Renamed
17515 patch_method_invocation_stmt. Extracts function call expression
17516 (wfl) and arguments (args) from CALL_EXPR tree operands.
17517 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
17518 call. Patch the function and argument operand of the CALL_EXPR
17520 (patch_argument, java_complete_tree): New functions.
17522 1998-04-20 Per Bothner <bothner@cygnus.com>
17524 Recover from missing fields and methods (i.e. error instead of fatal).
17525 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
17526 * expr.c (expand_invoke): Recover from missing method.
17527 (expand_java_field_op): Recover from missing field.
17528 Inline references to java.lang.{Integer,Char,...}.TYPE.
17529 * typeck.c (get_type_from_signature), java-tree.h: New function.
17530 * class.c (add_method): Use get_type_from_signature.
17531 (build_class_ref): Handle a class that was not found.
17532 * typeck.c (convert): Handle conversion to pointers (for convenience).
17533 * verify.c (verify_jvm_instructions): Use get_type_from_signature
17534 instead of lookup_field to handle missing fields.
17536 * jcf-parse.c (process_zip_dir): Set java_source.
17538 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
17540 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
17542 1998-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
17544 * jcf-parse.c (load_class): Don't change input_filename before
17545 calling jcf_parse_source (but still do it before calling
17547 (jcf_parse_source): Assign input_filename after having saved the
17549 * lex.c (java_init_lex): Chain a WFL node to the import on demand
17550 list. ctxp->modifier_ctx zeroed according to its new
17551 definition. ctxp->filename initialized. Removed
17552 JAVA_MODIFIER_CTX_UNMARK.
17553 (java_unget_unicode): Update the character based column position.
17554 (java_allocate_new_line): ref_count not used anymore. Always free
17555 ctxp->p_line. Initialize c_line->char_col to 0.
17556 (java_get_unicode): Update the character based column position.
17557 (java_lex): Use ctxp->elc to store current position in source
17558 file, at the beginning of the parsed token. Set modifier_ctx entry
17559 corresponding to the parse modifier to a WFL node. Return a WFL
17560 node when an identifier is parsed.
17561 (java_lex_error): Now uses ctxp->elc to store current position in
17563 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
17564 * lex.h (build_wfl_node): New function definitions.
17565 (struct java_line): ref_count and next fields are gone. New field
17567 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
17568 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
17569 (JAVA_COLUMN_DELTA): New macro.
17570 (java_lc): New typedef on new struct _java_lc.
17571 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
17572 (parse_error_context, parse_warning_context): Changed prototypes.
17573 (java_get_line_col): Added as an available global function.
17574 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
17575 (IC_DECL): Replaced by macro IC_TYPE
17576 (DEPEND_WFL): New macro.
17577 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
17579 (exit_java_complete_class): Removed a commented out statement.
17580 (struct parser_ctxt): Added comments on fields. modifier_ctx is
17581 now an array of tree nodes. Deleted fields line_list and
17582 e_line. New field elc, to replace e_line.
17583 * parse.y (array_type:): Build WFL node.
17584 (qualified_name:): Build a single WFL node out of two. Retain
17585 the location information of the first node in the resulting node.
17586 (package_declaration:): Use package name as a WFL node
17587 (single_type_import_declaration:): Use imported name as a WFL node.
17588 (type_import_on_demand_declaration:): Use root of the imported
17589 packages as a WFL node.
17590 (field_declaration:): Removed unused local variable cl.
17591 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
17592 (yyerror): New static elc. Removed static error_line, error_pos.
17593 New local code_from_source. Save ctxp->elc into elc at the first
17594 pass. Call java_get_line_col to get a string of the line where
17595 the error occurred.
17596 (debug_line): Removed static function.
17597 (parse_error_context, parse_warning_context): Parameter cl is now
17598 a WFL node. Use its value to initialize ctxp->elc.
17599 (redefinition_error): Parameter cl is now a WFL node.
17600 (parse_add_interface): New parameter wfl. No longer call
17601 lookup_cl, use wfl instead.
17602 (check_class_interface_creation): Parameter cl is now a WFL node.
17603 (maybe_create_class_interface_decl): Likewise.
17604 (add_superinterfaces): New function.
17605 (create_interface): Removed local cl, node, super_decl,
17606 super_decl_type. Function now uses id as a WFL node. Better
17607 warning/error report on obsolete or forbidden mix of
17608 modifiers. Now calls add_superinterfaces to register interfaces.
17609 (create_class): Removed local cl, node. Local variable id is used
17610 as a WFL node. Better error report on forbidden modifier
17611 mix. Uses add_superinterfaces to register interfaces.
17612 (find_field): Argument cl is now a WFL node. Now store the WFL
17613 node of a fields that needs to be checked for their
17615 (method_header): Local variable node non longer used. Local
17616 variable id replaces cl.
17617 (check_modifiers_consistency): Local variable cl is now a WFL
17619 (method_declarator): Local variable cl replaced by parameter id.
17620 (parser_qualified_name): Now uses parameter name as a WFL node.
17621 (parser_check_super_interface): New parameter wfl, for achieve
17622 greater accuracy during error reports.
17623 (parser_chain_incomplete_item): New parameter named location. Used,
17624 along the decl, to construct the incomplete item node.
17625 (java_complete_class): resolve_class now uses WFL node extracted
17626 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
17628 (complete_method_decl): Unresolved function's argument types are WFL.
17629 (resolve_class): Parameter cl is now a WFL node.
17630 (resolve_and_layout): Likewise.
17631 (do_resolve_class): Likewise. Try first to use cl and then do the
17632 lookup on the decl when calling check_pkg_class_access.
17633 (complete_class_report_errors): Use IC_TYPE in place of
17634 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
17635 instead of doing a lookup over the decl.
17636 (java_check_final): Use WFL info from field tree list.
17637 (lookup_cl): Rewritten and returns a statically defined WFL node.
17638 (lookup_modifier_cl): Now uses information from WFL nodes.
17639 (process_imports): Likewise.
17640 (read_import_dir): name and cl arguments replaced by a single WFL
17641 node. Function modified accordingly.
17642 (find_in_imports_on_demand): Now uses WFL node.
17643 (check_pkg_class_access): cl argument is now a WFL node.
17644 (declare_local_variables): Fixed to use WFL nodes.
17645 (resolve_expression_name): Likewise.
17646 (build_method_invocation_stmt): name_combo argument renamed
17647 wfl. Function modified to use WFL nodes.
17648 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
17649 (lookup_method_invoke): cl is now a WFL node. Added missing
17650 IDENTIFIER_POINTER to class type decl name.
17652 1998-04-14 Dave Brolley <brolley@cygnus.com>
17654 * lang.c (init_parse): Now returns char* containing the filename.
17656 1998-04-10 Per Bothner <bothner@cygnus.com>
17658 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
17660 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
17661 * class.c (make_class_data): If flag_assume_compiled, initial class
17662 state is CSTATE_PREPARED; make superclass and interfaces direct
17663 references, rather than constant pool indexes.
17665 1998-04-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
17667 * parser.y: Include flags.h. Removed debug variable pl.
17668 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
17669 (block:): Likewise.
17670 (labeled_statement_nsi:): Generate debug info when reducing
17671 expression_statement:.
17672 (check_pkg_class_access): get_access_flags_from_decl invocation
17673 fixed for new CLASS_* flags location.
17674 (source_end_java_method): Save/restore parser context when
17675 entering/leaving this routine. Restore lineno to its right value
17676 before calling expand_end_bindings.
17677 (build_method_invocation_stmt): build_invoke called with the
17678 current line information.
17679 (build_invoke): New argument cl. Wrap the function call around a
17681 (refine_accessible_methods_list): Changed comment, removed
17683 * parse.h: Fixed typo in comments.
17684 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
17685 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
17686 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
17688 * lex.c (java_lex): Record the last closing curly bracket of a
17690 * jcf-parse.c (jcf_parse_source): Now calls
17691 java_check_methods. Clarified comment, fixed typo.
17693 1998-04-09 Dave Brolley <brolley@cygnus.com>
17695 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
17696 (finish_parse): Expose for non USE_CPPLIB builds.
17698 1998-04-08 Jeffrey A Law (law@cygnus.com)
17700 * lang.c (lang_print_xnode): New function.
17702 1998-04-03 Per Bothner <bothner@cygnus.com>
17704 * decl.c (class_dtable_decl), java-tree.h: New tree node.
17705 * class.c (get_dispatch_vector, get_dispatch_table): New functions
17706 used to build a class's dispatch table.
17707 (make_class_data): Generate dispatch table if flag_assume_compiled.
17708 Set dtable of class object to address of class_dtable_decl.
17710 * decl.c (int_decl_processing): Make soft_badarrayindex_node
17711 be volatile and have side effects - generates better code.
17713 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
17714 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
17716 * expr.c (expand_invoke): If class is final, method is
17717 effectively final, so can call it directly.
17719 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
17721 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
17723 1998-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
17725 * parse.y (build_method_invocation_stmt): Removed extra argument
17728 1998-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
17730 * expr.c (dtable_indent): Now static global.
17731 (expand_invoke): Now call invoke_build_dtable and
17732 build_invokevirtual.
17733 (invoke_build_dtable, build_invokevirtual): New functions.
17734 * jcf-io.c (find_class): Defer issuing a warning by setting
17735 jcf->outofsynch to 1.
17736 * jcf-parse.c (jcf_out_of_synch): New function.
17737 (load_class): Test this_jcf.outofsynch flag and call
17738 jcf_out_of_synch accordingly.
17739 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
17740 comment indentation.
17741 * lex.c (java_get_unicode): Fixed code indentation.
17742 (java_lex): Create string literal. Fixed typo. Removed several
17743 premature obstack_free.
17744 * parse.h: New enums for name resolution and invocation mode.
17745 (struct qualification): New data structure.
17746 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
17747 (do_resolve_class, build_method_invocation_stmt,
17748 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
17749 debug_line, identical_subpath_p, invocation_mode,
17750 refine_accessible_methods_list, build_invoke,
17751 lookup_method_invoke): New functions declared.
17752 (build_invokevirtual, invoke_build_dtable, match_java_method,
17753 build_field_ref, jcf_out_of_synch): New references to external
17755 (struct parse_ctxt): Removed artificial_constructor field.
17756 * parse.y: (array_type:): Type defined for this rule.
17757 (class_type:): Installed default rule for interface_type:.
17758 (array_type:): Now build Java array type.
17759 (qualified_name:): Now use obstack_grow0.
17760 (method_declaration:): Skip the artificial constructor added to
17762 (abstract_method_declaration:): Execute the code only during pass 1.
17763 (block:): Installed default rule in block_statements:.
17764 (block_statement:): Add the statement to the method during pass 2.
17765 (statement_expression): Installed default rule for
17766 method_invocation:.
17767 (argument_list:): Added code to build the argument list.
17768 (method_invocation:): Added call to create the method invocation
17770 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
17771 (debug_line): New function for debug.
17772 (complete_class_decl): No longer do something during pass 1.
17773 (method_header): Use BUILD_PTR_FROM_NAME.
17774 (parser_qualified_classname): Use obstack_grow0. Removed bogus
17776 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
17777 function's main comment.
17778 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
17780 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
17781 (resolve_class): Now works with arrays.
17782 (do_resolve_class, resolve_and_layout): New functions.
17783 (java_check_regular_methods): Reverse method list before and after
17784 having processed it. No longer set ctxp->artificial_constructor.
17785 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
17786 accordingly. Fixed typo in issued error message. Now use
17788 (find_in_imports_on_demand): Now use obstack_grow0.
17789 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
17790 (source_end_java_method): Call expand_expr_stmt instead of
17791 expand_expr. Calls it before calling expand_function_end.
17792 (java_method_add_stmt): Do nothing if errors were found during
17794 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
17795 (build_method_invocation_stmt, build_invoke, invocation_mode,
17796 lookup_method_invoke, refine_accessible_methods_list,
17797 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
17799 * typeck.c (build_java_signature): Properly end method signature
17800 if return type skipped.
17801 (match_java_method): New function.
17803 1998-03-16 Per Bothner <bothner@cygnus.com>
17805 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
17807 1998-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
17809 * expr.c (build_invoke_non_interface): New function.
17810 (methods_ident, ncode_ident): Now static globals.
17811 (expand_invoke): Use build_invoke_non_interface.
17812 * java-tree.h (struct lang_decl): New field function_decl_body.
17813 (DECL_FUNCTION_BODY): New macro.
17814 * jcf-parse.c (jcf_parse_source): Deeper check before setting
17815 CLASS_FROM_SOURCE_P.
17816 (parse_source_file): Fixed typos. Call java_layout_parsed_class
17817 before starting pass 2. Call to java_generate_parsed_class replaced
17818 by java_register_parsed_class.
17819 * lex.c: Fixed typo in header. Some line width related formating.
17820 * lex.h: Some line width related formating.
17821 * parse.h (source_end_java_method, resolve_expression_name,
17822 complete_class_decl, maybe_create_class_interface_decl,
17823 check_class_interface_creation): New static function declarations.
17824 (java_layout_parsed_class, java_method_add_stmt): New function
17826 (struct parser_ctxt): Field mark_class_generate removed. New
17827 fields class_list and artificial_constructor.
17828 * parse.y: Fixed typo in header.
17829 (class_declaration:): Call complete_class_decl when class body
17831 (method_declaration:): Call source_end_java_method in pass 2 when
17832 the method body is defined.
17833 (postfix_expression:): Do expression name resolution on sub-rule
17834 name during pass 2.
17835 (create_class, create_interface): Merged common pieces.
17836 (check_class_interface_creation, maybe_create_class_interface_decl):
17838 (complete_class_decl): New function.
17839 (register_fields): Fixed line width related typo.
17840 (method_header): Correctly skip first argument when fixing
17841 argument line. Changed the loop.
17842 (java_check_circular_reference): Now use ctxp->class_list.
17843 (java_complete_class): Removed start/stop marking.
17844 (java_check_regular_methods): Now takes a class decl as an
17845 argument. Add default constructor if none were encountered.
17846 (java_check_methods): Now use ctxp->class_list. Changed call to
17847 java_check_regular_methods.
17848 (source_start_java_method): Set DECL_ARG_TYPE for each function
17850 (source_end_java_method, java_method_add_stmt): New functions.
17851 (java_generate_parsed_class): No longer exists.
17852 (java_layout_parsed_class, java_register_parsed_class): New functions.
17853 (resolve_expression_name): New function.
17855 1998-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
17857 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
17858 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
17859 until pass initializations are done. Call read_import_dir with
17861 * parse.h: (lookup_modifier_cl): New function declared.
17862 (INTERFACE_FIELD_MODIFIERS): New macro.
17863 (OBSOLETE_MODIFIER_WARNING): New macro.
17864 * parse.y: (register_fields): Class type and current field name in
17865 local variables. Check modifier(s) if adding field(s) to an interface.
17866 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
17867 and report errors using the faulty modifier line context.
17868 (lookup_modifier_cl): New function.
17869 (read_import_dir): Detect and report default import processing
17872 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
17874 Add a pair of -fassume-compiled/-fno-assume-compiled options.
17875 * class.c (is_compiled_class): Return 1 after making sure it
17876 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
17877 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
17878 * java-tree.h (flag_assume_compiled): Add decl.
17879 * lang.c (lang_f_options): Add the flag.
17880 (flag_assume_compiled): Add decl, default to 0.
17882 1998-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
17884 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
17885 (is_compiled_class): Likewise.
17886 (layout_class): Likewise.
17887 (layout_class): Detect and lay out classes defined in source code.
17888 (interface_of_p, add_interface_do, may_add_interface): New
17890 (add_interface): Now use add_interface_do.
17891 (add_method_1): New function.
17892 (add_method): Now use add_method_1.
17893 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
17894 (complete_start_java_method): New function.
17895 (start_java_mehod): Now call complete_start_java_method.
17896 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
17897 (expand_invoke): Likewise and fixed typo.
17898 *gjava.c: (print_super_field): Use new argument to find_class
17901 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
17902 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
17903 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
17905 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
17906 (add_method_1, push_class): New prototypes.
17907 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
17908 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
17909 directory where the class was found.
17910 (find_class): New argument DO_CLASS_FILE. Function find_class
17911 modified accordingly.
17912 *jcf-parse.c: (fix_class_path): New function.
17913 (load_class): Use new VERBOSE argument. load_class now finds and
17914 loads/parses .class/.java files. Save read_state of current_jcf
17916 (java_parser_abort_on_error): New macro.
17917 (jcf_parse_source, parse_source_file): New function.
17918 (jcf_parse): Fixed typo.
17919 (yyparse): Call parse_source_file () only.
17920 (process_zip_dir): Fixed typo, fix zdir->filename_length when
17921 writing the real class name back in the zip directory entry.
17922 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
17923 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
17924 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
17925 (find_class): Prototype fixed.
17926 *lex.c: Added 1998 time stamp.
17927 Removed all static global variables, moved into the parser
17928 context data structure.. Now include unistd.h if SEEK_SET not
17930 (java_init_lex): Rewritten.
17931 (java_sneak_unicode): Modified current unicode access in current line.
17932 (java_unget_unicode): Likewise.
17933 (java_allocate_new_line): New allocation management.
17934 (java_read_char): Modified access and storage of unget_utf8_value.
17935 New way of processing current unicode.
17936 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
17937 (java_get_unicode): Now use the parser context.
17938 (java_lineterminator): Likewise.
17939 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
17940 of the reentrant parser implementation. Function now use the
17941 parser context data structure and java_lval. Fixed production of
17942 the float and double constant "out of range" error message. Fixed
17943 obstack use. Return integer value when hitting a modifier. Now
17944 return type for TRUE, FALSE and other predefined types. Return
17945 identifier as a TREE_LIST list containing the current line context
17946 as the TREE_VALUE sub-node.
17947 (java_unicode_2_utf8): Fixed typo in declaration.
17948 (java_lex_error): Now use the parser context data structure.
17949 *lex.h: Added 1998 time stamp.
17950 (struct java_line): New fields ref_count and next.
17951 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
17952 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
17953 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
17954 *parse.h: Added 1998 time stamp.
17955 (java_parse_source_file): Renamed from parse_source_file.
17956 (YYERROR_NOW, YYNOT_TWICE): Fixed.
17957 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
17958 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
17959 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
17960 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
17961 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
17962 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
17963 (struct parser_ctxt): New data structure to keep the parser context.
17964 *parse.y: Added 1998 time stamp, got rid of static global variables.
17965 (java_error_count, ctxp): New global variables.
17966 (%union): New value field.
17967 (numeric_type, integral_type): Rules removed.
17968 (primitive_type): Rule defined to handle integral, float, double and
17970 (qualified_name, package_declaration,
17971 single_type_import_declaration, type_import_on_demand_declaration,
17972 modifiers, class_declaration, super, interfaces,
17973 interface_type_list, class_body, field_declaration,
17974 field_declaration, variable_declarators, variable_declarator,
17975 variable_declarator_id, method_declaration, method_header,
17976 formal_parameter_list, formal_parameter, method_body, block,
17977 static, interface_declaration, extends_interfaces,
17978 abstract_method_declaration, local_variable_declarators): Rules now
17980 (force_error, do_warning): New global statics.
17981 (push_parser_context, parser_context_save_global,
17982 parser_context_restore_global, pop_parser_context): New functions.
17983 (yyerror): Now uses the global parser context. Fixed use of obstack.
17984 (parse_error, parse_error_context, parse_warning_context,
17985 java_accstring_lookup, redefinition_error, check_modifiers,
17986 parser_add_interface, create_interface, create_class, find_field,
17987 duplicate_declaration_error, register_fields, method_header,
17988 check_modifiers_consistency, check_abstract_method_header,
17989 method_declarator, parser_qualified_classname,
17990 parser_check_super_interface, parser_check_super,
17991 parser_chain_incomplete_item, java_check_circular_reference,
17992 layout_class_from_source, java_complete_class,
17993 complete_method_decl, resolve_class, complete_class_report_errors,
17994 java_check_final, check_method_redefinition,
17995 java_check_regular_methods, java_check_abstract_methods,
17996 java_check_methods, lookup_java_interface_method2,
17997 lookup_java_method2, lookup_cl, find_name_in_single_imports,
17998 process_imports, find_in_imports, read_import_entry,
17999 read_import_dir, find_in_imports_on_demand,
18000 check_pkg_class_access, not_builtin_p, declare_local_variables,
18001 source_start_java_method, java_generate_parsed_class): New
18003 *typeck.c: (signature_include_return): New global variable.
18004 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
18005 to add the function returned type in the signature.
18007 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
18009 * jcf-io.c (open_in_zip): Use strncmp and LEN.
18011 1998-01-29 Dave Brolley <brolley@cygnus.com>
18013 * Make-lang.in (java.info): Added.
18014 (java.install-info): Added
18016 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
18018 * Makefile.in (clean): Also remove java/parse.c.
18020 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
18022 Add a pair of -fbounds-check/-fno-bounds-check options.
18023 * lang.c (lang_decode_option): Add code to grok arguments.
18024 (flag_bounds_check): Add decl.
18025 (lang_f_options): New array w/ the option in it.
18026 * java-tree.h (flag_bounds_check): Add decl.
18027 * lang-options.h: New file.
18028 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
18029 of a static macro value.
18030 (JAVA_ARRAY_EXCEPTION): Delete macro.
18032 1998-01-23 Per Bothner <bothner@cygnus.com>
18034 * typeck.c (build_java_array_type): Fix two bugs in previous change.
18035 * expr.c (build_anewarray): Add missing promote_type.
18037 1998-01-22 Per Bothner <bothner@cygnus.com>
18039 Add array types with known length to optimize bounds checking.
18040 * typeck.c (build_java_array_type): Take length parameter.
18041 (java_array_type_length, build_prim_array_type): New functions.
18042 * java-tree.h: Update for new functions.
18043 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
18044 * class.c: Use build_prim_array_type.
18045 * expr.c (can_widen_reference_to): Handle known-length array types.
18046 (verify_jvm_instructions): Keep track of integer push instructions
18047 followed by newarray/anewarray, so we can build known-length arrays.
18048 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
18049 (java_array_data_offset): New function.
18050 (build_java_array_length_access): New function. Optimize if constant.
18051 (build_java_arrayaccess): Constant fold bounds check.
18052 (expand_java_newarray, expand_java_anewarray): Replaced by ...
18053 (build_newarray, build_anewarray): New functions.
18054 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
18055 * verify.c (merge_types): Handle known-lengh array types.
18057 1998-01-19 Per Bothner <bothner@cygnus.com>
18059 * expr.c (expand_byte_code): Fix performace bug, which caused
18060 searching linenumber_table to be linear rather than constant.
18062 1997-12-12 Per Bothner <bothner@cygnus.com>
18064 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
18066 * decl.c, java-tree.h (soft_fmod_node): New global.
18067 * decl.c (init_decl_processing): Define __builtin_fmod.
18068 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
18069 using __builtin_fmod.
18071 1997-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
18073 * keyword.h: New file, output of keyword.gperf as processed by
18075 * lex.c (java_lex_init): Initialize java_error_flag.
18076 * parse.c (YYERROR_NOW): Uses java_error_flag.
18077 * parse.y: New static java_error_flag. Useless definition of
18079 * parse.y (java_error): Portable error recovery using
18080 java_error_flag (not yet completely tuned).
18082 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
18084 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
18086 1997-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
18088 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
18089 (parse.c, lex.c, keyword.h): New rules for Java source code
18091 * parse.c: Renamed into jcf-parse.c.
18092 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
18093 * keyword.gperf: New file, Java keywords.
18094 * parse.y: New file, Java language grammar.
18095 * parse.h: New file, Java language grammar definitions.
18096 * lex.c: New file, Java language lexer.
18097 * lex.h: New file, Java language lexer definitions.
18099 1997-12-03 Per Bothner <bothner@cygnus.com>
18101 * decl.c (clinit_identifier_node), java-tree.h: New global.
18102 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
18103 * verify.c (verify_jvm_instructions): Inline use of removed macros.
18104 * expr.c (expand_java_field_op): Check for invalid assignment
18107 * jcf-reader.c (get_attribute): Test for wrong attribute length.
18109 1997-10-27 Per Bothner <bothner@cygnus.com>
18111 * verify.c (verify_jvm_instructions): When processing a handler,
18112 attempt to set the current_subr to the right value.
18113 (More complicated code combines Sep 17 and Oct 22 versions.)
18115 1997-10-24 Per Bothner <bothner@cygnus.com>
18117 * class.c (push_class): Figure out (guess) name of source file.
18118 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
18119 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
18120 (parse_class_file): Change return type from int to void.
18121 Call debug_start_source_file/debug_end_source_file.
18123 * expr.c (build_java_binop): Fix masking 2nd operand.
18124 * decl.c (init_decl_processing): Set sizetype first.
18126 1997-10-22 Per Bothner <bothner@cygnus.com>
18128 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
18129 (Revert Sep 17 change.)
18131 1997-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
18133 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
18134 .class extension in their name and fix thing so we don't process
18135 them parse_zip_file_entries().
18136 (parse_zip_file_entries): Cleaned unused local variables.
18138 1997-10-20 Per Bothner <bothner@cygnus.com>
18140 * expr.c (can_widen_reference_to): Allows equal array element types.
18141 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
18142 * jcf-dump.c (RET): Get (and print) index.
18144 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
18145 Promote element type to POINTER_TYPE.
18147 1997-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
18149 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
18150 find_in_current_zip, jcf_figure_file_type): Moved from
18151 jcf-reader.c to parse.c.
18152 * zextract.c: (read_zip_archive): takes file_comment_length possible
18153 field into account.
18155 1997-10-20 Per Bothner <bothner@cygnus.com>
18157 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
18159 * verify.c (merge_types): Handle array types even better ...
18161 1997-10-17 Per Bothner <bothner@cygnus.com>
18163 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
18165 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
18166 * class.c (make_class_data): Don't build fields_decl if no fields.
18167 When building fields_decl, skip if DECL_ARTIFICIAL.
18169 * expr.c (java_stack_swap): Update stack_type_map.
18170 * verify.c (merge_types): Handle array types better.
18172 1997-10-15 Per Bothner <bothner@cygnus.com>
18174 * class.c (add_field): Don't promote short integral fields to
18175 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
18176 * expr.c (push_value): Promote and convert short integral values.
18178 * decl.c, java-tree.h (integer_two_node): New constant node.
18179 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
18181 1997-10-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
18183 * class.c (append_gpp_mangled_type): Use function argument
18184 unpromoted type to generate mangled name.
18186 1997-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
18188 * constants.c (build_constant_data_ref): Now uses current_class
18189 instead of main_class.
18190 (build_constants_constructor): Now uses current_class instead of
18192 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
18193 of the global variable SeepZipFiles done here.
18194 * zextract.c (read_zip_archive): extra_field optional field taken
18195 into account while computing the position of the class file in the
18197 * verify.c (verify_jvm_instructions): Use current_jcf to search
18199 * parse.c (load_class): First search for the class to load in the
18200 current zip file. Saves current_jcf (restored before returning
18201 from that function). Don't call JCF_FINISH in the class was found
18202 in the current ZIP file.
18203 (jcf_parse): If the class was found in the current ZIP file, save
18204 its tree_constant_pool (for later reuse).
18205 (parse_class_file): New function. Process each method defined in
18206 the current class and record the class as to be later registered.
18207 (yyparse): Rewritten. Figure the type of the current file and switch
18209 * lang.c: New global variable current_jcf.
18210 (lang_init): Removed compiling_from_source test (done later, in
18211 yyparse). Removed call the jcf_parse ().
18212 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
18213 (typedef struct JCF): New fields seen_in_zip (to mark a class found
18214 in the current ZIP file) and zip_offset (offset to the class data in
18215 the current zip file).
18216 * jcf-reader.c: zipfile.h included.
18217 localToFile: New ZipFileCache static global variable
18218 (parse_zip_file_entries): New function. Browse the current ZIP
18219 file directory and process each class found.
18220 (process_zip_dir): New function. Register each class found in the
18221 ZIP file directory. The class aren't parsed but a valid JCF is
18222 link to each of them.
18223 (find_in_current_zip): New function. Search for a class in the
18224 current ZIP file directory. If found, prepare the class so that it
18226 (jcf_figure_file_type): New function. Examine the file structure
18227 to figure a class file, a ZIP file. If none of these categories are
18228 matched, a source file is assumed.
18229 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
18230 SeenZipFile: New global variable.
18231 (open_in_zip): Use zipmember's length to accelerate the search for
18232 a member. If zipmember was NULL and zip file successfully read,
18234 * java-tree.h: New global variable current_jcf declared. Added
18235 declaration for current_constant_pool_tags, current_constant_pool_data,
18236 current_constant_pool_length, current_constant_pool_data_ref.
18237 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
18238 store the JCF of classes seen in a zip file) and tree *constant_pool
18239 (to save a loaded class constant pool). current_class declared here.
18240 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
18241 retrieve method_ref_constant.
18242 (PUSHC): java_push_constant_from_pool now uses current_jcf.
18243 (OBJECT): get_class_constant now uses current_jcf.
18244 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
18245 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
18246 (expand_invoke): Now uses current_class instead of main_class
18247 (build_class_init): Now uses current_class instead of main_class
18248 * class.c: New static global variable registered_class.
18249 (register_class): New function.
18250 (emit_register_class): Modified to use registered_class instead of
18252 (is_compiled_class): Now take into account class seen in the archive.
18254 1997-10-06 Per Bothner <bothner@cygnus.com>
18256 * except.h: Renamed to: java-except.h.
18257 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
18258 * except.c: Add semi-working (commented out) implementation.
18260 * expr.c (expand_iinc): Add needed flush_quick_stack.
18261 * parse.c (set_source_filename): New function.
18262 (give_name_to_class): Set input_filename from package.classname.java.
18264 * jcf-io.c (find_class): Don't look first in ".".
18266 1997-10-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
18268 * zextract.c (read_zip_archive): Now takes into account the
18270 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
18272 1997-09-20 Per Bothner <bothner@cygnus.com>
18274 * constants.c, java-tree.h (build_internal_class_name): New function.
18275 (alloc_class_constant): Re-implement using build_internal_class_name.
18276 * class.c (make_class_data): Likewise.
18277 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
18279 1997-09-17 Per Bothner <bothner@cygnus.com>
18281 * verify.c (verify_jvm_instructions): Temporarily set current_subr
18282 to NULL before pushing an exception handler target.
18284 * expr.c (flush_quick_stack): Save from low stack indexes to high.
18285 (java_stack_swap, java_stack_dup): Re-write to be safe from
18286 clobbering registers.
18287 (build_class_init): New function.
18289 1997-09-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
18291 * typeck.c (build_java_array_type): Temporary use
18292 permanent_obstack to create the array 'length' field.
18293 * expr.c (lookup_label): Temporay use permanent_obstack to create
18294 label if not found.
18295 * class.c (push_super_field): Tempory use permanent_obstack.
18297 1997-09-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
18299 * typeck.c (type_for_mode): Now handles double_type_node and
18301 * verify.c (verify_jvm_instructions): The instruction following
18302 the wide bytecode is checked. OPCODE_ret added to the list of
18305 1997-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
18307 * class.c (make_class): Temporary use permanent_obstack. Set the
18308 class CLASS_P field to 1.
18309 (push_class): Temporary use permanent_obstack.
18310 (set_super_info): Temporary use permanent_obstack.
18311 (add_method): Temporary use permanent_obstack, set
18312 METHOD_TRANSIENT().
18313 (add_field): Temporary use permanent_obstack. Sets
18314 FIELD_VOLATILE() and FIELD_TRANSIENT().
18315 (build_class_ref): Temporary use permanent_obstack if the class
18317 (build_static_field_ref): Temporary use permanent_obstack when
18318 creating field's rtl.
18319 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
18320 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
18321 and fields. Function finalized, as far as flag handling.
18322 (push_class_static_dummy_field): Temporary use permanent_obstack.
18323 (emit_register_class): Force generation of class registration at
18325 * decl.c (end_java_method): Call permanent_allocation() before
18327 * expr.c (can_widen_reference_to): Added comment to interface
18328 handling, fixed typo.
18329 (lookup_field): Now uses CLASS_P() to correct FIXME
18330 (expand_invoke): Verification on public && !static &&
18331 !abstract moved into soft_lookupinterfacemethod (kaffe).
18332 Use Object class dtable if objectref is an array when expanding
18334 (java_push_constant_from_pool): Temporary use permanent_obstack
18335 for CONSTANT_string
18336 * parse.c (get_ref_constant): Temporary use permanent_obstack to
18337 create constant references.
18338 (get_constant): Temporary use permanent_obstack to create constant.
18339 (load_class): Temporary use permanent_obstack to load class.
18340 (jcf_parse): Temporary use permanent_obstack to perform class
18342 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
18343 (build_java_signature): Temporary use permanent_obstack.
18344 * verify.c: (verify_jvm_instruction): removed unnecessary verification
18346 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
18347 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
18350 1997-09-11 Per Bothner <bothner@cygnus.com>
18352 * class.c (append_gpp_mangled_type): Fix typo.
18353 (emit_register_class): Use main_class to get class object, rather
18354 than looking for no-longer-existing static decl starting with _CL.
18355 * typeck.c (parse_signature_type): Promote array element type
18356 if it is a RECORD_TYPE.
18358 1997-09-10 Per Bothner <bothner@cygnus.com>
18360 * class.c (push_class_static_dummy_field): New function.
18361 (mangle_static_field): New. Do G++-style mangling of static fields.
18362 (layout_class): Mandle static fields here, not in add_field.
18363 (build_class_ref): The class object is now a dummy static field.
18364 * decl.c (find_local_variable): Look for best, instead of first match.
18365 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
18366 (build_java_athrow): Don't check here if exception is Throwable.
18367 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
18368 (TYPE_USED): Removed. No longer used ...
18369 * parse.c (jcf_parse): Call push_class_static_dummy_field.
18370 * verify.c (push_pending_label): New function.
18371 (push_pending_block): Renamed to check_pending_block.
18372 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
18373 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
18374 re-checking possible handlers) after a store (less wasted work).
18375 Check for null handler (finally) before calling add_handler.
18376 Various changes to (finally?) correctly handle try/finally.
18378 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
18380 * class.c: Include stdio.h.
18382 1997-09-04 Per Bothner <bothner@cygnus.com>
18384 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
18385 to make sure class is initialized before static/special invoke.
18387 * verify.c (verify_jvm_instructions): On a store instruction,
18388 call find_local_variable to force pre-allocation of decl and rtx.
18389 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
18391 1997-09-03 Per Bothner <bothner@cygnus.com>
18393 * class.c (build_class_ref): Strip off "promoted_" if need be.
18394 (make_field_value): Call build_java_signature when needed.
18395 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
18396 * expr.c (build_java_athrow): Don't push_value of exception.
18397 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
18398 match specification of [fd]cmp[lg] for NaNs.
18399 (expand_byte_code): Add support for exception handler ranges.
18400 * except.c: Add skeleton for EH code-generation.
18401 * verify.c (merge_types): Treat all promoted integral types as equal.
18402 * constants.c (build_constants_constructor): To force creation of
18403 current_constant_pool_data_ref, call build_constant_data_ref.
18405 * javaop.def (lload): Fix typo.
18406 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
18408 1997-09-02 Brendan Kehoe <brendan@lisa.cygnus.com>
18410 * parse.c: Don't include function.h.
18412 1997-08-27 Per Bothner <bothner@cygnus.com>
18414 * except.[ch]: New files.
18415 * Makefile.in (JAVA_OBJS): Add except.o
18416 * expr.c: Temporary warning about unimplemented exceptions.
18417 * verify.c: Verify exception handlers.
18419 * jcf-dump.c (disassemble_method): Print exception table.
18421 1997-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
18423 * expr.c (verify_jvm_instructions): Started a thorough
18424 verification of invoke* bytecodes.
18425 (expand_byte_code): flush quick stack if PC is the target of a
18426 branch. and undef RET (conflicting with config/i386/i386.h).
18427 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
18429 (expand_invoke): Now handles invokeinterface and do more
18430 verification according to the bytecode.
18431 (lookup_field): Don't try to load the class if processing
18433 (can_widen_reference_to): Now handles interfaces.
18434 * decl.c (init_decl_processing): New global variable
18435 soft_lookupinterfacemethod_node, declared in java-tree.h.
18436 Call set_super_info on string_type_node.
18437 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
18439 * class.c (set_super_info): Fills the CLASS_* flags according to
18441 (get_access_flags_from_decl): Handles all class flags.
18443 1997-08-26 Per Bothner <bothner@cygnus.com>
18445 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
18446 * parse.c (yyparse): Check for abstract method, and missing code.
18447 * expr.c (expand_byte_code): Change interface.
18448 * lang.c (put_decl_node): Print promoted types prettier.
18449 * verify.c (verify_jvm_instruction): Change interface.
18450 Partial support for scanning exception table.
18451 For load instructions, handle promoted integral types.
18453 1997-08-21 Per Bothner <bothner@cygnus.com>
18455 * verify.c: New file, with contents moved from expr.c.
18456 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
18457 * typeck.c (is_array_type_p): Moved here from expr.c.
18458 * java-tree.h: Add some now-needed function declarations.
18459 * Makefile.in (JAVA_OBJS): Added verify.o.
18461 1997-08-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
18463 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
18464 METHOD_ABSTRACT flag.
18466 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
18467 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
18468 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
18470 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
18472 (start_java_method): Hook for SYNCHRONIZED methods.
18474 * expr.c (build_java_jsr, build_java_ret): New functions
18475 (JSR,PRE): New macros
18476 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
18477 (verify_jvm_instructions): tableswitch, lookupswitch,
18478 monitorenter, monitorexit, goto_w: verified.
18479 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
18480 (build_java_monitor): New function.
18481 (MONITOR_OPERATION): Modified to call build_java_monitor()
18482 (verify_jvm_instructions): Started a thorough verification of
18485 1997-08-19 Per Bothner <bothner@cygnus.com>
18487 Support verification of jsr/ret subroutines (used for try/finally).
18488 * decl.c (return_address_type_node): New type node.
18489 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
18490 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
18491 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
18492 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
18493 TYPE_USED): New macros for special types in type_map.
18495 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
18496 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
18498 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
18500 * expr.c (can_widen_reference_to): New function.
18501 (pop_type): Use it.
18502 (merge_type_state): Support handling start of subroutine.
18503 (push_pending_block): Return char* error message, instead of calling
18504 fatal on an error. Also handle subroutines.
18505 (verify_jvm_instructions): Handle errors from push_poending_block.
18506 Support jsr and ret instructions.
18508 1997-08-19 Per Bothner <bothner@cygnus.com>
18510 * jcf-io.c (find_classfile): Fix thinko.
18511 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
18513 1997-08-12 Jason Merrill <jason@yorick.cygnus.com>
18515 * Makefile.in (BISON): Remove.
18517 1997-08-07 Per Bothner <bothner@cygnus.com>
18519 * Makefile.in: Convert to autoconf.
18520 * config-lang.in (outputs): Added java/Makefile.
18522 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
18523 Rename cc1java to jc1.
18525 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
18526 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
18528 * class.c (class_depth): Do load_class if needed.
18530 Mostly better verification.
18531 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
18532 (init_decl_processing): Change return type of soft_checkcast.
18533 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
18534 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
18535 lang_print_error): New functions.
18536 (lang_init): Set global hook print_error_function to lang_print_error.
18537 * expr.c: In the type_map ptr_type_node is only used for null now.
18538 (pop_type, merge_types): Hence ptr_type_node matches any reference.
18539 (merge_types): Dererence pointer to record types before comparing.
18540 (decode_newarray_type, merge_types): On error just return NULL.
18541 (build_java_binop): Add preliminary implementation (with warning)
18542 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
18543 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
18544 (expand_compare, expand_java_goto, expand_java_call): Don't
18545 push_pending_block, since that only makes sense when verifying.
18546 (merge_type_state): Different return codes.
18547 (push_pending_block): A block may need to be verified more than once.
18548 (expand_byte_code): Warn about unused code at code generation time.
18549 (verify_jvm_instruction): Changed logic, since code may need to be
18550 re-verified if type-state has changed. Also, better error handling.
18551 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
18552 Improve newarray, anewarray, ?aload, athrow,
18553 * java-tree.h (LABEL_CHANGED): New macro.
18555 1997-08-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
18557 * decl.c (soft_athrow_node): New global variable initialized.
18558 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
18559 * typeck.c (convert): Added support for REAL_TYPE.
18560 (convert_to_char): New function.
18561 (convert): Handle CHAR_TYPE.
18562 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
18563 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
18564 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
18566 (verify_jvm_instructions): Added break a the end of bogus unop: label.
18567 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
18568 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
18569 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
18570 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
18571 to Use The Right Things.
18572 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
18573 compatible with INT. BOOLEAN is made equivalent to BYTE.
18574 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
18575 OPCODE_ifnonnull): Now supported.
18576 (build_java_athrow): New function.
18578 1997-08-04 Per Bothner <bothner@cygnus.com>
18580 Rename method name <init> to match G++ (and fix mangling).
18581 * class.c (layout_class): Replace method name of <init> by class name.
18582 (make_method_value): Do inverse renaming of constructor from <init>.
18583 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
18584 * typeck.c (lookup_java_constructor): New function.
18585 * expr.c (expand_invoke): If method_name is <init>, call
18586 lookup_java_constructor to find constructor.
18588 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
18590 1997-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
18592 * parse.c (get_class_constant): Modified to handle array "classes"
18593 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
18595 (convert): Modified to handle real type.
18596 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
18597 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
18598 variables declared.
18599 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
18600 soft_multianewarray, soft_newarray_node, soft_throw_node): New
18601 global variables initialized.
18602 (find_local_variable): Handles the case of a pointer
18603 (end_java_method): Restore the use of one more scope
18604 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
18605 build_java_array_length_access, expand_java_arrayload,
18606 expand_java_arraystore, expand_java_array_length,
18607 expand_java_multianewarray, expand_java_anewarray,
18608 build_java_check_indexed_type, is_array_type_p,
18609 build_java_throw_out_of_bound_exception): New functions.
18610 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
18611 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
18612 OPCODE_<t>aload): Implemented code for verification.
18613 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
18614 ARRAY_NEW_MULTI): Macro defined.
18615 (CONVERT): Modified to invoke convert().
18616 (case OPCODE_aload2): Fixed index typo from 2 to 1.
18618 1997-07-31 Per Bothner <bothner@cygnus.com>
18620 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
18621 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
18622 (make_class_data): Field name needs '/' as package prefix.
18623 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
18625 1997-07-25 Per Bothner <bothner@cygnus.com>
18627 Implement debug information for local variables.
18628 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
18629 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
18630 DECL_LOCAL_SLOT_CHAIN): New macros.
18631 (struct lang_decl_var): New type.
18632 * parse.c (give_name_to_locals): Move to decl.c.
18633 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
18634 (start_java_method): Re-write parameter handling.
18635 (pending_local_decls): New global variable.
18636 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
18637 (find_local_variable): Accept pc so we can skips decls not in range.
18638 (struct binding_level): Add end_pc field.
18639 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
18640 (various): Change so current pc gets passed to find_local_variable.
18642 * decl.c (init_decl_processing): Re-arrange fields in
18643 class_type_node and and method_type_node to match kaffe 0.9.1.
18644 * class.c (make_method_value, make_class_data): Update
18645 initializations to match.
18647 1997-07-16 Per Bothner <bothner@cygnus.com>
18649 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
18650 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
18651 (push_super_field): New function.
18652 (make_class_data): Handle inheritance of class static initializer.
18653 (layout_class): New name mangling.
18654 * constants.c (build_constant_data_ref): Init type of data array
18655 to a one-element array.
18656 (build_constants_constructor): Set DECL_SIZE from complete array type.
18657 * decl.c: Rename class_type, object_type etc to class_type_node,
18658 object_type_node etc. Make former inherit from latter.
18659 * expr.c (expand_invoke): Add cast of function address.
18660 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
18661 * parse.c (yyparse): Don't call layout_class here.
18662 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
18664 1997-06-14 Per Bothner <bothner@cygnus.com>
18666 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
18667 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
18668 (alloc_class_constant): New.
18669 * expr.c (expand_invoke): Make sure method's class is initialized.
18670 * class.c (interits_from_p, emit_register_class): New functions.
18671 * parse.c (yyparse): Call emit_register_class.
18673 1997-06-09 Per Bothner <bothner@cygnus.com>
18675 * constants.c: New file, to handle constant pool.
18676 * Makefile.in (JAVA_OBJS): Add constants.o.
18677 * decl.c (init_decl_processing): Update, fix, finish various structs.
18678 (pushdecl_top_level): New.
18679 * parse.c (layout_class): Moved to class.c.
18680 * expr.c (java_push_constant_from_pool): New function.
18681 * class.c (build_class_ref): Make work fully
18682 (make_class_data): Emit super-class, constant pool, interface vector.
18684 1997-06-03 Per Bothner <bothner@cygnus.com>
18686 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
18687 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
18688 * class.c (class_depth): New function.
18689 (lookup_named_class): Replaced by new function lookup_class.
18690 * decl.c (object_type_node, string_type_node): New.
18691 Remove various types that we no longer need.
18692 * expr.c (verify_jvm_instructions): New separate verifier pass.
18693 (push_type, pop_type): New functions for verifier.
18694 (type_stack_dup, pop_argument_types, merge_types): Likewise.
18695 (expand_byte_code): Simplify, since we assume already verified.
18696 (expand_invoke): Now mostly works.
18697 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
18698 * lang.c (main_class): Move to parse.c. Don't make_class yet.
18699 * parse.c: Wait to allocate class object until we know its name.
18700 (layout_class): Calculate DECL_VINDEX for each virtual method.
18701 * typeck.c (get_array_type): Rename to ...
18702 (build_java_array_type): ... and provide working implementation.
18703 (build_java_signature): New function - build Java signature of type.
18704 (set_java_signature): New function - cache signature with type.
18705 (lookup_java_method): New function.
18707 1997-05-06 Per Bothner <bothner@deneb.cygnus.com>
18709 * class.c (ident_subst): Take extra SUFFIX parameter.
18710 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
18711 (set_constant_value, build_static_field_ref, is_compiled_class): New.
18712 (build_class_ref): Actually implement.
18713 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
18714 * decl.c (builtin_function): New.
18715 (init_decl_processing): Update for current Kaffe. Declare some
18716 builtin Kaffe functions.
18717 * expr.c (build_address_of): New.
18718 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
18719 Renamed (from expand_java_new etc), and added working implementations.
18720 (build_field_ref): Now also handle static fields.
18721 (expand_invoke): Implement invokestatic, and start implement rest.
18722 * java-opcodes.h: Use javaop.def to avoid duplicated list.
18723 * javaop.def: Rename invokevirt -> invokevirtual.
18724 * lang.c (use_handles): Removed.
18725 * parse.c: Add support for ConstantValue attribute.
18726 Handle nested loading of a class. (JPOOL_UTF): New.
18728 1997-03-11 Per Bothner <bothner@deneb.cygnus.com>
18730 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
18732 1997-02-27 Per Bothner <bothner@deneb.cygnus.com>
18734 * Make-lang.in (java.install-man): New empty rule.
18735 * typeck.c (set_local_type): New function.
18736 * expr.c (STORE_INTERNAL): Call find_local_variable,
18737 not find_stack_slot. Call set_local_type.
18739 1997-02-12 Per Bothner <bothner@kalessin.cygnus.com>
18741 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
18742 and building RECORD_TYPE CONSTRUCTORs.
18743 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
18745 * lang.c (use_handles): Change the default to 0.
18746 * decl.c: Define and build class_type, field_type, utf8const_type.
18747 * class.c (make_class_data, make_field_value,
18748 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
18749 hashUtf8String, strLengthUtf8, mangled_classname:
18750 Functions to build reflective data structures.
18751 * parse.c (yyparse): Call make_class_data.
18753 * jcf-io.c (open_class, find_classfile): New functions.
18754 * jcf-dump.c: Support reading classfile from explicitly-named
18755 class file (without CLASSPATH searching).
18757 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>
18759 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
18760 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
18761 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
18762 (get_constant): Now trivial for CONSTANT_Utf8.
18764 * jcf.h: Make NEW_CPOOL the default.
18765 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
18767 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>