1 2002-03-11 Eric Blake <ebb9@email.byu.edu>
3 * lex.c: Adjust comments to GNU standards.
5 2002-03-11 Eric Blake <ebb9@email.byu.edu>
8 * lex.c (java_lex): Fix parsing of literals.
10 2002-03-11 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
12 * parse.y (patch_assignment): Wrap the right-hand-side with a save_expr
13 to prevent it getting evaluated twice in the store checking case.
14 * expr.c (build_java_arraystore_check): Unwrap SAVE_EXPR's when
17 2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
19 * decl.c (java_init_decl_processing): Make sure class_type_node
20 alignment is not less than 64 bits if hash synchronization is enabled.
22 2002-03-08 Per Bothner <per@bothner.com>
24 * parse.y (java_complete_lhs): Check if patch_assignment
25 returned an error-mark.
27 * parse.y (try_builtin_assignconv): Don't special-case zero.
29 2002-03-08 Per Bothner <per@bothner.com>
32 * expr.c (build_java_jsr): Take pc arguments, and do lookup_label
33 gere instead of in JSR macro. Likewise with load_type_state call.
34 Do the latter on if the return_pc has been verified (the jsr returns).
35 (JSR): No just call build_java_jsr.
37 2002-03-07 Jeff Sturm <jsturm@one-point.com>
39 * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define.
40 (java.install-common): Link native driver to
41 JAVA_TARGET_INSTALL_NAME.
43 2002-03-05 David Billinghurst <David.Billinghurst@riotinto.com>
45 * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED
46 * builtins.c(sin_builtin): Likewise
47 * builtins.c(sqrt_builtin): Likewise
49 2002-03-03 Zack Weinberg <zack@codesourcery.com>
51 * java/expr.c, java/jcf-parse.c, java/lex.c:
52 Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
53 REAL_ARITHMETIC blocks unconditional. Delete some further
54 #ifdef blocks predicated on REAL_ARITHMETIC.
56 2002-03-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
58 * class.c (init_class_processing): Use ARRAY_SIZE in lieu of
59 explicit sizeof/sizeof.
60 * decl.c (java_init_decl_processing): Likewise.
61 * jcf-parse.c (init_jcf_parse): Likewise.
62 * parse.y (init_src_parse): Likewise.
64 2002-03-02 Per Bothner <per@bothner.com>
66 Make --CLASSPATH by a synonym for --classpath and -classpath.
67 Implement --bootclasspath.
68 * jcf-path.c (classpath_u): Rename static variable to classpath_user.
69 (classpath_l): Remove.
70 (jcf_path_CLASSPATH_arg): Remove.
71 (jcf_path_bootclasspath_arg): New function.
72 (jcf_path_seal): Simplify accordingly.
74 * jcf.h (jcf_path_bootclasspath_arg): New declarations.
75 (jcf_path_CLASSPATH): Remove declaration.
76 * jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*.
77 (lang_specific_driver): Translate -bootclasspath.
78 * lang-options.h: Add --bootclasspath. Update --CLASSPATH.
79 * lang.c (decode_lang_options): Do jcf_path_init first.
80 Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath.
81 * gjavah.c: Also handle --bootclasspath.
82 Handle --CLASSPATH as a synonum for --classpath.
83 * jcf-dump.c: Likewise.
85 "." is not part of system path, but is the default for --classpath.
86 * jcf-path.c (jcf_path_init): Don't add "." to sys_dirs.
87 (jcf_path_seal): Add "." if no CLASSPATH specified.
89 * gcj.texi: Document changes.
91 2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
93 * expr.c (build_java_arraystore_check): Fix formatting.
95 2002-02-28 Alexandre Petit-Bianco <apbianco@redhat.com>
97 Fix for PR java/5758, java/5632:
98 * jcf-parse.c (load_class): Renamed local variable, consider `.' an
99 inner-class separator too.
100 * parse.y (do_resolve_class): New local `decl_result.'
101 Progressively build a name for what can have been loaded.
103 2002-02-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
105 * expr.c (java_array_data_offset): Removed function.
106 (JAVA_ARRAY_LENGTH_OFFSET): Removed macro.
107 (build_java_array_length_access): Obtain "length" value using a
108 COMPONENT_REF, instead of INDIRECT_REF and arithmetic.
109 (build_java_arrayaccess): Correct comment. Access "data" using a
110 COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF.
111 (build_java_arraystore_check): New function.
112 (expand_java_arraystore): Use build_java_arraystore_check.
113 * parse.y (patch_assignment): Simplify code to insert a store check
114 when lvalue is an ARRAY_REF. Use build_java_arraystore_check.
115 * check-init.c (check_init): Update to reflect that an array length
116 access is now a COMPONENT_REF.
117 * gcj.texi (Code Generation): Improve documentation of
118 -fno-bounds-check. Add documentation for -fno-store-check.
119 * java-tree.h (flag_store_check): Declare.
120 (build_java_arraystore_check): Declare.
121 * lang.c (flag_store_check): Initialize to 1.
122 (lang_f_options): Add store-check option.
123 * jvspec.c: Don't pass store-check option to jvgenmain.
124 * lang-options.h: Add help string for -fno-store-check.
126 2002-02-28 Neil Booth <neil@daikokuya.demon.co.uk>
128 * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
129 * java-tree.h (java_dup_lang_specific_decl): New.
130 * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
132 2002-02-27 Zack Weinberg <zack@codesourcery.com>
134 * builtins.c, decl.c: Delete traditional-mode-related code
135 copied from the C front end but not used, or used only to
136 permit the compiler to link.
138 2002-02-22 Tom Tromey <tromey@redhat.com>
140 Fix for PR java/2369:
141 * jvspec.c (verify_class_name): New function.
142 (lang_specific_driver): Call it.
143 (JAVA_START_CHAR_P): New macro.
144 (JAVA_PART_CHAR_P): Likewise.
146 2002-02-22 Per Bothner <per@bothner.com>
148 * class.c: Change vtable to be more compatible with g++ v3 abi.
149 (get_dispatch_table): Prepend offset-to-top (always 0) and
150 type_info pointer (currently unimplemented hence NULL) to vtable.
151 Specifically, prepend offset-to-top and typeinfo ptr (currently null).
152 (make_class_data): Variable dtable_start_offset is sizeof 2 pointers.
153 Adjust vtable pointers by dtable_start_offse - i.e. skip new words.
154 (build_dtable_decl): Add declarations for new fields.
156 2002-02-20 Per Bothner <per@bothner.com>
158 * parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
159 to finit$ (otherwise generate_bytecode_insns drops it). However, we
160 don't need to set it on the COMPOUND_EXPR - the caller does that.
162 2002-02-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
164 * gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option
165 `--CLASSPATH' becomes `--classpath.'
166 * gjavah.c: Likewise.
167 * jcf-dump.c: Likewise.
168 * lang-options.h: Likewise.
170 * jcf-path.c: Updated comment.
171 (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.'
172 (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.'
173 * jcf.h (jcf_path_CLASSPATH_arg): Ditto.
174 (jcf_path_CLASSPATH_arg): Ditto.
175 (classpath_u): Updated leading comment.
177 2002-02-20 Per Bothner <per@bothner.com>
179 * builtins.c (check_for_builtin): New function.
180 (build_call_or_builtin): Remove.
181 * java-tree.h: Update accordingly.
182 * expr.c (expand_invoke): Use build + check_for_builtin instead
183 of build_call_or_builtin.
184 * parse.y (patch_invoke): Likewise. This avoids needlessly creating
185 a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER
186 flag (which had caused jcf-write to incorrectly emit invokevirtual).
188 2002-02-17 Tom Tromey <tromey@redhat.com>
190 * java-tree.h (TYPE_STRICTFP): New macro.
191 (struct lang_type) [strictfp]: New field.
192 (CLASS_STRICTFP): New macro.
193 (METHOD_STRICTFP): New macro.
194 (struct lang_decl) [strictfp]: New field.
195 * parse.y (method_header): Disallow strictfp constructor or
197 (STRICT_TK): Move before MODIFIER_TK.
198 * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
199 (METHOD_MODIFIERS): Likewise.
200 (INTERFACE_MODIFIERS): Likewise.
201 * jcf-write.c (get_access_flags): Likewise.
202 * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
203 (add_method_1): Likewise.
204 (get_access_flags_from_decl): Likewise.
205 * jcf-dump.c (print_access_flags): Print in standard order. Also,
206 recognize strictfp flag.
207 * jcf.h (ACC_STRICT): New define.
209 2002-02-12 David Billinghurst <Davod.Billinghurst@riotinto.com>
211 * class.c(build_utf8_ref): Move declaration of decl_size
213 2002-02-07 Tom Tromey <tromey@redhat.com>
215 * gcj.texi (Input Options): --CLASSPATH does not suppress system
218 2002-02-04 Anthony Green <green@redhat.com>
220 * class.c (build_utf8_ref): Put UTF-8 constants into merged
221 sections if available.
223 2002-02-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
225 * parse.y (java_expand_classes): Fix typo in static field loop.
227 2002-02-02 Richard Henderson <rth@redhat.com>
229 * class.c (add_field): Mark static fields external.
230 (build_class_ref): Remove redundant set.
231 * parse.y (java_expand_classes): Mark static fields of classes
232 to be compiled as local.
233 * jcf-parse.c (parse_class_file): Likewise.
235 2002-02-02 Nic Ferrier <nferrier@tapsellferrier.co.uk>
237 * gcj.texi (About CNI): New node.
239 2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
242 * jcf-parse.c : Check for HAVE_LOCALE_H before using
243 setlocale() with LC_CTYPE as a parameter.
246 2002-01-31 Joseph S. Myers <jsm28@cam.ac.uk>
248 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
249 Follow GNU Coding Standards for --version.
251 2002-01-28 Tom Tromey <tromey@redhat.com>
253 * expr.c (build_jni_stub): Ensure storage for `meth' is
255 * parse.y (java_complete_expand_methods): Set
256 current_function_decl before building JNI stub.
258 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
260 * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not
263 2002-01-22 Tom Tromey <tromey@redhat.com>
265 * decl.c (java_init_decl_processing): Use add_predefined_file.
266 Predefine RawData.java.
267 (predef_filenames): Removed.
268 (java_init_decl_processing): Don't register predef_filenames.
269 * jcf-parse.c (add_predefined_file): New function.
270 (predefined_filename_p): Rewrote.
271 (predefined_filename_p): No longer static.
272 * decl.c (java_init_decl_processing): Call initialize_builtins.
273 * Make-lang.in (JAVA_OBJS): Added builtins.o.
274 (java/builtins.o): New target.
275 * builtins.c: New file.
276 * parse.y (patch_invoke): Use build_call_or_builtin.
277 * java-tree.h (build_call_or_builtin): Declare.
278 (initialize_builtins): Declare.
279 (java_set_exception_lang_code): Removed unused declaration.
280 (PREDEF_FILENAMES_SIZE): Removed.
281 (java_tree_index): Added JTI_PREDEF_FILENAMES.
282 (predef_filenames): New define.
283 (add_predefined_file): Declare.
284 (predefined_filename_p): Declare.
285 * expr.c (expand_invoke): Use build_call_or_builtin.
287 2002-01-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
289 * parse.y (patch_switch_statement): Fix format specifier.
291 2002-01-16 Tom Tromey <tromey@redhat.com>
293 More for PR java/5365:
294 * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
296 (process_file): Generate include for
297 java.lang.UnsupportedOperationExceptions.
299 2002-01-15 Andreas Jaeger <aj@suse.de>
301 * .cvsignore: Add man pages.
303 2002-01-15 Tom Tromey <tromey@redhat.com>
305 Fix for PR java/5365:
306 * gjavah.c (process_file): Turn class name into a file name.
308 2002-01-14 Matthias Klose <doko@debian.org>
310 * gcj.texi: Fix whitespace and formatting errors in the
311 synopsis of the man pages. Update copyright.
313 2002-01-14 Tom Tromey <tromey@redhat.com>
316 * Make-lang.in (java.install-man): Handle jv-convert man page.
317 (java.generated-manpages): Added jv-convert.1.
318 (java.uninstall): Remove jv-convert.1.
319 (java.maintainer-clean): Likewise.
320 ($(srcdir)/java/jv-convert.1): New target.
321 * gcj.texi (Top): Link to jv-convert node.
322 (Individual utilities): Likewise.
323 (Invoking jv-convert): New node.
325 2001-01-10 Jeff Sturm <jsturm@one-point.com>
326 Martin Kahlert <martin.kahlert@infineon.com>
328 * jcf-parse.c (get_constant): Don't swap lo/hi for big
329 endian targets when HOST_BITS_PER_WIDE_INT >= 64.
331 2002-01-03 Graham Stott <grahams@redhat.com>
333 * class.c (compile_resource_file): Update copyright date.
334 Constify filename parameter.
335 (java-tree.h): Update copyright date.
336 (compile_resource_file): Constify filename parameter.
338 2002-01-03 Graham Stott <grahams@redhat.com>
340 * gcc/jcf-parse.c: Update copyright date.
341 (yyparse): Constify resource_filename.
343 2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
345 * parse.y (src_parse_roots): Don't needlessly zero init.
347 2001-12-31 Tom Tromey <tromey@redhat.com>
349 * parse.y (dump_java_tree): New function.
350 (source_end_java_method): Call it.
351 (end_class_declaration): Likewise.
352 * lang.c (java_decode_option): Call dump_switch_p.
354 2001-12-28 Tom Tromey <tromey@redhat.com>
356 * gen-table.pl: Don't process characters after \uffff. Added
357 comment pointing to input file.
359 2001-12-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
361 * gen-table.pl: Const-ify output. Document the location of a
362 suitable unicode input file.
364 * chartables.h: Regenerate.
366 2001-12-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
368 * chartables.h: Const-ify.
369 * gjavah.c (options): Likewise.
370 * jcf-dump.c (options): Likewise.
371 * jv-scan.c (options): Likewise.
372 * lex.c (java_start_char_p, java_part_char_p): Likewise.
373 * parse.y (binop_lookup): Likewise.
375 2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
377 * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
378 the static arrays that are output.
379 * jvspec.c (jvgenmain_spec): Make static.
380 * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
381 * keyword.h: Regenerate.
382 * lang.c (string_option, process_option_with_no, lang_f_options,
383 lang_W_options): Const-ify.
384 * lex.c (java_lex): Likewise.
386 2001-12-21 Richard Henderson <rth@redhat.com>
388 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
389 (get_boehm_type_descriptor): ... here. Arrange for the
390 TREE_TYPE to get set properly.
392 2001-12-21 Richard Henderson <rth@redhat.com>
394 * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
395 only if the target requires collect2.
397 * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
399 2001-12-20 Tom Tromey <tromey@redhat.com>
402 * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
403 CAN_COMPLETE_NORMALLY for the node.
404 * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
405 generate code for second branch if first branch can't complete
407 (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
408 the loop head if the loop body can't complete normally.
410 2001-12-20 Tom Tromey <tromey@redhat.com>
413 * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
414 case where `finally' clause can't complete normally.
416 2001-12-20 Tom Tromey <tromey@redhat.com>
419 * parse.y (analyze_clinit_body): Added this_class parameter.
420 Check for more cases where we must keep <clinit>.
421 (maybe_yank_clinit): Cleaned up flow control.
423 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
425 * decl.c (java_init_decl_processing): Don't initialize
426 finit_leg_identifier_node.
427 * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
428 (finit_leg_identifier_node): Remove.
429 (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
431 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
433 * mangle.c (mangle_member_name): Don't special-case for
435 * mangle_name.c (unicode_mangling_length): Likewise.
436 (append_unicode_mangled_name): Likewise.
437 * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
440 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
442 * expr.c (build_java_array_length_access): Don't force null pointer
443 check unless flag_check_references is set.
445 2001-12-20 Tom Tromey <tromey@redhat.com>
447 Fix for PR java/3417:
448 * parse.y (patch_assignment): Added special processing for
450 (patch_return): Don't convert booleans to integers, and don't
453 2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
455 * config-lang.in (diff_excludes): Remove.
457 2001-12-17 Joseph S. Myers <jsm28@cam.ac.uk>
459 * gcj.texi: Update link to GCC manual.
461 2001-12-17 Tom Tromey <tromey@redhat.com>
463 * parse.y (link_nested_class_to_enclosing): Removed useless
466 2001-12-16 Tom Tromey <tromey@redhat.com>
468 * mangle.c (mangle_method_decl): Never emit `C2' constructor.
471 2001-12-16 Joseph S. Myers <jsm28@cam.ac.uk>
473 * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
474 jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
477 2001-12-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
479 * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
481 2001-12-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
483 * decl.c (java_init_decl_processing): Build otable_type correctly.
484 otable_decl is an otable_type.
486 2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
488 * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
489 otable_type, otable_ptr_type, method_symbol_type,
490 method_symbols_array_type, method_symbols_array_ptr_type): New
491 field/global tree definitions.
492 (flag_indirect_dispatch): New flag.
493 * decl.c (java_init_decl_processing): Initialize new otable and
494 otable_syms type nodes and decls. Add new field "index" to
496 * class.c (build_method_symbols_entry): New function.
497 (make_method_value): Set "index" to to method's vtable index for
498 virtual methods when indirect-dispatch is not used.
499 (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
500 and set vtable_method_count to -1. Set otable and otable_syms field
501 if indirect-dispatch is used and there was something to put in them.
502 (build_method_symbols_entry): New function.
503 (emit_offset_symbol_table): New function.
504 * expr.c (get_offset_table_index): New function.
505 (build_invokevirtual): Build array reference to otable at the index
506 returned by get_offset_table_index, and use the result as the vtable
508 (build_invokeinterface): Similar.
509 * jcf-parse.c (yyparse): If indirect-dispatch, call
510 emit_offset_symbol_table at the end of compilation, after all classes
512 * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
513 * lang.c (flag_indirect_dispatch): Define.
514 (lang_f_options): Add indirect-dispatch flag.
516 2001-12-14 Matthias Klose <doko@debian.org>
518 * gcj.texi: Markup for man page generation. Document missing
519 options printed by <tool> --help.
520 Terminate description of gij's -ms option with a dot.
521 * Make-lang.in ($(srcdir)/java/*.1): New targets.
522 (java.generated-manpages java.install-man, java.uninstall,
523 java-maintainer-clean) Updated.
525 2001-12-14 Hans Boehm <Hans_Boehm@hp.com>
527 * class.c (get_dispatch_table): Fix java vtable layout
528 for TARGET_VTABLE_USES_DESCRIPTORS.
529 * decl.c (java_init_decl_processing): Initialize
530 alloc_no_finalizer_node, finalize_identifier_node.
531 * expr.c (class_has_finalize_method): New function.
532 (expand_java_NEW): Generate calls for finalizer-free allocation.
533 (build_invokevirtual): Fix java vtable layout for
534 TARGET_VTABLE_USES_DESCRIPTORS.
535 * java-tree.h (enum java_tree_index): New entries:
536 JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
537 (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
538 (class_has_finalize_method): declare.
539 (HAS_FINALIZER_P): New macro.
540 * parse.y (patch_invoke): Generate calls for finalizer-free
543 2001-12-12 Matthias Klose <doko@debian.org>
545 * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
546 whitespace at end of line.
548 2001-12-11 Tom Tromey <tromey@redhat.com>
550 * lex.c (java_init_lex): Define wfl_to_string as
551 gnu.gcj.runtime.StringBuffer unless generating bytecode.
553 2001-12-11 Jeff Sturm <jsturm@one-point.com>
555 * class.c (make_method_value): Use null_pointer_node to
556 represent empty exception table.
558 2001-12-10 Tom Tromey <tromey@redhat.com>
560 * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
562 Mon Dec 10 06:09:57 2001 Douglas B. Rupp <rupp@gnat.com>
564 * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
566 2001-12-09 Per Bothner <per@bothner.com>
568 * check-init.c (current_switch_has_default): New static field.
569 (check_init): Case DEFAULT_EXPR: Set current_switch_has_default.
570 Case SWITCH_EXPR: Save/restore current_switch_has_default. If no
571 DEFAULT_EXPR seen, simulate a default alternative that copies state.
573 2001-12-09 Tom Tromey <tromey@redhat.com>
575 * check-init.c (check_init): Don't allow pre- or post- increment
576 or decrement of final variable.
577 (final_assign_error): Minor error message rewording.
579 2001-12-08 Tom Tromey <tromey@redhat.com>
581 * java-tree.h: Fixed typo.
583 * gjavah.c (decompile_method): Don't decompile to `return this'
586 * gjavah.c (cxx_keywords): Re-sorted.
587 * lex.c (cxx_keywords): Re-sorted.
589 * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
592 * gjavah.c (print_namelet): Clear subnamelets.
593 (HANDLE_METHOD): Set `method_printed' earlier.
595 2001-12-07 Tom Tromey <tromey@redhat.com>
597 * lang.c (lang_f_options): Added
598 optimize-static-class-initialization.
599 (java_decode_option): Removed special case.
601 2001-12-07 Per Bothner <per@bothner.com>
603 * check-init.c (check_init): Fix typo freeing memory twice.
605 2001-12-05 Per Bothner <per@bothner.com>
607 Restore support for static class initialization optimization.
608 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
609 * check-init.c (check_int): At end of BLOCK handle initialization
610 blocks, which used to be done in java_complete_expand_method but did
611 not handle the case where check_for_initialization might allocate
612 more than a word of bits.
613 * decl.c (lang_make_tree): The smic field is now a tree.
614 * expr.c (build_class_init): Set DECL_FUNCTION_INIT_TEST_CLASS field.
615 * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE): New macro.
617 * parse.y (emit_test_initialization): Combine hash_lookup calls.
619 * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
620 Change from a hash table to a list.
621 (struct_lang_decl): Change field 'smic' to match.
622 * class.c (add_method_1): Initialize
623 DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
624 * parse.y (adjust_init_test_initialization): Removed - inlined into -
625 (java_expand_method_bodies): -here, since 'smic' is now a list.
626 (patch_invoke): Add to 'smic' list, instead of hash_lookup.
628 * check-init.c (WORD_SIZE): Use BITS_PER_UNIT.
630 * class.c (java_hash_compare_tree_node): Fix casts.
632 2001-12-04 Per Bothner <per@bothner.com>
634 * check-init.c: Handle definite unassignment to finals in addition
635 to definite assignment.
636 (loop_current_locals): New field.
637 (num_current_locals, int start_current_locals, num_current_words):
639 (SET_P, CLEAR_P, SET_BIT): Add needed but missing parentheses.
640 (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
641 CLEAR_ASSIGNED, CLEAR_UNASSIGNED): New macros.
642 (get_variable_decl, check_final_reassigned): New functions.
643 (check_init, check_bool_init): Modify as needed for checking finals.
644 (check_for_initialization): Take extra parameter and return void.
645 Do extra start-up logic to check final fields for assignment.
646 * parse.y (check_static_final_variable_assignment_flag,
647 reset_static_final_variable_assignment_flag, check_final_assignment,
648 check_final_variable_local_assignment_flag,
649 reset_final_variable_indirect_assignment_flag,
650 reset_final_variable_global_assignment_flag): Remove functions.
651 (java_complete_expand_methods, outer_field_access_fix,
652 patch_assignment): Remove no-longer used logic.
653 * java-tree.h (DECL_FIELD_FINAL_IUD): Change usage and comments.
654 * parse.y (register_fields, java_complete_tree): Update accordingly.
656 * check-init.c (ALLOC_WORDS/FREE_WORDS): Use xmalloc/free, not alloca.
657 (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER): New.
658 (check_cond_init, check_bool2_init): Use DECLARE_BUFFERS.
660 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Temporarily turn off.
662 * java-tree.h (DECL FINAL): New bit-field.
663 (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL): Define as DECL_FINAL.
664 (LOCAL_FINAL_P): Use DECL_FINAL rather than old LOCAL_FINAL.
665 (DECL_INIT_CALLS_THIS): New macro.
666 (struct lang_decl): New bit-field init_calls_this.
667 (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
668 DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
669 (DECL_BIT_INDEX): Change to use pointer_alias_set since we now
670 use it for both local variables and final fields.
671 (struct lang_decl_var): Remove bit-fields final_liic, final_ierr,
673 (struct lang_type): Remove hfv bit-field.
674 (check_for_initialization): Change to return void.
676 * java-tree.h (IS_ARRAY_LENGTH_ACCESS): New macros.
677 * expr.c (build_java_array_length_access): Set IS_ARRAY_LENGTH_ACCESS.
678 * check-init.c (final_assign_error): New helper function.
679 (check_final_reassigned, check_init): Use it.
680 (check_init): Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
682 * java-tree.h (struct lang_decl, struct lang_decl_var): Change all
683 bit-fields to unsigned.
685 2001-12-03 Per Bothner <per@bothner.com>
687 * parse.y (patch_binop): Minor constant folding.
689 * parse.y (build_current_thisn): Shorter 'buffer'.
691 2001-12-03 Per Bothner <per@bothner.com>
693 * decl.c (complete_start_java_method): Now generate TRY_FINALLY_EXPR
694 instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
695 * jcf-write.c (generate_bytecode_insns): Remove support for
696 CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
697 * check-init.c (check_init): Likewise.
699 2001-12-03 Per Bothner <per@bothner.com>
701 * verify.c (subroutine_nesting): New function.
702 (verify_jvm_instructions): Use it to fix logic for checking that
703 we're done with the current subroutine.
705 * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
706 OPCODE_instanceof use POP_TYPE macro for better diagnostics.
708 2001-12-03 Per Bothner <per@bothner.com>
710 * jcf.h: Fix obvious typo in comment.
711 * typeck.c (build_null_signature): Add comment.
713 2001-12-03 Neil Booth <neil@daikokuya.demon.co.uk>
715 * expr.c: Remove leading capital from diagnostic messages, as
716 per GNU coding standards.
717 * jcf-io.c: Similarly.
718 * jcf-parse.c: Similarly.
719 * jv-scan.c: Similarly.
720 * jvspec.c: Similarly.
721 * mangle.c: Similarly.
723 2001-12-02 Tang Ching-Hui <nicholas@cs.nthu.edu.tw>
724 Alexandre Petit-Bianco <apbianco@redhat.com>
726 * expr.c (build_java_arrayaccess): Call save_expr on array for
727 correct evaluation order, modified comment, fixed indentation.
728 * parse.y: (patch_assignment): Correctly extract the array base
729 from the tree generate by build_java_arrayaccess, added comments.
730 (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
731 Fixes PR java/3096, PR java/3803, PR java/3965.
733 2001-12-01 Neil Booth <neil@daikokuya.demon.co.uk>
735 * expr.c (expand_byte_code): Remove trailing periods from messages.
736 * jcf-parse.c (load_class, jcf_parse): Similarly.
737 * jcf-write.c (generate_classfile): Similarly.
738 * lex.c (java_lex): Similarly.
740 2001-11-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
742 * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
744 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk>
746 * Make-lang.in (java.generated-manpages): New dummy target.
748 2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
750 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
752 (lang_specific_pre_link): Use set_input to set input_filename.
754 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
755 (main): Fix definition.
756 Strip `main' from classname.
759 2001-11-18 Roger Sayle <roger@eyesopen.com>
761 * parse.h (java_expand_switch): Remove old prototype.
763 2001-11-18 Tom Tromey <tromey@redhat.com>
765 Fix for PR java/1401:
766 * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
768 (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
771 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk>
773 * lang.c (finish_parse): Rename to java_finish.
774 (LANG_HOOKS_FINISH, java_finish): New.
776 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk>
778 * decl.c (init_decl_processing): Rename java_init_decl_processing.
779 * java-tree.h: New prototype.
780 * lang.c (java_init): Update prototype. Combine with old init_parse.
782 2001-11-13 Tom Tromey <tromey@redhat.com>
784 * gjavah.c (method_signature): New global.
785 (HANDLE_METHOD): Set it.
786 (decompile_return_statement): New function.
787 (decompile_method): Use it.
788 (print_method_info): Removed `synth' argument.
790 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
792 * java-tree.h (java_set_yydebug): New.
793 * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
794 * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
795 (print_lang_decl, print_lang_type, print_lang_identifier,
796 print_lang_statistics, lang_print_xnode): Remove.
798 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
800 * jcf-parse.c (init_lex): Remove.
801 * lang.c (language_string, lang_identify): Remove.
802 (struct lang_hooks): Constify.
803 (LANG_HOOKS_NAME): Override.
804 (init_parse): Update.
806 2001-11-08 Andreas Franck <afranck@gmx.de>
808 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
809 program_transform_name the way suggested by autoconf.
810 (java.install-common): Also transform auxiliary program names with
811 program_transform_name.
813 2001-11-08 Tom Tromey <tromey@cygnus.com>
815 * parse.y (trap_overflow_corner_case): New rule.
816 (unary_expression): Use it.
817 * lex.c (java_init_lex): Don't set minus_seen.
818 (yylex): Don't use minus_seen. Communicate overflow to parser for
820 (error_if_numeric_overflow): New function.
821 * parse.h (minus_seen): Removed field.
822 (JAVA_RADIX10_FLAG): New define.
824 2001-11-07 Tom Tromey <tromey@redhat.com>
826 Patch for PR java/1414:
827 * parse.y (case_label_list): New global.
828 (goal): Register case_label_list with GC.
829 (java_complete_lhs): Save new case on case_label_list.
830 (patch_switch_statement): Check for duplicate case labels.
832 2001-11-07 Alexandre Petit-Bianco <apbianco@redhat.com>
834 * parse.y (patch_assignment): Removed unused third argument.
835 (java_complete_lhs): Removed unused third argument to patch_assignment.
837 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk>
839 * lang.c: Include langhooks-def.h.
840 * Make-lang.in: Update.
842 2001-10-31 Zack Weinberg <zack@codesourcery.com>
844 * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
846 2001-10-29 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
848 * mangle.c (find_compression_record_match): Don't match compression
849 records for package name elements unless they occur at the start of
850 the name. Fix for PR java/4717.
852 2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
854 * expr.c (expand_java_field_op): Don't special-case references to
855 java.lang.PRIMTYPE.TYPE.
856 (build_primtype_type_ref): Removed.
857 * java-tree.h (build_primtype_type_ref): Remove prototype.
858 * parse.y (maybe_build_primttype_type_ref): Removed.
859 (complete_function_arguments): Don't special-case references to
860 java.lang.PRIMTYPE.TYPE.
861 (patch_assignment): Likewise.
862 (array_constructor_check_entry): Likewise.
864 2001-10-24 Alexandre Petit-Bianco <apbianco@redhat.com>
866 * mangle.c (static tree compression_table): Fixed leading comment.
867 * parse.h (struct parser_ctxt): Fixed field comment.
868 * parse.y (check_pkg_class_access): New prototype, fixed leading
869 comment, new parameter used to emit error only if passed as true.
870 (parse_check_super): Pass extra argument to check_pkg_class_access.
871 (do_resolve_class): Likewise.
872 (process_imports): Likewise.
873 (read_import_dir): Fixed indentation.
874 (find_in_imports_on_demand): New local class_type_name. Local
875 node_to_use deleted. while loop changed into for loop. Report
876 multiple definition only for accessible classes. Improved error
878 (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
879 assigned to parameter list, fixed indentation. while loop changed
880 into for loop, restore TREE_CHAIN on local `tem' before the next
883 Tue Oct 23 14:02:17 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
885 * lang.c (lang_get_alias_set): Deleted.
887 2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
889 * gjavah.c (jni_print_char): Fix thinko in last change.
891 * gjavah.c (jni_print_char, decode_signature_piece): Use
892 safe-ctype macros and/or fold extra calls into fewer ones.
893 * lex.c (java_read_unicode, java_lex): Likewise.
894 * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
895 JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
896 * mangle_name.c (append_unicode_mangled_name,
897 unicode_mangling_length): Likewise.
899 2001-10-17 Richard Henderson <rth@redhat.com>
901 * Make-lang.in (java/lang.o): Depend on langhooks.h.
903 2001-10-15 Alexandre Petit-Bianco <apbianco@redhat.com>
905 * lang.c (langhooks.h): Included.
906 (LANG_HOOKS_INIT): Redefined.
907 (LANG_HOOKS_INIT_OPTIONS): Likewise.
908 (LANG_HOOKS_DECODE_OPTION): Likewise.
909 (struct lang_hooks lang_hooks): New initialization.
911 2001-10-11 Per Bothner <per@bothner.com>
913 * parse.y (patch_synchronized_statement): Use a TRY_FINALLY_EXPR
914 rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
915 The former is simpler, and jcf-write.c handles it better.
916 (java_complete_lhs): No longer need to handle CLEANUP_POINT_EXPR
917 or WITH_CLEANUP_EXPR.
918 * jcf-write.c: Revert Alex's change from 2000-10-18. It is no
919 longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
921 * parse.y (patch_if_else_statement): If the condition is constant,
922 optimize away the test.
924 2001-10-09 Alexandre Petit-Bianco <apbianco@redhat.com>
926 * parse.y (patch_cast): Call patch_string on the first operand of
927 the incoming node, update it if necessary. Fixes PR java/4510.
929 2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
931 * parse.y (find_as_inner_class): Don't disregard the enclosing scope
932 when name qualifier matches a package name.
934 2001-10-08 Tom Tromey <tromey@redhat.com>
936 Fix for PR java/4489:
937 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
938 force a new label when computing `body_block'.
940 2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
942 * jcf-io.c (format_uint): Const-ify.
943 * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
944 * lex.c (java_get_line_col): Likewise.
945 * parse.y (build_incdec): Likewise.
947 2001-10-05 Alexandre Petit-Bianco <apbianco@redhat.com>
949 * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
950 a NULL enclosing context if appropriate. Fixes PR java/4466.
952 2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
954 * parse.y (patch_assignment): Use lvalue's original TYPE when
955 building the final COMPOUND_EXPR.
956 (try_reference_assignconv): Fixed leading comment.
958 2001-09-26 Alexandre Petit-Bianco <apbianco@redhat.com>
960 * parse.y (check_final_variable_indirect_assignment): For
961 COMPOUND_EXPR, return only if finals were found initialized
962 properly, if not, keep on checking.
963 (check_final_variable_global_assignment_flag): New local
964 error_found, set when appropriate and used to decide whether to
965 report uninitialized finals. Fixed typo in comment.
967 2001-09-22 Alexandre Petit-Bianco <apbianco@redhat.com>
969 * decl.c (init_decl_processing): Fixed typo in predef_filenames
970 last three initializations. Fixes PR java/4360.
972 2001-09-21 Richard Henderson <rth@redhat.com>
974 * class.c (get_dispatch_table): Handle function descriptors.
975 (build_dtable_decl): Likewise.
976 * expr.c (build_invokevirtual): Likewise.
978 2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
980 * parse.y (patch_method_invocation): Build class initialization
981 when static finals are used to qualify method invocation.
984 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
986 * parse.h: (WFL_STRIP_BRACKET): Re-written using
987 build_type_name_from_array_name.
988 (STRING_STRIP_BRACKETS): New macro.
989 * parse.y (build_type_name_from_array_name): New function.
990 (array_creation_expression:): Accumulate []s instead of [s.
991 (cast_expression:): Accumulate []s instead of [s after cast type
993 (build_array_from_name): Local string deleted, use
994 build_type_name_from_array_name.
995 (build_unresolved_array_type): Accumulate []s instead of [s after
997 (register_fields): Fixed comment.
998 (resolve_class): Local name, base deleted, new locals tname and
999 array_dims. Use build_type_name_from_array_name. Use array_dims to
1001 (purify_type_name): Use STRING_STRIP_BRACKETS.
1003 2001-09-18 Andreas Jaeger <aj@suse.de>
1005 * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
1006 * jv-scan.c: Likewise.
1008 2001-09-17 Alexandre Petit-Bianco <apbianco@redhat.com>
1010 * parse.y (patch_method_invocation): Inner class creation context
1011 check not enforced within constructors. Fixes PR java/1873.
1013 2001-09-16 Tom Tromey <tromey@redhat.com>
1015 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
1016 NOTE_PUSH for single-case push. Fixes PR java/4189.
1018 2001-09-13 Alexandre Petit-Bianco <apbianco@redhat.com>
1020 * java-tree.h (TYPE_IMPORT_LIST): New macro.
1021 (TYPE_IMPORT_DEMAND_LIST): Likewise.
1022 (struct lang_type): New fields import_list and import_demand_list.
1023 * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
1024 TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
1025 (do_resolve_class): New local saved_enclosing_type, initialized,
1026 passed as parameter to find_in_imports and find_in_imports_on_demand.
1027 (find_in_imports): Added paramater enclosing_type, use its
1028 TYPE_IMPORT_LIST when applicable.
1029 (find_in_imports_on_demand): Added parameter enclosing_type, use
1030 its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
1031 declaration and initialization.
1032 (fold_constant_for_init): Switch/restore current_class to the
1033 appropriate context.
1035 2001-09-13 Mark Mitchell <mark@codesourcery.com>
1037 * verify.c (verify_jvm_instructions): Fix typo.
1039 2001-09-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1041 * expr.c (expand_invoke): Const-ification.
1042 * parse.y (patch_method_invocation): Likewise.
1044 2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1046 * gjavah.c (cxx_keywords): Const-ification.
1047 * keyword.gperf (java_keyword): Likewise.
1048 * lang.c (java_tree_code_name): Likewise.
1049 * lex.c (cxx_keywords): Likewise.
1050 * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
1052 2001-09-11 Richard Henderson <rth@redhat.com>
1054 * parse.h (ctxp_for_generation): Mark extern.
1056 2001-09-10 Richard Henderson <rth@redhat.com>
1058 * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
1060 2001-09-07 Matt Kraai <kraai@alumni.carnegiemellon.edu>
1062 * typeck.c (java_array_type_length, build_prim_array_type):
1063 Represent empty arrays by NULL index.
1065 2001-09-06 Alexandre Petit-Bianco <apbianco@redhat.com>
1067 * java-tree.h (compile_resource_file): Grouped with other prototypes.
1068 * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
1070 2001-09-06 Anthony Green <green@redhat.com>
1072 * class.c (O_BINARY): Define if necessary.
1073 (registerResource_libfunc): Declare.
1074 (init_class_processing): Initilize registerResource_libfunc.
1075 (compile_resource_file): New function.
1076 * java-tree.h (resource_name): Declare.
1077 (compile_resource_file): Declare.
1078 * jcf-parse.c (yyparse): Handle compiling java resource files.
1079 * lang.c (java_decode_option): Handle -fcompile-resource option.
1080 * jvspec.c (lang_specific_driver): Handle -R flag for compiling
1082 * gcj.texi (Code Generation): Add documentation for -R flag.
1084 2001-09-05 Alexandre Petit-Bianco <apbianco@redhat.com>
1086 * jcf-write.c (generate_classfile): Issue an error in case of
1087 field/initial value mismatch.
1088 * parse.y (analyze_clinit_body): Keep <clinit> if an array is
1089 being initialized and we're generating bytecode.
1090 (java_complete_lhs): In MODIFY_EXPR section: added comments,
1091 set DECL_INITIAL properly when appropriate.
1095 2001-09-01 Per Bothner <per@bothner.com>
1097 * parse.y (maybe_yank_clinit): A field without an initializer is not
1098 relevant. All initializers except static final and constant require
1099 <clinit>, regardless of flag_emit_class_files.
1101 2001-08-31 Per Bothner <per@bothner.com>
1103 * class.c (set_constant_value): When not emiting class files, then a
1104 String ConstantValue is a utf8const_ptr_type.
1106 2001-08-30 Per Bothner <per@bothner.com>
1108 * jcf-write.c (generate_classfile): Check that field is primitive
1109 or string before emitting ConstantValue attribute.
1111 2001-08-30 Per Bothner <per@bothner.com>
1113 * parse.y (resolve_qualified_expression_name): If creating a
1114 COMPOUND_EXPR, set it's type correctly.
1116 2001-08-30 Per Bothner <per@bothner.com>
1118 * jcf-io.c (open_class): Set filename field.
1120 * jcf-parse,c (parse_class_file): Set current_function_decl
1121 for better error message when Code attribute is missing.
1123 * lang.c (put_decl_node, lang_print_error): Re-arrange for
1124 better diagnostics, especially for constructors.
1126 2001-08-30 Per Bothner <per@bothner.com>
1128 * jcf-write.c (generate_classfile): Don't write ConstantValue
1129 attribute if field is not final, for compatibility with jdk.
1131 * jcf-write.c (generate_classfile): Convert ConstantValue values
1132 to correct type. Work-around for front-end bug.
1133 * class.c (set_constant_value): Error if constant has wrong type.
1135 2001-08-30 Per Bothner <per@bothner.com>
1137 * jcf-dump.c (print_constant): Fix fencepost error so "Float" and
1138 "Double" are printed at verbosity 1.
1140 * jcf-dump.c (main): Disable flag_print_attributes if --javap.
1142 * jcf-dump.c (SPECIAL_IINC): Remove unneeded casts to long.
1144 2001-08-30 Alexandre Petit-Bianco <apbianco@redhat.com>
1146 * parse.y (patch_assignment): Don't verify final re-assignment here.
1147 (java_complete_lhs): Verify assignments to finals calling
1148 patch_assignment. Verify re-assignments to finals before calling
1151 2001-08-29 Alexandre Petit-Bianco <apbianco@redhat.com>
1153 * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
1156 2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
1158 * lex.c (java_lex): new local found_hex_digits. Set and then used
1159 in test to reject invalid hexadecimal numbers.
1160 * parse.y (java_complete_tree): Prevent unwanted cast with
1161 initialized floating point finals.
1162 (patch_binop): Emit a warning when detecting a division by zero,
1163 mark result not constant, don't simplify non integer division.
1165 2001-08-28 Per Bothner <per@bothner.com>
1167 * jcf-write.c (generate_bytecode_insns): For increments and
1168 decrements just recurse to push constant. Improvement on Mark's patch.
1170 2001-08-28 Mark Mitchell <mark@codesourcery.com>
1172 * jcf-write.c (generate_bytecode_insns): Generate an integer to
1173 real conversion for increments and decrements of reals.
1175 2001-08-27 Alexandre Petit-Bianco <apbianco@redhat.com>
1177 * parse.y (resolve_qualified_expression_name): Handle unresolved
1178 qualified expressions, prevent numerical qualifiers, fixed typo.
1181 2001-08-24 Alexandre Petit-Bianco <apbianco@redhat.com>
1183 * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
1184 don't report anything but deprecated class when marked so. Handle
1186 (patch_method_invocation): Check deprecation on methods and types.
1187 (patch_binop): code becomes an enum tree_code, added default: to
1188 switch to handle that. Detect division by zero, try to fold and
1189 return before using a subroutine.
1191 2001-08-23 Alexandre Petit-Bianco <apbianco@redhat.com>
1193 * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
1194 file smaller than 4 bytes.
1195 * parse.y (check_inner_circular_reference): New function.
1196 (check_circular_reference): Likewise.
1197 (array_initializer:): Accept {,}.
1198 (java_check_circular_reference): Rewritten using
1199 check_circular_reference and check_inner_circular_reference.
1200 (java_complete_expand_method): Unconditionally save and restore
1201 the unpurged exception list.
1202 (build_dot_class_method_invocation): Unmangle signature parameter.
1204 2001-08-21 Tom Tromey <tromey@redhat.com>
1206 * decl.c (init_decl_processing): Add `throws' field to method
1208 * class.c (make_method_value): Compute `throws' field for method.
1210 2001-08-22 Alexandre Petit-Bianco <apbianco@redhat.com>
1212 * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
1213 circularity is detected.
1214 (ctors_unchecked_throws_clause_p): Fixed leading comment.
1216 2001-08-17 Richard Henderson <rth@redhat.com>
1218 * class.c (emit_register_classes): Add align parameter to
1219 call to assemble_integer.
1221 2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com>
1223 * jcf-parse.c (load_class): New locals saved and class_loaded. If
1224 loading a class_or_name fails, try considering an innerclass name
1225 and load the enclosing context.
1226 * parse.y (resolve_inner_class): New function.
1227 (find_as_inner_class): Added leading comment.
1228 (register_incomplete_type): Keep the current context as enclosing
1229 context for JDEP_FIELD dependencies.
1230 (do_resolve_class): Locals new_class_decl and super initialized to
1231 NULL. Call resolve_inner_class, explore the enclosing context
1232 superclass if necessary.
1235 2001-08-16 Tom Tromey <tromey@redhat.com>
1237 * jcf-dump.c (main): Updated for change to jcf_path_seal.
1238 * gjavah.c (main): Updated for change to jcf_path_seal.
1239 * lang.c (version_flag): New global.
1240 (java_decode_option): Recognize `-version'.
1241 (java_init): Update for change to jcf_path_seal.
1242 * jcf.h (jcf_path_seal): Added `print' argument.
1243 * jcf-path.c (jcf_path_seal): Added `print' argument.
1245 2001-08-13 Zack Weinberg <zackw@panix.com>
1247 * Make-lang.in (java/decl.o): Update dependencies.
1248 * decl.c: Include libfuncs.h, don't include toplev.h.
1250 2001-08-12 Alexandre Petit-Bianco <apbianco@redhat.com>
1252 * decl.c (init_decl_processing): exception_type_node,
1253 class_not_found_type_node, and no_class_def_found_type_node
1254 initialized. predef_filenames augmented accordingly.
1255 instinit_identifier_node initialized.
1256 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
1257 * java-tree.h (enum java_tree_index): New entries
1258 JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
1259 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
1260 (exception_type_node): New macro.
1261 (class_not_found_type_node): Likewise.
1262 (no_class_def_found_type_node): Likewise.
1263 (instinit_identifier_node): Likewise.
1264 (PREDEF_FILENAMES_SIZE): Adjusted.
1265 (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
1266 (struct lang_type): Fixed typo in bitfield name.
1267 (DECL_INSTINIT_P): New macro.
1268 (ID_INSTINIT_P): Likewise.
1269 * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
1271 * parse.y (encapsulate_with_try_catch): New function.
1272 (generate_instinit): Likewise.
1273 (build_instinit_invocation): Likewise.
1274 (ctors_unchecked_throws_clause_p): Likewise.
1275 (add_instance_initializer): Deleted.
1276 (build_instance_initializer): Likewise.
1277 (in_instance_initializer): Likewise.
1278 (check_method_redefinition): instinit$ not to be verified.
1279 (java_complete_expand_methods): Generate instinit$, simplified code.
1280 (build_dot_class_method): Eliminated unnecessary locals. Use
1281 encapsulate_with_try_catch, removed unnecessary code.
1282 (fix_constructors): New local iii. Use build_instinit_invocation.
1283 (patch_method_invocation): Added comment.
1284 (maybe_use_access_method): Don't consider instinit$.
1285 (find_applicable_accessible_methods_list): Shorten the search for
1287 (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
1288 (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
1289 (patch_throw_statement): Likewise. Fixed typo.
1291 2001-08-12 David Edelsohn <edelsohn@gnu.org>
1294 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1295 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1297 (lang_specific_pre_link): Use set_input to set input_filename.
1299 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1300 (main): Fix definition.
1301 Strip `main' from classname.
1304 2001-08-11 Zack Weinberg <zackw@panix.com>
1306 * lex.h: Don't include setjmp.h. Don't define
1307 SET_FLOAT_HANDLER or prototype set_float_handler.
1309 2001-08-09 Alexandre Petit-Bianco <apbianco@redhat.com>
1311 * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
1312 `poplevel' in the right order.
1314 2001-08-09 Richard Henderson <rth@redhat.com>
1316 * Make-lang.in (class.o): Depend on TARGET_H.
1317 * class.c (emit_register_classes): Use target hooks instead of
1318 assemble_constructor and assemble_destructor.
1320 2001-08-08 Alexandre Petit-Bianco <apbianco@redhat.com>
1322 * check-init.c (flags.h): Include
1323 (check_init): Don't report uninitialized static class
1324 initialization flags, don't free bit index when doing static class
1325 initialization optimization.
1326 (check_for_initialization): Return type changed to `unsigned int.'
1327 (attach_initialized_static_class): New function.
1328 * class.c (add_method_1): Create the initialized static class
1330 (finish_class): Always emit deferred inline methods.
1331 * decl.c (emit_init_test_initialization): Moved to expr.c
1332 (complete_start_java_method): Don't traverse
1333 DECL_FUNCTION_INIT_TEST_TABLE.
1334 (lang_mark_tree): Mark hash tables in function decls.
1335 * expr.c (emit_init_test_initialization): Moved from decl.c.
1336 (build_class_init): Create LAG_DECL_SPECIFIC for the static class
1337 initialization flag, set DECL_CONTEXT and
1338 LOCAL_CLASS_INITIALIZATION_FLAG.
1339 (java_lang_expand_expr): Emit initialization code for static class
1340 initialized flags when entering block, if necessary.
1341 * gcj.texi (-fno-optimize-static-class-initialization): Documented.
1342 * java-tree.h (flag_optimize_sci): New global variable declaration.
1343 (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
1344 (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
1345 (LOCAL_FINAL_P): Fixed typo in comment.
1346 (FINAL_VARIABLE_P): Likewise.
1347 (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
1348 (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
1349 (struct lang_decl): New fields `ict', `smic' and `cif.'
1350 (check_for_initialization): New returned value for global.
1351 (attach_initialized_static_class): New global function.
1352 (STATIC_CLASS_INIT_OPT_P): New macro.
1353 * lang-options.h (-fno-optimize-static-class-initialization): New flag.
1354 * lang.c (java_decode_option): Handle
1355 `-fno-optimize-static-class-initialization'
1356 * parse.y (start_complete_expand_method): New function.
1357 (java_expand_method_bodies): Likewise.
1358 (attach_init_test_initialization_flags): Likewise.
1359 (adjust_init_test_initialization): Likewise.
1360 (emit_test_initialization): Likewise.
1361 (java_complete_expand_methods): Nullify abstract and native method
1363 (java_complete_expand_method): New locals `fbody', `block_body'
1364 and `exception_copy.' Reorganized: directly return on empty method
1365 bodies, call `start_complete_expand_method', remember definitely
1366 initialized static class in function, don't expand method bodies.
1367 (java_expand_classes): Call `java_expand_method_bodies' before
1368 `finish_class' when compiling to native.
1369 (resolve_expression_name): Use `orig' after building outer class
1371 (patch_invoke): Remember static method invokations.
1373 2001-08-06 Richard Henderson <rth@redhat.com>
1375 * class.c (emit_register_classes): Pass a symbol_ref and priority
1376 to assemble_constructor.
1378 2001-08-02 Alexandre Petit-Bianco <apbianco@redhat.com>
1380 * java-tree.h (all_class_filename): New macro.
1381 (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
1382 (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
1383 newly created IDENTIFIER_NODE to `all_class_filename.'
1385 2001-08-01 Jeff Sturm <jsturm@one-point.com>
1387 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
1388 Use ggc_add_tree_root to register roots.
1390 2001-07-31 Alexandre Petit-Bianco <apbianco@redhat.com>
1392 * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
1393 second operand calling check_init.
1394 * decl.c (complete_start_java_method): Swaped second and third
1395 arguments while creating WITH_CLEANUP_EXPR node.
1396 * jcf-write.c (generate_bytecode_insns): Use second operand
1397 instead of third when handling WITH_CLEANUP_EXPR.
1398 * parse.y (java_complete_lhs): Expand second operand of
1399 WITH_CLEANUP_EXPR nodes.
1400 (patch_synchronized_statement): Swaped second and third arguments
1401 while creating WITH_CLEANUP_EXPR node.
1403 2001-07-18 Alexandre Petit-Bianco <apbianco@redhat.com>
1405 * parse.y (create_interface): Avoid cyclic inheritance report when
1406 syntax error encountered during class definition.
1409 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1411 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1413 (lang_specific_pre_link): Use set_input to set input_filename.
1415 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1416 (main): Fix definition.
1417 Strip `main' from classname.
1420 2001-07-18 Tom Tromey <tromey@redhat.com>
1423 * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
1424 * lex.c (java_new_lexer): Use ICONV_CONST.
1425 (java_read_char): Likewise.
1426 * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
1427 (jv-scan$(exeext)): Likewise.
1429 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
1431 * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
1432 * parse.y (check_class_interface_creation): Allow `private' if the
1433 enclosing is not an interface.
1434 (create_interface): Interface tagged public if the enclosing
1435 context is an interface.
1436 (create_class): Class tagged public if the enclosing context
1440 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
1442 * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
1445 2001-07-14 Tim Josling <tej@melbpc.org.au>
1447 * check-init.c (check_init): Remove references to EXPON_EXPR.
1449 2001-07-13 Alexandre Petit-Bianco <apbianco@redhat.com>
1451 * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
1452 TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
1455 2001-07-13 Tom Tromey <tromey@redhat.com>
1457 * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
1460 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
1462 * parse.y (patch_method_invocation): Don't override primary if one
1463 is already provided, but let this$<n> be built. Fixed comment.
1465 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
1467 * parse.y (empty_statement:): Report empty statement error only
1468 when found at class declaration level.
1471 2001-07-12 Tom Tromey <tromey@redhat.com>
1473 * expr.c (expand_load_internal): New function.
1474 (LOAD_INTERNAL): Use it.
1476 2001-07-11 Alexandre Petit-Bianco <apbianco@redhat.com>
1478 * parse.y (verify_constructor_super): Compare anonymous class ctor
1479 args with `valid_method_invocation_conversion_p.'
1482 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
1484 * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
1485 `-fsyntax-only.' Fixes PR java/3248
1487 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
1489 * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
1491 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
1493 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
1494 current function is static. Fixes PR java/1970
1496 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
1498 * parse.y (patch_method_invocation): Add enclosing context to ctor
1499 calls if necessary. Fixes PR java/2953
1501 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
1503 * parse.y (resolve_package): Abort if qualified expression member
1505 (qualify_ambiguous_name): Don't qualify as type if `this' in use.
1508 2001-07-07 Zack Weinberg <zackw@stanford.edu>
1510 * verify.c: Don't use // comments.
1512 2001-07-05 Tom Tromey <tromey@redhat.com>
1514 * lang.c (flag_assume_compiled): Removed.
1515 * java-tree.h (flag_assume_compiled): Removed.
1516 * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
1517 -fhash-synchronization, -fuse-divide-subroutine,
1518 -fcheck-references, -femit-class-file, -femit-class-files,
1519 -fassume-compiled. Updated --encoding information. Changed
1520 -foutput-class-dir to `-d'.
1522 2001-07-04 Daniel Berlin <dan@cgsoftware.com>
1524 * jcf-parse.c (parse_class_file): Add lineno parameter to
1525 debug_start_source_file call.
1527 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
1529 * gcj.texi: Use gpl.texi.
1530 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
1531 dependencies and use doc/include in search path.
1533 2001-07-03 Jeff Sturm <jsturm@one-point.com>
1535 * parse.y (fix_constructors): Test if a CALL_EXPR invokes
1536 `this'. If so, don't build instance initializers.
1538 2001-07-03 Alexandre Petit-Bianco <apbianco@redhat.com>
1540 * parse.y (resolve_expression_name): Improved error message for
1541 inner class cases. Fixes PR java/1958
1543 2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
1545 * lang.c: #include diagnostic.h
1546 (lang_print_error): Add a `diagnostic_context *' parameter.
1547 (java_dummy_print): Likewise.
1548 * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
1550 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
1552 * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
1553 * jcf.h (typedef struct JCF): New bitfield `finished.'
1554 (JCF_FINISH): Set `finished.'
1555 (JCF_ZERO): Reset `finished.'
1558 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
1560 * parse.y (class_body_declaration:): Don't install empty instance
1564 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
1566 * class.c (set_super_info): Call `set_class_decl_access_flags.'
1567 (set_class_decl_access_flags): New function.
1568 * java-tree.h (set_class_decl_access_flags): New prototype.
1569 * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
1570 (parse_class_file): New local `decl_max_locals.' Take wide types
1571 into account to compute DECL_MAX_LOCALS.
1572 * parse.y (type_import_on_demand_declaration:): Ignore duplicate
1575 2001-06-22 Jan van Male <jan.vanmale@fenk.wau.nl>
1577 * zipfile.h: Use GCC_JCF_H instead of JCF_H.
1579 2001-06-20 Alexandre Petit-Bianco <apbianco@redhat.com>
1581 * class.c (java_hash_tree_node): Fixed indentation in leading comment.
1582 * parse.y (do_resolve_class): Moved comments out to leading comment
1583 section. Removed local `start', New local `_ht' and
1584 `circularity_hash.' Record `enclosing' in hash table and search
1585 it to detect circularity. Use `enclosing' as an argument to
1586 `lookup_cl.' Free the hash table when done.
1588 2001-06-19 Tom Tromey <tromey@redhat.com>
1590 * lex.c (java_read_char): Disallow invalid and overlong
1591 sequences. Fixes PR java/2319.
1593 2001-06-05 Jeff Sturm <jsturm@one-point.com>
1595 * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
1597 2001-06-04 Alexandre Petit-Bianco <apbianco@redhat.com>
1599 * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
1600 arguments accordingly.
1602 2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
1604 * gcj.texi: Move contents to just after title page.
1606 2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
1608 * parse.y (type_literals:): Use `build_incomplete_class_ref' with
1610 (patch_incomplete_class_ref): Build the class ref, build the class
1611 init if necessary, complete the tree.
1614 2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com>
1616 * parse.y (lookup_field_wrapper): Test `name' code.
1617 (resolve_qualified_expression_name): Test `qual_wfl' code.
1618 (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
1619 handle `qual_wfl' by code.
1620 (maybe_build_primttype_type_ref): Test `wfl' code.
1622 2001-05-23 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
1624 * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
1626 (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls. Create
1627 the dvi file in the java directory.
1629 2001-05-25 Sam TH <sam@uchicago.edu>
1631 * gen-table.pl javaop.h jcf.h lex.h,
1632 parse.h: Fix header include guards.
1634 2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
1636 * jv-scan.c (version): Update copyright year.
1638 2001-05-21 Per Bothner <per@bothner.com>
1640 * jcf-parse.c (read_class): If class is from .class or .zip file
1641 and it's already been read, don't push/pop parser context.
1643 2001-05-18 Per Bothner <per@bothner.com>
1645 * jvspec.c (lang_specific_pre_link): Re-arrange the linker
1646 command line so the jvgenmain-generated main program comes first.
1648 2001-05-15 Tom Tromey <tromey@redhat.com>
1650 * class.c (build_utf8_ref): Don't generate identifier based on
1653 2001-05-12 Richard Henderson <rth@redhat.com>
1655 * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
1656 * expr.c (java_lang_expand_expr): Expand it.
1657 (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
1658 calling build_exception_object_ref.
1659 * parse.y (catch_clause_parameter): Likewise.
1660 (build_dot_class_method): Likewise.
1661 (try_reference_assignconv): Likewise.
1662 * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
1663 * jcf-write.c (generate_bytecode_insns): Likewise.
1665 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
1667 * parse.y (build_unresolved_array_type): Set
1668 EXPR_WFL_QUALIFICATION on the newly created wfl.
1669 Fixes PR java/2538. Fixes PR java/2535.
1671 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
1673 * parse.y (fix_constructors): Removed unnecessary assignment to
1674 local. Moved assignment to `this$<n>', fixed comments and
1676 (build_wfl_wrap): Fixed indentation.
1677 Fixes PR java/2598, java/2579 and java/2658.
1679 2001-05-03 Mo DeJong <mdejong@redhat.com>
1681 * lex.c (java_new_lexer): Call iconv_close on temp handle used to
1682 check for byte swap.
1684 2000-05-02 Jeff Sturm <jsturm@one-point.com>
1686 * expr.c (build_class_init): Move MODIFY_EXPR
1687 outside of COND_EXPR. Remove variable `call'.
1689 2001-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1691 * decl.c: NULL_PTR -> NULL.
1692 * jcf-write.c: Likewise.
1694 2001-05-01 Tom Tromey <tromey@redhat.com>
1696 * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
1697 (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
1698 * gcj.texi: Updated copyright text. Include fdl.texi.
1699 (Top): Link to new node.
1701 2001-05-01 Per Bothner <per@bothner.com>
1703 * parse.h (REGISTER_IMPORT): Use tree_cons instead of chainon.
1705 2001-05-01 Per Bothner <per@bothner.com>
1707 * parse.y (java_pop_parser_context): The TREE_VALUE of a link in the
1708 import_list contains the name, not the TREE_PURPOSE.
1710 2001-04-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1712 * jcf-io.c (read_zip_member): Cast to long in comparison with
1715 * jvspec.c (lang_specific_driver): Initialize variables.
1717 * mangle.c (find_compression_record_match): Likewise.
1719 * typeck.c (build_null_signature): Provide static prototype. Mark
1720 parameter with ATTRIBUTE_UNUSED.
1722 * verify.c (verify_jvm_instructions): Initialize variable.
1724 2001-04-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1726 * parse.y (do_resolve_class): Check for cyclic inheritance during
1727 inner class resolution.
1729 2001-04-27 Per Bothner <per@bothner.com>
1731 * parse.y (java_expand_classes): Don't change ctxp_for_generation
1732 while iterating, since that could cause gc to lose stuff.
1734 2001-04-26 Per Bothner <per@bothner.com>
1736 Fix method search wrt scope of inner classes to match JLS2.
1737 * typeck.c (build_null_signature): New static function.
1738 (has_method): New function. Uses build_null_signature and lookup_do.
1739 * java-tree.h (has_method): New declaration.
1740 * parse.y (find_applicable_accessible_methods_list): Do not search
1741 context of inner classes here.
1742 (patch_method_invocation): Search scope, ie. current and outer clases,
1743 for method matching simple name, to find class.
1745 2001-04-26 Per Bothner <per@bothner.com>
1747 * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
1748 Fix thinko: If a single case, use if_icmpeq, not ifeq.
1750 * constants.c (find_methodref_with_class_index): New function.
1751 (find_methodref_index): Use find_methodref_with_class_index.
1752 * java-tree.h (find_methodref_with_class_index): New declaration.
1753 * jcf-write.c (generate_bytecode_insns case CALL_EXPR): Don't change
1754 DECL_CONTEXT, instead use new find_methodref_with_class_index function.
1755 If context changed from interface to class, don't use invokeinterface.
1757 2001-04-25 Per Bothner <per@bothner.com>
1759 * verify.c (verify_jvm_instructions): For field instructions,
1760 check that field index is valid. For invoke instructions, check that
1761 method index is valid.
1763 2001-04-25 Alexandre Oliva <aoliva@redhat.com>
1765 * config-lang.in (target_libs): Copy from $libgcj_saved.
1767 2001-04-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1769 * decl.c (init_decl_processing): Add new class "protectionDomain"
1771 * class.c (make_class_data): Set initial value for "protectionDomain".
1773 2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1775 * jvspec.c (lang_specific_driver): Fix memory allocation
1776 deficit, by using concat in lieu of xmalloc/sprintf.
1778 2001-04-20 Per Bothner <per@bothner.com>
1780 Fixes to compile multiple .class files at once.
1781 * decl.c (init_decl_processing): Don't set CLASS_LOADED_P.
1782 * java-tree.h (CLASS_PARSED_P): New macro.
1783 (CLASS_LOADED_P): Re-define to use TYPE_SIZE and CLASS_PARSED_P.
1784 * jcf-parse.c (jcf_parse_source): Inline into read_class.
1785 (read_class): Avoid some code duplication.
1786 Don't call JCF_FINISH for a .class file - might be needed later.
1787 (jcf_parse): Don't call layout_class here. Check/set CLASS_PARSED_P
1788 rather than CLASS_LOADED_P, since latter implies class laid out.
1789 (yyparse): Do layout_class and JCF_FINISh here instead, in pass 2.
1790 * parse.y: Don't need to set CLASS_LOADED_P for array types.
1792 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1794 * Make-lang.in (java/boehm.o): Depend on toplev.h.
1796 * boehm.c: Include toplev.h.
1798 2001-04-06 Tom Tromey <tromey@redhat.com>
1799 Alexandre Petit-Bianco <apbianco@redhat.com>
1801 Fix for PR gcj/1404 and PR gcj/2332:
1802 * parse.y (build_array_from_name): If we use the type_wfl then
1803 accumulate dimensions from the original type as well.
1804 (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
1806 2001-04-06 Tom Tromey <tromey@redhat.com>
1808 * parse.y (analyze_clinit_body): Return true if the second operand
1809 of a METHOD_EXPR is nonzero.
1811 2001-04-06 Tom Tromey <tromey@redhat.com>
1813 * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
1815 ($(srcdir)/java/parse.c): Likewise.
1817 2001-04-05 Alexandre Petit-Bianco <apbianco@redhat.com>
1819 * gcj.texi: Use `which-gcj' instead of `which-g77.'
1820 (version-gcc): Initialized.
1821 (which-gcj): Likewise.
1823 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
1825 * java-tree.h (struct lang_decl): New macro
1826 `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
1827 * parse.y (build_instance_initializer): New function.
1828 (add_instance_initializer): Use it.
1829 (java_fix_constructors): Set `current_class' before fix pass.
1830 (fix_constructors): Just return if already fixed. Move `super()'
1831 invokation ahead. Use `build_instance_initializer.'
1834 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
1836 * parse.y (resolve_qualified_expression_name): Pass field's
1837 DECL_CONTEXT to `not_accessible_p.'
1838 (not_accessible_p): Changed parameters order in `inherits_from_p'
1841 2001-03-27 Andrew Haley <aph@cambridge.redhat.com>
1843 * lang-options.h: Add flag_check_references.
1845 2001-04-04 Per Bothner <per@bothner.com>
1847 * java-tree.h (CONSTANT_VALUE_P): New macro.
1848 * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P.
1849 * parse.y (maybe_build_class_init_for_field): New static function.
1850 (resolve_expression_name, resolve_field_access): Use
1851 maybe_build_class_init_for_field instead of build_class_init
1852 This does not do the init if the field is compile-time-constant.
1853 (resolve_field_access): Simplify.
1855 * parse.y (fold_constant_for_init): Merge test into switch.
1857 2001-04-03 Zack Weinberg <zackw@stanford.edu>
1859 * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
1861 * buffer.c, jvgenmain.c: Don't include gansidecl.h.
1863 2001-04-02 Zack Weinberg <zackw@stanford.edu>
1865 * expr.c (pop_type_0): Save the result of the first
1866 lang_printable_name call in a scratch buffer, so it
1867 won't be clobbered by the second call.
1869 2001-03-30 Alexandre Petit-Bianco <apbianco@redhat.com>
1871 * parse-scan.y (array_type:): Rewritten.
1872 (type_declaration:): `empty_statement' replaces `SC_TK.'
1873 (class_member_declaration:): `empty statement' added.
1874 (method_body:): Simplified.
1875 (static_initializer:): Likewise.
1876 (primary_no_new_array:): Use `type_literals.'
1877 (type_literals:): New rule.
1878 (dims:): Set and update `bracket_count.'
1879 Fixes PR java/1074. Fixes PR java/2412.
1881 2001-03-28 Hans Boehm <boehm@acm.org>
1883 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
1884 (get_boehm_type_descriptor): Set type on returned value to be a
1885 pointer length integer.
1887 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1889 * expr.c (pop_type_0): Call `concat' rather than building the
1891 (pop_type): Add format specifier in call to `error'.
1893 * parse.y (patch_method_invocation): Avoid casting away
1896 2001-03-28 Jeffrey Oldham <oldham@codesourcery.com>
1898 * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
1900 2001-03-28 Richard Henderson <rth@redhat.com>
1902 IA-64 ABI Exception Handling:
1903 * Make-lang.in (except.o): Don't depend on eh-common.h.
1904 * check-init.c (check_init): Handle EXC_PTR_EXPR.
1905 * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
1906 [soft_exceptioninfo_call_node]: Remove.
1907 [eh_personality_libfunc, lang_eh_runtime_type]: New.
1908 (end_java_method): No emit_handlers.
1909 * except.c (java_set_exception_lang_code): Remove.
1910 (method_init_exceptions): Don't call it.
1911 (prepare_eh_table_type): No CATCH_ALL_TYPE.
1912 (build_exception_object_ref): New.
1913 (expand_end_java_handler): Update for except.h name changes.
1914 (emit_handlers, expand_resume_after_catch): Remove.
1915 * expr.c (java_lang_expand_expr): Update for except.h name changes.
1916 (process_jvm_instruction): Use build_exception_object_ref.
1917 * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
1918 (soft_exceptioninfo_call_node): Remove.
1919 (build_exception_object_ref): Declare.
1920 * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
1921 soft_exceptioninfo_call_node. Move processing ...
1922 [EXC_PTR_EXPR]: ... here.
1923 * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
1924 * parse.y (catch_clause_parameter): Use build_exception_object_ref.
1925 (source_end_java_method): No java_set_exception_lang_code or
1927 (build_dot_class_method): Use build_exception_object_ref.
1928 (try_reference_assignconv): Check EXC_PTR_EXPR not
1929 soft_exceptioninfo_call_node.
1931 2001-03-28 Richard Henderson <rth@redhat.com>
1933 * java-tree.h (throw_node): Define as a single member of
1934 java_global_trees instead of a separate array.
1935 (JTI_THROW_NODE): New.
1936 * decl.c (throw_node): Don't declare.
1937 (init_decl_processing): Init a scalar throw_node.
1938 Don't register it for gc.
1939 * check-init.c (check_init): Reference scalar throw_node.
1940 * expr.c (build_java_athrow): Likewise.
1941 * jcf-write.c (generate_bytecode_insns): Likewise.
1942 * parse.h (BUILD_THROW): Likewise.
1944 2001-03-28 Richard Henderson <rth@redhat.com>
1946 * decl.c (end_java_method): Do not save and restore
1947 flag_non_call_exceptions.
1948 * parse.y (source_end_java_method): Likewise.
1949 * lang.c (flag_exceptions): Don't declare.
1950 (java_init_options): Set flag_non_call_exceptions. Set
1951 flag_exceptions here ...
1952 (java_init): ... not here.
1954 2001-03-27 Richard Henderson <rth@redhat.com>
1956 * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
1957 exceptions_via_longjmp.
1959 * lang.c (flag_new_exceptions): Don't declare it.
1960 (java_init_options): Or set it.
1962 2001-03-27 Richard Henderson <rth@redhat.com>
1964 * decl.c (end_java_method): Rename asynchronous_exceptions to
1965 flag_non_call_exceptions.
1966 * parse.y (source_end_java_method): Likewise.
1968 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1970 * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
1972 2001-03-26 Mark Mitchell <mark@codesourcery.com>
1974 * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
1976 2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com>
1978 * parse.y (find_as_inner_class): Follow current package
1979 indications not to mistakingly load an unrelated class.
1981 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1983 * constants.c (PUTN): Use memcpy, not bcopy.
1985 * lex.c (java_read_char): Use memmove, not bcopy.
1987 * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
1989 2001-03-23 Per Bothner <per@bothner.com>
1991 * verify.c (verify_jvm_instructions): Replace 3 pop_type by POP_TYPE
1992 macro for better error pin-pointing.
1993 * java-tree.h: Fix typo in comment.
1995 * jcf-write.c (generate_bytecode_insns): Changes to TRY_FINALLY_EXPR.
1996 Don't include jsr/goto in exception range.
1997 Check if start and end of exception range are the same (also TRY_EXPR).
1998 Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
1999 However, do emit the following goto even if try_block is empty.
2000 Defer freeing exception_decl until after the finalizer, to make
2001 sure the local isn't reused in the finalizer. Fixes PR java/1208.
2003 * parse.y (java_complete_lhs): If the try-clause is empty, just
2004 return the finally-clause and vice versa.
2006 2001-03-23 Alexandre Petit-Bianco <apbianco@redhat.com>
2008 * gcj.texi (Input Options): documented the check for attribute
2009 `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
2010 * java-tree.h (flag_force_classes_archive_check): Declared extern.
2011 * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
2012 (jcf_parse): Check for the right classes archive if necessary.
2013 * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
2014 (jcf_parse_fields): Fixed indentation.
2015 * jcf-write.c (append_gcj_attribute): New function.
2016 (generate_classfile): Compute the attribute count, invoke
2017 `append_gcj_attribute'.
2018 * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
2019 turned into bit fields. New bit field `right_zip.'
2020 (JCF_ZERO): Set `right_zip' to zero.
2021 * lang-options.h (-fforce-classes-archive-check): Added flag.
2022 * lang.c (flag_force_classes_archive_check): New flag.
2023 (lang_f_options): New entry `force-classes-archive-check.'
2026 2001-02-07 Andrew Haley <aph@redhat.com>
2028 * gcj.texi (Configure-time Options): Add -fcheck-references.
2029 * expr.c (build_java_indirect_ref): New function.
2030 (java_check_reference): New function.
2031 (build_java_array_length_access): Use build_java_indirect_ref to
2032 check for null references.
2033 (build_java_arrayaccess): Likewise.
2034 (build_get_class): Likewise.
2035 (build_field_ref): Likewise.
2036 (invoke_build_dtable): Likewise.
2037 (build_invokeinterface): Likewise.
2038 * lang.c (lang_f_options): Add flag_check_references.
2039 * jvspec.c (jvgenmain_spec): Add flag_check_references.
2040 * java-tree.h (flag_check_references): New variable.
2041 * lang.c (flag_check_references): Likewise.
2042 * parse.y (patch_invoke): Use java_check_reference.
2043 (patch_assignment): Allow for extra nesting in
2044 _Jv_CheckArrayStore.
2046 2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
2048 * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
2049 * lex.c (cxx_keywords): Likewise.
2051 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
2053 * parse.y (qualify_ambiguous_name): Broaden `length'
2054 recognition. Help MODIFY_EXPR be resolved as expression names.
2055 Fixes PR java/2066. Fixes PR java/2400.
2057 2001-03-21 Bryce McKinlay <bryce@albatross.co.nz>
2059 * gjavah.c (process_file): Mark interface definitions with
2060 "__attribute__ ((java_interface))".
2062 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
2064 * class.c (layout_class): Fixed push_super_field's second
2065 argument. Fixes PR java/2333.
2066 (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
2067 too early to lay innerclasses out.
2069 2001-03-20 Tom Tromey <tromey@redhat.com>
2070 Alexandre Petit-Bianco <apbianco@redhat.com>
2072 * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
2073 inside an array reference. Insertion of the array store check
2074 rewritten. Fixes PR java/2299.
2076 2001-03-20 Tom Tromey <tromey@redhat.com>
2078 * lex.c (java_read_unicode): Only accept leading `u's.
2080 2001-03-20 Tom Tromey <tromey@redhat.com>
2082 * jcf-parse.c (read_class): Initialize `class'.
2084 2001-03-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
2086 * jcf_parse.c (jcf_parse): Eliminate unused variable.
2088 2001-03-19 Mark Mitchell <mark@codesourcery.com>
2090 * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
2091 (layout_class): Likewise.
2092 (layout_class_method): Likewise.
2093 (emit_register_classes): Likewise.
2094 * decl.c (builtin_function): Likewise.
2095 (give_name_to_locals): Likewise.
2097 2001-03-19 Per Bothner <per@bothner.com>
2099 * jcf-parse.c (load_inner_classes): Check CLASS_LOADED_P
2100 before trying to load an inner class.
2102 Fixes to process to command-line .class files in two passes.
2103 * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P): New flags.
2104 (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P): Rename to ..
2105 (CLASS_FROM_CURRENTLY_COMPILED_P): ... because it is more general now.
2106 * class.c (is_compiled_class): Fix for renamed flag.
2107 * parse.y (maybe_create_class_interface_decl): Likewise.
2108 * jcf-parse.c (yyparse): Also set if compiling .class files.
2109 * jcf-parse.c (read_class); Read current_class.
2110 (jcf_parse): Make static.
2111 (load_inner_classes): New function, with code moved from jcf_parse,
2112 because we need to inner classes after the command-line files are read.
2113 (yyparse): Set finput to NULL when it doesn't need to be closed.
2114 Reduce use of main_jcf (basically only for archive) and
2115 use finput instead of main_jcf->read_state.
2116 Inline jcf_figure_file_type into yyparse.
2117 Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
2118 Defer load_inner_classes and parse_class_file to a second pass,
2119 after we've correctly mapped command-line .clas fiels to classes.
2120 (jcf_figure_file_type): Removed.
2121 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): Removed flags.
2122 (JCF_ZERO): Also clear zipd field.
2123 * zipfile.h: Conditionalize on JCF_H insread of JCF_ZIP.
2125 2001-03-18 Matt Kraai <kraai@alumni.carnegiemellon.edu>
2127 * jcf-parse.c (yyparse): Change ch from char * to char.
2129 2001-03-19 Per Bothner <per@bothner.com>
2131 * jvspec.c (lang_specific_driver): Check for .zip and .jar files.
2132 Add constructed filelist-file at end, following -xjava. Thus any .o
2133 and library files are not affected by the -xjava. Also wrap
2134 explicit @FILE with -xjava and -xnone.
2136 2001-03-19 Andrew Haley <aph@cambridge.redhat.com>
2138 * class.c (build_static_field_ref): Call make_decl_rtl() after
2139 setting the DECL_EXTERNAL flag.
2141 2001-03-17 Per Bothner <per@bothner.com>
2143 * decl.c (clear_binding_level): Fix initializer (broke 03-15).
2145 * jcf-write.c (generate_bytecode_insns): Handle emitting iinc
2146 when result is is needed (target is STACK_TARGET).
2148 * parse.h (JDEP_SOLV): Removed.
2149 * parse.y (register_incomplete_type): Use JDEP_TO_RESOLVE instead.
2151 * parse.y (incomplete_class_list): Removed.
2152 (obtain_incomplete_type): Don't use or set incomplete_class_list.
2153 It doesn't work if resolve_class changes the name of an array type
2154 that is on the list and then someone else looks for the modified name.
2155 Also, seems liable to break when compiling multiple source files at
2156 once. So the simplest is to just remove incomplete_class_list -
2157 it is only a minor space win and it is not even clear it saves time.
2159 * parse.y (resolve_class): Remove unneeded promote_type.
2161 2001-03-15 Per Bothner <per@bothner.com>
2163 * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
2164 * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
2165 * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
2166 Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
2168 * jcf-parse.c (yyparse): Set/reset input_filename for source file.
2169 * parse.y (java_expand_classes): Likewise.
2171 * parse.y (expand_start_java_method): Was only called once and had a
2172 misleading name, so inline in caller java_complete_expand_method.
2173 (enter_a_block): Likewise inline in enter_block and remove.
2175 Remove junk from when gcc/java was created (by copying from C/C++).
2176 * decl.c (keep_next_level_flag, keep_next_if_subblocks): Remove.
2177 (struct binding_level): Remove fields keep, keep_if_subblocks,
2178 more_cleanups_ok, have_cleanups (which have never been used).
2179 (pushlevel, poplevel): Remove related useless code.
2181 * class.c (make_class_data): The class_dtable_decl (i.e. the
2182 vtable for Class) should be external, except when compiling Class.
2184 * jvspec.c (lang_specific_driver): Fix -C handling.
2185 Check -save-temps to see if temp @FILE should be deleted.
2186 Follow-up to/fix for February 16 patch.
2188 * verify.c (verify_jvm_instructions): Better error msgs for dup.
2189 (type_stack_dup): Remove no-longer neded error check.
2191 2001-03-15 Bryce McKinlay <bryce@albatross.co.nz>
2193 * mangle.c (mangle_record_type): Rename 'from_pointer' argument
2194 to 'for_pointer'. If this type is for a pointer (argument) mangling,
2195 don't surround the element with 'N..E' if the type name is
2198 2001-03-14 Mark Mitchell <mark@codesourcery.com>
2200 * class.c (build_static_field_ref): Use COPY_DECL_RTL,
2201 DECL_RTL_SET_P, etc.
2202 (make_method_value): Likewise.
2203 (get_dispatch_table): Likewise.
2205 * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
2207 2001-03-07 Tom Tromey <tromey@redhat.com>
2209 * config-lang.in (lang_requires): Define.
2211 2001-03-07 Brad Lucier <lucier@math.purdue.edu>
2213 * typeck.c (convert): Check flag_unsafe_math_optimizations,
2216 2001-03-05 Per Bothner <per@bothner.com>
2218 Fix a problem where rest_of_decl_compilation applied to
2219 class_dtable_decl causes problems because it was done too early,
2220 before output file was opened.
2221 * decl.c (init_decl_processing): Remove init of class_dtable_decl.
2222 * class.c (class_dtable_decl): Add macro - element of class_roots.
2223 (make_class_data): Define class_dtable_decl.
2224 * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl): Removed.
2226 2001-03-01 Zack Weinberg <zackw@stanford.edu>
2228 * java/class.c, java/decl.c, java/java-tree.h: Replace all
2229 uses of 'boolean' with 'bool'.
2231 2001-03-01 Zack Weinberg <zackw@stanford.edu>
2233 * lang-specs.h: Add zero initializer for cpp_spec field to all
2236 2001-02-16 Per Bothner <per@bothner.com>
2238 Handle compiling multiple input files at once, and @FILE syntax.
2239 * gcj.texi: Updated documentation to match.
2240 * java-tree.h (flag_filelist_file, init_src_parse): New declarations.
2241 * jcf-parse.c (parse_source_file): Split into ...
2242 (parse_source_file_1): New function - and:
2243 (parse_source_file_2): New function.
2244 (yyparse): On -ffilelist-file, open and scan named file.
2245 On first pass over files, only do parse_source_file_1.
2246 A new second pass calls parse_source_file_2 for each file to compile.
2247 (init_jcf_parse): Call init_src_parse.
2248 * jvspec.c (INDIRECT_FILE_ARG): New flag.
2249 (lang_specific_driver): Support @FILELIST-FILE syntax, as well
2250 as multiple input file combined in one compilation.
2251 * lang-options.h: Add -ffilelist-file
2252 * lang.c (flag_filelist_file): New flag variable.
2253 (lang_f_options): Handle -ffilelist-file.
2254 * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
2255 * parse.h (struct parse_ctxt): Remove fields incomplete_class and
2256 gclass_list - use global fields of src_parse_roots instead.
2257 * parse.y (src_parse_roots): New array.
2258 (incomplete_class_list, gclass_list): New macros.
2259 (push_parser_context, java_pop_parser_context,
2260 java_parser_context_resume): Don't fiddle with deleted fields.
2261 (various): Use incomplete_class gclass_list and global macros
2262 instead of parse_ctxt fields - the lists are global.
2263 (init_src_parse): New function.
2265 Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2267 * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
2269 2001-02-20 Alexandre Petit-Bianco <apbianco@redhat.com>
2271 * parse.y (check_inner_class_access): Moved declaration of local
2272 `enclosing_decl_type' to the right location.
2274 2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
2276 * parse.y (parser_check_super_interface): Don't call
2277 check_pkg_class_access for an inner interface.
2278 (parser_check_super): Don't call check_pkg_class_access for inner
2280 (do_resolve_class): Simplify enclosing type loop. Don't call
2281 check_pkg_class_access if CL and DECL are not set.
2282 (find_in_imports_on_demand): Set DECL if class_type needed to be
2283 loaded. Don't call check_pkg_class_access for an inner class.
2284 (check_inner_class_access): Rewritten to implement member access
2285 rules as per spec 6.6.1.
2286 (check_pkg_class_access): Handle the empty package correctly.
2287 (in_same_package): New function. Determine if two classes are in the
2290 2001-02-18 Bryce McKinlay <bryce@albatross.co.nz>
2292 * typeck.c (build_java_array_type): Don't try to poke a public `clone'
2293 method into array types.
2294 * parse.y (patch_method_invocation): Bypass access check on clone call
2297 2001-02-15 Alexandre Petit-Bianco <apbianco@redhat.com>
2299 * expr.c (build_instanceof): Check for arrays when trying fold to
2302 2001-02-15 Jim Meyering <meyering@lucent.com>
2304 * Make-lang.in (java.install-common): Depend on `installdirs'.
2305 (java.install-info): Likewise.
2307 2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
2309 * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
2311 2001-02-14 Tom Tromey <tromey@redhat.com>
2312 Alexandre Petit-Bianco <apbianco@cygnus.com>
2314 Fix for PR java/1261.
2315 * typeck.c (build_java_array_type): Add public `clone' method to
2317 * parse.y (resolve_qualified_expression_name): Use current_class
2318 when checking for inaccessibility.
2319 (patch_method_invocation): Fixed error message when accessibility
2320 denied. Added `from_super' argument.
2322 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
2324 * parse.y (resolve_class): Don't build a fake decl. Use the one
2326 * typeck.c (build_java_array_type): Build and assign decl to array
2329 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
2331 * parse.y (not_accessible_p): Changed leading comment. Added extra
2332 `where' argument. Use it to enforce protected access rules.
2333 (resolve_qualified_expression_name): Added extra argument to
2335 (patch_method_invocation): Use argument `primary' to provide
2336 not_accessible_p with an extra argument.
2337 (lookup_method_invoke): Added extra argument to not_accessible_p.
2338 (search_applicable_method_list): Likewise.
2340 2001-02-13 Alexandre Petit-Bianco <apbianco@redhat.com>
2342 * parse.y (resolve_qualified_expression_name): Try to resolve as
2343 an inner class access only if `decl' is a TYPE_DECL.
2345 2001-02-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
2347 * decl.c (classdollar_identifier_node): Initialize.
2348 * java-tree.h (enum java_tree_index): New entry
2349 `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
2350 (classdollar_identifier_node): New macro.
2351 (ID_CLASSDOLLAR_P): Likewise.
2352 * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
2353 (build_dot_class_method_invocation): Likewise.
2354 (find_applicable_accessible_methods_list): `class$' can't be
2357 2001-02-09 Raja R Harinath <harinath@cs.umn.edu>
2359 * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
2361 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
2363 * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
2364 * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
2367 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
2369 * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
2370 outside of the `__U' sequence too.
2371 (unicode_mangling_length): Count `_' or `U' outside of the `__U'
2374 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
2376 * jvgenmain.c (error): Reversed 2001-02-01 deletion.
2378 2001-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
2380 * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
2381 (JVGENMAIN_OBJS): Likewise.
2382 * java-tree.h (append_gpp_mangled_name): New prototype.
2383 * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
2384 Removed cast calling `gcc_add_root.'
2385 * jvgenmain.c (mangle_obstack): New global, initialized.
2387 (do_mangle_class): Constify local `ptr.'
2388 Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
2389 append_gpp_mangle_name and update `count' if necessary.
2390 Use `mangle_obstack.'
2391 * mangle.c (append_unicode_mangled_name): Removed.
2392 (append_gpp_mangled_name): Likewise.
2393 (unicode_mangling_length): Likewise.
2394 (mangle_member_name): Return type set to `void.'
2395 (mangle_field_decl): Don't append `U' in escaped names.
2396 (mangle_method_decl): Likewise.
2397 (mangle_member_name): Just use `append_gpp_mangled_name.'
2398 * mangle_name.c: New file.
2400 2001-02-07 Per Bothner <per@bothner.com>
2402 * check-init.c (check_init): Fix TRY_FINALLY_EXPR logic.
2404 * check-init.c (check_init): Don't call done_alternative after
2405 processing loop code, as a LOOP_EXPR never terminates normally.
2407 2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
2409 * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
2411 2001-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
2413 * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
2416 2001-02-06 Tom Tromey <tromey@redhat.com>
2418 * lex.c (java_new_lexer): Longer error message.
2420 2001-02-05 Jeff Sturm <jeff.sturm@commerceone.com>
2421 Alexandre Petit-Bianco <apbianco@cygnus.com>
2423 * typeck.c (build_prim_array_type): Added leading comment.
2424 (build_java_array_type): Moved locals out of
2425 block. Always create the `data' field, fixed alignment to match
2428 2001-02-04 Tom Tromey <tromey@redhat.com>
2430 * expr.c (java_lang_expand_expr): Don't bother recomputing
2431 `length'. Use rest_of_decl_compilation, not make_decl_rtl.
2434 2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
2436 * parse.y (process_imports): Save the original name of the import
2437 for better error report.
2439 2001-02-04 Bryce McKinlay <bryce@albatross.co.nz>
2441 * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
2442 of macros used when compiling jvspec.c.
2443 * jvspec.c (lang_specific_driver): Link with the shared
2446 Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2448 * check-init.c (check_init): Call internal_error instead of fatal.
2449 * expr.c (java_lang_expand_expr): Likewise.
2450 * jcf-parse.c (get_constant): Likewise.
2451 * mangle.c (java_mangle_decl): Likewise.
2452 * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
2453 (operator_string): Likewise.
2454 * check-init.c (check_init): Call abort instead of fatal.
2455 * class.c (build_class_ref): Likewise.
2456 * constants.c (write_constant_pool): Likewise.
2457 * decl.c (start_java_method): Likewise.
2458 * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
2459 (java_stack_dup, encode_newarray_type): Likewise.
2460 (build_java_array_length_access): Likewise.
2461 (build_java_check_indexed_type, expand_java_pushc): Likewise.
2462 (build_java_soft_divmod, build_invokeinterface): Likewise.
2463 * java-tree.h (INNER_CLASS_P): Likewise.
2464 * jcf-parse.c (parse_signature, get_name_constant): Likewise.
2465 (give_name_to_class, get_class_constant): Likewise.
2466 * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
2467 (find_constant_index, generate_bytecode_conditional): Likewise.
2468 (generate_bytecode_insns, perform_relocations): Likewise.
2469 * lex.c (java_unget_unicode, java_lex): Likewise.
2470 * mangle.c (mangle_type, mangle_record_type): Likewise.
2471 (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
2472 (finish_mangling): Likewise.
2473 * parse.h (MARK_FINAL_PARMS): Likewise.
2474 * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
2475 (obtain_incomplete_type, java_complete_class): Likewise.
2476 (java_check_regular_methods, java_complete_expand_method): Likewise.
2477 (cut_identifier_in_qualified, check_deprecation): Likewise.
2478 (patch_invoke, find_applicable_accessible_methods_list): Likewise.
2479 (java_complete_lhs, lookup_name_in_blocks): Likewise.
2480 (check_final_variable_indirect_assignment, build_unaryop): Likewise.
2481 * typeck.c (set_local_type, parse_signature_type): Likewise.
2482 (parse_signature_string, build_java_signature): Likewise;
2483 (set_java_signature): Likewise.
2484 * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
2485 * class.c (add_method): Call fatal_error instead of fatal.
2486 (build_static_field_ref): Likewise.
2487 * expr.c (build_known_method_ref, expand_invoke): Likewise.
2488 * jcf-parse.c (get_constant, jcf_parse): Likewise.
2489 * lex.c (java_new_new_lexer): Likewise.
2490 * jv-scan.c (main): Likewise.
2491 (fatal_error): Renamed from fatal.
2492 * jcf-parse.c (yyparse): Call fatal_io_error instead of
2494 * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
2495 (yyparse): Likewise.
2496 * jcf-write.c (make_class_file_name, write_classfile): Likewise.
2497 * lex.c (java_get_line_col): Likewise.
2498 * jcf-parse.c (load_class): Make errors non-fatal.
2499 * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
2501 2001-02-01 Bryce McKinlay <bryce@albatross.co.nz>
2503 * jvgenmain.c (class_mangling_suffix): Remove unused string.
2504 (error): Remove unused function.
2505 (main): Don't use "__attribute__ alias" on generated class symbol.
2507 2001-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
2509 * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
2511 * parse.y (finish_method_declaration): Code accounting for WFLed
2512 method DECL_NAMEs deleted.
2513 (check_abstract_method_definitions): Likewise.
2514 (resolve_type_during_patch): Layout resolved type.
2515 * typeck.c (lookup_do): Removed unused local.
2517 2001-01-30 Bryce McKinlay <bryce@albatross.co.nz>
2519 * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
2520 * decl.c (init_decl_processing): Use integer_minus_one_node, not
2521 integer_negative_one_node.
2522 * expr.c (build_java_binop): Likewise.
2524 2001-01-24 Jeff Sturm <jeff.sturm@commerceone.com>
2526 * zextract.c (read_zip_archive): Read file_offset before writing
2527 zipd and consequently clobbering the header contents.
2529 2001-01-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2531 * Make-lang.in: Remove all dependencies on defaults.h.
2532 * decl.c: Don't include defaults.h.
2534 * parse.y: Likewise.
2536 2001-01-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
2538 * ChangeLog (2001-01-21): Fixed typo.
2539 * class.c (layout_class_method): Code accounting for WFLed
2540 method DECL_NAMEs deleted.
2541 * constant.c (find_methodref_index): Likewise.
2542 * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
2543 * java-tree.h (DECL_FUNCTION_WFL): New macro.
2544 (struct lang_decl): New field `wfl'.
2545 (java_get_real_method_name): Prototype deleted.
2546 * mangle.c (mangle_method_decl): Code accounting for WFLed
2547 method DECL_NAMEs deleted.
2548 * parse.h (GET_METHOD_NAME): Macro deleted.
2549 * parse.y (reset_method_name): Deleted.
2550 (method_header): Set DECL_FUNCTION_WFL.
2551 (check_abstract_method_header): Code accounting for WFLed method
2553 (java_get_real_method_name): Deleted.
2554 (check_method_redefinition): Code accounting for WFLed method
2555 DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
2556 (java_check_regular_methods): Likewise.
2557 (java_check_abstract_methods): Likewise.
2558 (java_expand_classes): Don't call `reset_method_name.'
2559 (search_applicable_method_list): Use DECL_NAMEs instead of
2561 * typeck.c (lookup_do): Code accounting for WFLed method
2564 2001-01-25 Richard Earnshaw <rearnsha@arm.com>
2566 * lex.c (java_read_char): Check for EOF from getc first.
2568 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
2570 * class.c (layout_class): Don't lay the superclass out if it's
2571 already being laid out.
2572 * jcf-parse.c (handle_innerclass_attribute): New function.
2573 (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
2574 handle_innerclasses_attribute.
2575 (jcf_parse): Don't load an innerclasses if it's already being
2577 * jcf-write.c (append_innerclass_attribute_entry): Static
2578 `anonymous_name' and its initialization deleted. `ocii' and `ini'
2579 to be zero for anonymous classes.
2581 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
2583 * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
2585 * jcf-parse.c (set_source_filename): Use
2586 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
2588 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
2590 * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
2591 gets a unique asm name.
2593 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
2595 * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
2596 (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
2598 (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
2599 * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
2600 * parse.y (lookup_package_type_and_set_next): Deleted.
2601 (resolve_package): Removed unnecessary code.
2602 (find_applicable_accessible_methods_list): `finit$' can't be
2604 * verify.c (pop_argument_types): Added missing prototype.
2606 2001-01-23 Bryce McKinlay <bryce@albatross.co.nz>
2608 * config-lang.in: Disable java by default.
2610 2001-01-23 Tom Tromey <tromey@redhat.com>
2612 * gcj.texi (Copying): New node.
2613 Added copyright information.
2615 2001-01-21 Per Bothner <per@bothner.com>
2617 Various fixes to allow compiling a compressed .jar/.zip archive.
2618 * zipfile.h (struct ZipFileCache): Replace by struct ZipFile.
2619 (struct ZipFile): Add fields name and next (from ZipFileCache).
2620 (struct ZipDirectory): New field zipf points to owning ZipFile.
2621 * jcf.h (struct ZipDirectory): Add forward declaration.
2622 (struct JCF): Declare zipd field to have type struct ZipDirectory.
2623 Remove seen_in_zip and zip_offset fields.
2624 (JCF_SEEN_IN_ZIP): New macro.
2625 * zextract.c (read_zip_archive): Set ZipDirectory's zipf field.
2626 * jcf-io.c: Change all ZipFileCache to ZipFile.
2627 (read_zip_member): New function.
2628 (open_in_zip): Call read_zip_member.
2629 * jcf-parse.c (find_in_current_zip): Remove function.
2630 (read_class): Merge in find_in_current_zip functionality.
2631 Call read_zip_member if needed.
2632 (parse_zip_file_entries): Use read_zip_member.
2633 (process_zip_dir): Update for removed and added JCF fields.
2634 (jcf_figure_file_type): Re-use, don't copy initial ZipFile struct.
2636 2001-01-21 Per Bothner <per@bothner.com>
2638 Minor optimization of static ggc roots.
2639 * jcf-parse.c (parse_roots): New static field.
2640 (current_field, current_method, current_file_list): Replace by macros
2641 naming fields of parse_roots.
2642 (init_jcf_parse): Combine 3 ggc_add_tree_root calls to 1.
2643 * class.c (class_roots): New static field.
2644 (registered_class, fields_ident, info_ident, class_list):
2645 New macros naming fields of parse_roots.
2646 (build_static_field_ref): Don't register roots here.
2647 (layout_class): Static field list replaced by macro class_list.
2648 (init_class_processing): Call ggc_add_tree_root for 4 roots.
2649 Initialize fields_ident and info_ident here.
2651 2001-01-21 Per Bothner <per@bothner.com>
2653 * jcf-parse.c (ggc_mark_jcf): New function.
2654 (init_jcf_parse): Register current_jcf as ggc root.
2656 2001-01-21 Per Bothner <per@bothner.com>
2658 * lang.c (put_decl_node): Print method's name.
2660 2001-01-21 Per Bothner <per@bothner.com>
2662 * verify.c (VERIFICATION_ERROR_WITH_INDEX): New macro.
2663 (verify_jvm_instructions): Use it, for better error messages on loads.
2665 2001-01-21 Per Bothner <per@bothner.com>
2667 * verify.c (merge_type_state): Still may have to merge even if
2668 LABEL_VERIFIED (label).
2670 2001-01-21 Per Bothner <per@bothner.com>
2672 * parse.y (method_header): Don't set the DECL_NAME of a FUNCTION_DECL
2673 to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
2675 2001-01-19 Per Bothner <per@bothner.com>
2677 * expr.c (pop_type_0): Only return object_ptr_type_node on mismatch
2678 if expeting an interface type. Refines Tom's change of 2000-09-12.
2680 2001-01-18 Per Bothner <per@bothner.com>
2682 * gcj.texi (Input Options): Mention .java files.
2684 2001-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
2686 * lang-options.h (-Wunsupported-jdk11): Removed.
2687 * lang.c (flag_not_overriding): Deleted.
2688 (flag_static_local_jdk1_1): Likewise.
2689 (lang_W_options): Removed "unsupported-jdk11" entry.
2690 * parse.y (java_check_methods): Removed dead code.
2692 2001-01-17 Tom Tromey <tromey@redhat.com>
2694 Changes suggested by Per Bothner:
2695 * gcj.texi (Input Options): Don't mention input files.
2696 (Code Generation): Updated --main information.
2697 (Invoking jcf-dump): Mention that --javap is incomplete.
2698 From Alexandre Petit-Bianco:
2699 (Warnings): Don't mention -Wunsupported-jdk11.
2701 (Compatibility): Mention JDK 1.2-ness of libraries.
2702 (Resources): Mention resources used when writing gcj.
2704 2001-01-17 Tom Tromey <tromey@redhat.com>
2706 * gcj.texi: New file.
2707 * Make-lang.in ($(srcdir)/java/gcj.info): New target.
2708 (java.info): Depend on gcj.info.
2709 (java/gcj.dvi): New target.
2710 (java.dvi): Depend on gcj.dvi.
2711 (java.install-info): Wrote.
2713 2001-01-16 Jeff Sturm <jeff.sturm@appnet.com>
2715 * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
2716 having called make_decl_rtl.
2718 2001-01-14 Per Bothner <per@bothner.com>
2720 Various patches to emit better messages on verification errors.
2721 * expr.c (push_type_0): Return error indication on stack overflow,
2722 instead of callinfg fatal.
2723 (push_type): Now just call push_type_0 (nd fatal on overflow).
2724 (pop_type_0): Return detailed error message (in a char** argument).
2725 (pop_type): If pop_type_0 fails, print error message.
2726 (pop_argument_types): Moved to verify.c.
2727 * verify.c (pop_argument_types): Moved from expr.c.
2728 Return a (possible) error message, rather than void.
2729 (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING): New macros.
2730 (verify_jvm_instruction): Use new macros, improving error messages.
2731 For case OPCODE_astore use object_ptr_type_node.
2732 * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED): New macros.
2733 (pop_type_0, push_type_0, pop_argument_types): Update accordingly.
2735 * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
2736 constant, return body without wrapper. (Improves constant folding.)
2737 * lex.c (build_wfl_node): Clear TREE_TYPE from returned node.
2739 2001-01-13 Per Bothner <per@bothner.com>
2741 * expr.c (expand_java_field_op): Assigning to a final field outside
2742 an initializer does not violate JVM spec, so should be warning, not
2743 error. (Sun's verifier does not complain - though MicroSoft's does.)
2745 2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk>
2747 * gjavah.c (version), jcf-dump.c (version): Update copyright year
2750 2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
2752 * parse.y (resolve_expression_name): Permit instance variables from
2753 enclosing context in super constructor call.
2754 (resolve_qualified_expression_name): Permit enclosing class's qualified
2755 "this" in super constructor call.
2757 2001-01-10 Mark Mitchell <mark@codesourcery.com>
2759 * class.c (build_utf8_ref): Remove last argument in call to
2760 make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
2761 (build_class_ref): Likewise.
2762 (build_static_field_ref): Likewise.
2763 (get_dispatch_table): Likewise.
2764 (layout_class_method): Likewise.
2765 (emit_register_classes): Likewise.
2766 * constants.c (build_constant_data_ref): Likewise.
2767 * decl.c (builtin_function): Likewise.
2768 (create_primitive_vtable): Likewise.
2769 * expr.c (build_known_method_def): Likewise.
2770 (build_jni_stub): Likewise.
2771 (java_lang_expand_expr): Likewise.
2773 2001-01-10 Tom Tromey <tromey@redhat.com>
2775 * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
2777 2001-01-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
2779 * java-tree.h (lang_printable_name_wls): New prototype.
2780 * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
2781 rather than `current_class' to print type name. Don't prepend type
2782 names when printing constructor names.
2783 (lang_printable_name_wls): New function.
2784 * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
2785 `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
2786 * parse.y (patch_method_invocation): Message tuned for constructors.
2787 (not_accessible_p): Grant `private' access from within
2790 2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
2792 All files with updated copyright when applicable.
2793 * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
2794 * class.c (mangle_class_field): Function removed.
2795 (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
2796 (utf8_cmp, cxx_keyword_p): Moved to lex.c.
2797 (build_class_ref): Call `java_mangle_class_field' instead of
2798 `mangle_class_field.'
2799 (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
2800 (layout_class): Call `java_mangle_decl' instead of
2801 `mangle_static_field.'
2802 (cxx_keywords): Initialized static array moved to `lex.c.'
2803 (layout_class_method): Changed leading comment. Simplified to
2804 call `java_mangle_decl.' Local `ptr' moved in for loop body.
2805 * decl.c (lang_mark_tree): Mark field `package_list.'
2806 * java-tree.h (TYPE_PACKAGE_LIST): New macro.
2807 (struct lang_type): New field `package_list.'
2808 (unicode_mangling_length): Prototype removed.
2809 (append_gpp_mangled_name, append_gpp_mangled_classtype,
2810 emit_unicode_mangled_name): Likewise.
2811 (cxx_keyword_p): New prototype.
2812 (java_mangle_decl, java_mangle_class_field,
2813 java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
2814 * jcf-parse.c (jcf_parse_source): Constify `file' argument to
2816 * jvgenmain.c (main_method_prefix): Global variable removed.
2817 (main_method_suffix): Likewise.
2818 (do_mangle_classname): New function.
2819 (main): Call it. Format changed to accommodate new mangling scheme.
2820 * lex.c: (utf8_cmp): Conditionally prototyped.
2821 (cxx_keywords): Moved from class.c, conditionally defined.
2822 (utf8_cmp, cxx_keyword_p): Likewise.
2823 * mangle.c (obstack.h, ggc.h): Included.
2824 (mangle_field_decl): New function.
2825 (mangle_method_decl, mangle_type, mangle_pointer_type,
2826 mangle_array_type, mangle_record_type,
2827 find_compression_pointer_match, find_compression_array_match,
2828 find_compression_record_match,
2829 find_compression_array_template_match, set_type_package_list,
2830 entry_match_pointer_p, emit_compression_string, init_mangling,
2831 finish_mangling, compression_table_add, mangle_member_name): Likewise.
2832 (mangle_obstack): New global.
2833 (MANGLE_RAW_STRING): New macro.
2834 (unicode_mangling_length): Turned static.
2835 (append_unicode_mangled_name): Renamed from
2836 `emit_unicode_mangled_name.' Turned static. `mangle_obstack'
2837 replaces `obstack', removed from the parameter list.
2838 (append_gpp_mangled_name): Turned static. `mangle_obstack'
2839 replaces parameter `obstack', removed from the parameter list. Call
2840 `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
2841 (append_gpp_mangled_classtype): Removed.
2842 (compression_table, compression_next): New static variables.
2843 * parse.y (temporary_obstack): Extern declaration removed.
2845 2001-01-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
2847 * parse.y (patch_binop): Compute missing type in error situations.
2849 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
2851 * class.c (make_class_data): Push initial value for "arrayclass".
2852 * decl.c (init_decl_processing): Add new class field "arrayclass".
2854 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
2856 From patha@softlab.ericsson.se:
2857 * parse.y (switch_label): Use build, not build1, to construct
2860 2001-01-04 Neil Booth <neil@daikokuya.demon.co.uk>
2862 * lang.c (lang_decode_option): Change -MA to -MP.
2863 * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
2864 Update to new prototype; do quote targets.
2865 (jcf_dependency_write): Update.
2867 2000-12-22 Bryce McKinlay <bryce@albatross.co.nz>
2869 Shorten primitive array allocation path:
2870 * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
2871 to create new primitive arrays.
2872 * expr.c (build_newarray): If generating native code, call
2873 soft_newarray_node with a reference to the primitive TYPE identifier
2874 instead of type_value.
2876 2000-12-17 Bryce McKinlay <bryce@albatross.co.nz>
2878 Fix for PRs gcj/312 and gcj/253:
2879 * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
2880 dest if they arn't already.
2881 * class.c (layout_class): Call maybe_layout_super_class on
2882 superinterfaces also, but only if compiling from bytecode.
2885 * parse.y (create_class): Set ACC_STATIC if class is declared in an
2888 2000-12-15 Tom Tromey <tromey@redhat.com>
2890 * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
2893 2000-12-14 Andrew Haley <aph@redhat.com>
2895 * boehm.c (mark_reference_fields): Change test to correctly detect
2898 2000-12-15 Andreas Jaeger <aj@suse.de>
2900 * config-lang.in (lang_dirs): Added.
2902 2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
2904 * parse.y (end_artificial_method_body): Fixed undefined behavior.
2905 Credits go to rth for finding it.
2907 2000-12-13 Mike Stump <mrs@wrs.com>
2909 * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
2911 2000-11-07 Tom Tromey <tromey@cygnus.com>
2913 * Make-lang.in (JAVA_LEX_C): Added chartables.h.
2914 * lex.c (java_ignorable_control_p): Removed.
2915 (java_letter_or_digit_p): Removed.
2916 (java_start_char_p): New function.
2917 (java_read_char): Return `int', not `unicode_t'. Changed
2919 (java_read_unicode): Likewise.
2920 (java_read_unicode_collapsing_terminators): Likewise.
2921 (java_get_unicode): Likewise.
2922 (java_new_lexer): Initialize hit_eof.
2923 (java_parse_end_comment): Take `int' argument.
2924 (java_parse_doc_section): Likewise.
2925 (java_parse_escape_sequence): Don't allow backlash-newline.
2927 * lex.h (JAVA_DIGIT_P): Removed.
2928 (_JAVA_LETTER_OR_DIGIT_P): Removed.
2929 (_JAVA_IDENTIFIER_IGNORABLE): Removed.
2930 (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
2931 (JAVA_PART_CHAR_P): New macro.
2933 (JAVA_CHAR_ERROR): Now -2.
2934 (java_lexer): New field `hit_eof'.
2935 * chartables.h: New file.
2936 * gen-table.pl: new file.
2938 2000-11-20 Tom Tromey <tromey@cygnus.com>
2939 Alexandre Petit-Bianco <apbianco@cygnus.com>
2941 * parse.y (java_complete_lhs): Only allow compound assignment of
2942 reference type if type is String.
2944 2000-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
2946 * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
2947 jcf-path.c: Likewise.
2949 2000-12-09 Anthony Green <green@redhat.com>
2951 * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
2952 filestart and filename_length as int values.
2954 2000-12-07 Mo DeJong <mdejong@redhat.com>
2956 * jcf-io.c (find_class): Correct the logic that tests to see if a
2957 .java file is newer than its .class file. The compiler was
2958 incorrectly printing a warning when file mod times were equal.
2960 2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
2962 * jvgenmain.c: Use ISPRINT not isascii.
2964 2000-12-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
2966 * parse.y (end_artificial_method_body): Fixed typo.
2968 2000-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
2970 * parse.y (patch_method_invocation): Pick the correct enclosing
2971 context when creating inner class instances.
2974 2000-11-26 Joseph S. Myers <jsm28@cam.ac.uk>
2976 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
2977 Update copyright year to 2000.
2979 2000-11-23 Anthony Green <green@redhat.com>
2981 * jcf-parse.c (init_jcf_parse): Register current_file_list root.
2982 Move current_file_list out of yyparse and make it static.
2984 * expr.c: Declare quick_stack and tree_list_free_list as static
2985 (init_expr_processing): Register quick_stack and
2986 tree_list_free_list roots.
2988 2000-11-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
2990 * parse.y (build_outer_field_access): New local `decl_ctx', use
2991 it. Check for field's context and current class immediate outer
2992 context inheritance.
2993 (outer_field_access_p): Consider fields inherited from the last
2995 (build_access_to_thisn): Stop at the last enclosing context if
2999 Thu Nov 23 02:19:14 2000 J"orn Rennecke <amylaar@redhat.com>
3001 * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
3003 2000-11-22 Bryce McKinlay <bryce@albatross.co.nz>
3005 * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
3008 2000-11-20 Tom Tromey <tromey@cygnus.com>
3010 * jv-scan.c (help): Document --complexity.
3011 (options): Added --complexity.
3012 (flag_complexity): New global.
3013 (main): Call `report'.
3014 * parse-scan.y (complexity): New global.
3015 (if_then_statement, if_then_else_statement,
3016 if_then_else_statement_nsi, switch_block_statement_group,
3017 while_expression, do_statement, for_begin, continue_statement,
3018 throw_statement, catch_clause, finally, method_invocation,
3019 conditional_and_expression, conditional_or_expression,
3020 conditional_expression): Update complexity.
3021 (reset_report): Reset complexity.
3022 (report): New function.
3024 2000-11-20 Tom Tromey <tromey@cygnus.com>
3026 * lex.c (yylex): Added STRICT_TK case.
3027 * parse.y (STRICT_TK): Added.
3028 * parse-scan.y (STRICT_TK): Added.
3029 * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
3030 `;'. Use 4, not 3, with -k option. Correctly rename resulting
3032 * keyword.h: Rebuilt.
3033 * keyword.gperf (strictfp): Added.
3035 2000-11-20 Tom Tromey <tromey@cygnus.com>
3037 * lex.c (yylex): Recognize floating point constants with leading
3040 2000-11-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3042 * java-tree.h (cyclic_inheritance_report): Constify.
3043 * parse.y (cyclic_inheritance_report): Likewise.
3045 2000-11-17 Zack Weinberg <zack@wolery.stanford.edu>
3047 * parse.y (goal): Remove call to ggc_add_string_root.
3049 2000-11-16 Zack Weinberg <zack@wolery.stanford.edu>
3051 * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
3052 Create string in scratch buffer, then pass to build_string.
3054 2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
3056 * parse.y (issue_warning_error_from_context): Add
3059 2000-11-11 Anthony Green <green@redhat.com>
3061 * jcf-parse.c (process_zip_dir): Add finput parameter.
3062 (jcf_figure_file_type): Call process_zip_dir with appropriate
3065 2000-11-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3067 * decl.c (copy_lang_decl): Use memcpy, not bcopy.
3068 * jcf-parse.c (jcf_figure_file_type): Likewise.
3070 2000-11-09 Joseph S. Myers <jsm28@cam.ac.uk>
3072 * parse.y (create_new_parser_context): Use memset () instead of
3075 2000-11-08 Tom Tromey <tromey@cygnus.com>
3077 * gjavah.c (process_file): Only include gcj/cni.h when generating
3080 2000-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
3082 * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
3083 (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
3084 instead of bzero ().
3086 2000-11-05 Tom Tromey <tromey@cygnus.com>
3088 * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
3089 * lex.c (IS_ZERO): New define.
3090 (java_perform_atof): Error on floating point underflow.
3092 2000-11-04 Tom Tromey <tromey@cygnus.com>
3094 * lex.c (java_parse_escape_sequence): Only read two octal
3095 characters if the first one is greater than 3. Don't allow
3096 "octal" numbers to include the digits 8 or 9.
3098 2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
3100 * Make-lang.in (java.distdir): Remove.
3102 2000-11-03 Tom Tromey <tromey@cygnus.com>
3104 * Make-lang.in (java.dvi): New target.
3105 Partial fix for PR other/567.
3107 * lang-options.h: Mention -Wout-of-date.
3108 * jcf-dump.c (flag_newer): New global.
3109 * gjavah.c (flag_newer): New global.
3110 * jcf-io.c (find_class): Only warn when flag_newer set.
3111 * lang.c (flag_newer): New global.
3112 (struct string_option): New declaration.
3113 (lang_W_options): New global.
3114 (process_option_with_no): New function.
3115 (lang_decode_option): Use it.
3117 * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
3118 * gjavah.c (cxx_keyword_subst): Handle any number of trailing
3121 * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
3122 (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
3123 * lex.c (java_read_unicode): Removed `term_context' argument.
3124 Recognize any number of `u' in `\u'.
3125 (java_read_unicode_collapsing_terminators): New function.
3126 (java_get_unicode): Use it.
3127 (java_lineterminator): Removed.
3128 (yylex): Produce error if character literal is newline or single
3129 quote. Return if eof found in middle of `//' comment. EOF in
3130 `//' comment is only an error if pedantic.
3131 (java_ignorable_control_p): New function.
3132 (java_parse_end_comment): Return if eof found in middle of
3135 * jv-scan.c (pedantic): New global.
3137 2000-10-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
3139 * parse.y (outer_field_access_p): Inherited fields aren't
3140 consider outer fields.
3141 (maybe_build_thisn_access_method): Use
3142 PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
3143 (resolve_expression_name): Trigger an error if a static field
3144 is being accessed as an outer field.
3146 2000-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
3148 * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
3151 2000-10-27 Zack Weinberg <zack@wolery.stanford.edu>
3153 * Make-lang.in: Move all build rules here from Makefile.in,
3154 adapt to new context. Wrap all rules that change the current
3155 directory in parentheses. Expunge all references to $(P).
3156 When one command depends on another and they're run all at
3157 once, use && to separate them, not ;. Add OUTPUT_OPTION to
3158 all object-file generation rules. Delete obsolete variables.
3160 * Makefile.in: Delete.
3161 * config-lang.in: Delete outputs= line.
3163 2000-10-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
3165 * parse.y (patch_method_invocation): NULLify this_arg when already
3167 (maybe_use_access_method): Handle call to methods unrelated to the
3168 current class. Fixed comment.
3171 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
3173 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
3176 2000-10-24 Tom Tromey <tromey@cygnus.com>
3178 * lex.c (java_new_lexer): Initialize new fields. Work around
3179 broken iconv() implementations.
3180 (java_read_char): Swap bytes if required. Use fallback decoder if
3182 (byteswap_init, need_byteswap): New globals.
3183 (java_destroy_lexer): Only close iconv handle if it is in use.
3184 * lex.h (java_lexer): New fields read_anything, byte_swap,
3186 Made out_buffer unsigned.
3188 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
3190 * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
3191 where an enclosing context can be set on the jdep.
3192 (do_resolve_class): Fixed identation.
3194 2000-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3196 * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
3198 * jcf-reader.c (peek_attribute, skip_attribute): Only define
3201 * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
3203 * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
3205 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
3207 * jcf-write.c (OP1): Update `last_bc'.
3208 (struct jcf_block): Fixed indentation and typo in comments. New
3210 (generate_bytecode_insns): Insert `nop' if `jsr' immediately
3211 follows `monitorenter'.
3212 * parse.y (patch_synchronized_statement): New local `tmp'. Call
3216 2000-10-16 Tom Tromey <tromey@cygnus.com>
3218 * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
3219 * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
3220 * lang-options.h: Added -MA, -MT, -MF..
3221 * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
3222 (DEPEND_TARGET_SET): New macro.
3223 (DEPEND_FILE_ALREADY_SET): Likewise.
3224 (init_parse): Handle new flags.
3225 * jcf.h (jcf_dependency_print_dummies): Declare.
3226 * Make-lang.in (s-java): Added mkdeps.o.
3227 * Makefile.in (BACKEND): Added mkdeps.o.
3228 (../gcjh$(exeext)): Added mkdeps.o.
3229 (../jcf-dump$(exeext)): Added mkdeps.o.
3230 * jcf-depend.c: Include mkdeps.h.
3231 (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
3232 add_entry): Removed.
3233 (jcf_dependency_reset): Rewrote.
3234 (dependencies): New global.
3235 (jcf_dependency_set_target): Rewrote.
3236 (jcf_dependency_add_target): Likewise.
3237 (jcf_dependency_add_file): Likewise.
3239 (print_ents): Removed.
3240 (jcf_dependency_write): Rewrote.
3241 (print_dummies): New global.
3242 (jcf_dependency_print_dummies): New function
3243 (jcf_dependency_write): Call deps_dummy_targets if required.
3245 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
3247 * gjavah.c (add_class_decl): Removed unused variables `tname',
3248 `tlen' and `name_index'.
3249 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
3250 * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
3251 in `wfl_operator' with value.
3252 (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
3253 (jcf_figure_file_type): Fixed identation.
3254 * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
3255 * parse.y (analyze_clinit_body): New function.
3256 (static_initializer:): Reset `current_static_block'.
3257 (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
3258 `wfl_operator' with new value.
3259 (lookup_cl): Use EXPR_WFL_FILENAME.
3260 (maybe_yank_clinit): Handle bogus <clinit> bodies, call
3261 analyze_clinit_body.
3262 (build_outer_field_access): Access to this$<n> built from
3263 current_class, not its outer context.
3264 (build_access_to_thisn): Fixed leading comment. Tidied things up.
3265 (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
3266 (patch_method_invocation): Use `is_static_flag' when already
3268 (patch_newarray): Removed assignment in ternary operator.
3270 2000-10-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
3272 * except.c (free_eh_ranges): Don't free `whole_range'.
3274 2000-10-15 Anthony Green <green@redhat.com>
3276 * decl.c (init_decl_processing): Call init_class_processing before
3279 2000-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
3281 * check-init.c (check_init): Fixed leading comment. Use
3283 * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3284 (give_name_to_locals): Likewise.
3285 (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
3286 fields in lang_decl_var.
3287 * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
3288 DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
3289 (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
3290 (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
3291 DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
3292 (LOCAL_FINAL): Rewritten.
3293 (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
3294 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
3295 (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
3296 `init_final' fields.
3297 (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
3298 `final_uid', `final_liic', `final_ierr' and `local_final' fields.
3299 (TYPE_HAS_FINAL_VARIABLE): New macro.
3300 (struct lang_type): Added `afv' field.
3301 * parse.y (check_static_final_variable_assignment_flag): New function.
3302 (reset_static_final_variable_assignment_flag): Likewise.
3303 (check_final_variable_local_assignment_flag): Likewise.
3304 (reset_final_variable_local_assignment_flag): Likewise.
3305 (check_final_variable_indirect_assignment): Likewise.
3306 (check_final_variable_global_assignment_flag): Likewise.
3307 (add_inner_class_fields): Use LOCAL_FINAL_P.
3308 (register_fields): Handle local finals and final variables.
3309 (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
3310 (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3311 (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
3313 (java_complete_expand_methods): Loop to set
3314 TYPE_HAS_FINAL_VARIABLE. Call
3315 `reset_final_variable_local_assignment_flag' and
3316 `check_final_variable_local_assignment_flag' accordingly before
3317 and after constructor expansion. Call
3318 `reset_static_final_variable_assignment_flag'
3319 before expanding <clinit> and after call
3320 `check_static_final_variable_assignment_flag' if the
3321 current_class isn't an interface. After all methods have been
3322 expanded, call `check_final_variable_global_assignment_flag' and
3323 `check_static_final_variable_assignment_flag' if the current class
3325 (maybe_yank_clinit): Fixed typo in comment.
3326 (build_outer_field_access_methods): Removed old sanity check. Use
3327 FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3328 Don't create access methods for finals.
3329 (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
3330 (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
3331 existing DECL_INIT has been processed.
3332 (java_complete_lhs): Likewise.
3333 (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
3334 Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
3336 (patch_assignment): Use LOCAL_FINAL_P.
3337 (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
3338 DECL_INITIAL is nullified.
3341 2000-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3343 * Make-lang.in (parse.c, parse-scan.c): Create atomically.
3345 * Makefile.in (parse.c, parse-scan.c): Likewise.
3347 2000-10-12 Mark Mitchell <mark@codesourcery.com>
3349 * class.c (temporary_obstack): Remove.
3350 (make_class): Don't mess with obstascks.
3351 (push_class): Likewise.
3352 (set_super_info): Likewise.
3353 (add_method_1): Likewise.
3354 (add_method): Likewise.
3355 (add_field): Likewise.
3356 (build_utf8_ref): Likewise.
3357 (build_class_ref): Likewise.
3358 (build_static_field_ref): Likewise.
3359 (finish_class): Likewise.
3360 (push_super_field): Likewise.
3361 (layout_class): Likewise.
3362 (layout_class_methods): Likewise.
3363 (init_class_processing): Likewise.
3364 * constants.c (get_tag_node): Likewise.
3365 (build_constant_data_ref): Likewise.
3366 * decl.c (ggc_p): Remove.
3367 (copy_lang_decl): Use ggc_alloc.
3368 (complete_start_java_method): Don't mess with obstacks.
3369 (start_java_method): Likewise.
3370 (end_java_method): Likewise.
3371 * except.c (link_handler): Use xmalloc.
3372 (free_eh_ranges): New function.
3373 (method_init_exceptions): Use it.
3374 (add_handler): Use xmalloc.
3375 (expand_start_java_handler): Don't mess with obstacks.
3376 (prepare_eh_table_type): Likewise.
3377 (expand_end_java_handler): Likewise.
3378 * expr.c (push_value): Likewise.
3379 (create_label_decl): Likewise.
3380 (build_jni_stub): Likewise.
3381 (java_lang_expand_expr): Likewise.
3382 (note_instructions): Use xrealloc.
3383 (java_push_constant_from_pool): Don't mess with obstacks.
3384 (process_jvm_instruction): Likewise.
3385 * java-tree.h (cyclic_inheritance_report): Remove duplicate
3387 * jcf-parse.c (get_constant): Don't mess with obstacks.
3388 (read_class): Likewise.
3389 (jcf_parse): Likewise.
3390 * lex.c (expression_obstack): Remove.
3391 (java_lex): Don't use obstack_free.
3392 * parse.h (exit_java_complete_class): Don't mess with obstacks.
3393 (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
3394 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
3395 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
3396 * parse.y (gaol): Add more GC roots.
3397 (add_inner_class_fields): Adjust calls to MANGLE_* macros.
3398 (lookup_field_wrapper): Likewise.
3399 (obtain_incomplete_type): Don't mess with obstacks.
3400 (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
3402 (craft_constructor): Don't mess with obstacks.
3403 (safe_layout_class): Likewise.
3404 (java_complete_class): Likewise.
3405 (source_end_java_method): Likewise.
3406 (build_outer_field_access_methods): Likewise.
3407 (build_outer_method_access_method): Likewise.
3408 (maybe_build_thisn_access_method): Likewise.
3409 (build_dot_class_method_invocation): Likewise.
3410 (java_complete_tree): Likewise.
3411 (java_complete_lhs): Likewise.
3412 (do_merge_string_cste): Likewise.
3413 (patch_string_cst): Likewise.
3414 (array_constructor_check_entry): Likewise.
3415 * typeck.c (build_java_array_type): Likewise.
3416 (parse_signature_string): Likewise.
3417 (build_java_signature): Likewise.
3419 2000-10-12 Tom Tromey <tromey@cygnus.com>
3422 * gjavah.c (add_class_decl): Don't special-case inner classes.
3423 (add_namelet): Likewise.
3425 2000-10-11 Rodney Brown <RodneyBrown@mynd.com>
3427 * java-tree.h: Constify current_encoding.
3428 * lang.c: Constify current_encoding.
3430 2000-10-10 Jeff Sturm <jeff.sturm@appnet.com>
3432 * jvgenmain.c (class_mangling_suffix): Omit `.'.
3433 (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
3435 2000-10-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
3437 * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
3438 patch. Fixes gcj/340.
3440 2000-10-10 Tom Tromey <tromey@cygnus.com>
3442 * lex.c (java_new_lexer): Initialize out_first and out_last
3444 * lex.h (java_lexer): Added out_buffer, out_first, out_last.
3446 2000-10-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
3448 * parse.y (pop_current_osb): New function.
3449 (array_type:): Use `dims:', changed actions
3450 accordingly. Suggested by Anthony Green.
3451 (array_creation_expression:): Used pop_current_osb.
3452 (cast_expression:): Likewise.
3453 (search_applicable_method_list): Fixed indentation.
3455 2000-10-08 Anthony Green <green@redhat.com>
3457 * parse.y (array_type_literal): Remove production.
3458 (type_literals): Refer to array_type, not array_type_literal.
3460 2000-10-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
3462 Patch contributed by Corey Minyard.
3463 * decl.c (check_local_named_variable): New function.
3464 (tree check_local_unnamed_variable): Likewise.
3465 (find_local_variable): Splitted. Call check_local_{un}named_variable.
3467 2000-10-07 Anthony Green <green@redhat.com>
3469 * class.c (layout_class): Handle case where superclass can't be
3472 2000-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
3474 * Makefile.in (keyword.h): Refer to GNU FTP site for updated
3477 2000-10-05 Tom Tromey <tromey@cygnus.com>
3479 * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
3480 * jvgenmain.c (class_mangling_prefix): Removed.
3481 (class_mangling_suffix): New global.
3483 * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
3485 (print_method_info): Handle overrides for static and final
3487 (process_file): Generate declaration for class object field.
3488 * class.c (cxx_keywords): New array.
3489 (utf8_cmp): New function.
3490 (cxx_keyword_p): New function.
3491 (layout_class_method): Mangle C++ keywords by appending `$'.
3492 (mangle_field): New function.
3493 (mangle_class_field): Use mangle_field. Mangle class name as
3495 (mangle_static_field): Use mangle_field.
3497 Tue Oct 3 13:44:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
3499 * decl.c (find_local_variable): Removed uncessary type check and
3500 fixed range check typo. From Corey Minyard.
3502 Wed Sep 13 16:06:52 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
3504 * decl.c (give_name_to_locals): New local `code_offset'. Call
3505 `maybe_adjust_start_pc'.
3506 * expr.c (note_instructions): New function.
3507 (expand_byte_code): Don't collect insn starts here.
3508 (peek_opcode_at_pc): New function.
3509 (maybe_adjust_start_pc): Likewise.
3510 * java-tree.h (maybe_adjust_start_pc): Declare.
3511 (note_instructions): Likewise.
3512 * jcf-parse.c (parse_class_file): Call `note_instructions'.
3514 Wed Sep 13 11:50:35 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
3516 * parse.y (field_access:): Fixed indentation.
3517 (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
3519 2000-09-07 Tom Tromey <tromey@cygnus.com>
3522 * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
3523 JPRIMITIVE_TYPE_P, for arithmetic operators.
3524 (patch_method_invocation): Indentation fix.
3525 (try_builtin_assignconv): Handle boolean specially. Fixed typo.
3526 (valid_builtin_assignconv_identity_widening_p): Handle boolean.
3527 (do_unary_numeric_promotion): Cleaned up code.
3528 (valid_cast_to_p): Handle boolean correctly.
3530 2000-09-27 Tom Tromey <tromey@cygnus.com>
3532 * lex.c (java_read_unicode): Reset bs_count when finished with
3535 2000-10-01 Mark Mitchell <mark@codesourcery.com>
3538 * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
3539 * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
3540 (typeck.o): Depend on ggc.h.
3541 * class.c (add_method_1): Use GC functions for allocation.
3542 (init_class_processing): Register roots.
3543 * decl.c (ggc_p): Set to 1.
3544 (pending_local_decls): Make it static.
3545 (push_jvm_slot): Use GC functions for allocation.
3546 (init_decl_processing): Register roots.
3547 (give_name_to_locals): Use GC functions for allocation.
3548 (lang_mark_tree): New function.
3549 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
3550 functions for allocation.
3551 * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
3552 * lex.c (java_lex): Use build_string, rather than replicating it
3554 * parse.y (goal): Add more roots.
3555 (mark_parser_ctxt): New function.
3556 * typeck.c: Include ggc.h.
3558 2000-09-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
3560 * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
3561 contains something else than MODIFY_EXPR.
3563 2000-09-23 Mark Mitchell <mark@codesourcery.com>
3565 * Make-lang.in (JAVA_SRCS): Include java-tree.h.
3566 * Makefile.in (parse.o): Depend on ggc.h.
3567 (class.o): Likewise.
3568 (constants.o): Likewise.
3571 (jcf-parse.o): Likewise.
3572 (jcf-write.o): Likewise.
3573 (mangle.o): Likewise.
3574 * class.c: Include ggc.h.
3575 (build_static_field_ref): Register GC roots.
3576 (layout_class): Likewise.
3577 (init_class_processing): Likewise.
3578 * constants.c: Include ggc.h.
3579 (current_constant_pool_data_ref): Remove.
3580 (tag_nodes): Move it to ...
3581 (get_tag_node): ... here. Register GC roots.
3582 * decl.c: Include ggc.h. Remove many global tree definitions.
3583 (throw_node): Define.
3584 (java_global_trees): Likewise.
3585 (predef_filenames): Make the size a constant.
3586 (init_decl_processing): Adjust accordingly.
3587 (init_decl_processing): Call init_jcf_parse. Register GC roots.
3588 * expr.c: Include ggc.h.
3589 (init_expr_processing): Register GC roots.
3590 (build_invokeinterface): Likewise.
3591 * java-tree.h: Replace extern tree declarations with macros.
3592 (java_global_trees): New variable.
3593 (java_tree_index): New enumeration.
3594 (init_jcf_parse): Declare.
3595 * jcf-parse.c: Include ggc.h.
3596 (current_class): Remove declaration.
3597 (main_class): Likewise.
3598 (all_class_list): Likewise.
3599 (predefined_filename_p): Adjust for constant size of
3601 (init_jcf_parse): New function.
3602 * jcf-write.c: Include ggc.h.
3603 (generate_classfile): Register GC roots.
3604 (append_synthetic_attribute): Likewise.
3605 (append_innerclass_attribute_entry): Likewise.
3606 * lang.c: Include ggc.h.
3607 (lang_print_error): Register GC roots.
3608 * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
3610 * parse.y: Include ggc.h.
3611 (wfl_operator): Remove.
3612 (goal): Register GC roots.
3613 (java_pop_parser_context): Adjust for new field names.
3614 (java_parser_context_save_global): Likewse.
3615 (java_parser_context_restore_global): Likewise.
3616 (java_parser_context_suspend): Likewise.
3617 (java_parser_context_resume): Likewise.
3618 (verify_constructor_circularity): Register GC roots.
3619 (lookup_cl): Likewise.
3620 (java_reorder_fields): Likewise.
3621 (build_current_this): Likewise.
3622 (class_in_current_package): Likewise.
3623 (argument_types_convertible): Likewise.
3624 (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
3626 2000-09-14 Tom Tromey <tromey@cygnus.com>
3628 * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
3630 2000-09-13 Tom Tromey <tromey@cygnus.com>
3632 * jcf-parse.c: Include <locale.h>.
3633 * jv-scan.c: Include <locale.h>.
3635 2000-09-12 Tom Tromey <tromey@cygnus.com>
3637 * expr.c (pop_type_0): Return `Object' if trying to merge two
3639 * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
3640 interface types; `Object' is always a valid supertype.
3642 2000-09-12 Tom Tromey <tromey@cygnus.com>
3645 * jv-scan.c (help): Document --encoding.
3646 (options): Added `encoding' entry.
3647 (OPT_ENCODING): New define.
3648 (main): Handle --encoding.
3649 Include <langinfo.h> if nl_langinfo exists.
3650 * lang-options.h: Document --classpath, --CLASSPATH, --main, and
3652 * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
3653 (parse_source_file): Correctly call java_init_lex. Added `finput'
3654 argument. Use nl_langinfo to determine default encoding.
3655 * java-tree.h (current_encoding): Declare.
3656 * parse.y (java_parser_context_restore_global): Don't restore
3658 (java_parser_context_save_global): Don't set `finput' field.
3659 (java_pop_parser_context): Don't restore `finput'. Free old lexer
3661 * lang.c (current_encoding): New global.
3662 (lang_decode_option): Recognize `-fencoding='.
3663 (finish_parse): Don't close finput.
3664 * parse.h (struct parser_ctxt): Removed `finput' and
3665 `unget_utf8_value' fields. Added `lexer' field.
3666 (java_init_lex): Fixed declaration.
3667 * lex.c (java_new_lexer): New function.
3668 (java_destroy_lexer): Likewise.
3669 (java_read_char): Added `lex' argument. Handle iconv case.
3670 (java_read_unicode): Added `lex' argument. Count backslashes in
3672 (java_init_lex): Added `finput' and `encoding' arguments. Set
3673 `lexer' field in ctxp.
3674 (BAD_UTF8_VALUE): Removed.
3675 (java_lex): Handle seeing UEOF in the middle of a string literal.
3676 * lex.h: Include <iconv.h> if HAVE_ICONV defined.
3677 (java_lexer): New structure.
3680 (DEFAULT_ENCODING): New define.
3681 (java_destroy_lexer): Declare.
3683 2000-09-12 Tom Tromey <tromey@cygnus.com>
3686 * lex.c (java_init_lex): Initialize java_io_serializable.
3687 * parse.y (java_io_serializable): New global.
3688 (valid_ref_assignconv_cast_p): An array can be cast to
3691 2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
3693 * decl.c, expr.c: Include defaults.h if not already included.
3694 Don't define the *_TYPE_SIZE macros.
3696 2000-09-09 Geoffrey Keating <geoffk@cygnus.com>
3698 * typeck.c (build_java_array_type): Correct first parameter
3699 in ADJUST_FIELD_ALIGN invocation.
3701 2000-09-06 Tom Tromey <tromey@cygnus.com>
3703 * lang-specs.h: Also recognize `-femit-class-files'.
3705 2000-09-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
3707 * verify.c (merge_types): Load the types to merge if necessary.
3709 2000-09-02 Anthony Green <green@redhat.com>
3711 * jcf-io.c: Include zlib.h.
3712 (open_in_zip): Read compressed class file archives.
3713 * zipfile.h (ZipDirectory): Add uncompressed_size and
3714 compression_method fields.
3715 * zextract.c (read_zip_archive): Collect file compression info.
3717 2000-08-15 Bryce McKinlay <bryce@albatross.co.nz>
3719 * parse.y (do_resolve_class): Also explore superclasses of
3720 intermediate enclosing contexts when searching for inner classes.
3722 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
3724 * parse.y (variable_declarator_id:): Better error message.
3725 (expression_statement:): Use YYNOT_TWICE.
3726 (cast_expression:): Likewise.
3727 (assignment:): Likewise.
3729 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
3731 * parse.y (do_merge_string_cste): New locals. Create new
3732 STRING_CSTs each time, use memcpy. Fixes gcj/311.
3734 2000-08-07 Hans Boehm <boehm@acm.org>
3736 * boehm.c (mark_reference_fields): Set marking bits for all words in
3737 a multiple-word record.
3738 (get_boehm_type_descriptor): Use the procedure marking descriptor for
3741 2000-08-31 Mike Stump <mrs@wrs.com>
3743 * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
3744 jcf-dump$(exeext)): Make parallel safe.
3746 2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
3748 * jcf-parse.c (set_source_filename): Constify a char *.
3749 * jcf-write.c (append_innerclasses_attribute,
3750 make_class_file_name): Constify a char *. Don't recycle a
3751 variable for an unrelated purpose.
3752 * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
3753 (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
3755 2000-08-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
3757 * expr.c (can_widen_reference_to): Fixed indentation.
3758 * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
3759 * parse.y: `finit$' replaces `$finit$' in comments.
3760 (try_builtin_assignconv): Fixed leading comment.
3762 2000-08-25 Greg McGary <greg@mcgary.org>
3764 * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
3766 2000-08-24 Greg McGary <greg@mcgary.org>
3768 * lang.c (lang_decode_option): Use ARRAY_SIZE.
3769 * parse.y (BINOP_LOOKUP): Likewise.
3771 2000-08-22 Andrew Haley <aph@cygnus.com>
3773 * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
3774 sign extending. Fixes gcj/321.
3775 * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
3776 combining to make a jlong. Fixes gcj/321.
3778 2000-08-21 Nix <nix@esperi.demon.co.uk>
3780 * lang-specs.h: Do not process -o or run the assembler if
3783 2000-08-16 Andrew Haley <aph@cygnus.com>
3785 * typeck.c (build_java_array_type): Rewrite code to do array
3786 alignment. Take into account back-end macros when aligning array
3787 data. Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
3788 user to set alignment. Fixes gcj/252 and 160.
3790 2000-08-09 Tom Tromey <tromey@cygnus.com>
3792 * parse.y (check_abstract_method_definitions): Now return `int'.
3793 Check implemented interfaces. Fixes PR gcj/305.
3795 * parse.y (patch_switch_statement): Disallow `long' in switch
3796 expressions. Fixes PR gcj/310.
3798 2000-08-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
3800 * decl.c (finit_leg_identifier_node): New global.
3801 (init_decl_processing): Use `finit$' to initialize
3802 finit_identifier_node. Use `$finit$' to initialize
3803 finit_leg_identifier_node.
3804 * expr.c (expand_java_field_op): Use ID_FINIT_P.
3805 * java-tree.h (finit_identifier_node): Changed attached comment.
3806 (finit_leg_identifier_node): New declaration.
3807 (ID_FINIT_P): Take finit_identifier_node and
3808 finit_leg_identifier_node into account. This is a backward
3811 2000-08-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
3813 * jcf-write.c (generate_bytecode_conditional): Re-installed lost
3815 (generate_bytecode_insns): Check `nargs' before emitting it.
3816 * verify.c (merge_type_state): Fixed typo.
3817 * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
3818 generate_bytecode_{conditional,insns}.
3820 Sun Aug 13 09:41:49 2000 Anthony Green <green@redhat.com>
3822 * check-init.c (check_init): Add case for BIT_FIELD_REF (required
3825 2000-08-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
3827 * class.c (maybe_layout_super_class): Fixed indentation.
3828 * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
3829 (java_check_methods): New function declaration.
3830 * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
3831 instead of `str_ptr'.
3832 * jcf-write.c (generate_bytecode_insns): Emit number the of args
3833 of a `invokeinterface' at the right time.
3834 * parse.h (WFL_STRIP_BRACKET): New macro.
3835 (SET_TYPE_FOR_RESOLUTION): Use it.
3836 * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
3837 (check_class_interface_creation): Don't check for cross package
3838 innerclass name clashes.
3839 (method_header): Behave properly if MDECL is `error_mark_node'.
3840 (method_declarator): Return `error_mark_node' if bogus current
3842 (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
3843 (resolve_and_layout): New local `decl_type', set and used. Call
3845 (java_check_methods): New method.
3846 (java_layout_classes): Use it.
3847 (resolve_qualified_expression_name): No EH check necessary in
3849 (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
3851 (patch_assignment): Set DECL_INITIAL on integral final local.
3853 2000-08-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
3855 * java-tree.h (flag_extraneous_semicolon): New extern.
3856 * lang-options.h: (-Wextraneous-semicolon): New option.
3857 * lang.c (flag_redundant): Fixed typo in leading comment.
3858 (flag_extraneous_semicolon): New global.
3859 (lang_decode_option): Set `flag_extraneous_semicolon' when
3860 -Wall. Decode `-Wextraneous-semicolon'.
3861 * parse.y (type_declaration:): Removed `SC_TK' hack, added
3862 `empty_statement' rule.
3863 (class_body_declaration): Likewise.
3864 (method_body:): Accept `;' as a method body.
3865 (static_initializer:): Removed `SC_TK' hack.
3866 (constructor_block_end:): Likewise.
3867 (empty_statement:): Report deprecated empty declaration. Fixes
3870 2000-08-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
3872 * parse.y (build_dot_class_method_invocation): Changed parameter
3873 name to `type'. Build signature from `type' and convert it to a
3874 STRING_CST if it's an array.
3875 (patch_incomplete_class_ref): `build_dot_class_method_invocation'
3876 to use `ref_type' directly.
3878 Sun Aug 6 00:47:24 2000 Ovidiu Predescu <ovidiu@cup.hp.com>
3880 * lang-options.h: Added a comma after the last element to avoid
3881 syntax errors when other languages define additional options.
3883 2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
3885 * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
3886 * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
3887 (jc1): Link with $(BACKEND).
3888 (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
3890 2000-08-02 Zack Weinberg <zack@wolery.cumb.org>
3892 * jvspec.c: Adjust type of second argument to
3893 lang_specific_driver, and update code as necessary.
3895 * class.c (build_dtable_decl): Initialize dummy.
3897 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
3899 * parse.y (maybe_yank_clinit): When generating bytecode: non empty
3900 method bodies not to rule out discarding `<clinit>'; don't use
3901 <clinit> to initialize static fields with constant initializers.
3903 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
3905 * gjavah.c (print_method_info): Added `synth' parameter. Skip
3907 (method_synthetic): New global.
3908 (HANDLE_METHOD): Recognize synthetic method and tell
3909 `print_method_info' about it.
3910 (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
3911 processing a synthetic method.
3912 * jcf-reader.c (skip_attribute): New function.
3913 ( skip_attribute): Likewise.
3915 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
3917 * parse.y (build_outer_field_access): Fixed comments.
3918 (fix_constructors): Emit the initialization of this$<n> before
3920 (resolve_qualified_expression_name): Build an access to `decl' if
3923 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
3925 * parse-scan.y (curent_class): Non longer const.
3926 (inner_qualifier, inner_qualifier_length): Deleted.
3927 (current_class_length): New global.
3928 (bracket_count): Fixed typo in leading comment.
3929 (anonymous_count): New global.
3930 (class_instance_creation_expression:): Handle anonymous classes.
3931 (anonymous_class_creation:): New rule.
3932 (push_class_context): Rewritten.
3933 (pop_class_context): Likewise.
3934 (INNER_QUALIFIER): Macro deleted.
3935 (report_class_declaration): call `push_class_context' when
3936 entering the function. `fprintf' format modified not to use
3938 (report_class_declaration): Assign `package_name' and
3939 `current_class' to NULL separately.
3941 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
3943 * expr.c (build_invokeinterface): Call layout_class_methods on
3946 2000-07-27 Tom Tromey <tromey@cygnus.com>
3947 Anthony Green <green@cygnus.com>
3948 Alexandre Petit-Bianco <apbianco@cygnus.com>
3950 * class.c (make_class_data): Create vtable for abstract classes.
3951 (get_dispatch_table): Changed to cope with abstract classes.
3953 2000-07-27 Tom Tromey <tromey@cygnus.com>
3955 * parse.y (patch_method_invocation): Don't reverse the argument
3956 list when dealing with anonymous class constructors. Fixed typo in
3959 2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
3961 * parse.y (build_alias_initializer_parameter_list): Reverse
3962 crafted list when building aliases for anonymous class
3965 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
3967 * parse.y (jdep_resolve_class): Don't bother checking potential
3968 innerclass access if `decl' is NULL.
3969 (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
3972 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
3974 * parse.c: Remove (again.)
3976 2000-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
3978 * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
3979 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
3980 outside the `if' statement, alias to innerclass removed, `decl'
3981 used to mark the class complete.
3983 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
3985 * parse.y (simple_name:): Fixed typo in error message.
3987 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
3989 * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
3990 or its first operand can be error marks.
3992 2000-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
3994 * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
3995 * parse.y (method_header): Likewise.
3997 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
3999 * parse.y (process_imports): Consider that one might be trying to
4000 import an innerclass. Fixes gcj/254
4002 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
4004 * parse.y (find_as_inner_class): Handle the case where the
4005 enclosing context of an innerclass has been loaded as bytecode.
4007 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
4009 * parse.y (simple_name:): Reject `$' in type names.
4010 (resolve_type_during_patch): Use `type' as a second
4011 argument to resolve_no_layout. Fixes gcj/257.
4013 2000-07-18 Bryce McKinlay <bryce@albatross.co.nz>
4015 * parse.y (find_most_specific_methods_list): Select the only
4016 non-abstract method even if max has been set.
4017 Fixes gcj/285, gcj/298.
4019 2000-07-18 Jeff Sturm <jeff.sturm@appnet.com>
4021 * lang-specs.h: Added %(jc1) to java compiler options.
4023 2000-07-14 Zack Weinberg <zack@wolery.cumb.org>
4025 * .cvsignore: New file.
4027 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
4029 * parse.y (not_accessible_p): Access granted to innerclasses
4030 (indirectly) extending the reference type. Fixes gcj/249.
4032 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
4034 * parse.y (patch_method_invocation): Fixed comment.
4035 (maybe_use_access_method): Build this$<n>s to the context of the
4036 target method, or a type that extends it. Fixes gcj/242.
4038 2000-07-13 Mark Mitchell <mark@codesourcery.com>
4042 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
4044 * parse.y (fold_constant_for_init): Avoid bullish conversion.
4046 2000-07-13 Tom Tromey <tromey@cygnus.com>
4048 * lang-specs.h: Added %{I*}.
4050 2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
4052 * lang-specs.h: Use the new named specs. Remove unnecessary braces.
4054 2000-07-12 Mark Mitchell <mark@codesourcery.com>
4056 * parse-scan.c: Remove.
4058 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
4060 * class.c (set_super_info): Handled protected inner classes.
4061 (common_enclosing_context_p): Bail early if arguments aren't both
4063 (get_access_flags_from_decl): Handle private and protected inner
4065 * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
4066 (CLASS_PROTECTED): Likewise.
4067 (struct lang_type): New bitfield `poic'.
4068 * parse.y (jdep_resolve_class): Call check_inner_class_access on
4070 (check_inner_class_access): Renamed arguments, added
4071 comments. Handles protected inner classes (fixes gcj/225)
4072 (not_accessible_p): Fixed comments. Avoid handling inner classes.
4074 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
4076 * parse.y (resolve_qualified_expression_name): Verify qualified
4077 access to `this'. Fixes gcj/239.
4079 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
4081 * jcf-write.c (generate_classfile): Don't install ConstantValue
4084 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4086 * parse.y (resolve_qualified_expression_name): Handle inner class
4087 access. Fixes gcj/256.
4089 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4091 * jcf-write.c (generate_classfile): Properly install the
4092 ConstantValue attribute and the initial value constant pool index
4093 on string constants.
4094 * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
4097 2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
4099 * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
4101 * parse.y (find_as_inner_class): Fixed typo.
4102 (do_resolve_class): Explore enclosing contexts when searching for
4103 innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
4104 (check_inner_class_access): Check `decl' which can be null in case
4107 2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4109 * java-tree.h (java_debug_context): Declared `extern'.
4110 (safe_layout_class): Likewise.
4111 * parse.y (resolve_field_access): Field must be `static' in order
4112 to be replaced by its initial value. Added comments.
4113 (find_applicable_accessible_methods_list): Fixed typo.
4114 (find_most_specific_methods_list): Methods found in innerclasses
4115 take over methods founds in the enclosing contexts.
4116 (java_complete_tree): Loosen restrictions on the type of DECLs
4117 that can be replaced by their initialization values.
4118 (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
4120 2000-07-05 Tom Tromey <tromey@cygnus.com>
4122 * Make-lang.in (PARSE_DIR): New macro.
4123 (PARSE_RELDIR): Likewise.
4124 (PARSE_C): Likewise.
4125 (PARSE_SCAN_C): Likewise.
4126 ($(PARSE_C)): New target.
4127 ($(PARSE_SCAN_C)): Likewise.
4128 (SET_BISON): New macro.
4129 (BISONFLAGS): Likewise.
4130 (JAVABISONFLAGS): Likewise.
4132 2000-07-02 Bryce McKinlay <bryce@albatross.co.nz>
4134 * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
4135 argument on the first pass for CNI as well as JNI.
4136 (print_method_info): Set up method name on the first pass only.
4138 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
4140 * parse.y (parser_qualified_classname): Removed parameter
4142 (create_interface): Removed first passed parameter to
4143 parser_qualified_classname.
4144 (create_class): Likewise. Don't install alias on static
4145 innerclasses. Fixes gcj/275.
4147 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
4149 * parse.y (maybe_generate_pre_expand_clinit): Don't build a
4150 debugable statement with empty_stmt_node. Fixes gcj/272
4152 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
4154 * expr.c (build_instanceof): Layout type after it's loaded. Fixes
4157 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
4159 * jcf-write.c (push_long_const): Appropriately cast short negative
4162 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
4164 * parse.y (verify_constructor_super): Use loop variable
4165 `m_arg_type' initialized with `mdecl_arg_type'.
4167 2000-06-29 Tom Tromey <tromey@cygnus.com>
4169 * parse.y (resolve_field_access): Handle case where `type_found'
4172 2000-06-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
4174 * expr.c (lookup_field): The same field can be found through two
4175 different interface. Don't declare it ambiguous in that case.
4177 2000-06-27 Tom Tromey <tromey@cygnus.com>
4179 * lex.c (java_lineterminator): Don't recognize \r after \n. If \r
4180 follows \r, then unget it at a lower level.
4182 2000-06-26 Tom Tromey <tromey@cygnus.com>
4184 * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
4187 2000-06-25 Tom Tromey <tromey@cygnus.com>
4189 * parse.y (for_statement): Wrap expression in a WFL if it is a
4190 constant. For PR gcj/268.
4192 2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
4194 * parse.y (do_resolve_class): Minor optimiztion in the package
4195 list search. Removed unnecessary test and return statement.
4196 (valid_ref_assignconv_cast_p): Order of arguments to
4197 enclosing_context_p fixed.
4199 2000-06-24 Tom Tromey <tromey@cygnus.com>
4201 * expr.c (lookup_field): Print error and return error_mark_node if
4202 field reference is ambiguous.
4204 * parse.y (check_abstract_method_definitions): Also check if
4205 `other_method' is abstract.
4207 2000-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
4209 * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
4211 * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
4212 (struct lang_type): New field `pic'.
4213 (CLASS_PRIVATE): New macro.
4214 * parse.y (check_inner_class_access): New function.
4215 (jdep_resolve_class): Call it.
4217 2000-06-23 Tom Tromey <tromey@cygnus.com>
4219 * parse.y (patch_incomplete_class_ref): Initialize the returned
4220 class. For PR gcj/260.
4222 2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
4224 * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
4226 2000-06-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
4228 * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
4229 Java specific checks.
4230 * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
4232 * java-tree.def (CASE_EXPR): Marked 'e'.
4233 (DEFAULT_EXPR): Likewise.
4234 * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
4236 * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
4237 Java specific checks.
4238 (generate_bytecode_insns): Test try_block for BLOCK before using
4240 * parse.y (build_wfl_wrap): Added `location' argument. Set
4241 EXPR_WFL_LINECOL accordingly.
4242 (dim_expr:): Wrap constants with WFLs.
4243 (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
4244 (resolve_package): Check for `stmt' not being a BLOCK before
4245 building a debuggable statement with it.
4246 (make_qualified_primary): Added extra parameter to build_wfl_wrap
4248 (resolve_field_access): Make sure `decl' is a DECL before treating
4250 (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
4251 IDENTIFIER_NODE before treating it as such.
4252 (patch_new_array_init): Make sure `elt' is a TREE_LIST before
4253 treating it as such.
4254 (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
4255 to be applied only on non array types.
4257 2000-06-16 Per Bothner <per@bothner.com>
4259 * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN): Don't
4260 define in terms of DECL_RESULT, as that fails when --enable-checking.
4262 2000-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4264 * jcf-write.c (CHECK_PUT): Add static prototype. Make pointer
4265 types the same in comparison.
4266 (CHECK_OP): Add static prototype.
4268 2000-06-13 Jakub Jelinek <jakub@redhat.com>
4270 * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
4271 * parse.y (java_complete_class): Set DECL_USER_ALIGN.
4274 2000-06-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4276 * decl.c (create_primitive_vtable): Prototype.
4278 * jcf-write.c (generate_bytecode_insns): Initialize variable
4281 * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
4283 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
4285 * parse.y (find_applicable_accessible_methods_list): Use a hashtable
4286 to track searched classes, and do not search the same class more than
4287 once. Call find_applicable_accessible_methods_list on immediate
4288 superclass, instead of search_applicable_method_list on all ancestors.
4291 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
4293 * parse.y (register_fields): Permit static fields in inner classes
4294 if they are final. Fix for PR gcj/255.
4296 2000-06-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
4298 * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
4299 * parse.y (find_in_imports): Returned type changed to void,
4300 leading comment fixed.
4301 (register_package): New function.
4302 (qualify_and_find): Likewise.
4303 (package_declaration:): Use `register_package'.
4304 (single_type_import_declaration:): Removed local variable
4305 `node'. Added missing `;' for consistency.
4306 (type_import_on_demand_declaration:): Use `chainon' to link new
4308 (lookup_field_wrapper): Lookup local variables defined in outer
4310 (java_complete_class): Don't reverse the list of imported on demand.
4311 (do_resolve_class): Reorganized. Removed local variable
4312 `original_name'. Call `qualify_and_find' with the current package
4313 name, invoke `find_in_imports_on_demand' right after. Call
4314 `qualify_and_find' with the packages we've seen so far. Fixed
4315 operations numbering in comments.
4316 (java_expand_class): Don't reverse `package_list'.
4317 (find_most_specific_methods_list): New local variables `abstract'
4318 and `candidates'. Use them to pick the right method.
4320 Tue Jun 6 11:39:05 2000 Tom Tromey <tromey@ferrule.cygnus.com>
4322 * parse.y (check_modifiers_consistency): Don't subtract out
4323 `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
4325 2000-06-04 Philipp Thomas <pthomas@suse.de>
4327 * Makefile.in (INTLLIBS): New.
4331 Fri Jun 2 16:48:55 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4333 * class.c (get_dispatch_table): Build the vtable dummy entry list
4334 element with a null purpose. Fixed leading comment.
4335 (build_dtable_decl): Build an accurate dtable type when appropriate
4338 2000-06-02 Richard Henderson <rth@cygnus.com>
4340 * lang.c (lang_get_alias_set): New.
4342 2000-05-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
4344 * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
4345 before using it as the accessed field.
4347 2000-05-31 Tom Tromey <tromey@cygnus.com>
4349 * java-tree.h (boolean_array_vtable, byte_array_vtable,
4350 char_array_vtable, short_array_vtable, int_array_vtable,
4351 long_array_vtable, float_array_vtable, double_array_vtable):
4353 * expr.c (get_primitive_array_vtable): New function.
4354 (create_primitive_vtable): New function.
4355 (java_lang_expand_expr): Enable code to statically generate
4357 * decl.c (init_decl_processing): Create primitive vtables.
4358 (boolean_array_vtable, byte_array_vtable, char_array_vtable,
4359 short_array_vtable, int_array_vtable, long_array_vtable,
4360 float_array_vtable, double_array_vtable): Define.
4362 2000-05-26 Zack Weinberg <zack@wolery.cumb.org>
4364 * java/parse.y (find_applicable_accessible_methods_list):
4365 Don't add an uninitialized value to the list.
4367 2000-05-25 Tom Tromey <tromey@cygnus.com>
4369 * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
4370 when trying to see if field's class should be initialized. Always
4371 initialize field's declaring class, not qualified class.
4374 * parse.y (array_constructor_check_entry): Pass `wfl_value', not
4375 `wfl_operator', to maybe_build_primttype_type_ref.
4378 2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
4380 * parse.y (patch_method_invocation): Don't try to lookup methods
4383 2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
4385 * parse.y (resolve_field_access): Call the appropriate <clinit>
4386 before accessing the length of a static array. Craft a decl for
4387 the field while its time. Fixes PR gcj/129.
4389 2000-05-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
4391 * parse.y (resolve_package): Correctly set `*next' (was off by
4393 (resolve_qualified_expression_name): Fixed comment.
4395 Thu Apr 27 17:47:34 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4397 * jcf-parse.c (jcf_parse_source): Reset current_class and
4398 current_function_decl to NULL before parsing a new file.
4400 Thu Apr 27 17:25:33 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4402 * parse.y (block_end:): If the collected block doesn't feature a
4403 statement, insert an empty statement.
4405 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
4407 * parse.y (maybe_yank_clinit): New function.
4408 (maybe_generate_pre_expand_clinit): Always link <clinit> at the
4409 end of the list of methods belonging to a class.
4410 (java_complete_expand_method): Check whether <clinit> is really
4411 necessary and expand it accordingly.
4413 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
4415 * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
4416 processed by the method's switch statement.
4418 2000-05-19 Tom Tromey <tromey@cygnus.com>
4420 * java-tree.h: Added init state enum.
4421 * decl.c (emit_init_test_initialization): Initialize class
4422 initialization check variable by looking at class' state.
4424 2000-05-19 Tom Tromey <tromey@cygnus.com>
4426 * java-tree.h (build_instanceof): Declare.
4427 (build_get_class): Declare.
4428 * parse.y (patch_binop): Use build_instanceof.
4429 * expr.c (build_instanceof): New function. If class is final,
4430 don't make a function call.
4431 (expand_java_INSTANCEOF): Use it.
4432 (build_get_class): New function.
4434 2000-05-18 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
4436 * jcf-write.c (generate_classfile): Scan the source_file for
4437 slashes with the right pointer variable.
4439 Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
4441 * lang.c (lang_decode_option): Update -Wunused flags by calling
4443 * decl.c (poplevel): Replace warn_unused with warn_unused_label.
4445 2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
4447 * check_init.c (check_init): Constify local char *.
4448 * class.c (push_class): Constify local char *.
4449 * java_tree.h: Update prototypes.
4450 * jcf-io.c (open_class): Constify filename parameter and
4452 (find_class): Remove redundant string copy. Cast return from
4454 * jcf-parse.c (read_class, parse_class_file, yyparse):
4455 Constify local char *.
4456 * jcf-write.c (generate_bytecode_insns, generate_classfile):
4457 Constify local char *.
4458 * jcf.h (JCF): Constify filename and classname.
4459 (JCF_FINISH): Cast args to FREE to char * when appropriate.
4460 * lang.c (init_parse): Constify parameter and return value.
4461 * lex.c (java_get_line_col): Constify filename parameter.
4462 * parse.h: Constify parser_ctxt.filename. Update prototypes.
4463 * parse.y (java_parser_context_suspend,
4464 issue_warning_error_from_context, safe_layout_class): Constify
4466 * parse.c: Regenerate.
4468 2000-05-08 Tom Tromey <tromey@cygnus.com>
4470 * expr.c (build_jni_stub): Cache the result of
4471 _Jv_LookupJNIMethod.
4473 2000-05-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4475 * decl.c (predef_filenames_size): Now 7.
4476 (predef_filenames): New seventh entry.
4478 2000-05-04 Tom Tromey <tromey@cygnus.com>
4480 * boehm.c (mark_reference_fields): Don't mark RawData fields.
4481 Keep track of when we've seen a reference field after a
4482 non-reference field.
4483 (get_boehm_type_descriptor): Handle case where we see
4484 non-reference fields but no trailing reference field.
4485 * decl.c (rawdata_ptr_type_node): Define.
4486 (init_decl_processing): Initialize rawdata_ptr_type_node.
4487 * java-tree.h (rawdata_ptr_type_node): Declare.
4489 2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4491 * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
4492 specifiers in calls to fprintf.
4494 2000-05-03 Andrew Haley <aph@cygnus.com>
4496 * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
4498 * javaop.h (WORD_TO_INT): New function.
4499 (IMMEDIATE_s4): Use WORD_TO_INT.
4500 * jcf.h (JPOOL_INT): Ditto.
4502 * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
4505 2000-04-19 Tom Tromey <tromey@cygnus.com>
4507 * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
4509 * jcf-parse.c (parse_class_file): Call build_jni_stub for native
4511 * expr.c (build_jni_stub): New function.
4512 * lang-specs.h: -fjni and -femit-class-file are incompatible.
4514 * parse.y (java_complete_expand_methods): Expand a native method
4515 and call build_jni_stub if -fjni given.
4516 * lang-options.h: Document -fjni.
4517 * lang.c (flag_jni): New global.
4518 (lang_f_options): Added `jni' entry.
4519 * java-tree.h (soft_lookupjnimethod_node,
4520 soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
4522 (flag_jni): Declare.
4523 (build_jni_stub): Declare.
4524 (struct lang_decl): Added `native' flag.
4525 (METHOD_NATIVE): Redefined to use `native' field of lang specific
4527 * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
4528 soft_jnipopsystemframe_node): New globals.
4529 (init_decl_processing): Set them. _Jv_InitClass only takes one
4532 * java-tree.def: Put into `C' mode.
4534 2000-04-27 Tom Tromey <tromey@cygnus.com>
4537 * expr.c (expand_invoke): Generate check to see if object pointer
4538 is null in nonvirtual invocation case.
4539 * java-tree.h (soft_nullpointer_node): Declare.
4540 * decl.c (soft_nullpointer_node): New global.
4541 (init_decl_processing): Initialize soft_nullpointer_node.
4542 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
4543 or `private' methods.
4544 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
4546 Wed Apr 26 14:29:33 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4548 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
4551 2000-04-26 Tom Tromey <tromey@cygnus.com>
4553 * zextract.c (find_zip_file_start): New function.
4554 (read_zip_archive): Use it.
4556 2000-04-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
4558 * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
4560 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
4562 * class.c (common_enclosing_context_p): New function.
4563 * java-tree.h (common_enclosing_context_p): Added prototype.
4564 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
4565 classes sharing an outer context with the current instance.
4566 * parse.y (build_access_to_thisn): Fixed leading comment.
4567 (verify_constructor_super): New local `supper_inner'. Skip
4568 enclosing context argument in the case of inner class constructors.
4569 (patch_method_invocation): Insert proper context as second
4570 parameter to pure inner class constructor super invocations.
4572 Mon Apr 24 14:59:36 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4574 * parse.y (end_class_declaration): Reset the interface number
4577 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
4579 * parse.y (source_start_java_method): Deleted unnecessary code.
4580 (patch_method_invocation): Fixed comment.
4582 2000-04-24 Robert Lipe <robertlipe@usa.net>
4584 * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
4586 2000-04-23 Tom Tromey <tromey@cygnus.com>
4588 * boehm.c (mark_reference_fields): Use int_byte_position.
4590 2000-04-22 Tom Tromey <tromey@cygnus.com>
4592 * boehm.c (mark_reference_fields): Only call byte_position on
4595 2000-04-22 Tom Tromey <tromey@cygnus.com>
4597 * boehm.c (mark_reference_fields): Added `last_view_index'
4598 argument. Use DECL_FIELD_OFFSET to determine field's offset.
4600 Thu Apr 20 17:41:28 2000 Mo DeJong <mdejong@cygnus.com>
4602 * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
4603 * parse.y (check_class_interface_creation): Fixed comments. Select
4604 permitted modifiers for (inner) interfaces. Changed error message
4605 to report rejected modifiers used with local classes.
4607 2000-04-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
4609 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
4610 of directly inherited type considered in scope.
4611 * parse.y (do_resolve_class): Search inherited classes for inner
4614 2000-04-20 Tom Tromey <tromey@cygnus.com>
4616 * parse.y (not_accessible_p): Use member's class, not current
4617 class, when doing inheritance check for protected reference.
4620 Thu Apr 20 18:20:58 2000 Jason Schroeder <shrode@subnature.com>
4622 * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
4624 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
4626 * parse.y (lookup_field_wrapper): Search for final local aliases.
4627 (resolve_expression_name): Let lookup_field_wrapper search for
4628 final local aliases. Force the value of `name' if one is found.
4629 (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
4630 an expression name. Fixed comments.
4632 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
4634 * parse.y (yyerror): `msg' can be null, don't use it in that case.
4636 2000-04-19 Tom Tromey <tromey@cygnus.com>
4638 * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
4640 2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
4642 * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
4644 2000-04-18 Tom Tromey <tromey@cygnus.com>
4647 * gjavah.c (utf8_cmp): Changed return value.
4648 (cxx_keyword_subst): Handle all C++ keywords. Allocate new return
4650 (cxx_keywords): New global.
4651 (get_field_name): Handle new result of cxx_keyword_subst.
4652 (print_method_info): Likewise.
4654 2000-04-17 Bryce McKinlay <bryce@albatross.co.nz>
4656 * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
4657 with a newline, for CNI.
4658 (print_stub_or_jni): Print a space or newline before method name for
4660 (print_cxx_classname): Don't write leading "::" in CNI stub method.
4661 (process_file): Include gcj/cni.h if generating CNI stubs.
4663 2000-04-16 Tom Tromey <tromey@cygnus.com>
4665 * gjavah.c (decompile_method): Use print_field_name.
4668 2000-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
4670 * parse.y (java_expand_classes): Reverse the package list once.
4671 (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
4673 (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
4674 the `==' and `!=' operators.
4676 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4678 * jcf-write.c (generate_bytecode_insns): At invokation time,
4679 always relate an interface method to the type of its selector.
4681 2000-04-05 Tom Tromey <tromey@cygnus.com>
4684 * expr.c (expand_invoke): Generate check to see if object pointer
4685 is null in nonvirtual invocation case.
4686 * java-tree.h (soft_nullpointer_node): Declare.
4687 * decl.c (soft_nullpointer_node): New global.
4688 (init_decl_processing): Initialize soft_nullpointer_node.
4689 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
4690 or `private' methods.
4691 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
4693 2000-04-05 Tom Tromey <tromey@cygnus.com>
4696 * parse.y (check_final_assignment): Recognize assignments to the
4697 `length' field of an array when generating class files.
4699 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4701 * class.c (decl_hash): Prototype removed.
4702 (decl_compare): Likewise.
4704 2000-04-05 Tom Tromey <tromey@cygnus.com>
4706 * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
4707 * parse.y (check_modifiers_consistency): Check for final/volatile
4708 clash. Fixes PR gcj/164.
4710 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4712 * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
4714 (java_hash_compare_tree_node): Renamed from `decl_compare, made
4716 (add_method_1): Use `java_hash_hash_tree_node' and
4717 `java_hash_compare_tree_node'.
4718 * java-tree.h: (java_hash_hash_tree_node): Prototyped.
4719 (java_hash_compare_tree_node): Likewise.
4720 * parse.y (find_applicable_accessible_methods_list): Create,
4721 delete and use a hash table to remember already searched interfaces.
4723 2000-04-03 Matt Welsh <mdw@cs.berkeley.edu>
4725 * jcf-depend.c (add_entry): Fixed bug where list was always replaced
4728 2000-04-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4730 * boehm.c (mark_reference_fields, set_bit): Prototype.
4731 (set_bit): Un-ANSI-fy definition.
4733 * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
4736 * decl.c (emit_init_test_initialization): Likewise.
4738 * gjavah.c (jni_print_char): Likewise.
4740 * parse.y (create_new_parser_context): Likewise.
4742 Thu Mar 30 15:26:56 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4744 * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
4745 patch missing hunk. Fixed indentation.
4747 2000-03-30 Tom Tromey <tromey@cygnus.com>
4749 * gjavah.c (D_NAN_MASK): Only define as word-reversed when
4750 HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
4752 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
4754 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
4755 when negative *before* using it as an array index.
4756 * ChangeLog: Fixed typo.
4758 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
4760 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
4761 to 0 when it reaches -1.
4763 2000-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
4765 * jcf-parse.c (get_constant): Properly cast `num' during the
4766 invocation of `add_double'.
4767 * jcf-write.c (push_long_const): Properly cast `lo' before
4768 comparing it to short bounds.
4769 * parse-scan.y (interface_declaration:): Rule re-arrange so that
4770 `interface_body:' is reduced after the current interface is
4773 2000-03-26 Tom Tromey <tromey@cygnus.com>
4775 * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
4776 Java-specific `-f' option.
4778 Sun Mar 26 11:37:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4780 * decl.c (init_decl_processing): Only call initialize_sizetypes once.
4781 Adjust order of making types.
4782 Make bitsize_*_node values.
4784 Sat Mar 25 09:12:10 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4786 * class.c (make_field_value): Use byte_position.
4787 * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
4788 (java_array_data_offset): Likewise.
4789 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
4792 2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
4794 * parse.y (check_abstract_method_definitions): New local
4795 `end_type_reached'. Make sure we also consider `end_type'.
4796 (java_check_abstract_method_definitions): Make sure we eventually
4797 consider `java.lang.Object'.
4798 (maybe_use_access_method): Don't use access method if not in the
4799 context of a pure inner class or if the method's context is right.
4800 (find_applicable_accessible_methods_list): New static flag
4801 `object_done'. Don't search abstract classes as interfaces. Fixed
4802 indentation. Fixed the `java.lang.Object' only search. Search
4803 class interface(s) first, then fully search enclosing contexts.
4804 (find_most_specific_methods_list): Pick the closest candidate when
4805 they're all abstract.
4807 Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4809 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
4810 properly initialize `finished_label'. Don't emit gotos for empty
4813 2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
4815 * except.c (emit_handlers): Clear catch_clauses_last.
4817 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
4819 * parse.y (check_method_types_complete): New function.
4820 (create_class): Reset anonymous class counter only when seeing an
4822 (java_complete_class): JDEP_METHOD: Don't recompute signature
4825 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
4827 * class.c (build_static_ref): Fixed indentation in comment.
4828 * java-tree.def (TRY_EXPR): Fixed typo in name.
4829 (CLASS_LITERAL): Likewise.
4830 * java-tree.h: (TYPE_DOT_CLASS): New macro.
4831 (struct lang_type): New field `dot_class'.
4832 * jcf-write.c (generate_bytecode_insns): Fixed error message.
4833 (generate_classfile): Method `class$' is synthetic.
4834 * parse.y (build_do_class_method): New function.
4835 (build_dot_class_method_invocation): Likewise.
4836 (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
4837 (resolve_qualified_expression_name): Handle CLASS_LITERAL.
4838 (qualify_ambiguous_name): Likewise.
4839 (patch_incomplete_class_ref): Invoke synthetic method if necessary.
4840 (build_try_statement): Fixed leading comment.
4842 Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4844 * class.c (make_field_value): Properly handle sizes.
4845 (get_dispatch_vector): Use tree_low_cst and host_integerp.
4846 (layout_class_method): Count using trees.
4847 * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
4848 * expr.c (java_array_data_offset): Use int_bit_position.
4849 (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
4850 (build_invokevirtual): Use tree_low_cst and do computations with trees.
4852 2000-03-16 Tom Tromey <tromey@cygnus.com>
4854 * lang.c (flag_hash_synchronization): New global.
4855 (lang_f_options): Added `hash-synchronization'.
4856 * lang-options.h: Mention -fhash-synchronization.
4857 * java-tree.h (flag_hash_synchronization): Declare.
4858 * expr.c (java_lang_expand_expr): Only push `sync_info' value when
4859 hash table synchronization is disabled.
4860 * decl.c (init_decl_processing): Only push `sync_info' value when
4861 hash table synchronization is disabled.
4862 * class.c (make_class_data): Only push `sync_info' field when hash
4863 table synchronization is disabled. Removed dead code.
4865 2000-03-16 Tom Tromey <tromey@cygnus.com>
4867 * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
4869 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
4871 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
4873 * parse.y (patch_method_invocation): Handle anonymous classes
4874 creation in static context.
4876 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
4878 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
4879 * parse.y (resolve_qualified_expression_name): Use it.
4880 (patch_method_invocation): Likewise.
4882 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
4884 * parse.y (register_incomplete_type): JDEP_ENCLOSING set
4885 depending on the type of dependency which dictates what the
4887 (unresolved_type_p): Resolved types limited to the current class.
4889 2000-03-15 Tom Tromey <tromey@cygnus.com>
4891 * decl.c (init_decl_processing): Set type of `sync_info' to be
4894 * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
4895 Correctly compute bit number for current slot. Zero `high' and
4896 `low' in DS_LENGTH case. Don't skip inherited fields. Use
4897 mark_reference_fields.
4898 (mark_reference_fields): New function.
4900 Tue Mar 14 17:15:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4902 * parse.y (register_incomplete_type): Fixed initialization of
4905 2000-02-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
4907 * parse-scan.y (inner_qualifier, inner_qualifier_length): New
4909 (push_class_context, pop_class_context): New function.
4910 (class_body:): Call pop_class_context.
4911 (interface_body:): Likewise.
4912 (INNER_QUALIFIER): New macro.
4913 (report_class_declaration): Changed output format and use
4914 INNER_QUALIFIER. Call push_class_context.
4916 2000-02-14 Andrew Haley <aph@cygnus.com>
4918 * check-init.c (check_init): Add new cases for unary and binary
4921 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
4923 * parse.y (resolve_package): Set `next' once a type name has been
4924 progressively discovered.
4925 (resolve_qualified_expression_name): Propagate resolution only if
4926 there are remaining qualifiers. Take into account `q' might have
4927 been cleared after re-qualification.
4928 * parse.y (patch_method_invocation): New local `resolved'.
4929 Section dealing with qualified expression rewritten to use
4930 resolve_field_access.
4932 Mon Mar 13 12:21:13 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
4934 * parse.h (PUSH_CPC): Fixed indentation.
4935 (DEBUG_CPC): New macro.
4936 (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
4937 SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
4938 * parse.y (class_body_declaration:): Use
4939 SET_CPC_INSTANCE_INITIALIZER_STMT.
4940 (method_declaration:): Check for null current_function_decl.
4941 (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
4942 (java_parser_context_pop_initialized_field): Better handling of
4944 (maybe_make_nested_class_name): Mark nested class name as
4945 qualified when necessary.
4946 (end_class_declaration): Don't call java_parse_context_resume when
4947 one or more error occurred.
4948 (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
4949 (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
4950 SET_CPC_INITIALIZER_STMT.
4951 (method_header): Check for inner classes declaring static methods.
4952 (resolve_qualified_expression_name): Handle situation where `this'
4955 Mon Mar 13 11:36:51 2000 Hans Boehm <boehm@acm.org>
4957 * typeck.c (build_prim_array_type): Correctly set the high word too.
4959 2000-03-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
4961 * parse.y (java_complete_expand_methods): Leave <clinit> out of
4963 (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
4964 list of methods for interfaces.
4966 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4968 * parse.y (qualify_ambiguous_name): Properly handle expressions
4971 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4973 * parse.y (check_final_assignment): Extended to process
4975 (patch_assignment): Have check_final_assignment called only once.
4977 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4979 * java-tree.h (IS_INIT_CHECKED): New flag.
4980 * check-init.c (check_init): Test and set IS_INIT_CHECKED.
4981 * parse.y (patch_string): Call force_evaluation_order on the
4982 completed string concatenation tree.
4983 * expr.c (force_evaluation_order): Call force_evaluation_order on
4984 function's arguments too.
4986 Mon Mar 6 18:07:07 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4988 * decl.c (emit_init_test_initialization): Mark KEY as unused.
4989 * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
4990 (build_anewarray): Likewise.
4991 * parse.y (patch_newarray): Likewise.
4992 * parse.c: Regenerated.
4994 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
4996 * decl.c (init_decl_processing): Added new class fields `depth',
4997 `ancestors', and `idt' to class_type_node. Use
4998 _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
4999 * class.c (make_class_data): Push initial values for new fields.
5000 * java-tree.h: Updated prototype for `build_invokeinterface'.
5001 * expr.c (build_invokeinterface): Changed parameters to accept
5002 `method' tree. Calculate index of `method' in its declaring
5003 interface. Build call to _Jv_LookupInterfaceMethodIdx.
5004 (expand_invoke): Call `build_invokeinterface' with new parameters.
5005 * parse.y (patch_invoke): Call `build_invokeinterface' with new
5008 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
5010 * typeck.c (lookup_do): Search superinterfaces first
5011 when looking up an interface method. From Godmar Back
5014 2000-03-06 Tom Tromey <tromey@cygnus.com>
5016 * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
5018 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
5020 * java-tree.h (lookup_argument_method2): Declared.
5021 (safe_layout_class): Prototype moved from parse.h.
5022 * parse.h (safe_layout_class): Prototype moved to java-tree.h.
5023 * parse.y (java_check_regular_methods): Local `super_class' gone.
5024 Call lookup_argument_method2 instead of lookup_argument_method.
5025 Perform modifier match for methods found declared in implemented
5026 interfaces. Fixed indentation problem. Overriding/hiding error
5027 report to take place only for methods found in classes.
5028 * typeck.c (lookup_argument_method): Changed leading
5029 comment. Re-written by calling lookup_do.
5030 (lookup_argument_method2): New function.
5031 (lookup_java_method): Re-written by calling lookup_do.
5032 (lookup_do): New function.
5034 Thu Mar 2 15:18:33 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5036 * check-init.c (check_init): Removed dead code. Handle (blank)
5038 * parse.y (declare_local_variables): New local `final_p', set it
5039 and use it to initialize LOCAL_FINAL.
5040 (check_final_assignment): Only check FIELD_DECLs.
5042 2000-02-17 Tom Tromey <tromey@cygnus.com>
5044 * Makefile.in (JAVA_OBJS): Added boehm.o.
5045 (boehm.o): New target.
5046 * Make-lang.in (JAVA_SRCS): Added boehm.c.
5047 * java-tree.h (flag_use_boehm_gc): Declare.
5048 (get_boehm_type_descriptor): Declare.
5049 * lang.c (lang_f_options): Added `use-boehm-gc'.
5050 (flag_use_boehm_gc): New global.
5051 * lang-options.h: Added -fuse-boehm-gc.
5052 * boehm.c: New file.
5053 * class.c (get_dispatch_table): If class uses a Boehm type
5054 descriptor, put it in the vtable.
5055 (make_class_data): Removed dead code.
5057 2000-03-03 Per Bothner <per@bothner.com>
5059 * decl.c (init_decl_processing): Initialize sizetype properly.
5061 2000-03-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
5063 * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
5064 (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
5065 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
5066 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
5067 (jcf_parse): New local `current'. Load innerclasses seen in outer
5068 context being processed.
5069 * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
5070 * jcf-write.c (append_innerclasses_attribute): New function.
5071 (append_innerclasses_attribute_entry): Likewise.
5072 (get_access_flags): Handle static classes. Set anonymous and local
5073 classes to be private.
5074 (generate_classfile): Attribute count adjusted. Call
5075 append_innerclasses_attribute.
5076 * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
5077 PURE_INNER_CLASS_TYPE_P.
5078 * parse.y (parser_qualified_classname): New parameter `is_static',
5079 produce non qualified name accordingly.
5080 (block_statement:): Set LOCAL_CLASS_P when declaring local class.
5081 (create_interface): Added argument to parser_qualified_classname.
5082 (create_class): Added argument to parser_qualified_classname. Setup
5083 alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
5084 (add_inner_class_fields): Fixed indentation.
5085 (method_declarator): Use PURE_INNER_CLASS_DECP_P.
5086 (method_declarator): Fixed typo in comment.
5087 (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
5088 (build_current_thisn): Likewise.
5089 (patch_method_invocation): Likewise.
5091 2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
5093 * decl.c (current_function_decl): Move to toplev.c.
5095 Mon Feb 28 08:20:42 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
5097 * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
5098 (DECL_BIT_INDEX): Use underlying representation.
5099 * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
5101 Sun Feb 27 16:40:33 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
5103 * expr.c (build_java_ret): Pass proper type to size_binop.
5105 2000-02-25 Anthony Green <green@cygnus.com>
5107 * expr.c (build_class_init): Mark the decl to be ignored by
5109 * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
5110 * check-init.c: Move DECL_BIT_INDEX to java-tree.h
5111 * class.c (init_test_hash_newfunc): New function.
5112 (decl_hash): New function.
5113 (decl_compare): New function.
5114 * decl.c (emit_init_test_initialization): New function.
5115 (complete_start_java_method): Traverse the init test hashtable,
5116 calling emit_init_test_initialization.
5117 (always_initialize_class_p): Define.
5118 * expr.c (build_class_init): Use initialization tests when
5119 emitting class initialization code.
5120 (always_initialize_class_p): Declare.
5121 * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
5123 * java-tree.h: Include hash.h.
5124 (DECL_FUNCTION_INIT_TEST_TABLE): Define.
5125 (struct lang_decl): Add init_test_table field.
5126 (init_test_hash_entry): Define.
5128 Fri Feb 25 18:41:31 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5130 * gjavah.c (main): Avoid using `argi' to report unimplemented
5133 Fri Feb 25 18:47:25 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5135 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
5136 initialize locals to avoid warnings. Local `exception_type' moved
5139 Fri Feb 25 18:00:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5141 * parse.y (resolve_expression_name): Use `orig' as a second
5142 argument to resolve_field_access.
5143 (resolve_field_access): Removed unnecessary code when dealing with
5146 Wed Feb 23 17:41:50 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5148 * class.c (push_super_field): Don't push the field twice.
5149 * jcf-parse.c (parse_source_file): Call java_reorder_fields.
5150 * parse.h (java_reorder_fields): Prototyped.
5151 * parse.y (java_reorder_fields): New function.
5152 (java_layout_class): Simplified not to worry about re-ordering.
5154 2000-02-23 Tom Tromey <tromey@cygnus.com>
5156 * gjavah.c (print_name): In JNI case, correctly quote string.
5157 (print_method_info): Don't handle overrides in JNI mode.
5159 2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
5161 * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
5162 value type set to `boolean_type_node'.
5164 Mon Jan 18 14:30:09 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
5166 * jcf-dump.c (main): Test for correct condition after
5167 output file creation.
5169 2000-02-19 Anthony Green <green@cygnus.com>
5171 * jcf-depend.c (add_entry): Fix test for first list entry.
5173 Sat Feb 19 18:43:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
5175 * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
5176 * constants.c (build_constants_constructor): Likewise.
5178 2000-02-19 Anthony Green <green@cygnus.com>
5180 * jcf-depend.c (add_entry): Add entries to the end of the list.
5182 Wed Nov 03 02:16:00 PST 1999 Pekka Nikander <pekka.nikander@hut.fi>
5184 * decl.c (INT_TYPE_SIZE): Define if necessary.
5185 (expand_java_return): Handle the case of a native integer smaller
5188 2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
5190 * gjavah.c (help): Use GCCBUGURL.
5191 * jv-scan.c (help): Likewise.
5192 * jcf-dump.c (help): Likewise.
5194 Thu Feb 17 14:30:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5196 * jcf-write.c (generate_bytecode_insns): Don't generate empty
5199 Thu Feb 17 13:20:58 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5201 * jcf-parse.c (load_class): Call `fatal' if no file containing
5202 the target class are found.
5204 2000-02-16 Zack Weinberg <zack@wolery.cumb.org>
5206 * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
5207 lex.c, lex.h, and PARSE_H to...
5208 (parse.o, parse-scan.o): ...here, respectively.
5210 * lex.c: Split out code that may trigger SIGFPE from yylex()
5211 to its own function.
5212 * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
5214 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5216 * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
5218 2000-02-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
5220 * parse.y (outer_field_access_p): Stop in time when outer contexts
5222 (resolve_qualified_expression_name): Properly qualify *everything*
5223 after a package.type to be resoled as expression names.
5224 (find_applicable_accessible_methods_list): Save/restore `class' to
5225 isolate it from a possible outer context search.
5227 2000-02-15 Tom Tromey <tromey@cygnus.com>
5229 * gjavah.c (jni_print_char): New function.
5230 (print_full_cxx_name): Use it.
5231 (decode_signature_piece): Likewise.
5232 (print_cxx_classname): Likewise.
5234 2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5236 * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
5238 (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
5240 * gjavah.c: Include version.h.
5242 * jcf-dump.c: Likewise.
5244 * jv-scan.c: Likewise.
5246 Sat Feb 12 04:34:04 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5248 * parse.y (outer_field_access_fix): First parameter now a tree
5249 node. Check for assignement to final. First argument to
5250 build_outer_field_access_fix modified to accommodate prototype.
5251 (build_outer_field_access): Don't check for assignment to final
5253 (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
5254 possibly returned by outer_field_access_fix. Changed
5255 outer_field_access_fix's first argument.
5256 (check_final_assignment): $finit$'s context is OK.
5257 (patch_unaryop): Use node instead of its line/column value when
5258 calling outer_field_access_fix.
5260 Fri Feb 11 17:38:26 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5262 * parse.y (interface_declaration:): No longer tagged
5263 <node>. Re-installed default action.
5264 (class_member_declaration:): Handle inner interfaces.
5265 (interface_member_declaration): Handle inner interfaces and
5267 (create_interface): Push error if one seen. Suspend parsing
5268 context when processing an inner interface.
5269 (register_fields): Inner class static field limitations not to
5270 apply to inner interfaces.
5272 Thu Feb 10 22:07:35 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5274 * jcf-parse.c (load_class): Update `java_error_count' when a
5275 class' file can't be found.
5276 (parse.y): Avoid (byte)code generation when errors seen.
5278 Thu Feb 10 20:10:43 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5280 * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
5281 decodes a valid node.
5282 (patch_binop): Handle TRUNC_DIV_EXPR.
5284 Thu Feb 10 16:04:26 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5286 * parse.y (resolve_package): New local `acc'. Try to progressively
5287 build and guess a package and type name.
5289 Thu Feb 10 12:52:09 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5291 * parse.y (find_applicable_accessible_methods_list): Load and
5292 layout the search class if necessary.
5293 (java_complete_tree): Keep to original type of the folded initial
5296 2000-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
5298 * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
5299 Generate error message if circularity is detected. New static
5301 * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro. *
5302 * jcf-write.c (generate_bytecode_insns): Very simply handle
5304 * parse.y (java_check_circular_reference): Use
5305 `cyclic_inheritance_report' during report, if necessary.
5306 (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
5307 walking NEW_ARRAY_INIT twice.
5309 2000-02-09 Tom Tromey <tromey@cygnus.com>
5311 * parse.y (check_class_interface_creation): Allow inner classes to
5312 be `private' or `protected', check modifiers' consistency. Prevent
5313 block local classes from bearing any modifiers.
5315 2000-02-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5317 * except.c (check_start_handlers): Re-add prototype lost in last
5319 (maybe_start_try): Remove excess argument to `check_start_handlers'.
5321 2000-02-09 Andrew Haley <aph@cygnus.com>
5323 * decl.c (clear_binding_level): Remove excess initializer.
5324 (maybe_poplevels): Remove unused variable.
5325 (force_poplevels): Ditto.
5326 (struct binding_level): Add comment.
5328 2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
5330 * jcf-write.c (generate_classfile): Don't consider
5331 pre-initialization with reference value (use <clinit> instead.)
5332 * parse.y (java_fix_constructors): No generated constructor for
5334 (build_outer_field_access): Removed debug message.
5335 (outer_field_expanded_access_p): Adapted to bytecode generation.
5336 (build_outer_field_access_method): Use fix_method_argument_names.
5337 (build_outer_method_access_method): Fixed indentation. Added
5338 comment. Handle access method generation for static and also void
5340 (build_access_to_thisn): Inserted debug message.
5341 (maybe_build_thisn_access_method): Use fix_method_argument_names.
5342 (resolve_qualified_expression_name): Fixed comment.
5343 (not_accessible_p): Adapted to bytecode generation. Added comment.
5344 (patch_method_invocation): Added comment.
5345 (maybe_use_access_method): Fixed leading comment. Handle static
5347 (java_complete_lhs): Don't shortcut handling of initialized upon
5348 declaration String type static fields when generating bytecode.
5349 (patch_unaryop): Handle outer field access when generating
5352 Thu Feb 3 20:23:19 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5354 * java-tree.h (FIELD_THISN): New macro.
5355 * jcf-write.c (append_synthetic_attribute): New function.
5356 (generate_classfile): Set "Synthetic" attribute on this$<n>,
5357 val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
5358 * parse.y (add_inner_class_fields): Set FIELD_THISN for created
5360 (build_outer_field_access): Turned on access functions usage and
5361 generation when compiling to bytecode.
5362 (maybe_use_access_method): Likewise.
5364 2000-01-25 Andrew Haley <aph@cygnus.com>
5366 * java-except.h (struct eh_range): Add `expanded' field.
5367 (maybe_start_try): Add end_pc arg.
5368 (maybe_end_try): Ditto.
5369 * java-tree.h (force_poplevels): new function.
5370 * expr.c (expand_byte_code): Don't call maybe_start_try or
5372 * except.c (add_handler): Reset expanded.
5373 (expand_start_java_handler): Set expanded.
5374 (check_start_handlers): Don't expand a start handler that's
5375 already been expanded.
5376 (maybe_start_try): Add end_pc arg. Only expand a handler which
5378 (expand_end_java_handler): call force_poplevels.
5379 (force_poplevels): new function.
5380 * decl.c (binding_level): Add start_pc of binding level.
5381 (maybe_pushlevels): Call maybe_start_try when pushing binding
5383 (maybe_poplevels): Call maybe_end_try when popping binding levels.
5384 (LARGEST_PC): Define.
5385 (clear_binding_level): Use LARGEST_PC.
5387 * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
5388 * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
5389 (binding_depth, is_class_level, current_pc): new variables.
5390 (struct binding_level): ditto.
5391 (indent): new function.
5392 (push_jvm_slot): add debugging info.
5393 (maybe_pushlevels): ditto.
5394 (maybe_poplevels): ditto.
5397 (start_java_method): ditto.
5398 (give_name_to_locals): comment only.
5399 * except.c (binding_depth, is_class_level, current_pc):
5401 (expand_start_java_handler): add debugging info.
5402 (expand_end_java_handler): ditto.
5404 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5406 * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
5407 (print_name_for_stub_or_jni, process_file): Constify a char*.
5409 2000-02-03 Tom Tromey <tromey@cygnus.com>
5411 * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
5413 2000-01-31 Scott Bambrough <scottb@netwinder.org>
5415 * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
5416 assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
5419 Wed Feb 2 18:43:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5421 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
5422 * java-tree.h (TYPE_II_STMT_LIST): New macro.
5423 (struct lang_type): New field `ii_block'.
5424 * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
5425 CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
5426 * parse.h (struct parser_ctxt): New field `instance_initializers'.
5427 (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
5428 CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
5429 CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
5431 * parse.y (add_instance_initializer): New function.
5432 (in_instance_initializer): New static global.
5433 (class_body_declaration:): Link instance initializer block.
5434 (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
5435 (array_creation_expression:): Remove unused local.
5436 (java_parser_context_push_initialized_field): Fixed leading
5437 comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
5438 CPC_INSTANCE_INITIALIZER_LIST.
5439 (java_parser_context_pop_initialized_field): Likewise.
5440 (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
5441 (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
5442 CPC_INITIALIZER_STMT.
5443 (fix_constructors): New local `class_type'. Use it. Call
5444 add_instance_initializer.
5445 (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
5446 (patch_return): Forbid return in instance initializers.
5447 (patch_throw_statement): Enforce exception handling in the context
5448 of instance initializers.
5450 2000-02-03 Tom Tromey <tromey@cygnus.com>
5452 * Make-lang.in (java.mostlyclean): Remove executables in
5455 2000-01-31 Scott Bambrough <scottb@netwinder.org>
5457 * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
5458 HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
5459 (java_float_finite): Convert to use union Word from javaop.h.
5460 (java_double_finite): Convert to use union DWord from javaop.h.
5462 2000-02-02 Tom Tromey <tromey@cygnus.com>
5464 * gjavah.c (options): Added `jni' entry.
5465 (help): Document -jni.
5466 (flag_jni): New global.
5467 (process_file): Handle JNI output. Don't print text from
5468 -prepend, -add, etc, when generating stubs. Only remove `.class'
5469 suffix if it actually exists.
5470 (main): Create a `.c' file when run with `--jni --stubs'. Create
5471 correct output file name with `--jni'.
5472 (print_include): Mangle header name differently in JNI case.
5473 (HANDLE_METHOD): In JNI mode, call print_method_info to generate
5475 (print_method_info): Handle JNI case. Put signature info into
5476 method name. Handle case when STREAM is NULL.
5477 (print_name_for_stub_or_jni): New function.
5478 (print_stub_or_jni): Renamed from `print_stub'. Handle JNI.
5479 (print_cxx_classname): Handle JNI.
5480 (print_full_cxx_name): Likewise.
5481 (decode_signature_piece): Likewise.
5482 (overloaded_jni_method_exists_p): New function.
5483 (struct method_name): Added `signature' and `sig_length' fields.
5484 (HANDLE_END_FIELD): Do nothing in JNI mode.
5486 2000-02-02 Tom Tromey <tromey@cygnus.com>
5488 * jv-scan.c: Include version.c, <getopt.h>.
5489 (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
5490 (options): New array.
5491 (usage): New function.
5492 (version): New function.
5493 (main): Use getopt_long to parse command line.
5494 * jcf-dump.c: Include version.c, <getopt.h>.
5495 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
5496 OPT_JAVAP): New macros.
5497 (options): New array.
5498 (usage): Return `void'. Changed message.
5499 (help): New function.
5500 (version): New function.
5501 (main): Use getopt_long_only to parse command line.
5502 * gjavah.c: Include <getopt.h>.
5503 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
5504 OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
5505 OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
5506 (options): New array.
5507 (java_no_argument): Removed.
5508 (help): Updated with missing options.
5509 (main): Use getopt_long_only to parse command line.
5510 (usage): Changed message.
5512 Tue Feb 1 22:23:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5514 * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
5515 * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
5516 ANONYMOUS_ARRAY_INITIALIZER): New access macros.
5517 * parse.y (array_creation_expression:): Handle anonymous arrays.
5518 (build_array_from_name): Don't set `ret_name' if null.
5519 (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
5520 (qualify_ambiguous_name): Likewise.
5521 (java_complete_expand_class): Likewise.
5523 Tue Feb 1 14:59:35 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5525 * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
5526 * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
5527 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
5528 (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
5529 (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
5530 AIPL_FUNCTION_COMPLETED_INVOCATION.
5531 (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
5532 AIPL_FUNCTION_INVOCATION_READY.
5533 (AIPL_FUNCTION_DECLARATION): New enum entry.
5534 * parse.y (reorder_static_initialized): New function.
5535 (java_parser_context_pop_initialized_field): Use it.
5536 (add_inner_class_fields): Use
5537 MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
5538 augmented. Install marker after last alias initializer, if any.
5539 (generate_finit): Fixed typo. Don't try to retain only the used
5541 (method_header): Compute and set DECL_FUNCTION_NAP.
5542 (method_declarator): Fixed comment. Insert alias initializer in
5544 (build_alias_initializer_parameter_list): Fixed leading
5545 comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
5546 replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
5547 (java_complete_expand_class): Code to retain only used aliases
5549 (java_complete_expand_methods): New local `first_decl'. Generate
5550 $finit$ first, then expand the constructors, regular methods and
5552 (java_complete_expand_method): Don't report error on missing
5553 return statement if previously detected bogus.
5554 (fix_constructors): Don't patch constructor parameters list.
5555 (patch_method_invocation): Use new AIPL enum values. Reverse
5556 alias initializer list for anonymous classes.
5558 2000-01-30 Anthony Green <green@redhat.com>
5560 * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
5561 determine how many stack slots to pop.
5563 2000-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
5565 * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
5566 error handling/recovery.
5567 * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
5569 Fri Jan 28 20:10:57 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5571 * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
5572 FIELD_LOCAL_ALIAS_USED): New macros.
5573 (DECL_FUNCTION_NAP): New macro.
5574 (struct lang_decl): New field `nap'.
5575 (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
5576 (struct lang_type): New fields `finit_stmt_list' and
5578 (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
5579 * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
5580 (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
5581 UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
5582 (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
5583 AIPL_FUNCTION_INVOCATION_READY): New enum fields.
5584 (BUILD_THROW): Macro line separator re-indented.
5585 * parse.y (end_class_declaration): New function.
5586 (maybe_generate_pre_expand_clinit): New name for
5587 java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
5588 pre-expand static fields.
5589 (maybe_generate_clinit): Function deleted.
5590 (check_for_static_method_reference): Prototype's parameter list
5592 (generate_finit): New name for maybe_generate_finit. Changed
5593 leading comment. Function rewritten to use
5594 TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
5595 (build_alias_initializer_parameter_list): New function.
5596 (java_parser_context_pop_initialized_field): Likewise.
5597 (add_inner_class_fields): Likewise.
5598 (type_declaration:): Call end_class_declaration.
5599 (class_member_declaration:): Likewise.
5600 (formal_parameter_list:): Fixed typos.
5601 (formal_parameter:): Use ARG_FINAL_P to mark created tree list
5602 element. Improved error handling.
5603 (block_statement:): Call end_class_declaration.
5604 (anonymous_class_creation:): Likewise.
5605 (create_anonymous_class): Fixed comments.
5606 (create_class): Call add_inner_class_fields.
5607 (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
5608 (method_header): Use MARK_FINAL_PARMS.
5609 (finish_method_declaration): Use UNMARK_FINAL_PARMS.
5610 (method_declarator): Propagate final argument flag.
5611 (craft_constructor): New local `artificial'. Call
5612 build_alias_initializer_parameter_list. Use
5613 CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
5614 (source_start_java_method): Mark parm decls with LOCAL_FINAL if
5616 (complete_expand_class): Get rid of unused outer context local
5618 (java_complete_expand_methods): Fixed leading
5619 comment. Generate/pre-expand <clinit> first. Changed method
5620 expansion order to regular, $finit$, constructors, <clinit>.
5621 (java_complete_expand_method): Set current_function_decl.
5622 (fix_constructors): Fix constructor parameter list to account for
5623 outer context local alias initializers.
5624 (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
5625 (resolve_expression_name): Lookup outer context local aliases. New
5626 local `access', use it.
5627 (patch_method_invocation): Patch inner class ctor invocation with
5628 outer context local aliases initialization values. $finit$
5629 invocation patching now includes things generated with
5630 build_alias_initializer_parameter_list.
5631 (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
5632 (build_super_invocation): Likewise.
5633 (patch_assignment): Changed comment.
5635 2000-01-27 Andrew Haley <aph@cygnus.com>
5637 * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
5641 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5643 * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
5645 (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
5647 * parse.y (register_fields): Don't pass a format specifier to
5648 OBSOLETE_MODIFIER_WARNING.
5649 (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
5650 instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
5652 (check_modifiers): Change function into a macro.
5653 (check_class_interface_creation): Pass a literal format string.
5655 2000-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5657 * buffer.h: PROTO -> PARAMS.
5658 * check-init.c: Likewise.
5659 * class.c: Likewise.
5660 * constants.c: Likewise.
5661 * convert.h: Likewise.
5663 * except.c: Likewise.
5665 * gjavah.c: Likewise.
5666 * java-except.h: Likewise.
5667 * java-tree.h: Likewise.
5668 * jcf-depend.c: Likewise.
5669 * jcf-dump.c: Likewise.
5670 * jcf-parse.c: Likewise.
5671 * jcf-path.c: Likewise.
5672 * jcf-reader.c: Likewise.
5673 * jcf-write.c: Likewise.
5675 * jv-scan.c: Likewise.
5676 * jvgenmain.c: Likewise.
5677 * jvspec.c: Likewise.
5681 * parse-scan.y: Likewise.
5682 * parse.h: Likewise.
5683 * parse.y: Likewise.
5684 * typeck.c: Likewise.
5685 * verify.c: Likewise.
5688 * zextract.c: Likewise.
5689 * zipfile.h: Likewise.
5691 2000-01-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
5693 * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
5694 (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
5695 * constants.c (build_constant_data_ref): Check for cached
5696 current_constant_pool_data_ref. Cache current_constant_pool_data_ref
5697 in TYPE_CPOOL_DATE_REF.
5698 * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
5699 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
5700 (struct lang_type): New fields `cpool' and `cpool_data_ref'.
5701 (LOCAL_FINAL): New macro.
5702 * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
5703 constant pool -- don't try to reuse.
5704 (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
5706 (find_in_current_zip): Use TYPE_JCF.
5707 * parse.h (java_check_final): Prototype removed.
5708 * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
5709 (maybe_create_class_interface_decl,
5710 check_class_interface_creation): Likewise.
5711 (java_expand_finals): Function removed.
5712 (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
5713 (block_statement:): Fixed comment.
5714 (anonymous_class_creation:): Likewise.
5715 (check_class_interface_creation): Reversed Jan 12, 2000 extra
5717 (check_class_interface_creation): Loosened error report on (inner)
5718 public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
5719 (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
5720 (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
5722 (create_interface): Likewise.
5723 (anonymous_class_counter): New static global.
5724 (create_anonymous_class): Reversed Jan 12, 2000 extra argument
5725 patch. Fixed comments.
5726 (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
5727 anonymous_class_counter when declaring a toplevel class.
5728 (craft_constructor): Fixed constructor name when handling
5729 anonymous classes. Anonymous class constructors to feature hidden
5731 (java_fix_constructors): Added comment.
5732 (java_check_final): Function removed.
5733 (java_complete_expand_methods): Fixed comment. Don't generate
5734 class data, save its outgoing constant pool instead.
5735 (verify_constructor_super): Skip anonymous class constructor
5736 hidden this$<n> parameter.
5737 (java_expand_classes): New local `saved_ctxp'. Removed call to
5738 java_expand_finals and java_check_final. Expand anonymous class
5739 constructors. Generate class data.
5740 (build_super_invocation): Skip anonymous class hidden this$<n>
5742 * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
5743 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
5744 (set_java_signature): Likewise.
5746 Mon Jan 18 14:30:09 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
5748 * gjavah.c: Delete ACC_VISIBILITY define.
5749 * jcf.h: Add ACC_VISIBILITY define.
5750 * parse.y: final: rule tagged <value>.
5751 (java_check_regular_methods): Use ACC_VISIBILITY define for
5752 default package access check.
5753 (local_variable_declaration_statement): Use final: rule.
5755 Mon Jan 17 11:58:17 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
5757 * parse.y (format_parameter:): Use final: rule instead of modifiers:.
5760 2000-01-17 Tom Tromey <tromey@cygnus.com>
5762 * gjavah.c (print_field_info): Allow non-static final fields.
5764 Fri Jan 14 18:03:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5766 * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
5767 * parse.y (patch_anonymous_class): New function.
5768 (create_anonymous_class): Register incomplete type when the
5769 class/interface to extends/implement isn't known yet.
5770 (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
5771 (verify_constructor_super): Tuned error message.
5773 Fri Jan 14 00:14:24 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5775 * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
5776 (ANONYMOUS_CLASS_P): New macro.
5777 (TYPE_SIGNATURE, TYPE_JCF): New macros.
5778 (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
5779 * parse.y (create_class): Added leading argument.
5780 (maybe_create_class_interface_decl,
5781 check_class_interface_creation): Likewise.
5782 (craft_constructor): New function.
5783 (verify_constructor_super): Added argument in prototype.
5784 (class_declaration:): Inserted leading argument.
5785 (for_begin:): Use FOR_LOOP_P.
5786 (anonymous_class_creation): Create WFL of the anonymous class to
5787 instantiate. Call build_new_invocation. Added comments.
5788 (check_class_interface_creation): Handle parameter `anonymous' in
5789 verbose mode class creation announce.
5790 (link_nested_class_to_enclosing): Exclude anonymous classes.
5791 (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
5792 anonymous class, even though they appear to have an enclosing
5794 (create_interface): Pass extra argument to
5795 check_class_interface_creation.
5796 (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
5797 (create_class): Call check_class_interface_creation and
5798 maybe_create_class_interface_decl with extra new argument. Don't
5799 add private this$<n> to anonymous classes.
5800 (method_declarator): Insert hidden this$<n> to anonymous class
5802 (java_fix_constructors): Deleted code creating default
5803 constructor. Call craft_constructor instead.
5804 (java_check_regular_methods): Set `saw_constructor' to 1 for
5806 (fix_constructors): Pass extra argument to verify_constructor_super.
5807 (verify_constructor_super): New local `sdecl', use it. Search for
5808 matching constructor (possibly featuring arguments) in super
5810 (lookup_method_invoke): Craft constructor according to arguments
5811 list when dealing with anonymous class constructors.
5812 (build_super_invocation): Pass arguments to anonymous class super
5814 (search_loop): Use FOR_LOOP_P.
5815 (labeled_block_contains_loop_p): Likewise.
5817 Wed Jan 12 00:38:47 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
5819 * class.c (set_super_info): Set CLASS_STATIC when appropriate.
5820 (enclosing_context_p): New function.
5821 (get_access_flags_from_decl): Handle CLASS_STATIC.
5822 (maybe_layout_super_class): Extra first argument passed to
5824 (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
5826 * decl.c (access0_identifier_node): New global.
5827 (init_decl_processing): access0_identifier_node initialized.
5828 (pushdecl): Set DECL_CONTEXT only on non type decls.
5829 * expr.c (lookup_field): Lookup inner class fields in enclosing
5831 (expand_invoke): Use ID_INIT_P.
5832 (expand_java_field_op): Use DECL_CLINIT_P.
5833 * java-tree.def (CLASS_LITERAL): New tree code.
5834 * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
5835 DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
5836 (struct lang_decl): New field `inner_access'.
5837 (enclosing_context_p): Prototyped.
5838 (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
5839 ID_CLINIT_P): New macros.
5840 (CLASS_STATIC): New macro.
5841 (CLASS_ACCESS0_GENERATED_P): New macro.
5842 (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
5843 TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
5844 INNER_CLASS_P): New macros.
5845 (DECL_INNER_CLASS_LIST): New macro.
5846 * jcf-parse.c (yyparse): Avoid the use of ANSI string
5848 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
5849 the shift value to int. Fixed typo in comment.
5850 * lex.c (inst_id, wpv_id): Initialize.
5851 * mangle.c (unicode_mangling_length): Take `$' into account.
5852 * parse.h (DRECOVER, RECOVER): Terminate properly.
5853 (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
5854 (typedef struct _jdep): New field `enclosing'.
5855 (JDEP_ENCLOSING): New macro.
5856 (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
5857 (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
5858 (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
5859 GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
5860 GET_ENCLOSING_CPC_CONTEXT): New macros.
5861 (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
5862 (do_resolve_class): Added extra argument in prototype.
5863 * parse.y (resolve_class): Added extra argument in prototype.
5864 (maybe_create_class_interface_decl): Likewise.
5865 (maybe_use_access_method, build_wfl_wrap): New functions.
5866 (java_complete_expand_classes, java_complete_expand_class):
5868 (java_parser_context_push_initialized_field,
5869 java_parser_context_suspend, java_parser_context_resume):
5871 (maybe_make_nested_class_name, make_nested_class_name,
5872 set_nested_class_simple_name_value,
5873 link_nested_class_to_enclosing, find_as_inner_class,
5874 find_as_inner_class_do, check_inner_class_redefinition,
5875 build_thisn_assign, build_current_thisn, build_access_to_thisn,
5876 maybe_build_thisn_access_method, build_outer_field_access,
5877 build_outer_field_access_methods, build_outer_field_access_expr,
5878 build_outer_method_access_method, build_new_access_id,
5879 build_outer_field_access_method, outer_field_access_p,
5880 outer_field_expanded_access_p, outer_field_access_fix,
5881 build_incomplete_class_ref, patch_incomplete_class_ref,
5882 create_anonymous_class): Likewise.
5883 (inst_id, wpv_id): New static global variables.
5884 (synchronized:): New rule, tagged <node>.
5885 (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
5887 (anonymous_class_creation:): New rule, tagged <node>.
5888 (NEW_TK): Tagged <node>.
5889 (type_literals, array_type_literal): New rules, tagged <node>.
5890 (class_declaration:): Removed action when reducing by class_body:
5891 (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
5892 using GET_CPC in sub-rules.
5893 (class_member_declaration): Handle inner classes.
5894 (method_declaration): When reducing method_header:, reset
5895 current_function_decl when appropriate.
5896 (method_declarator:): Set the number of formal parameter to 0 for
5897 method declared without arguments.
5898 (constructor_declarator:): Likewise.
5899 (static_initializer:): List of elements kept in a list.
5900 (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
5901 use of the keyword `static' for type declarations.
5902 (block_statement:): Handle inner class declarations.
5903 (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
5904 type qualified `this'.
5905 (class_instance_creation_expression): Use anonymous_class_creation:
5906 to handle inner class instances creation. Handle qualified `new'.
5907 (something_dot_new): Added appropriate actions.
5908 (create_new_parser_context): New function.
5909 (java_push_parser_context, java_parser_context_save_global,
5910 java_parser_context_suspend): Use create_new_parser_context.
5911 (check_modifiers): Changed leading comment.
5912 (check_class_interface_creation): Handle interclasses.
5913 (add_superinterfaces): Fixed comment.
5914 (create_interface): Build qualified name from the raw_name instead
5915 of its matching WFL. Push the initialized fields list. raw_name added
5916 as an extra argument to maybe_create_class_interface_decl.
5917 (create_class): Build qualified name from the raw_name instead of
5918 its matching WFL. Removed assignment to current_parsed_class_un.
5919 Call PUSH_ERROR before returning an error. Suspend the current
5920 parser context when processing an inner class. Push the
5921 initialized fields list. raw_name added as an extra argument to
5922 maybe_create_class_interface_decl. Add the private this$<n>
5924 (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
5925 (register_fields): Get the class type from GET_CPC and handle
5926 previous errors. Added code to handle the creation of static
5927 fields in inner classes. Initialized fields initialization
5928 statements kept in a list of lists.
5929 (maybe_generate_finit): Initialized fields initialization
5930 statements kept in a list of lists. Use GET_CPC.
5931 (maybe_generate_clinit): Likewise.
5932 (method_header): Use GET_CPC and GET_CPC_UN.
5933 (parser_qualified_classname): Handle inner classes.
5934 (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
5935 (java_fix_constructors): Hide pointer to enclosing context
5936 instance in constructor list when dealing with inner classes.
5937 (jdep_resolve_class): Call resolve_class with extra first argument
5939 (resolve_class): Add enclosing context as a first extra argument
5940 to do_resolve_class.
5941 (do_resolve_class): Call find_as_inner_class. Handle WFLs
5943 (resolve_no_layout): Extra argument added to resolve_class
5945 (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
5946 (java_get_real_method_name): Use GET_CPC_UN.
5947 (check_abstract_method_definitions): Use DECL_CLINIT_P.
5948 (java_check_abstract_methods): Handle static method declared in
5949 inner classes by an error.
5950 (java_check_regular_methods): Use DECL_CLINIT_P.
5951 (source_start_java_method): Also set DECL_MAX_LOCALS.
5952 (create_artificial_method): Call java_parser_context_save_global
5953 and java_parser_context_restore_global instead of saving/restoring
5954 the context by hand.
5955 (expand_start_java_method): Improved verbose mode message.
5956 (java_complete_expand_methods): Fixed leading comment. Use
5958 (fix_constructors): Added assignment to this$<n> if necessary.
5959 (java_expand_classes): Call java_complete_expand_classes instead
5960 of java_complete_expand_methods.
5961 (make_qualified_primary): Simplified.
5962 (merge_qualified_name): Optimized for missing left or right parts.
5963 (resolve_expression_name): Handle access to outer class fields from
5965 (resolve_qualified_expression_name): New macro
5966 RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
5967 classes. Report error on non appropriate qualification of
5968 `new'. Handle qualified `this'.
5969 (not_accessible_p): Allow access to outer class private fields from
5971 (patch_method_invocation): Handle method invocations through
5972 access methods and inner class constructor invocations.
5973 (find_applicable_accessible_methods_list): Search enclosing
5974 contexts of an inner class.
5975 (search_applicable_methods_list): Fixed typo.
5976 (argument_types_convertible): Handle inner class constructors'
5977 hidden outer context reference argument.
5978 (qualify_ambiguous_name): Handle qualified `this'.
5979 (java_complete_lhs): Handle use of field accessed through
5980 artificial access methods in various cases of assignments. Handle
5982 (check_final_assignment): Use DECL_CLINIT_P.
5983 (valid_ref_assignconv_cast_p): Handle the destination being an
5984 enclosing context of the source.
5985 (patch_unaryop): Handle use of field accessed through artificial
5987 (patch_return): Use DECL_CLINIT_P.
5988 (patch_throw_statement): Use DECL_CLINIT_P.
5989 (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
5990 * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
5993 2000-01-16 Anthony Green <green@cygnus.com>
5995 * parse.y (build_string_concatenation): Only use
5996 StringBuffer(String) shortcut if String arg is constant.
5998 Wed Jan 12 20:20:11 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
6000 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
6001 the shift value to int. Fixed typo in comment.
6003 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
6005 * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
6006 * jcf-write.c: Likewise.
6007 * parse.y: Likewise.
6008 * parse.c: Regenerate.
6010 2000-01-09 Anthony Green <green@cygnus.com>
6012 * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
6013 bytecodes in the correct order.
6015 2000-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6017 * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
6019 Thu Jan 6 16:31:28 2000 Anthony Green <green@cygnus.com>
6021 * expr.c (java_lang_expand_expr): Switch to permanent obstack
6022 before building constant array decl.
6024 Thu Jan 6 00:54:10 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
6026 * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
6027 method invocation and typo in conditional expression.
6028 (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
6029 the appropriate NOTE_POP.
6030 * parse.y (patch_binop): Shift value mask to feature the right
6033 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6035 * class.c (assume_compiled, assume_compiled_node): Add static
6037 (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
6039 * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
6041 * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
6043 * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
6044 to `__modifier' to avoid stringifying it.
6046 * parse.y (verify_constructor_circularity): Don't call a variadic
6047 function with a non-literal format string.
6048 (java_check_abstract_methods): Move unreachable code inside
6049 `continue' statement.
6050 (lookup_method_invoke): Call xstrdup, not strdup.
6052 * expr.c (expand_java_field_op): Avoid the use of ANSI string
6055 * jcf-parse.c (yyparse): Likewise.
6057 * jv-scan.c (main): Likewise.
6059 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6061 * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
6062 ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
6063 ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
6066 * parse.y (synchronized, variable_redefinition_error,
6067 check_class_interface_creation, create_interface, create_class,
6068 method_header, finish_method_declaration,
6069 check_modifiers_consistency, method_declarator,
6070 complete_class_report_errors, check_abstract_method_definitions,
6071 java_check_regular_methods, check_throws_clauses,
6072 java_check_abstract_methods, read_import_dir,
6073 check_pkg_class_access, declare_local_variables, fix_constructors,
6074 cut_identifier_in_qualified, resolve_expression_name,
6075 resolve_qualified_expression_name, patch_method_invocation,
6076 java_complete_lhs, patch_assignment, try_builtin_assignconv,
6077 patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
6078 patch_exit_expr, patch_exit_expr, patch_switch_statement,
6079 patch_try_statement, patch_synchronized_statement,
6080 patch_throw_statement, check_thrown_exceptions,
6081 patch_conditional_expr): Likewise.
6083 Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6085 * Makefile.in (LIBDEPS): Added gcc's errors.o
6086 (../jcf-dump$(exeext):): Link with gcc's errors.o
6087 (../gcjh$(exeext):): Likewise.
6088 * expr.c (expand_java_NEW): Layout the entire target type instead of
6089 laying out its methods only.
6090 (lookup_field): Layout the class after having loaded it.
6091 * java-tree.h (java_debug_context): Declared.
6092 * jcf-io.c (toplev.h): Included.
6093 (find_class): Removed assignment to jcf's outofsynch
6094 field. Force source file to be read if newer than its matching
6095 class file. Tweaked debug messages.
6096 * jcf-parse.c (jcf_out_of_synch): Deleted.
6097 (read_class): Call to jcf_out_of_synch removed.
6098 * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
6099 (jcf_out_of_synch): Prototype deleted.
6100 * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
6101 `deprecated' and `class_err': integer turned into bit fields.
6102 New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
6103 * parse.y (package_list): New global.
6104 (package_declaration:): Record newly parsed package name.
6105 (extra_ctxp_pushed_p): Static global deleted.
6106 (java_parser_context_save_global): Create buffer context for the
6107 purpose of saving globals, if necessary.
6108 (java_parser_context_restore_global): Pop context pushed for the
6109 purpose of saving globals, if necessary.
6110 (java_debug_context_do): New prototype and function.
6111 (java_debug_context): Likewise.
6112 (do_resolve_class): Use already parsed package names to qualify
6113 and lookup class candidate.
6114 (java_pre_expand_clinit): Removed unnecessary local variable.
6116 1999-12-17 Tom Tromey <tromey@cygnus.com>
6118 * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
6120 (process_file): Use `\n\' at end of each line in string.
6122 Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6124 * expr.c (expand_invoke): Layout the loaded class before
6125 attempting to use it.
6126 (expand_java_field_op): Allow final field assignments to take
6128 * typeck.c (convert): Return error_mark_node if expr is null.
6130 1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
6132 * class.c (class_depth): Return -1 if the class doesn't load
6134 * expr.c (can_widen_reference_to): Check for errors during depth
6135 computation and return 0 accordingly.
6136 * jcf-parse.c (parse_source_file): Call java_fix_constructors to
6137 create default constructors and add an other error check.
6138 * parse.h (java_fix_constructors): Prototyped.
6139 * parse.y (java_pre_expand_clinit): Likewise.
6140 (build_super_invocation): Re-prototyped to feature one argument.
6141 (java_check_circular_reference): Directly use `current'.
6142 (java_fix_constructors): New function.
6143 (java_check_regular_methods): Don't create default constructors
6144 here, but abort if none were found.
6145 (java_complete_expand_methods): Pre-process <clinit> calling
6146 java_pre_expand_clinit.
6147 (java_pre_expand_clinit): New function.
6148 (fix_constructors): build_super_invocation invoked with the
6149 current method declaration as an argument.
6150 (build_super_invocation): Use the context of the processed method
6151 decl argument instead of current_class.
6152 * typeck.c (lookup_java_method): Take WFLs in method names into
6155 Tue Dec 14 14:20:16 1999 Per Bothner <per@bothner.com>
6157 * class.c (make_class_data): flag_keep_inline_functions to keep
6158 private methods in the method array.
6160 1999-12-15 Anthony Green <green@cygnus.com>
6162 * check-init.c (check_init): Take into account both types of
6163 `throw's when checking for uninitialized variables.
6165 Fri Dec 10 21:53:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6167 * parse.y (java_complete_lhs): Force convertion of array
6168 dimensions to int_type_node, that's what runtime's ABI expects.
6170 Fri Dec 10 16:13:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6172 * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
6173 operand of a WFL, until the Java front-end gets fixed with regard
6174 to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
6176 1999-12-10 Andrew Haley <aph@cygnus.com>
6178 * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
6179 decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
6180 expr.c (build_java_athrow): Add support for sjlj-exceptions.
6184 Wed Dec 8 15:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6186 * expr.c (java_lang_expand_expr): Switch to permanent obstack
6187 before calling expand_eh_region_start and expand_start_all_catch.
6188 * except.c (expand_start_java_handler): Switch to permanent
6189 obstack before calling expand_eh_region_start.
6190 (expand_end_java_handler): Switch to permanent obstack before
6191 calling expand_start_all_catch.
6193 1999-12-5 Anthony Green <green@cygnus.com>
6195 * decl.c (init_decl_processing): Mark throw_node as a noreturn
6196 function with side effects.
6197 (init_decl_processing): Mark all memory allocating DECLs with
6200 Wed Dec 1 04:25:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6202 * except.c (expand_end_java_handler): Call
6203 expand_resume_after_catch and end_catch_handler.
6205 Tue Nov 30 12:36:15 1999 Anthony Green <green@cygnus.com>
6207 * verify.c (verify_jvm_instructions): Create new return label
6208 chain if non existent (don't rely on the verified state of the jsr
6211 Tue Nov 30 12:28:34 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6213 * jcf-write.c (generate_bytecode_insns): Fixed indentation for
6214 COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
6216 * parse.y (patch_assignment): Removed bogus final class test on
6217 lhs when checking on whether to emit an ArrayStoreException runtime
6219 * expr.c (expand_java_arraystore): Likewise.
6221 1999-11-28 Anthony Green <green@cygnus.com>
6223 * decl.c (find_local_variable): Reuse single slot decls when
6226 Wed Nov 24 17:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6228 * jcf-parse.c (saw_java_source): Global variable removed.
6229 (read_class): Don't use `saw_java_source'. Added extra braces.
6230 (yyparse): Code setting `saw_java_source' removed.
6232 1999-11-24 Mark Mitchell <mark@codesourcery.com>
6234 * except.c (emit_handlers): Zero catch_clauses after emitting them.
6236 Tue Nov 23 17:29:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6238 * verify.c (merge_type_state): Non verified subroutines being
6239 considered more than once to trigger passive type merge.
6241 Tue Nov 23 10:55:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6243 * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
6244 in case of error. Error message tuned.
6246 1999-11-21 Anthony Green <green@cygnus.com>
6248 * constants.c (find_methodref_index): Unwrap method names before
6249 inserting them in the constant pool.
6251 * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
6253 * class.c (assume_compiled_node): New typedef.
6254 (assume_compiled_tree): New static data.
6255 (find_assume_compiled_node): New function.
6256 (add_assume_compiled): New function.
6257 (assume_compiled): New function.
6258 * class.c (make_class_data): Use assume_compiled.
6259 (is_compiled_class): Use assume_compiled.
6261 * java-tree.h (add_assume_compiled): Declare.
6263 * lang.c (lang_decode_option): Parse new options.
6265 Wed Nov 17 21:09:28 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6267 * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
6268 int_type_node: that's what `_Jv_AllocObject' expects.
6270 Thu Nov 11 01:57:14 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6272 * parse.y (lookup_method_invoke): Use lang_printable_name to
6273 reliably build the type name during error report. Fixes PR gcj/97.
6275 1999-11-09 Tom Tromey <tromey@cygnus.com>
6277 * jcf-path.c: Include <sys/stat.h>.
6278 (jcf_path_init): Search for libjava.zip. Fixes PR gcj/84.
6279 (DIR_UP): New macro.
6281 Tue Nov 9 12:12:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6283 * parse.y (source_end_java_method): Resume permanent allocation,
6284 reversing Apr 27 1998 patch.
6285 (patch_string_cst): Pop obstacks after having pushed the permanent
6288 1999-11-05 Tom Tromey <tromey@cygnus.com>
6290 * class.c (finish_class): Emit inlined methods if any native
6291 methods exist in the class. Fixes PR gcj/85.
6293 Thu Nov 4 16:27:01 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6295 * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
6296 (qualify_ambiguous_name): Likewise.
6298 Wed Nov 3 15:20:02 MST 1999 Godmar Back <gback@cs.utah.edu>
6300 * typeck.c: (lookup_java_method): search all inherited
6301 interfaces when looking up interface method.
6303 Mon Nov 1 23:42:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6305 * parse.y (method_header:): Issue error message for rule `type
6307 (synchronized:): Error report when not using synchronized.
6309 Mon Nov 1 01:32:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6311 * parse.y (resolve_qualified_expression_name): Prevent `this' from
6312 being used before the superclass constructor has been called.
6313 (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
6314 instead of `CALL_THIS_CONSTRUCTOR_P'.
6316 Sat Oct 30 21:35:13 1999 Todd T. Fries <todd@lighthouse.fries.net>
6318 * check-init.c: Fix typo in comment.
6320 Fri Oct 29 14:35:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6322 * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
6325 Fri Oct 29 14:23:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6327 * parse.y (expression_statement:): Call function to report
6328 improper invocation of a constructor.
6329 (parse_ctor_invocation_error): New function.
6331 1999-10-26 Mark Mitchell <mark@codesourcery.com>
6333 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
6336 1999-10-21 Tom Tromey <tromey@cygnus.com>
6338 * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
6339 in generated `main'.
6341 Thu Oct 21 01:27:31 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6343 * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
6344 (qualify_ambiguous_name): Likewise.
6346 Wed Oct 20 01:41:47 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6348 * parse.y (java_complete_tree): fold_constant_for_init to work on
6350 (java_complete_lhs): Likewise.
6351 (array_constructor_check_entry): Complete an initializer element
6352 on permanent_obstack.
6354 1999-10-19 Tom Tromey <tromey@cygnus.com>
6356 * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
6357 From Mike Moreton <mike@pillim.demon.co.uk>.
6359 1999-10-15 Greg McGary <gkm@gnu.org>
6361 * java-tree.h (flag_bounds_check): Remove extern decl.
6362 * lang.c (flag_bounds_check): Remove global variable.
6363 (lang_f_options): Remove "bounds-check" entry.
6364 (lang_init_options): Default flag_bounds_check to "on".
6366 1999-10-14 Tom Tromey <tromey@cygnus.com>
6368 * jvgenmain.c (usage): New function.
6369 (main): Use it. Also, handle `-D' options.
6370 * jvspec.c (lang_specific_driver): Recognize -D.
6371 (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
6373 * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
6375 1999-10-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6377 * jcf-dump.c (print_constant, disassemble_method): Don't call a
6378 variadic function with a non-literal format string.
6380 * parse-scan.y (report_main_declaration): Likewise.
6382 * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
6384 * parse.y (read_import_dir, patch_assignment, patch_binop,
6385 patch_array_ref): Likewise.
6387 * typeck.c (build_java_array_type): Likewise.
6389 * verify.c (verify_jvm_instructions): Likewise.
6391 Tue Oct 12 22:28:10 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6393 * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
6395 1999-10-07 Anthony Green <green@cygnus.com>
6397 * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
6398 where CHECK_PUT may fail for valid reasons.
6400 * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
6401 UNSAFE_PUTN): New macros.
6403 1999-10-04 Tom Tromey <tromey@cygnus.com>
6405 * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
6406 well. Fixes Java PR gcj/59.
6407 * parse-scan.y (yyerror): Report errors.
6409 Fri Sep 24 12:23:05 1999 Glenn Chambers <GChambers@provsol.com>
6411 * decl.c (insert_block): Remove unconditional `abort'.
6413 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
6415 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
6416 FUNCTION_CODE now of type int. All callers changed.
6417 Set the builtin's DECL_BUILT_IN_CLASS.
6419 1999-09-23 Tom Tromey <tromey@cygnus.com>
6421 * jvspec.c (lang_specific_driver): Don't read spec file if
6422 -fsyntax-only given.
6424 1999-09-22 Tom Tromey <tromey@cygnus.com>
6426 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
6428 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
6429 (WORDS_TO_LONG): Likewise.
6430 (WORDS_TO_DOUBLE): Likewise.
6432 Tue Sep 14 16:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6434 * jcf-write.c (RELOCATION_VALUE_0): New macro.
6435 (RELOCATION_VALUE_1): Likewise.
6436 (emit_iinc, emit_reloc, push_constant1, push_constant2,
6437 push_in_const, push_long_const): Prototyped.
6438 (push_constant1): Argument `index' is of type HOST_WIDE_INT.
6439 (push_constant2): Likewise.
6440 (push_int_const): Cast find_constant1's integer arguments to `jword'.
6441 (find_constant_wide): Cast find_constant2's integer arguments to
6443 (find_constant_index): Cast find_constant2's and find_constant2's
6444 integer arguments to `jword'.
6445 (emit_pop): Argument `value' is of type HOST_WIDE_INT.
6446 (emit_switch_reloc): Use RELOCATION_VALUE_0.
6447 (emit_if): Use RELOCATION_VALUE_1.
6448 (emit_goto): Likewise.
6449 (emit_jsr): Likewise.
6450 (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
6451 argument to push_long_const to HOST_WIDE_INT.
6453 1999-09-15 Andreas Schwab <schwab@suse.de>
6455 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
6457 1999-09-20 Nick Clifton <nickc@cygnus.com>
6459 * lang.c (lang_decode_option): Extend comment.
6461 Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6463 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
6466 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6468 * gjavah.c (get_field_name, print_method_info, print_include,
6469 add_namelet): Use xmalloc, not malloc.
6471 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
6472 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
6475 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
6477 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
6479 * jcf-path.c (add_entry): Likewise.
6481 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
6483 * jv-scan.c (xmalloc): Remove definition.
6485 * jvgenmain.c (xmalloc): Likewise.
6487 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
6489 * lex.c (java_store_unicode): Use xrealloc, not realloc.
6491 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
6492 concat, not xmalloc/sprintf.
6493 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
6494 (xstrdup): Remove definition.
6496 * parse.y (duplicate_declaration_error_p,
6497 constructor_circularity_msg, verify_constructor_circularity,
6498 check_abstract_method_definitions, java_check_regular_methods,
6499 java_check_abstract_methods, patch_method_invocation,
6500 check_for_static_method_reference, patch_assignment, patch_binop,
6501 patch_cast, array_constructor_check_entry, patch_return,
6502 patch_conditional_expr): Use xstrdup, not strdup.
6504 * zextract.c (ALLOC): Use xmalloc, not malloc.
6506 Sun Sep 12 23:30:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6508 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
6510 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
6511 (do_spec, lang_specific_pre_link, lang_specific_driver,
6512 input_filename, input_filename_length): Don't declare.
6513 (main_class_name, jvgenmain_spec, lang_specific_driver):
6515 (lang_specific_driver): All calls to the function pointer
6516 parameter now explicitly call `fatal'.
6518 Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6520 * parse.y (find_applicable_accessible_methods_list): Search
6521 abstract classes as interfaces.
6523 Thu Sep 9 17:33:28 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6525 * class.c (finish_class): We're now outside a valid method
6526 declaration. Tell the rest of gcc so.
6528 1999-09-08 Bruce Korb autogen@linuxbox.com
6530 * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
6532 1999-09-07 Tom Tromey <tromey@cygnus.com>
6534 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
6536 (decode_signature_piece): Don't emit "::" in JArray<>.
6537 (print_namelet): Only print trailing `;' when printing a class.
6539 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
6541 * java-tree.h: Delete declarations for all tree nodes now moved to
6543 * decl.c: Delete their definitions.
6545 1999-09-04 Mark Mitchell <mark@codesourcery.com>
6547 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
6548 * Makefile.in (OBJS): Add ggc-callbacks.o.
6549 (OBJDEPS): Likewise.
6551 1999-09-03 Tom Tromey <tromey@cygnus.com>
6553 * parse.y (strip_out_static_field_access_decl): Return operand if
6554 it satisfies JDECL_P.
6556 1999-09-02 Tom Tromey <tromey@cygnus.com>
6558 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
6559 Handle nested arrays, like `[[I'.
6561 1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6563 * class.c (finish_class): Remove unused parameter, all callers
6566 * expr.c (build_java_athrow): Change return type to void.
6567 (java_lang_expand_expr): Make sure each case in switch returns a
6570 * java-tree.h (finish_class): Fix prototype to take void args.
6572 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
6573 (main): Issue return from main, not exit.
6575 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
6577 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
6579 * jv-scan.c (main): Issue return from main, not exit.
6581 * parse.y (check_abstract_method_definitions,
6582 java_check_abstract_method_definitions): Add static prototypes.
6583 (java_complete_expand_methods): Fix call to `finish_class'.
6585 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
6588 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6590 * lang.c (language_string): Constify.
6592 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6594 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
6595 Remove hacks for stuff which comes from libiberty.
6597 * Make-lang.in: Likewise.
6599 Mon Aug 30 16:41:41 1999 Hans-Peter Nilsson <hp@axis.se>
6601 * Makefile.in (xref.o): Depend on xref.c explicitly.
6603 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6605 * java-tree.h (lang_printable_name): Constify a char*.
6607 * lang.c (lang_printable_name): Likewise.
6609 Fri Aug 27 23:31:57 1999 Jeffrey A Law (law@cygnus.com)
6611 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
6614 1999-08-26 Tom Tromey <tromey@cygnus.com>
6616 * gjavah.c (print_cxx_classname): Print "::" before qualified
6619 Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6621 * parse.y (lookup_cl): Changed leading comment. Now does its best
6622 to set the column number.
6623 (qualify_ambiguous_name): Take WFL wrappers into account.
6625 Wed Aug 25 15:37:15 1999 Gregg Townsend <gmt@cs.arizona.edu>
6627 * verify.c (verify_jvm_instructions): Don't check instruction
6628 validity beyond end of method.
6630 1999-08-25 Tom Tromey <tromey@cygnus.com>
6632 * jvspec.c (lang_specific_driver): Correctly handle --help again.
6634 1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6636 * gjavah.c (print_name, print_base_classname, utf8_cmp,
6637 cxx_keyword_subst, generate_access, name_is_method_p,
6638 get_field_name, print_field_name, super_class_name, print_include,
6639 decode_signature_piece, print_class_decls, usage, help,
6640 java_no_argument, version, add_namelet, print_namelet): Add static
6642 (print_base_classname, utf8_cmp, cxx_keyword_subst,
6643 name_is_method_p): Constify a char*.
6644 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
6645 Provide a final else clause in an if-else-if.
6646 (print_field_info): Add missing final arg in function call to
6648 (print_method_info, decompile_method, decode_signature_piece,
6649 print_c_decl, print_full_cxx_name, print_stub,
6650 print_mangled_classname, super_class_name, print_include,
6651 add_namelet, add_class_decl, print_class_decls, process_file,
6652 help): Constify a char*.
6654 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
6655 push_int_const, find_constant_wide, find_constant_index,
6656 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
6657 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
6658 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
6659 emit_if, emit_goto, emit_jsr, call_cleanups,
6660 make_class_file_name): Add static prototypes.
6661 (generate_bytecode_return, generate_bytecode_insns): Pass a
6662 NULL_PTR, not a NULL_TREE.
6664 * jv-scan.c: Include "jcf.h".
6665 (main): Declare using DEFUN macro.
6667 * jvspec.c (find_spec_file, lang_specific_pre_link,
6668 lang_specific_driver): Add prototypes.
6669 (find_spec_file): Constify a char*.
6671 * keyword.gperf (hash, java_keyword): Add prototypes.
6673 * lang.c (lang_print_error): Add static prototype.
6674 (lang_init): Prefer memcpy over bcopy to avoid casts.
6676 * lex.c (yylex): Add static prototype.
6678 * parse-scan.y: Include "lex.c" earlier.
6680 * parse.h: Remove redundant declaration for `yylex'.
6682 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
6683 labeled_block_contains_loop_p): Add static prototypes.
6684 (not_accessible_p): Make static to match prototype.
6686 * verify.c (start_pc_cmp): Don't needlessly cast away const.
6688 Sun Aug 22 11:07:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6690 * parse.y (check_method_redefinition): Changed leading comment.
6691 (check_abstract_method_definitions): New function.
6692 (java_check_abstract_method_definitions): New function.
6693 (java_check_regular_methods): Call it.
6694 (verify_constructor_super): Fixed indentation.
6695 (lookup_method_invoke): Likewise.
6697 Thu Aug 19 10:26:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6699 * parse.y (method_header): Return a null pointer if the current
6701 (finish_method_declaration): Return if the current function decl
6703 (source_start_java_method): Likewise.
6704 (java_method_add_stmt): Likewise.
6706 Wed Aug 18 13:17:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6708 * class.c (emit_register_class): Removed unnecessary call to
6710 * parse.y (labeled_block_contains_loop_p): Removed unused local
6713 Tue Aug 17 22:51:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6715 * parse.y (java_refold): Added prototype.
6717 Tue Aug 17 21:48:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6719 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
6720 (java_stabilize_reference): Removed unnecessary `else'.
6721 (java_complete_lhs): Set flag to remember boolean. Call
6722 java_refold. Added comments.
6723 (java_decl_equiv): New function.
6724 (binop_compound_p): Likewise.
6725 (java_refold): Likewise.
6726 (patch_unaryop): Striped static field access assigned to decl and
6727 op. Changed promotion scheme for ++/-- operators.
6728 (search_loop): New function.
6729 (labeled_block_contains_loop_p): Likewise.
6730 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
6732 (patch_bc_statement): Call search_loop. Fixed comment.
6734 1999-08-14 Anthony Green <green@cygnus.com>
6736 * expr.c (java_lang_expand_expr): Mark static array data as
6739 Tue Aug 10 00:28:31 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
6741 * jvgenmain.c (main): NUL-terminate name_obstack.
6743 1999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6745 * check-init.c (check_bool2_init, done_alternative): Add static
6748 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
6749 (add_method, build_utf8_ref, build_class_ref,
6750 append_gpp_mangled_type, layout_class_method): Constify a char*.
6752 * decl.c (push_promoted_type, make_binding_level): Add static
6754 (push_promoted_type, pushdecl): Constify a char*.
6756 * except.c (find_handler_in_range, link_handler,
6757 check_start_handlers): Add static prototypes.
6759 * expr.c (process_jvm_instruction): Constify a char*.
6761 * gjavah.c (main): Constify a char*.
6763 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
6766 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
6768 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
6769 munge, print_ents): Constify a char*.
6771 * jcf-dump.c (disassemble_method): Constify a char*.
6772 (print_constant_pool, print_exception_table): Add static prototypes.
6773 (print_constant, print_exception_table, main, disassemble_method):
6776 * jcf-io.c (find_classfile, find_class): Likewise.
6778 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
6779 (set_source_filename, predefined_filename_p): Add static prototypes.
6780 (set_source_filename, get_constant, get_class_constant,
6781 find_in_current_zip): Constify a char*.
6783 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
6785 (add_entry, add_path, jcf_path_classpath_arg,
6786 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
6788 * jcf-reader.c (get_attribute, jcf_parse_preamble,
6789 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
6790 jcf_parse_one_method, jcf_parse_methods,
6791 jcf_parse_final_attributes): Add static prototypes.
6792 (get_attribute): Constify a char*.
6794 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
6795 jcf_dependency_add_target, jcf_path_classpath_arg,
6796 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
6798 * jv-scan.c (main): Constify a char*.
6799 (gcc_obstack_init): Add prototype arguments.
6801 * jvgenmain.c (gcc_obstack_init): Likewise.
6802 (main): Constify a char*.
6804 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
6806 (put_decl_string, lang_print_error): Constify a char*.
6807 (lang_init): Remove redundant extern prototype.
6809 * mangle.c (emit_unicode_mangled_name): Constify a char*.
6811 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
6812 Add static prototypes.
6813 (get_type_from_signature): Constify a char*.
6815 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
6816 Add static prototypes.
6817 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
6818 (verify_jvm_instructions): Constify a char*.
6820 * xref.c (xref_flag_value): Likewise.
6822 * xref.h (xref_flag_value): Likewise.
6824 * zextract.c (makeword, makelong): Add static prototypes.
6825 (makeword, makelong): Constify a uch*.
6827 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6829 * lang.c (java_dummy_print): Constify a char*.
6830 (lang_print_error): Likewise.
6831 (lang_init): Remove redundant prototype for `print_error_function'.
6832 (lang_init_source): Likewise.
6833 (lang_identify): Constify a char*.
6835 1999-08-09 Tom Tromey <tromey@cygnus.com>
6837 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
6838 (WORDS_TO_LONG): Likewise.
6839 (WORDS_TO_DOUBLE): Likewise.
6841 1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6843 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
6845 * expr.c (java_stack_pop, java_array_data_offset,
6846 build_java_throw_out_of_bounds_exception, case_identity,
6847 build_java_check_indexed_type): Add static prototypes.
6848 (linenumber_table, expand_invoke, expand_java_field_op,
6849 build_primtype_type_ref, expand_byte_code): Constify a char*.
6851 * java-tree.h (build_primtype_type_ref, linenumber_table):
6853 (java_lang_expand_expr): Add prototype.
6855 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
6856 `java_lang_expand_expr'.
6858 * lex.c (java_lex_error): Constify a char*.
6859 (java_get_unicode, java_read_char, java_allocate_new_line,
6860 java_unget_unicode, java_sneak_unicode): Prototype.
6862 * parse-scan.y (current_class, package_name, method_declarator,
6863 report_class_declaration, yyerror): Constify a char*.
6865 * parse.h (java_report_errors): Prototype.
6866 (yyerror): Constify a char*.
6868 * parse.y (classitf_redefinition_error, check_modifiers,
6869 parse_jdk1_1_error, lookup_package_type,
6870 lookup_package_type_and_set_next, get_printable_method_name,
6871 purify_type_name): Constify a char*.
6872 (build_super_invocation, maybe_generate_finit,
6873 verify_constructor_super, parser_add_interface,
6874 add_superinterfaces, jdep_resolve_class, note_possible_classname,
6875 java_complete_expand_methods, java_expand_finals,
6876 cut_identifier_in_qualified, java_stabilize_reference,
6877 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
6878 merge_string_cste): Prototype.
6879 (single_type_import_declaration, yyerror,
6880 variable_redefinition_error, build_array_from_name,
6881 build_unresolved_array_type, check_class_interface_creation,
6882 resolve_class, complete_class_report_errors,
6883 note_possible_classname, read_import_dir,
6884 find_in_imports_on_demand, resolve_package, fix_constructors,
6885 check_deprecation, lookup_method_invoke,
6886 maybe_build_primttype_type_ref, array_constructor_check_entry):
6888 (java_complete_expand_methods, java_expand_finals): Make static.
6889 (convert_narrow): Remove static prototype.
6891 Tue Aug 3 20:21:20 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
6893 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
6895 1999-08-02 Richard Henderson <rth@cygnus.com>
6897 * decl.c: Include defaults.h instead of expr.h.
6898 * parse.y: Likewise.
6900 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
6902 * java/decl.c (start_java_method): Change all uses of
6903 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
6904 Ensure expr.h is included.
6905 * java/expr.c (pop_arguments): Ditto.
6906 * java/parse.y (expand_start_java_method): Ditto.
6908 1999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6910 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
6912 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
6914 * decl.c: Include "function.h".
6915 * except.c: Likewise.
6916 * parse.y: Likewise.
6917 * Makefile.in: Update dependencies.
6919 1999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6921 * expr.c (build_java_soft_divmod): Provide a default case in switch.
6922 (java_lang_expand_expr): Mark parameters `target', `tmode' and
6923 `modifier' with ATTRIBUTE_UNUSED.
6925 * gjavah.c (process_file): Add braces around ambiguous `else'.
6927 * jcf-dump.c (print_access_flags, localvar_free): Change return
6930 * parse.y (java_complete_expand_method): Initialize variable
6932 (resolve_qualified_expression_name): Likewise for `field_decl'.
6933 (patch_method_invocation): Likewise for `class_to_search'.
6934 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
6935 (patch_assignment): Likewise for `lhs_type'.
6937 * verify.c (verify_jvm_instructions): Remove unused variable
6940 1999-07-25 Richard Henderson <rth@cygnus.com>
6942 * decl.c (va_list_type_node): New.
6944 1999-07-25 Anthony Green <green@cygnus.com>
6946 * gjavah.c (print_stub): New function.
6947 (METHOD_IS_NATIVE): New macro.
6948 (print_mangled_classname): Make static.
6949 (HANDLE_END_FIELD): Don't emit fields during stub generation.
6950 (process_file): Perform stub generation.
6951 (HANDLE_METHOD): Don't emit class decls during stub
6953 (HANDLE_END_METHOD): Take into account stub generation.
6954 (print_method_info): Handle stub generation.
6955 (print_stub): New function.
6956 (print_cxx_classname): Make signature consistant with others.
6957 (help): Describe -stubs option.
6958 (main): Create stub file.
6959 (version): Use version.c.
6960 (print_full_cxx_name): New function.
6961 (print_c_decl): Use print_full_cxx_name.
6963 Thu Jul 22 12:41:12 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6965 * check-init.c (check_init): Handle MAX_EXPR.
6967 1999-07-15 Andrew Haley <aph@cygnus.com>
6969 * lang.c (flag_use_divide_subroutine): New variable.
6970 * typeck.c: (convert_ieee_real_to_integer): Bounds check
6971 fp-to-integer conversion.
6972 (convert): Call convert_ieee_real_to_integer when flag_fast_math
6975 * expr.c (build_java_soft_divmod): New function.
6976 (build_java_binop): Call build_java_soft_divmod if
6977 flag_use_divide_subroutine is set.
6978 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
6979 soft_lrem_node: new builtin functions.
6980 (init_decl_processing) Initialize the new builtins.
6981 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
6982 soft_lrem_node: new builtin functions.
6983 (build_java_soft_divmod): New function.
6984 * parse.y: Call build_java_soft_divmod if
6985 flag_use_divide_subroutine is set.
6988 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
6989 a --specs= arg) even if not linking.
6990 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
6991 -fuse-divide-subroutine
6993 Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
6995 * parse.y (resolve_and_layout): Check methods only once.
6996 (resolve_qualified_expression_name): Verify thrown exceptions
6998 (check_thrown_exceptions): Reject exceptions thrown in
6999 initializer. Error message tuned.
7001 1999-07-14 Andrew Haley <aph@cygnus.com>
7003 * expr.c (expand_expr): Do not return the last statement in a
7004 block as the block's value.
7006 Sat Jul 3 22:26:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7008 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
7009 CALL_EXPR, to avoid order of evaluation changes.
7011 Fri Jul 2 17:44:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7013 * parse.y (qualify_ambiguous_name): Do not use
7014 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
7016 Thu Jul 1 23:31:16 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7018 * check-init.c (check_init): Handle MAX_EXPR.
7019 * expr.c (force_evaluation_order): Force method call arguments to
7020 be evaluated in left-to-right order.
7021 * parse.y (qualify_ambiguous_name): Loop again to qualify
7022 NEW_ARRAY_EXPR properly.
7024 Wed Jun 30 17:27:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7026 * parse.y (patch_invoke): Resolve unresolved invoked method
7028 (qualify_ambiguous_name): STRING_CST to qualify expression for
7029 type name resolution.
7031 1999-06-24 Andrew Haley <aph@cygnus.com>
7033 * class.c (finish_class): Whenever a deferred method is
7034 output, rescan the list of methods to see if a new candidate for
7035 output can be found.
7037 1999-06-28 Tom Tromey <tromey@cygnus.com>
7039 * jvspec.c (lang_specific_driver): Recognize --help.
7041 Fri Jun 25 13:35:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7043 * parse.y (resolve_package): Fixed bogus return statement.
7044 (patch_method_invocation): Resolve method invocation beginning with
7045 a package name qualifier.
7047 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7049 * Make-lang.in (java.stage1): Depend on stage1-start.
7050 (java.stage2): Likewise for stage2-start.
7051 (java.stage3): Likewise for stage3-start.
7052 (java.stage4): Likewise for stage4-start.
7054 Thu Jun 24 13:12:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7056 * parse.y (java_complete_lhs): When doing cross referencing, don't
7057 try to keep file location on a WFL expanded as a CALL_EXPR.
7059 Wed Jun 23 14:37:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7061 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
7062 compiling to class file a void method with an empty method body.
7063 As a side effect, the bytecode backend will generate the
7064 appropriate `return' instruction.
7066 Tue Jun 22 20:43:49 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7068 * parse.y (lookup_package_type_and_set_next): New function prototype.
7069 (resolve_package): Search current and imported packages.
7070 (lookup_package_type_and_set_next): New function.
7072 1999-06-22 Andrew Haley <aph@cygnus.com>
7074 * verify.c (verify_jvm_instructions): Check for pending blocks
7075 before invalid PC test and opcode switch, not after.
7077 1999-06-21 Andrew Haley <aph@cygnus.com>
7079 * except.c (find_handler_in_range): The upper limit for exception
7080 ranges is exclusive, not inclusive: (start <= pc < end).
7081 (link_handler): find child pointer which points to outer by
7082 searching sibling list: previous code incorrectly assumed that
7083 outer->outer->first_child must point to outer.
7084 * verify.c (verify_jvm_instructions): FIXME added to code for
7086 (verify_jvm_instructions): Do not assume that the last block
7087 processed in a subroutine is a block which ends with a `ret'
7088 instruction. With some control flows it is possible that the last
7089 block ends with an `athrow'.
7091 Mon Jun 14 13:13:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7093 * parse.y (qualify_ambiguous_name): Reorganized the post
7094 evaluation of non WFL leading expression nodes.
7096 Fri Jun 11 21:37:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7098 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
7101 Thu Jun 10 22:26:17 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7103 * parse.y (qualify_ambiguous_name): Handle qualified expression
7104 beginning with a STRING_CST.
7106 Thu Jun 10 20:27:25 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7108 * parse.y (register_fields): Set DECL_INITIAL on both
7109 pre-initialized static and public fields.
7110 (resolve_field_access): Static field access expressions to always
7112 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
7113 qualification. CONVERT_EXPR to be resolved as an expression name.
7114 (java_complete_lhs): Identify and access qualified final
7115 initialized field in switch statement case expression.
7116 (fold_constant_for_init): Pre-initialized field decl constant to
7119 Mon Jun 7 16:09:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7121 * parse.y (note_possible_classname): Mark returned node with
7122 QUALIFIED_P only if the original class name contained a '/'.
7124 Sat Jun 5 11:46:59 1999 Anthony Green <green@cygnus.com>
7126 * Make-lang.in (gcjh): More parallel build fixes.
7128 1999-06-03 Mike Stump <mrs@wrs.com>
7130 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
7132 Wed Jun 2 10:44:38 1999 Anthony Green <green@cygnus.com>
7134 * except.c (link_handler): Chain exception handlers in order.
7136 Wed Jun 2 10:41:24 1999 Anthony Green <green@cygnus.com>
7138 * expr.c (expand_byte_code): Fill unreachable bytecode regions
7139 with nops and process as usual in order to always set correct EH
7140 ranges. Emit detailed warnings about unreachable bytecodes.
7142 Wed Jun 2 10:35:13 1999 Anthony Green <green@cygnus.com>
7144 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
7147 Fri May 28 18:22:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7149 * parse.y (lookup_field_wrapper): Unified returned value to NULL
7150 or the searched field decl.
7152 Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7154 * parse.y (fold_constant_for_init): Convert numerical constant
7155 values to the type of the assigned field.
7157 Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7159 * expr.c (lookup_field): Relaxed the test on class loading error
7161 * parse.y (fold_constant_for_init): Enabeled old code.
7163 Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7165 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
7166 decide the validity of the cast of a java.lang.Cloneable reference
7168 (patch_conditional_expr): Fixed first argument passed to
7169 binary_numeric_promotion.
7171 Wed May 26 15:33:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7173 * parse.y (qualify_ambiguous_name): Take into account that a
7174 CONVERT_EXPR might specify a type as a WFL.
7176 Tue May 25 15:06:13 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7178 * parse.y (patch_assignment): Save the rhs before using it as an
7179 argument to _Jv_CheckArrayStore.
7181 Tue May 25 11:23:59 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7183 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
7185 Mon May 24 13:26:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7187 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
7188 floating point litteral only when the exponent indicator has been
7191 Sat May 22 13:54:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7193 * parse.y (formal_parameter:): Construct argument tree list
7194 element even if a yet unsupported final parameter was encountered.
7196 Tue May 18 00:28:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7198 * parse.y (finish_method_declaration): Issue errors for native or
7199 abstract methods declared with a method body, as well as for non
7200 native or non abstract methods with no method body.
7202 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7204 * class.c (build_utf8_ref): Initialize variable `field'.
7206 * decl.c (init_decl_processing): Initialize variable `field'.
7208 * expr.c (build_known_method_ref): Mark parameters `method_type',
7209 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
7210 (process_jvm_instruction): Likewise for parameter `length'.
7212 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
7213 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
7216 * parse.y (maybe_generate_clinit): Remove unused variable
7217 `has_non_primitive_fields'.
7218 (find_in_imports_on_demand): Initialize variables `node_to_use'
7220 (patch_binop): Likewise for variable `prom_type'.
7221 (patch_unaryop): Likewise for variable `prom_type'.
7223 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
7225 * xref.c (xref_table): Add missing initializer.
7227 1999-05-14 Tom Tromey <tromey@cygnus.com>
7229 * java-except.h (struct eh_range): Removed unused `next' member.
7230 * verify.c (verify_jvm_instructions): Call check_nested_ranges
7231 after adding all exception handlers. Sort exception ranges in
7233 (struct pc_index): New structure.
7234 (start_pc_cmp): New function.
7235 * except.c (add_handler): Return `void'. Don't call link_handler;
7236 instead construct an ordinary linked list and do range
7238 (check_nested_ranges): New function.
7239 (link_handler): Changed interface to allow merging of eh_ranges.
7240 Split overlapping ranges. Return `void'.
7242 Mon May 17 19:20:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7244 * parse.y (constructor_block_end:): New rule, tagged <node>.
7245 (constructor_body:): Use `constructor_block_end' instead of
7248 Mon May 17 18:01:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7250 * parse.y (statement_nsi:): Pop `for' statement block.
7251 (java_complete_lhs): Labeled blocks containing no statement are
7252 marked as completing normally.
7254 Fri May 14 12:31:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7256 * xref.c (xref_set_current_fp): New function, defined.
7257 * xref.h (xref_set_current_fp): New function, prototyped.
7259 Fri May 14 11:57:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7261 * check-init.c (check_init): Take into account that
7262 LABELED_BLOCK_STMT can be empty.
7264 Thu May 13 18:30:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7266 * parse.y (java_check_regular_methods): Warning check on not
7267 overriding methods with default access in other packages does not
7268 apply to `<clinit>'.
7269 (java_complete_lhs): If block body is an empty_stmt_node, replace
7270 it by NULL_TREE. This prevents gcc from generating an irrelevant
7273 Thu May 13 13:23:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7275 * check-init.c (check_init): Removed code accepting to see things
7276 falling through default:, when doing xrefs.
7277 * java-tree.h (do_not_fold): New global variable, declared.
7278 * parse.y (do_not_fold): New global variable, defined.
7279 (java_complete_expand_method): Set `do_not_fold' to the value of
7280 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
7281 and reinstall them after them have been purged; do not check for
7282 initializations; do not issue missing return errors.
7283 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
7285 (patch_binop): Skip the fold part when doing xrefs.
7286 (build_string_concatenation): Skip the concatenation part when
7288 (patch_synchronized_statement): Do not generate a try-finally when
7290 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
7291 and keep the location where the throw was seen.
7292 * typeck.c (convert): When `do_not_fold' is set, do not attempt
7293 any treatment on the converted node an simply return a NOP_EXPR of
7295 * xref.c (xref_get_data): New function, defined.
7296 * xref.h (xref_get_data): New function, declared.
7297 (XREF_GET_DATA): Use xref_get_data.
7299 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7301 * gjavah.c (print_include): Cast the result of `strlen' to int
7302 when comparing against a signed value.
7303 (add_namelet): Likewise.
7305 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7307 * expr.c (expand_invoke): Mark parameter `nargs' with
7309 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
7311 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
7314 * jcf-reader.c (get_attribute): Cast a value to long
7315 when comparing against a signed expression. Likewise.
7317 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
7320 1999-05-11 Andrew Haley <aph@cygnus.com>
7322 * parse.y (source_end_java_method): If the current method contains
7323 any exception handlers, force asynchronous_exceptions: this is
7324 necessary because signal handlers in libjava may throw exceptions.
7325 * decl.c (end_java_method): Ditto.
7327 1999-05-11 Tom Tromey <tromey@cygnus.com>
7329 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
7331 * jvspec.c (THREAD_NAME): Removed.
7332 (GC_NAME): Likewise.
7333 (MATHLIB): Likewise.
7334 (WITHLIBC): Likewise.
7336 (THREADLIB): Likewise.
7337 (MATH_LIBRARY): Likewise.
7338 (lang_specific_driver): Don't add `-l' options to command line.
7339 Instead, add a single --specs option. Recognize `-L' options and
7340 use them to search for spec file.
7341 (find_spec_file): New function.
7342 (SPEC_FILE): New define.
7344 Tue May 11 11:46:36 1999 Dave Brolley <brolley@cygnus.com>
7346 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
7347 cpplib-enabled build.
7349 1999-05-05 Per Bothner <bothner@cygnus.com>
7351 * class.c (make_field_value): DECL_INITIAL may be a string literal;
7352 temporarily zero it while calling rest_of_decl_compilation.
7354 * java-tree.h (string_ptr_type_node): Add declaration.
7355 * decl.c: Define and initialize string_ptr_type_node.
7356 * parse.y (patch_string_cst): Use string_ptr_type_node.
7358 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
7359 * parse.y (for_statement): Now unconditionally exit_block.
7360 (finish_labeled_statement): No longer exit_block if for-loop.
7361 (patch_loop_statement): Check harder if the loop is already labeled.
7363 * parse.y (patch_initialized_static_field): Removed function.
7364 (maybe_generate_clinit): Removed special handling for interfaces.
7365 (java_complete_expand_methods): Do a preliminary java_complete_tree
7366 on <clinit> to determine if it can be removed.
7367 (java_complete_expand_method): Remove special handling for <clinit>.
7368 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
7369 optimize if we get back empty_stmt_node.
7370 For MODIFY_EXPR, re-do checking of static initializers.
7371 (fold_constant_for_init): Don't return immediate if VAR_DECL.
7372 For VAR_DECL, pass correct context.
7374 * verify.c (verify_jvm_instructions): Better error messages.
7376 1999-05-03 Tom Tromey <tromey@cygnus.com>
7378 * parse-scan.y (interface_declaration): Call
7379 report_class_declaration for interfaces.
7381 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
7383 * Makefile.in: Remove -v from bison command lines.
7385 Fri Apr 30 17:54:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7387 * check-init.c (check_init): Exclude a case of error when doing
7389 * class.c (layout_class_method): Don't generate the error message
7390 twice when compiling from source.
7391 * lang-options.h: Added `-Wredundant-modifers' and
7392 `-Wunusupported-jdk11' flags and help text.
7393 * lang.c (lang_decode_option): Added support for
7394 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
7395 flag_static_local_jdk11 and flag_redundant set accordingly.
7396 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
7397 * parse.h (EXPR_WFL_ADD_COL): New macro.
7398 (DECL_END_SOURCE_LINE): Likewise.
7399 (DECL_INHERITED_SOURCE_LINE): Likewise.
7400 * parse.y (static_ref_err): New function, prototyped.
7401 (CCB_TK): Now tagged <operator>.
7402 (class_body:): Remember the location of the closing '}' of a class
7403 definition when doing xrefs.
7405 (block_end:): Likewise.
7406 (create_class): Remember the location of the inherited class
7407 identifier when doing xrefs.
7408 (register_fields): Added test on first operand of `init' before
7409 testing it TREE_CODE.
7410 (method_header): Store the location of the class identifier in the
7411 class decl when doing xrefs.
7412 (finish_method_declaration): Don't combine first/last method line
7414 (java_check_regular_methods): Warning check on not overriding
7415 methods with default access on other packages move before check on
7416 static methods. Initialization of `aflags' also moved up.
7417 (resolve_expression_name): Call static_ref_err to report the error.
7418 (static_ref_err): New function, implemented.
7419 (resolve_field_access): Returned simplified static field access
7421 (resolve_qualified_expression_name): Check for illegal use of
7422 static fields in a non static context. Call static_ref_err to
7423 report error in various places.
7424 (java_complete_tree): Do not fold initialized static fields when
7426 (java_complete_lhs): Likewise.
7428 1999-04-29 Anthony Green <green@cygnus.com>
7430 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
7431 create internal labels.
7432 (lookup_label): Ditto.
7434 Sat Apr 24 16:50:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7436 * class.c (layout_class_method): Generate <clinit>'s rtl for
7438 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
7439 for interfaces' <clinit>.
7440 * expr.c (lookup_field): Search for fields in interfaces.
7441 (expand_invoke): Fixed indentation.
7442 (expand_java_field_op): Likewise. Use IS_CLINIT.
7443 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
7444 (IS_CLINIT): New macro.
7445 * parse.y (type_declaration:): Call maybe_generate_clinit after an
7446 interface was parsed.
7447 (maybe_generate_clinit): Don't generate if the current class is an
7448 interface with only fields of primitive types.
7449 (reset_method_name): Use IS_CLINIT.
7450 (java_complete_expand_method): Expand <clinit> when it exists for
7451 interfaces. Use IS_CLINIT.
7452 (resolve_expression_name): Use DECL_CONTEXT instead of
7453 current_class to build static field references.
7454 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
7455 ARRAY_REF when doing xreferencing.
7456 (check_final_assignment): Fixed typo in leading comment. Use
7458 (patch_array_ref): Don't fully expand array references when
7460 (patch_return): Use IS_CLINIT.
7461 (patch_throw_statement): Likewise.
7463 1999-04-22 Tom Tromey <tromey@cygnus.com>
7465 * Make-lang.in (JAVA_SRCS): Added check-init.c.
7467 Wed Apr 21 11:13:36 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7469 * decl.c (predef_filenames, predef_filenames_size): New globals
7470 (init_decl_processing): predef_filenames and predef_filenames_size
7472 * java-tree.h (predef_filenames, predef_filenames_size): Declared
7474 * jcf-parse.c (predefined_filename_p): New function.
7475 (yyparse): Check that files on the command line are specified only
7476 once and issue a warning otherwise.
7477 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
7478 * parse.y (source_end_java_method): Nullify NOP method bodies, to
7479 avoid a gcc warning with -W -Wall turned on.
7480 (java_expand_classes): Abort if errors were encountered.
7481 (java_complete_lhs): If the cross reference flag is set, wrap
7482 field DECL node around a WFL when resolving expression name.
7484 Mon Apr 19 14:44:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7486 * lang.c (lang_decode_option): Fixed returned value when parsing
7487 `-fxref=...' and `-Wall'.
7488 * parse.y (source_end_java_method): Do not generate code when
7489 flag_emit_xref is set.
7490 (resolve_expression_name): Do not build static field access when
7491 flag_emit_xref is set.
7492 (resolve_field_access): No special treatment on `length' when
7493 flag_emit_xref is set. Do not build qualified static field access
7494 when flag_emit_xref is set.
7495 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
7496 when flag_emit_xref is set.
7497 (patch_assignment): Do not generate array store runtime check when
7498 flag_emit_xref is set.
7499 * xref.c (xref_flag_value): Fixed function declaration
7501 (xset_set_data): New function.
7502 * xref.h (xref_set_data): Added prototype for new function.
7503 (typedef struct xref_flag_table): New field data.
7504 (XREF_GET_DATA): New macro.
7506 1999-04-19 Tom Tromey <tromey@cygnus.com>
7508 * xref.h (enum): Removed trailing comma.
7510 * parse.y (resolve_qualified_expression_name): Added missing
7513 Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com>
7515 * gjavah.c: New prototypes for java_float_finite and
7518 Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7520 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
7523 Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com)
7525 * Makefile.in (TREE_H): Add tree-check.h.
7526 (RTL_H): Add genrtl.h.
7528 Tue Apr 6 15:15:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7530 * parse.y (patch_assignment): Added ArrayStoreException runtime
7533 1999-04-06 Per Bothner <bothner@cygnus.com>
7535 * expr.c (pop_type_0): New function.
7536 (pop_type): Use pop_type_0.
7537 * java-tree.h (pop_type_0): New declaration.
7538 * verify.c (verify_jvm_instructions): Check return instructions.
7540 * parse.y (patch_binop): Don't fold if non-constant and emiting
7543 Mon Apr 5 16:06:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7545 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
7547 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
7548 (main_jcf): Don't define.
7549 (process_file): Don't set `main_jcf'.
7551 * java-tree.h (main_jcf): Don't declare.
7553 * jcf-parse.c (main_jcf): Add static definition.
7555 * lang.c (main_jcf): Don't define.
7557 Mon Apr 5 15:43:51 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7559 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
7561 * decl.c (copy_lang_decl): Likewise for `bcopy'.
7563 * jcf-depend.c: Include "config.h", not <config.h>.
7565 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
7568 * jcf-path.c: Include "config.h", not <config.h>.
7570 * lex.c: Don't include various system header files.
7571 (java_init_lex): Cast the argument of `bzero' to PTR
7573 * parse-scan.y (java_push_parser_context): Likewise.
7575 * parse.y (java_push_parser_context): Likewise.
7576 (patch_bc_statement): Match format specifier to variable argument.
7578 * xref.c: Don't include <stdio.h>.
7580 Mon Apr 5 11:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7582 * parse.y (struct parser_ctxt *ctxp): Now global.
7583 (declare_local_variables): Use WFL compound value for the
7584 declaration source line value, when doing cross-referencing.
7586 1999-03-31 Tom Tromey <tromey@cygnus.com>
7588 * gjavah.c (print_field_info): Allow constants of other types.
7589 (print_include): Generate include when new name is proper prefix
7590 of already printed name.
7591 (add_namelet): Likewise.
7592 (cxx_keyword_subst): New function.
7593 (print_method_info): Use it.
7594 (print_field_name): New function.
7595 (get_field_name): New function.
7596 (print_field_info): Use get_field_name and print_field_name.
7598 Wed Mar 31 11:00:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7600 * Makefile.in (keyword.h): Generate using gperf language 'C', not
7601 'KR-C', so gperf uses the `const' keyword on strings.
7603 * keyword.gperf (java_keyword): Const-ify a char*.
7605 Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7607 * parse.y (patch_bc_statement): Fixed identation and a bogus
7610 Tue Mar 30 11:29:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7612 * parse.y (patch_assignment): Allow static variables in other
7613 classes to be assigned.
7615 Sun Mar 28 22:12:10 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7617 * class.c (maybe_add_interface): Remove unused variable
7619 (make_class_data): Use = for assignment, not ==. Likewise.
7620 (emit_register_classes): Remove unused variable `decl'.
7622 * lex.c: Fix comment so as not to contain an embedded `/*'.
7624 * verify.c (verify_jvm_instructions): Remove unused variable
7627 Sat Mar 27 15:49:18 1999 Per Bothner <bothner@cygnus.com>
7629 * parse.y (complete_loop_body): Rename to finish_loop_body.
7630 (complete_labeled_statement): Rename to finish_labeled_statement.
7631 (complete_for_loop): Rename to finish_for_loop.
7632 (complete_method_declaration): Rename to finish_method_declaration.
7634 * java-tree.h (continue_identifier_node): New global node.
7635 * decl.c: Define and initialize continue_identifier_node.
7636 * parse.y (generate_labeled_block): Remove - no longer needed.
7637 (build_loop_body): Use continue_identifier_node for continue block.
7638 (finish_labeled_statement): Also do pop_labeled_block actions.
7639 (java_complete_lhs): POP_LOOP even if error.
7640 (build_labeled_block): Special handling for continue_identifier_node.
7641 (patch_loop_statement): Re-organize.
7642 (patch_bc_statement): Re-write.
7644 Sat Mar 27 15:13:21 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7646 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
7647 using a WFL compound value.
7648 * parse.y (xref.h): Include.
7649 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
7651 (register_fields): Set WFL compound value to lineno if doing
7653 (java_complete_expand_method): Call expand_xref if flag_emit_xref
7655 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
7656 * xref.h (expand_xref): Prototype renamed from xref_generate.
7658 Sat Mar 27 14:16:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7660 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
7661 (GET_CURRENT_BLOCK): New macro.
7662 * parse.y (current_static_block): New global variable.
7663 (method_body:): Define action.
7664 (complete_method_declaration): Set current_function_decl to NULL
7665 when work on the current method is done.
7666 (declare_local_variables): Use GET_CURRENT_BLOCK.
7667 (java_method_add_stmt): Likewise.
7668 (java_complete_expand_method): Disable the use of `this' when
7670 (enter_a_block): If no current method exist, use
7671 current_static_block to link static initializer blocks.
7672 (exit_block): Rewritten to use current_static_block when no current
7674 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
7675 (patch_return): Forbid the use of `return' in static initializers.
7676 (patch_throw_statement): Fixed indentation. Issue specific error
7677 for uncaught thrown checked exception in static initializer
7678 blocks. Removed FIXME.
7680 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
7682 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
7683 Link gcj from gcc.o.
7685 Tue Mar 23 10:48:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7687 * parse.y (find_applicable_accessible_methods_list): When dealing
7688 with interface: ensure that a given interface or java.lang.Object
7689 are searched only once.
7691 Tue Mar 23 10:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7693 * gjavah.c (print_c_decl): Remove unused argument `flags'.
7695 * jcf-dump.c (print_access_flags): Add braces around if-else.
7697 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
7700 * lex.c (build_wfl_node): Add static prototype.
7702 * lex.h (build_wfl_node): Remove static prototype.
7704 * parse.y: Include lex.c early enough to declare everything needed.
7705 Ensure calls to `build_wfl_node' pass the proper arguments.
7706 (create_class): Remove unused variable `super_decl'.
7707 (get_printable_method_name): Initialize variable `name'.
7709 Mon Mar 22 20:14:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7711 * Changelog: Fixed 1999-03-22 typos.
7712 * lang.c (lang_decode_option): Fixed typo in error string in the
7715 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
7717 * Makefile.in (JAVA_OBJS): Added entry xref.o.
7719 * java-tree.h (flag_emit_xref): Declared extern.
7720 * lang.c (xref.h): Included.
7721 (flag_emit_xref): New global variable.
7722 (lang_decode_option): Added support for -fxref.
7726 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
7728 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
7731 Sun Mar 21 08:30:30 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7733 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
7734 $(srcdir)/../system.h and $(JAVA_TREE_H).
7735 (jcf-io.o): Depend on $(JAVA_TREE_H).
7736 (mangle.o): Likewise.
7738 * check-init.c (check_cond_init): Add static prototype.
7740 * class.c (build_java_method_type, hashUtf8String,
7741 make_field_value, get_dispatch_vector, get_dispatch_table,
7742 append_gpp_mangled_type, mangle_static_field): Likewise.
7743 (strLengthUtf8): Hide unused definition.
7744 (hashUtf8String): Const-ify.
7745 (make_field_value): Un-ANSI-fy.
7747 * constants.c: Move inclusion of jcf.h above java-tree.h.
7748 (set_constant_entry, find_class_or_string_constant,
7749 find_name_and_type_constant, get_tag_node,
7750 build_constant_data_ref): Add static prototype.
7752 * decl.c (push_jvm_slot, builtin_function,
7753 lookup_name_current_level): Likewise.
7754 (builtin_function): Const-ify.
7756 * except.c (expand_start_java_handler, expand_end_java_handler):
7757 Add static prototype.
7759 * expr.c (flush_quick_stack, push_value, pop_value,
7760 java_stack_swap, java_stack_dup, build_java_athrow,
7761 build_java_jsr, build_java_ret, expand_java_multianewarray,
7762 expand_java_arraystore, expand_java_arrayload,
7763 expand_java_array_length, build_java_monitor, expand_java_pushc,
7764 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
7765 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
7766 expand_compare, expand_test, expand_cond, expand_java_goto,
7767 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
7768 expand_java_field_op, java_push_constant_from_pool): Likewise.
7770 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
7771 (build_java_arraynull_check): Mark parameters `node' and `type'
7772 with ATTRIBUTE_UNUSED.
7773 (note_label): Likewise for parameter `current_pc'.
7774 (expand_java_call, expand_java_ret): Hide unused definition.
7776 * java-tree.h (make_class, build_constants_constructor,
7777 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
7778 init_outgoing_cpool, register_class, emit_register_classes,
7779 java_layout_seen_class_methods): Prototype.
7780 (unicode_mangling_length): Const-ify.
7781 (append_gpp_mangled_name, append_gpp_mangled_classtype,
7782 emit_unicode_mangled_name, format_int, format_uint,
7783 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
7784 jcf_print_utf8_replace, open_class): Prototype.
7786 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
7787 <stdio.h>. Include tree.h/java-tree.h.
7788 (utf8_equal_string usage, process_class): Add static prototype.
7789 (open_class): Don't prototype this here.
7790 (utf8_equal_string): Match arguments to format specifiers.
7791 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
7792 TABLE_SWITCH, disassemble_method): Likewise.
7794 * jcf-io.c: Include tree.h/java-tree.h.
7795 (open_class, find_classfile, jcf_print_utf8,
7796 jcf_print_utf8_replace): Const-ify.
7798 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
7799 parse_class_file): Add static prototype.
7800 (find_in_current_zip): Match definition to existing static
7803 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
7804 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
7805 finish_jcf_block, define_jcf_label, get_jcf_label_here,
7806 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
7807 write_chunks, adjust_typed_op, generate_bytecode_conditional,
7808 generate_bytecode_return, perform_relocations, init_jcf_state,
7809 init_jcf_method, release_jcf_state, generate_classfile):
7810 Add static prototype.
7811 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
7812 (make_class_file_name): Const-ify.
7814 * jcf.h (find_classfile): Const-ify.
7816 * jv-scan.c (reset_report): Remove prototype.
7818 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
7819 (error): Rewrite to allow varargs.
7821 * lang.c (lang_f_options): Const-ify.
7823 * lex.c (java_parse_escape_sequence): Add static prototype.
7824 (java_allocate_new_line): Match definition to existing static
7827 * mangle.c Include tree.h/java-tree.h.
7828 (unicode_mangling_length, emit_unicode_mangled_name,
7829 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
7831 * parse.h (jdep_code): Remove trailing comma in enumeration.
7832 (java_get_line_col): Move prototype outside of !JC1_LITE test.
7833 (reset_report): Add prototype.
7835 * verify.c (push_pending_label, merge_types): Add static
7838 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
7840 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
7842 * parse.y (find_applicable_accessible_methods_list): Extend the
7843 search to superinterfaces when relevant.
7844 (search_applicable_methods_list): New function.
7846 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
7848 * class.c (unmangle_classname): Implemented stricter testing
7849 before setting the QUALIFIED_P flag on an identifier.
7851 Tue Mar 16 15:15:41 1999 Per Bothner <bothner@cygnus.com>
7853 * parse.y (java_complete_lhs): Call force_evaluation_order
7854 after patch_newarray.
7855 (patch_binop): Don't call fold if there are side effects.
7857 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
7859 * parse.y (java_stabilize_reference): Use save_expr instead of
7860 building a SAVE_EXPR node.
7861 (java_complete_lhs): Patch the resulting string of the `+='
7862 operator (if necessary) and complete the RHS after having built
7865 Mon Mar 15 12:18:29 1999 Per Bothner <bothner@cygnus.com>
7867 * class.c (make_class): Don't set CLASS_P here (because
7868 this function is also called by build_java_array_type).
7869 (push_class): Set CLASS_P here instead.
7870 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
7872 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
7873 context. If the context is class, perfer "super" over "synchronized".
7874 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
7876 * parse.y (create_class): Don't call parser_check_super here;
7877 it is not robust. Always wait until later.
7879 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
7880 match what JDK 1.2 does), but don't set ACC_PUBLIC.
7882 Sat Mar 13 18:16:34 1999 Per Bothner <bothner@cygnus.com>
7884 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
7885 * lex.h (UNGETC): Change misleading macro.
7887 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
7889 * parse.y (java_stabilize_reference): Return NODE when patching a
7891 (java_complete_lhs): Put parenthesis around truth values.
7893 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
7895 * class.c (layout_class_method): Don't make rtl for interface
7897 * parse.h (GET_TYPE_NAME): New macro.
7898 * parse.y (if_then_statement:): Fixed indentation.
7899 (if_then_else_statement:): Likewise.
7900 (for_statement:): Fixed spacing.
7901 (try_statement:): Fixed indentation.
7902 (create_interface): Don't force interfaces to be abstract.
7903 (method_header): Abstract methods are OK in interfaces.
7904 (declare_local_variables): Fixed typo in comment.
7905 (java_complete_expand_method): Fixed indentation.
7906 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
7907 non accessible fields.
7908 (java_stabilize_reference): New function.
7909 (java_complete_lhs): Fixed indentation. Use
7910 java_stabilize_reference in compound assignement. Insert the
7911 cast. If not processing `+' fix string constants before processing
7914 Fri Mar 12 19:42:55 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7916 * constants.c (find_class_or_string_constant): Cast variable `j'
7917 to a `jword' when comparing against one.
7919 * expr.c (java_lang_expand_expr): Remove unused variables
7920 `has_finally_p' and `op0'.
7922 * gjavah.c (print_field_info): Cast a value to jint when comparing
7923 against one. Likewise for a jlong.
7924 (add_namelet): Likewise cast a `sizeof' to an int when comparing
7925 against a signed quantity.
7927 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
7928 (print_signature): Don't needlessly dereference variable `str'
7930 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
7931 `max_locals' with ATTRIBUTE_UNUSED.
7932 (jcf_parse_class): Likewise for variable `index'.
7934 * parse.h (reverse_jdep_list): Remove static prototype.
7936 * parse.y (build_jump_to_finally): Remove prototype and definition.
7937 (reverse_jdep_list): Add static prototype.
7939 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
7940 `assignment' and `expr_decl'.
7942 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
7944 1999-03-12 Andrew Haley <aph@cygnus.com>
7946 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
7947 we'll need a directory separator and a null character.
7949 Wed Mar 10 23:20:11 1999 Per Bothner <bothner@cygnus.com>
7951 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
7953 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
7955 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
7958 Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
7960 * lex.c (java_parse_end_comment): Take extra parameter (next char).
7962 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
7964 * class.c (layout_class_method): A static method in a base class
7965 is never overridden, so treat it like it doesn't exist.
7966 However, do complain about private non-static method overriding
7967 public static method.
7969 * parse.y: Don't set unused INITIALIZED_P flag.
7970 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
7972 * parse.y (find_expr_with_wfl): Optimize tail-calls.
7973 (build_array_from_name): Re-order &index[string] to &string[index].
7975 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
7976 error_mark (it might catch more errors, but it is more likely to lose).
7978 Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7980 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
7981 (parse-scan.o): Depend on toplev.h.
7983 * class.c (make_method_value): Add prototype. Make it static.
7984 Remove unused second argument, caller changed.
7986 * expr.c (java_lang_expand_expr): Remove unused variable
7989 * java-tree.h: Don't prototype find_in_current_zip.
7990 Add prototypes for verify_constant_pool, start_java_method,
7991 end_java_method, give_name_to_locals, expand_byte_code,
7992 open_in_zip, set_constant_value, find_constant1, find_constant2,
7993 find_utf8_constant, find_string_constant, find_class_constant,
7994 find_fieldref_index, find_methodref_index, write_constant_pool,
7995 count_constant_pool_bytes and encode_newarray_type.
7997 * jcf-dump.c: Remove unused variable `LONG_temp'.
7999 * jcf-parse.c: Include parse.h.
8000 (jcf_parse_source): Remove unused parameter, all callers changed.
8001 (jcf_figure_file_type): Add static prototype.
8002 (find_in_current_zip): Likewise. Also remove unused parameter,
8003 all callers changed.
8004 (read_class): Initialize variable `saved_pos'.
8006 * jcf-reader.c (jcf_parse_preamble): Mark variables
8007 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
8009 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
8010 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
8011 (java_parse_doc_section): Initialize variable `seen_star'.
8012 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
8013 (java_lex_error): Mark parameters `msg' and `forward' with
8015 (java_get_line_col): Mark parameters `filename' and `line' with
8018 * parse-scan.y: Include toplev.h.
8019 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
8021 * parse.h: use `struct JCF', not plain `JCF'.
8022 (java_parser_context_save_global, java_expand_classes
8023 java_parser_context_restore_global, java_parse): Add prototypes.
8025 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
8028 Wed Feb 24 16:13:59 1999 Per Bothner <bothner@deneb.cygnus.com>
8030 * check-init.c (check_init): COPYN takes word count, not bit count.
8032 Fri Feb 26 14:06:21 1999 Per Bothner <bothner@cygnus.com>
8034 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
8035 explicit build_decl. (Avoids crash in reload when optimizing.)
8037 Thu Feb 25 21:05:04 1999 Per Bothner <bothner@cygnus.com>
8039 * decl.c (complete_start_java_method): Handle synchronized method
8040 even when compiling from bytecode.
8042 1999-02-26 Tom Tromey <tromey@cygnus.com>
8044 * gjavah.c (add_class_decl): Only generate `#include' if outer
8045 class is not the name of the class we are processing. Correctly
8046 append `.h' in #include.
8047 (process_file): Clean up newlines around generated `#include's.
8048 (decode_signature_piece): Correctly handle inner classes.
8049 (struct include): New structure.
8050 (all_includes): New global.
8051 (print_include): New function.
8052 (add_class_decl): Use it.
8053 (process_file): Likewise.
8054 (add_class_decl): Generate include for java-array.h if array
8056 (process_file): Don't generate java-array.h include.
8058 * gjavah.c (add_namelet): Check for standard package names here.
8059 (add_class_decl): Don't check for standard package names here.
8061 1999-02-25 Tom Tromey <tromey@cygnus.com>
8063 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
8064 When reading a zip file, only use strncmp if both strings are
8065 bigger than the buffer length. Initialize `k' when looping
8068 1999-02-24 Tom Tromey <tromey@cygnus.com>
8070 * gjavah.c (struct namelet): New structure.
8071 (add_namelet): New function.
8072 (print_namelet): New function.
8073 (print_class_decls): Use add_namelet and print_namelet to generate
8074 namespaces and not classes.
8075 (method_printed): New global.
8076 (HANDLE_END_METHOD): Examine method_printed.
8077 (print_method_info): Set method_printed when required. Print
8078 error if function to be ignored is marked virtual. Handle $finit$
8080 (METHOD_IS_FINAL): New macro.
8081 (print_field_info): Use it.
8082 (HANDLE_METHOD): Clear method_printed.
8083 (method_pass): New global.
8084 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
8085 (process_file): Do two passes over both fields and methods.
8086 (HANDLE_METHOD): Examine method_pass.
8088 (add_class_decl): New function.
8089 (print_class_decls): Don't scan over entire constant pool.
8091 1999-02-23 Tom Tromey <tromey@cygnus.com>
8093 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
8094 disable linking in that case.
8096 1999-02-20 Tom Tromey <tromey@cygnus.com>
8098 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
8101 Sun Feb 21 14:56:11 1999 Per Bothner <bothner@cygnus.com>
8103 * decl.c (build_result_decl), java-tree.h: New method.
8104 (complete_start_java_method): Handle synchronized methods.
8105 Don't build DECL_RESULT here. (Ordering dependency problem.)
8106 (start_java_method): Call build_result_decl here instead ...
8107 * parse.y (java_complete_expand_method): ... and here.
8108 (expand_start_java_method): Don't call complete_start_java_method here.
8109 (java_complete_expand_method): Call it here instead.
8110 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
8111 * java-tree.h: ... here.
8113 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
8114 * parse.y (java_complete_lhs): Don't call force_evaluation_order
8115 for ARRAY_REF - it doesn't work when array bounds are checked.
8116 (patch_array_ref): Handle it here instead.
8118 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
8120 Fri Feb 19 15:35:01 1999 Per Bothner <bothner@cygnus.com>
8122 Force left-to-right evaluation of binary operations etc.
8123 * expr.c (force_evaluation_order), java-tree.h: New function.
8124 * parse.y (java_complete_lhs): Pass binary operations, procedure
8125 calls, and ARRAY_REFs to force_evaluation_order.
8126 (various): Set TREE_SIDE_EFFECTS more carefully.
8128 Tolerate random (non-UTF8) encoding in comments without complaining.
8129 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
8130 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
8132 * parse.y (resolve_qualified_expression_name): Handle error_mark.
8133 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
8135 * parse.y (java_complete_lhs): Ignore an empty statement in a
8136 COMPOUND_EXPR. Don't complain about empty statement after return.
8138 Fri Feb 19 13:00:56 1999 Per Bothner <bothner@cygnus.com>
8140 * parse.y (obtain_incomplete_type): Don't wrap unknown types
8141 in TREE_LIST - just chain the POINTER_TYPEs together.
8142 (resolve_class): If type already resolved, return decl.
8143 After resolving, update TREE_TYPE(class_type), and name (if array).
8144 * parse.h (do_resolve_class), parse.y: Make non-static.
8145 * class.c (maybe_layout_super_class): Take this_class argument.
8146 Do do_resolve_class if necessary.
8147 (layout_class, layout_class_methods): Adjust calls appropriately.
8148 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
8149 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
8150 * typeck.c (build_java_array_type): Don't call layout_class.
8152 Wed Feb 17 15:47:20 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8154 * parse.y (check_pkg_class_access): Allow private class access
8155 within the same package.
8156 (strip_out_static_field_access_decl): New function.
8157 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
8158 operator argument before testing its nature.
8160 Wed Feb 3 12:38:43 1999 Per Bothner <bothner@cygnus.com>
8162 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
8163 (TRY_EXPR): Simplify - it no longer has a finally clause.
8164 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
8165 Simpler handling of TRY_EXPR, which no longer has a finally clause.
8166 * expr.c (java_lang_expand_expr): Likewise.
8167 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
8168 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
8169 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
8170 (build_try_statement): Remove finally parameter and handling.
8171 (build_try_finally_statement): New function.
8172 (patch_try_statement): No longer need to support finally clause.
8173 (try_statement): Update grammar action rules.
8174 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
8175 Simpler handling of TRY_EXPR, which no longer has a finally clause.
8177 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
8179 * jcf-parse.c (get_constant): Add braces around computation of 'd'
8180 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
8182 1999-02-17 Andrew Haley <aph@cygnus.com>
8184 * class.c (build_utf8_ref): Back out broken patch which was
8185 intended to to output signatures using '.' as a separator.
8187 * class.c (make_class_data): Output signatures using '.' as a
8188 separator, rather than '/'.
8189 (mangled_classname): Likewise.
8190 (make_field_value): Likewise.
8191 (make_method_value): Likewise.
8192 * constants.c (alloc_class_constant): Likewise.
8193 * expr.c (build_invokeinterface): Likewise.
8195 Thu Feb 11 21:25:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8197 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
8198 of an ancient workaround.
8200 Wed Feb 10 23:27:33 1999 Jeffrey A Law (law@cygnus.com)
8202 * jvspec.c (xmalloc): Kill the prototype. It does not belong
8205 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8207 * lex.c (yylex): Encode \0 as UTF8.
8209 1999-02-10 Tom Tromey <tromey@cygnus.com>
8211 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
8212 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
8213 (libgcj_zip): Renamed.
8214 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
8216 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
8218 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
8219 (GC_NAME): Renamed -lgc to -lgcjgc.
8221 Tue Feb 9 19:31:09 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8223 * lex.c (java_lang_cloneable): Initialize.
8224 * parse.y (java_lang_cloneable): New static variable.
8225 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
8226 doing one more qualification round.
8227 (valid_ref_assignconv_cast_p): Reject null source or
8228 destination. Allow an array to be cast into java.lang.Cloneable.
8229 (patch_cast): Swapped two first arguments to first call to
8230 valid_ref_assignconv_cast_p.
8232 Mon Feb 8 11:50:50 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8234 * parse.h: DECL_P renamed JDECL_P.
8235 * parse.y: DECL_P replaced by JDECL_P.
8236 (build_array_from_name): Always use pointer's type.
8237 (patch_bc_statement): Extra code to search continue target in a
8238 for loop. Fixed comments. Continue target is current loop when
8241 1999-02-05 Andrew Haley <aph@cygnus.com>
8243 * class.c (make_class_data): The superclass of an interface should
8244 be null, not class Object.
8246 * lex.c (java_lex): Sign extend hex literals.
8248 1999-02-04 Andrew Haley <aph@cygnus.com>
8250 * class.c (build_utf8_ref): Output signatures using '.' as a
8251 separator, rather than '/'.
8252 (make_class_data): Likewise.
8254 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
8256 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
8257 mkstemp.o. Get them from libiberty now.
8259 Tue Feb 2 19:49:12 1999 Jeffrey A Law (law@cygnus.com)
8261 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
8263 Tue Feb 2 20:04:50 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8265 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
8268 Tue Feb 2 10:39:47 1999 Per Bothner <bothner@cygnus.com>
8270 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
8271 * jcf-write.c (generate_bytecode_return): New function.
8272 (generate_bytecode_insns): Use it, for RETURN_EXPR.
8274 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
8275 generate special [fd]const_[01] instructions.
8277 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
8279 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
8280 handling OPCODE_lookupswitch or OPCODE_tableswitch.
8282 Mon Feb 1 20:44:47 1999 Per Bothner <bothner@cygnus.com>
8284 * parse.y (patch_method_invocation): Handle calling static methods,
8285 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
8287 * parse.y (java_complete_lhs): Don't complain about unreachable
8288 exit condition in a do-while statement.
8290 Fri Jan 29 18:19:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8292 * lex.c (java_read_char): Fixed utf8 decoding.
8293 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
8295 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
8296 comments. Local variable `all_primitive' is gone. Broadened
8297 acceptance of `0' to floating point targets. `long' can now be
8298 widened to `double' or `float'.
8299 (valid_method_invocation_conversion_p): Added leading
8300 comment. Fixed tabulation.
8301 (build_string_concatenation): Optimize out left or right empty
8304 Thu Jan 28 18:51:26 1999 Per Bothner <bothner@cygnus.com>
8306 * jcf-write.c (localvar_alloc): Only emit entry for
8307 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
8308 (generate_bytecode_insns): Only call put_linenumber if
8309 debug_info_level > DINFO_LEVEL_NONE.
8310 * jvspec.c (lang_specific_driver): If no -O* or -g* option
8311 is specified, add -g1 (for compatibility wih javac).
8313 Thu Jan 28 09:17:51 1999 Hans-Peter Nilsson <hp@axis.se>
8315 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
8316 gjavah.o, check-init.o, jv-scan.o
8318 Mon Feb 1 09:50:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8320 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
8322 * gjavah.c: Include config.h and system.h.
8324 * javaop.h (inline): Don't define, its handled by system.h.
8325 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
8326 from `inline' to `static inline'.
8328 * jcf.h (inline): Don't define, its handled by system.h.
8330 * lex.c (inline): Likewise.
8332 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
8334 * lang-specs.h: Map -Qn to -fno-ident.
8336 Fri Jan 29 16:51:56 1999 Richard Henderson <rth@cygnus.com>
8338 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
8340 1999-01-29 Tom Tromey <tromey@cygnus.com>
8342 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
8343 then cast it to Object before calling `append' method.
8345 Thu Jan 28 14:45:39 1999 Per Bothner <bothner@cygnus.com>
8347 * check-init.c (check_bool2_init, check_bool_init, check_init):
8348 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
8349 * jcf-write.c (generate_bytecode_insns): Likewise.
8351 Thu Jan 28 11:50:11 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8353 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
8354 * parse.y (patch_cast): Allow a boolean to be cast into a
8357 Wed Jan 27 10:19:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8359 * parse.y: (class_declaration:): Fixed indentation.
8360 (class_member_declaration:): Extra `;' after field declaration now
8362 (interface_declaration:): Removed debug messages in error reports.
8363 (patch_binop): Nodes created and returned inherit the orignal
8364 node's COMPOUND_ASSIGN_P flag value.
8365 (patch_cast): Fix cast from char to floating point.
8367 Mon Jan 25 17:39:19 1999 Andrew Haley <aph@cygnus.com>
8369 * except.c, java-except.h (expand_resume_after_catch): new
8371 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
8372 to branch back to main flow of control after a catch block.
8374 Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8376 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
8377 $(srcdir)/../system.h.
8378 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
8379 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
8380 (jcf-write.o): Likewise.
8381 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8382 (mangle.o): Depend on $(srcdir)/../toplev.h.
8383 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8384 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8386 * class.c: Include output.h and parse.h.
8387 (mangled_classname): Add the `const' keyword to a char*.
8388 (find_named_method): Hide unused function definition.
8389 (build_utf8_ref): Change type of variable `c' to unsigned char.
8390 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
8391 (build_class_ref): Add the `const' keyword to a char*.
8392 (layout_class_method): Remove unused variable `buf'.
8394 * decl.c (find_local_variable): Remove unused variable `rtl'.
8395 (pushdecl): Likewise for variables `different_binding_level' and
8397 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
8398 (maybe_build_cleanup): Likewise for parameter `decl'.
8400 * except.c (expand_start_java_handler): Mark parameter `range'
8401 with ATTRIBUTE_UNUSED.
8403 * expr.c: Include except.h.
8404 (pop_type): Remove unused variable `i'.
8405 (pop_value): Likewise for variables `n_words' and `i'.
8406 (expand_java_arrayload): Likewise for variable `convert'.
8407 (java_lang_expand_expr): Likewise for variables `op0', `type',
8408 `mode', `unsignedp', `node' and `elements'.
8409 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
8411 (process_jvm_instruction): Add a `const' qualifier to a char*.
8413 * gjavah.c (output_directory): Add the `const' keyword to a char*.
8414 (temp_directory): Likewise.
8415 (print_c_decl): Likewise.
8416 (print_method_info): Likewise.
8417 (decode_signature_piece): Likewise.
8418 (print_mangled_classname): Likewise.
8420 * java-except.h: Provide prototypes for maybe_start_try,
8421 maybe_end_try and add_handler.
8423 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
8424 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
8425 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
8426 init_expr_processing, push_super_field, init_class_processing,
8427 can_widen_reference_to, class_depth, verify_jvm_instructions,
8428 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
8429 set_local_type, merge_type_state, push_type, load_type_state,
8430 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
8431 emit_unicode_mangled_name): Add prototypes.
8433 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
8434 (print_signature_type): Use ISDIGIT, not isdigit.
8435 (print_signature): Remove unused variable `j'.
8437 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
8438 int when comparing against one.
8440 * jcf-parse.c: Include toplev.h.
8442 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
8443 (localvar_free): Remove unused variable `i'.
8444 (generate_bytecode_conditional): Likewise for variable `kind'.
8446 * jv-scan.c: Include config.h and system.h. Remove redundant
8447 OS header and gansidecl.h includes.
8448 (warning): Add the `const' keyword to a char*. Also add
8449 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
8450 __STDC__, when determining whether to use ANSI-isms.
8451 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
8452 (xmalloc): Don't redundantly prototype here.
8453 (main): Remove unused parameter `envp'. Also fix the arguments
8454 passed to function `fatal' to match the format specifier.
8456 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
8458 * mangle.c: Include toplev.h.
8459 (emit_unicode_mangled_name): Declare parameter `len'.
8461 * parse.y (parse_warning_context): Add the `const' keyword to a
8462 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
8463 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
8464 (issue_warning_error_from_context): Add the `const' keyword to
8466 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
8467 not `__STDC__' for whether to use ANSI-isms.
8469 * typeck.c (incomplete_type_error): Mark parameters `value' and
8470 `type' with ATTRIBUTE_UNUSED.
8471 (parse_signature_type): Use ISDIGIT, not isdigit.
8473 * verify.c (check_pending_block): Add the `const' keyword to a char*.
8474 (verify_jvm_instructions): Likewise. Remove unused variables
8475 `field_name' and `default_val'.
8477 * zextract.c: Include config.h and system.h. Remove redundant
8480 * zipfile.h: Prototype `read_zip_archive'.
8482 Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
8484 * typeck.c (convert): Allow conversions to void type: some
8485 optimizations in gcc do this.
8487 Thu Jan 21 15:21:49 1999 Andrew Haley <aph@cygnus.com>
8489 * typeck.c (convert_ieee_real_to_integer): New function.
8490 (convert): When not using fast-math and using hardware fp, convert
8491 an IEEE NaN to zero.
8493 1999-01-18 Andrew Haley <aph@cygnus.com>
8495 * parse.y (patch_binop): Do a type conversion from signed to
8496 unsigned and then back to signed when a ">>>" is found.
8498 Sun Jan 17 22:34:22 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8500 * java-tree.h: (check_for_initialization): Added prototype.
8501 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
8502 * parse.y (do_resolve_class): Removed unused locals.
8503 (read_import_dir): Likewise.
8504 (resolve_qualified_expression_name): Array creation
8505 expressions are valid primary expressions.
8506 (qualify_ambiguous_name): Likewise.
8507 (patch_synchronized_statement): Removed unused local.
8509 Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com)
8511 * Makefile.in (zextract.o): Add dependencies.
8513 * Makefile.in: Do not put ^Ls at the start of a line.
8515 Fri Jan 15 20:16:20 1999 Per Bothner <bothner@cygnus.com>
8517 * expr.c (process_jvm_instruction): Coerce to correct Throwable
8518 sub-type the result of the call that gets the exception value.
8520 * parse.y (java_complete_expand_methods): If flags_syntax_only,
8521 don't call finish_class.
8523 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
8524 clear found before continuing.
8526 * verify.c (verify_jvm_instructions): On an array load, allow
8527 and handle top of stack to be TYPE_NULL.
8529 * gjavah.c (generate_access): Translate Java package private or
8530 protected access to C++ public, but with a comment.
8532 1999-01-13 Andrew Haley <aph@cygnus.com>
8534 * expr.c (generate_name): Name prefix changed to avoid clashes
8535 with assembler temp labels.
8537 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
8538 MODIFY_EXPR. Without this, code for the assignement may not be
8539 generated at all and the synchronized statement will read an
8540 uninitialized variable.
8542 Wed Jan 13 01:24:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
8544 * class.c (maybe_layout_super_class): Fixed returned value.
8545 * lex.c: Added 1999 to the copyright.
8546 (java_init_lex): Initialize java_lang_imported.
8547 * lex.h: Added 1999 to the copyright.
8548 * parse.h: Added 1999 to the copyright.
8549 (REGISTER_IMPORT): Fixed typo in trailing macro.
8550 (CURRENT_OSB): New macro.
8551 (struct parser_ctxt): New fields osb_depth, osb_limit.
8552 * parse.y (java_lang_id): New global variable.
8553 (type_import_on_demand_declaration): Don't import java.lang.* twice.
8554 (array_creation_expression:): Use CURRENT_OSB.
8555 (dims:): Uses a stack to keep track of array dimensions.
8556 (cast_expression:): Use CURRENT_OSB.
8557 (find_expr_with_wfl): Return NULL if node found doesn't meet the
8559 (register_fields): Fixed typos in comment.
8560 (check_method_redefinition): Fixed comment indentation.
8561 (java_check_regular_methods): Set saved found wfl to NULL after
8562 having reinstalled it in the previously found DECL_NAME.
8564 Sun Jan 10 13:36:14 1999 Richard Henderson <rth@cygnus.com>
8566 * gjavah.c (java_float_finite): Use a union to do type punning.
8567 (java_double_finite): Likewise.
8569 Sat Jan 9 11:25:00 1999 Per Bothner <bothner@cygnus.com>
8571 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
8572 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
8573 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
8574 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
8575 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
8576 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
8578 Fri Jan 8 15:48:03 1999 Per Bothner <bothner@cygnus.com>
8580 * check-init.c (check_init): If compiling to native, we don't
8581 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
8583 1999-01-08 Tom Tromey <tromey@cygnus.com>
8585 * parse-scan.y (variable_declarator_id): Set or increment
8587 (bracket_count): New global.
8588 (formal_parameter): Handle case where bracket pairs trail variable
8591 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
8593 * jcf-parse.c (yyparse): variable len changed from a char to an
8594 int to prevent overflow.
8596 Wed Jan 6 17:19:46 1999 Per Bothner <bothner@cygnus.com>
8598 * java-tree.h: Declare read_class.
8599 * jcf-parse.c (read_class): New function.
8600 (load_class): Now just call read_class.
8602 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
8603 * jcf-parse.c (parse_source_file): Declare save_error_count,
8604 which is needed by java_parse_abort_on_error macro,
8605 * parse.y (java_layout_classes, java_expand_classes): Likewise.
8607 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
8608 constructor, if initializing a static field.
8609 (patch_new_array_init): Set TREE_CONSTANT if it is.
8610 * expr.c (java_lang_expand_expr): For a static array constructor
8611 of primitive elements, allocate the array itself statically.
8612 Disabled until we can set the vtable field statically.
8614 * check-init.c: New file. Checks for definite assignment.
8615 * Makefile.in (JAVA_OBJS): Add check-init.o.
8616 * parse.y (java_complete_expand_method): Call check_for_initialization.
8617 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
8619 Wed Jan 6 14:53:10 1999 Graham <grahams@rcp.co.uk>
8621 * parse.y : include system.h instead of including
8622 standard headers directly with the exception of <dirent.h>.
8624 Wed Jan 6 16:20:06 1999 Per Bothner <bothner@cygnus.com>
8626 * lex.h: Moved static function declarations to lex.c,
8627 to shut up some -Wall warnings.
8628 * lex.c: Static function declarations moved here.
8629 * jcf-dump.c: Small fixes to shut up -Wall warnings.
8631 Tue Jan 5 22:15:40 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8633 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
8635 Tue Dec 22 11:25:19 1998 Per Bothner <bothner@cygnus.com>
8637 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
8638 * verify.c (verify_jvm_instructions): Fix off-by-one error.
8640 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
8641 (localvar_alloc): Change return type to void,
8642 (emit_unop): Remove unused variable size.
8644 * jcf-write.c (struct jcf_block): Add new union.
8645 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
8646 (call_cleanups): New functions.
8647 (struct jcf_partial): New fields num_finalizers and return_value_decl.
8648 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
8649 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
8650 * lang.c (lang_init): Call using_eh_for_cleanups.
8651 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
8652 completing operands to patch_synchronized_statement.
8653 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
8654 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
8655 WITH_CLEANUP_EXPR instead of TRY_EXPR.
8657 Sun Dec 20 16:15:44 1998 John F. Carr <jfc@mit.edu>
8659 * Make-lang.in: Comment out control-Ls; they upset some makes.
8661 1998-12-18 Tom Tromey <tromey@cygnus.com>
8663 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
8666 1998-12-17 Tom Tromey <tromey@cygnus.com>
8668 * parse.y (DIR_SEPARATOR): New define.
8669 (check_class_interface_creation): Use it.
8671 * parse-scan.y (report_main_declaration): Recognize
8672 `java.lang.String' in argument to main.
8674 Wed Dec 16 16:18:59 1998 Per Bothner <bothner@cygnus.com>
8676 * parse.y (create_interface): Remove bogus test.
8678 Wed Dec 16 14:42:19 1998 Per Bothner <bothner@cygnus.com>
8680 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
8681 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
8683 1998-12-16 Tom Tromey <tromey@cygnus.com>
8685 * parse-scan.y (qualified_name): Use correct sprintf format.
8687 1998-12-15 Tom Tromey <tromey@cygnus.com>
8689 * gjavah.c (print_field_info): Changed how most negative number is
8692 Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com>
8694 * parse.y (fold_constant_for_init): New function.
8695 (resolve_expression_name): Don't replace static final
8696 constant-initialized fields by its value.
8697 (java_complete_lhs): New. Same as java_complete_tree, except does
8698 not replace static final constant-initialized fields by their values.
8699 (register_fields): If there is an initializer, set DECL_INITIAL and
8700 MODIFY_EXPR_FROM_INITIALIZATION_P.
8701 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
8702 Only call patch_initialized_static_field if
8703 MODIFY_EXPR_FROM_INITIALIZATION_P.
8704 (patch_initialized_static_field): If not valid constant, clear
8707 * parse.y (lookup_field_wrapper): Fix thinko.
8709 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
8710 set and restore global lineno.
8712 1998-12-14 Tom Tromey <tromey@cygnus.com>
8714 * gjavah.c (print_field_info): If value to print is the smallest
8715 value of its size, then print as hex to avoid later warnings from
8718 1998-12-14 Tom Tromey <tromey@cygnus.com>
8720 * gjavah.c (decompile_method): Decompile `return null'.
8721 (process_file): Generate `#pragma interface'.
8722 (method_declared): New global.
8723 (print_method_info): Set it.
8724 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
8725 (print_method_info): Handle abstract methods.
8727 Sun Dec 13 17:31:40 1998 Per Bothner <bothner@cygnus.com>
8729 * parse.y (patch_method_invocation): If class_decl is null
8730 (e.g. an array type), use original type.
8732 * parse.y (check_thrown_exceptions): Temporary hack to suppress
8733 errors about uncaught exception from clone (of array, specifically).
8735 1998-12-13 Tom Tromey <tromey@cygnus.com>
8737 * gjavah.c (decompile_method): Handle all types of `return'
8738 opcode. Decompile `return this' and `return'.
8739 (method_access): New global.
8740 (print_method_info): Set it.
8741 (decompile_method): Don't decompile a synchronized method.
8743 1998-12-13 Tom Tromey <tromey@cygnus.com>
8745 * jcf-reader.c (jcf_parse_one_method): Recognize
8747 * gjavah.c (HANDLE_END_METHOD): New macro.
8748 (HANDLE_CODE_ATTRIBUTE): New macro.
8749 (decompile_method): New function.
8750 (print_method_info): Don't print `;\n' at end of function decl.
8751 Include java-opcodes.h.
8752 (decompiled): New global.
8754 Sat Dec 12 20:13:19 1998 Per Bothner <bothner@cygnus.com>
8756 * class.c (build_class_ref): Handle PRIMTYPE.class if
8757 flag_emit_class_files.
8758 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
8759 if flag_emit_class_files.
8760 * parse.y (java_complete_tree): Pre-liminary support for
8761 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
8763 * parse.y (patch_synchronized_statement): Don't call monitorexit
8764 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
8766 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
8768 * zipfile.h (opendir_in_zip): New declaration.
8769 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
8770 (opendir_in_zip): New function, using code from open_in_zip.
8771 (open_in_zip): Call opendir_in_zip.
8772 (find_class): Remove no-longer-used do_class_file parameter,
8773 but add source_ok parameter. Change logic so if we find a .java file,
8774 we don't look for .class in later classpath emtries.
8775 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
8776 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
8777 * gjavah.c: Update call to find_class.
8778 * jcf-dump.c: Likewise.
8780 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
8781 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
8782 nothing if body is empty_stmt_node.
8783 Various little fixes so SP gets correctly adjusted.
8784 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
8785 For CALL_EXPR, test if static first.
8786 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
8787 such as the ones we create for Object and Class.
8788 Set and restore current_function_decl.
8789 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
8790 (note_possible_classname): New function.
8791 (read_import_entry): Removed. Merged with read_import_dir.
8792 (read_import_dir): Don't call find_class - that only gives us
8793 the first classpath entry having the needed package.
8794 Use the struct buffer data structure from buffer.h.
8795 (read_import_dir, find_in_imports_on_demand): The remembered
8796 class names now use '.' (not '/') as package separator.
8798 * parse.y (java_complete_expand_methods): Call write_classfile
8799 here, and not in java_expand_classes (which only gets first class).
8801 Sat Dec 12 19:46:04 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8803 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
8804 (register_fields): If a static fields has an initializer, just
8805 chain it on ctxp->static_initialized, and handle later.
8806 (java_complete_expand_methods): Force <clinit> first.
8807 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
8808 - it's already been completed.
8809 (patch_initialized_static_field): New function.
8810 (java_complete_field): Call it.
8812 Sat Dec 12 19:21:11 1998 Per Bothner <bothner@cygnus.com>
8814 * expr.c (encode_newarray_type, build_new_array): New functions.
8815 * java-tree.h: Declare build_new_array.
8816 * jcf-write.c (patch_newarray): Use build_new_array.
8818 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
8819 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
8821 * parse.y (patch_new_array_init): Re-organize.
8822 Now is passed the actual array (pointer) type of the value.
8823 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
8824 (patch_array_constructor): Removed - merged into patch_new_array_init.
8825 (java_complete_tree): Update patch_new_array_init.
8827 * jcf-write.c (find_constant_index): New function.
8828 (generate_bytecode_insns): Use find_constant_index.
8829 (generate_classfile): Use find_constant_index for ConstantValue.
8831 1998-12-11 Tom Tromey <tromey@cygnus.com>
8833 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
8834 * decl.c (init_decl_processing): Renamed dtable -> vtable.
8835 * class.c (make_class_data): Renamed dtable -> vtable, and
8836 dtable_method_count -> vtable_method_count.
8838 Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8840 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
8841 global variables, initialized.
8842 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
8843 Declared new global variables.
8844 * lex.c (java_lex): Return long_zero_node, float_zero_node,
8845 double_zero_node, integer_zero_node upon direct matching.
8846 * parse.y (purify_type_name): Added function prototype.
8847 (duplicate_declaration_error_p): Consider new_type as potentially
8848 being a incomplete type. Use purify_type_name on type string.
8849 (method_header): saved_type: unused variable removed. Don't figure
8850 return type if method name is invalid.
8851 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
8852 processed by patch_unaryop.
8853 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
8854 increment/decrement node into its original type after binary
8855 numeric promotion on its operands.
8857 Thu Dec 10 11:02:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8859 * parse.y (array_initializer:): Array init operand is NULL_TREE
8860 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
8861 now an error. Fixed indentation problems.
8862 (patch_string): Handle error_mark_node as an argument.
8863 (patch_new_array_init): Fixed indentation problems.
8864 (array_constructor_check_entry): Removed check on null wfl_value.
8865 Return an error if wfl_value's walk returns an error.
8867 Wed Dec 9 15:37:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8869 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
8870 * lex.c (java_lex): Remember column position before advancing one
8871 token. Retain location information on OCB_TK.
8872 * lex.h (typedef struct java_lc): Added new field.
8873 * parse.h (GET_SKIP_TYPE): New macro.
8874 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
8875 * parse.y (build_new_array_init, patch_new_array_init,
8876 patch_array_constructor, maybe_build_array_element_wfl,
8877 array_constructor_check_entry): New function prototypes.
8878 (switch_block:): Tagged <node>.
8879 (OCB_TK): Tagged <operator>.
8880 (array_initializer:): Installed actions.
8881 (variable_initializer): Build location information on element if
8883 (switch_statement:): Fixed indentation typo.
8884 (switch_block:): Redefined default action.
8885 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
8886 (patch_assignment): Removed duplicate code.
8887 (maybe_build_array_element_wfl, build_new_array_init,
8888 patch_new_array_init, patch_array_constructor,
8889 array_constructor_check_entry): New functions.
8891 Mon Dec 7 15:13:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8893 * parse.y (array_initializer): Tagged <node>.
8894 (variable_initializer:): Use default rule.
8895 (array_initializer:): Defined actions.
8896 (variable_initializers:): Likewise.
8897 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
8898 non-static field accesses.
8899 (patch_invoke): Fixed indentation typo.
8900 (java_complete_tree): Likewise.
8901 (build_labeled_block): Changed leading comment. Generate an error
8902 in case of duplicate loop labels.
8903 (patch_conditional_expr): Patch results of string concatenation
8906 Sun Dec 6 13:45:00 1998 Per Bothner <bothner@cygnus.com>
8908 * constants.c (find_methodref_index): When the class is an interface,
8909 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
8911 * decl.c (finit_identifier_node): Use "$finit$", rather than
8912 "<finit>" (which Sun's verifier rejects).
8913 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
8914 (generate_field_initialization_code): Removed.
8915 (fix_constructors) Don't add call to $finit$ here (wrong order).
8916 (patch_method_invocation): Add $finit$ call here.
8918 * java-tree.h (CALL_USING_SUPER): New macro.
8919 * parse.y (patch_invoke): Remove im local variable.
8920 (patch_method_invocation, patch_invoke): Don't pass super parameter.
8921 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
8922 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
8924 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
8926 * parse.y (java_complete_tree): Don't complain about unreachable
8927 statement if it is empty_stmt_node.
8929 * jcf-write.c (find_constant_wide): New function.
8930 (push_long_const): Use find_constant_wide.
8932 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
8933 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
8934 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
8935 Emit invokeinterface when calling an interface method.
8936 Emit invokespecial also when calling super or private methods.
8938 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
8940 Sun Dec 6 13:21:18 1998 Per Bothner <bothner@cygnus.com>
8942 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
8944 Thu Dec 3 17:11:12 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8946 * java-tree.h (java_layout_seen_class_methods): New function
8948 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
8949 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
8950 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
8951 * parse.y (method_declarator:): Defined action.
8952 (issue_warning_error_from_context): input_filename saved, set to
8953 the appropriate value and restored after java_error is called.
8954 (build_unresolved_array_type): Fixed comment.
8955 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
8956 (method_header): Deal with return type the same way type are
8957 handled for fields and method's parameters and local variables
8959 (check_method_redefinition): Removed extra CR.
8960 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
8961 (java_layout_seen_class_methods): New function.
8962 (java_layout_classes): Call java_layout_seen_class_methods.
8964 Thu Dec 3 15:56:50 1998 Per Bothner <bothner@cygnus.com>
8966 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
8968 Thu Dec 3 15:08:30 1998 Per Bothner <bothner@cygnus.com>
8970 * jcf-dump.c (main): Fix error message.
8971 * jcf-path.c (add_entry): Style fix.
8973 Wed Dec 2 15:52:25 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8975 * class.c (layout_class_method): Call build_java_argument_signature
8976 on constructors too.
8977 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
8978 (patch_method_invocation): Define a primary when resolving an
8979 expression name. Augmented comment on code checking illegal `this'
8980 usage. Loosened it test by accepting NEW_CLASS_EXPR.
8982 Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
8984 * class.c (layout_class_method): Don't report error on non-static
8985 overriding static if the method is private.
8986 * java-tree.h (finish_class): Prototype added.
8987 * lex.c (java_get_line_col): Handle col argument -2 value.
8988 * parse.h: All static method declarations moved to parse.y.
8989 * parse.y: Now contains all static method declarations previously
8991 (find_expr_with_wfl, missing_return_error,
8992 unreachable_stmt_error): New functions.
8993 (java_get_real_method_name): Identify constructors bearing class
8994 names in source code compiled classes only.
8995 (java_complete_expand_methods): Call missing_return_error.
8996 (invocation_mode): Private methods invoked as static methods.
8997 (java_complete_tree): Call unreachable_stmt_error.
8999 1998-12-01 Tom Tromey <tromey@cygnus.com>
9001 * Makefile.in (+target): Removed.
9002 (+xmake_file): Likewise.
9003 (+tmake_file): Likewise.
9004 (.NOEXPORT): Removed duplicate.
9006 Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9008 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
9010 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
9012 * jvgenmain.c: Remove the xmalloc prototype, we get it from
9013 libiberty.h. Provide an xmalloc definition.
9015 * jvspec.c: Remove the xmalloc prototype.
9017 * parse-scan.y: Include config.h and system.h. Don't include
9018 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
9019 Provide an xstrdup definition.
9021 Thu Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
9023 * jcf-path.c (add_entry): Recognize ".jar" too.
9024 * lang-specs.h: Likewise.
9026 Thu Nov 26 12:44:07 1998 Per Bothner <bothner@cygnus.com>
9028 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
9029 soft_monitorenter_node, soft_monitorexit_node, throw_node.
9031 * jcf-write.c (generate_bytecode_insns):
9032 Handle pre/post-increment/decrement of long.
9034 * jcf-write.c (generate_bytecode_insns):
9035 Handle missing exception handler (finally for synchronized).
9037 Wed Nov 25 09:47:15 1998 Per Bothner <bothner@cygnus.com>
9039 * java-tree.h (end_params_node): Declare global.
9040 * decl.c (end_params_node): New global.
9041 (init_decl_processing, start_java_method): Use end_params_node for
9042 end of list of parameter types. Follows correct gcc conventions.
9043 * expr.c (pop_argument_types, pop_arguments): Likewise.
9044 * lang.c (put_decl_node): Likewise.
9045 * typeck.c (various places): Likewise.
9046 * class.y (various places): Likewise.
9047 * parse.y (various places): Likewise.
9049 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
9050 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
9052 * class.c: Add #include flags.h, remove no-longer needed declaration.
9054 * class.c (layout_class_method): Remove commented-out code, re-format.
9055 Don't add vtable entry (or index) for private methods.
9056 * expr.c (expand_invoke): A private method is implicitly final.
9057 * class.c (make_class_data): If inlining or optimizing,
9058 skip private methods.
9060 * class.c (finish_class): New function. Calls existing methods,
9061 but alls emits deferred inline functions.
9062 * jcf-parse.c (parse_class_file): Call finish_class.
9063 * parse.y (java_complete_expand_methods): Likewise.
9065 * expr.c (build_java_binop): Explicit default, to silence -Wall.
9067 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
9069 Wed Nov 25 00:50:58 1998 Marc Espie <espie@quatramaran.ens.fr>
9071 * jcf-write.c (generate_bytecode_conditional): Fix typo.
9073 Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com>
9075 * (generate_classfile): Always write class access flag with
9078 Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9080 * class.c (maybe_layout_super_class): New function.
9081 (layout_class): Reorganized. Loop on class methods dispatched into
9082 a new function. Call maybe_layout_super_class.
9083 (layout_class_methods, layout_class_method): New functions.
9084 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
9086 (expand_invoke): Likewise.
9087 * java-tree.h (all_class_list): New global variable declared.
9088 (layout_class_methods, layout_class_method): New function
9090 (LAYOUT_SEEN_CLASS_METHODS): New macro.
9091 * jcf-parse.c (all_class_list): New global variable.
9092 (load_class): Extended what class_or_name can be. Use parser
9093 context mechanism to save globals before calling jcf_parse.
9094 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
9095 is set on the file name.
9096 (jcf_parse): Layout class methods when Object is loaded, otherwise
9097 record class in all_class_list for delayed method layout.
9098 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
9099 * lang.c (put_decl_node): Decode <init> into the decl context
9101 * lex.c (java_allocate_new_line): Use xmalloc.
9102 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
9103 pointers, not TREE_LIST elements.
9104 (struct parser_ctxt): Fixed comment indentations, added comments
9105 and reordered some fields.
9106 (java_check_methods): Function prototype removed.
9107 * parse.y (java_push_parser_context): Use xmalloc.
9108 (java_parser_context_restore_global): Pop extra pushed ctxp only
9109 when there's nothing next.
9110 (maybe_create_class_interface_decl): Fixed comment, add new
9111 created class decl to all_class_list.
9112 (method_header): Use GET_REAL_TYPE on argument's types.
9113 (method_declarator): Use GET_REAL_TYPE, change type to the real
9114 type in TREE_LIST dependency node. Build argument list with the
9116 (create_jdep_list): Use xmalloc. Removed allocation error message.
9117 (obtain_incomplete_type): Fixed leading comment. Broadened
9118 incoming argument meaning.
9119 (register_incomplete_type): Use xmalloc. Removed allocation error
9121 (safe_layout_class): Fixed leading comment.
9122 (jdep_resolve_class): Reversed if statement condition and switch
9124 (resolve_and_layout): Fixed leading comment. Broadened incoming
9126 (complete_class_report_errors): New local variable name, for
9127 clarity. purify_type_name used for all error cases.
9128 (java_get_real_method_name): Stricter check on constructors.
9129 (java_check_regular_methods): Reverse methods list only if not
9130 already laid out. Layout artificial constructor.
9131 (java_check_methods): Deleted.
9132 (source_start_java_method): Obtain incomplete type for patchable
9134 (java_layout_classes): Fixed leading comment. Use
9135 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
9136 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
9137 before returning. Fixed comments.
9138 (java_expand_classes): Check for errors up front.
9139 (patch_method_invocation): Class to search is resolved and laid
9142 Tue Nov 24 12:57:13 1998 Per Bothner <bothner@cygnus.com>
9144 * expr.c (java_lang_expand_expr): Add missing emit_queue.
9146 * javaop.h (int8): Removed - not used.
9147 (jbyte): Redefine portably with correct signedness.
9149 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
9151 * jcf-write.c (generate_bytecode_insns): Fix typo
9152 OPCODE_getstatic to OPCODE_getfield.
9154 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
9155 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
9156 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
9158 Thu Nov 19 11:16:55 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9160 * jcf-parse.c (jcf_parse_source): Function returned type is
9161 void. Added prototype.
9162 (jcf_parse): Function returned type is void.
9163 (yyparse): Remove call to fclose on the last parsed file.
9165 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
9167 Wed Nov 18 23:54:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9169 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
9170 (layout_class): Cope with methods featuring WFL in decl names.
9171 * decl.c (unqualified_object_id_node): New global variable,
9173 (build_decl_no_layout): Removed.
9174 * expr.c (build_primtype_type_ref): Handle Double.
9175 (java_lang_expand_expr): Fixed indentations.
9176 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
9177 (flag_wall, flag_redundant, flag_not_overriding,
9178 flag_static_local_jdk1_1, unqualified_object_id_node): Global
9179 variable declarations.
9180 (build_decl_no_layout): Removed prototype.
9181 (java_get_real_method_name): Added prototype.
9182 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
9183 (java_parse_abort_on_error): Macro now just returns.
9184 * jcf-parse.c (jcf_parse_source): Check fclose returned
9185 value. Call emit_register_classes if java_report_errors returns
9187 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
9188 flag_static_local_jdk1_1): New integer flags.
9189 (lang_decode_option): New flags set here.
9190 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
9191 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
9192 the flag_redundant variable.
9193 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
9194 when parsing java.lang.Object class.
9195 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
9197 (resolve_qualified_expression_name): Fixed indentation.
9198 (patch_array_ref): Changed prototype.
9199 (not_initialized_as_it_should_p): Prototype removed.
9200 (java_report_errors): Added function prototype.
9201 * parse.y (formal_parameter:): Changed error message for not yet
9202 supported final parameters.
9203 (class_type_list:): Set both PURPOSE and VALUE of created
9204 TREE_LIST to be class_type.
9205 (primary_no_new_array:): Handle class literals on primitive types.
9206 (parse_warning_context): Reinstalled correct force_error and
9207 do_warning flags setups.
9208 (java_report_errors): Changed prototype. Return java_error_count
9210 (variable_redefinition_error): Consider treating variable type as
9212 (create_interface): Warn about redundant abstract modifier if
9213 flag_redundant is set. Changed error message.
9214 (lookup_field_wrapper): Save/restore globals before/after looking
9216 (duplicate_declaration_error_p): Consider treating declaration
9217 type as a fake pointer.
9218 (register_fields): Extract real type from dependency node. Check
9219 for duplicate field declaration after type adjustment. Use
9220 DECL_INITIAL to store static final initialized values.
9221 (method_header): Extract real function type from dependency node.
9222 (check_abstract_method_header): Use GET_METHOD_NAME.
9223 (obtain_incomplete_type): Layout fake pointer type.
9224 (safe_layout_class): Don't try to check for methods before layout.
9225 (java_complete_class): Don't check for correct throws clause
9226 elements inheritance here.
9227 (resolve_and_layout): Broadened name parameter meaning.
9228 (reset_method_name): Use GET_METHOD_NAME.
9229 (java_get_real_method_name): New function.
9230 (java_check_regular_methods): Don't check methods in
9231 java.lang.Object. Verify lineage of throws clause elements. Use
9232 flag_no_overriding in warning report.
9233 (check_throws_clauses): Don't check if class was from
9234 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
9235 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
9236 (declare_local_variables): Use flag_static_local_jdk1_1 to report
9237 warning on unsupported final local variables. Use build_decl
9238 instead of build_decl_no_layout. Get real local variable type from
9240 (source_start_java_method): Get real parameter type from
9241 dependency node. Call build_decl instead of build_decl_no_layout.
9242 (java_layout_classes): Reverse tree and layout type and class as
9243 required. Mark class as loaded when done.
9244 (resolve_field_access): Fixed indentation. Restricted condition
9245 leading to static field access code generation. Set field_type
9246 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
9247 (resolve_qualified_expression_name): Initialize type_found to
9248 null. Handle static field resolved during qualification. Fixed
9249 layout on non primitive field decl types.
9250 (not_accessible_p): Fixed typo in comment.
9251 (patch_method_invocation): Resolve and layout class to search from
9253 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
9254 layout non primitive type, if necessary. Make method node only to
9256 (find_applicable_accessible_methods_list): Consider WFL'ed method
9257 decl names. Fixed indentation.
9258 (argument_types_convertible): Resolve and layout target type if
9260 (java_complete_tree): Fixed indentation problems. Rewrote
9261 CALL_EXPR thrown exceptions check. Re-installed further processing
9262 of the assignment in certain cases.
9263 (patch_assignment): Call maybe_build_primttype_type_ref to perform
9264 inlining on class literals.
9265 (valid_builtin_assignconv_identity_widening_p): Cope with constant
9267 (valid_method_invocation_conversion_p): Likewise.
9268 (patch_string): Temporary disable forbidden use of `this' in
9269 explicit constructor invocations when doing string concatenation
9271 (patch_unaryop): Added comment. Reinstalled code to disable
9272 further check on assignment operation with cast expression RHS.
9273 (patch_switch_statement): Fixed indentation.
9274 (build_try_statement): Call build_decl instead of
9275 build_decl_no_layout.
9276 (patch_synchronized_statement): Likewise.
9277 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
9278 IS_UNCHECKED_EXPRESSION_P.
9279 (check_thrown_exceptions_do): Changed leading comment. Resolve and
9280 layout argument exception type.
9281 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
9282 of IS_UNCHECKED_EXPRESSION_P.
9284 Wed Nov 18 14:21:48 1998 Anthony Green <green@cygnus.com>
9286 * jcf-parse.c (yyparse): Open class file in binary mode.
9288 Sun Nov 15 17:14:17 1998 Per Bothner <bothner@cygnus.com>
9290 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
9292 * jcf-write.c (perform_relocations): Move check out one loop.
9294 Sun Nov 15 15:09:56 1998 Anthony Green <green@hoser.cygnus.com>
9296 * Make-lang.in: Fix reference to srcdir.
9297 * jv-scan.c: Add missing xmalloc prototype.
9298 * jvgenmain.c: Ditto.
9300 Sun Nov 15 14:36:29 1998 Per Bothner <bothner@cygnus.com>
9302 * decl.c (error_mark_node), java-tree.h: New global.
9303 * parse.y: Use empty_stmt_node instead of size_zero_node.
9304 (build_if_else_statement): If missing else, use empty_stmt_node.
9306 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
9307 (java_complete_expand_method): Complain if return is missing.
9308 (java_check_regular_methods): Comment out incorrect error check.
9309 (not_accessible_p): Fix incorrect handling of protected methods.
9310 (patch_method_invocation): Pass correct context to not_accessible_p.
9311 (find_applicable_accessible_methods_list): Likewise.
9312 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
9313 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
9314 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
9315 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
9317 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
9318 (push_int_const): Remove reundant NOTE_PUSH.
9319 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
9320 (- case SWITCH_EXPR): Fix code generation bug.
9321 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
9322 (generate_classfile): More robust for abstract methods.
9324 Sun Nov 15 13:52:39 1998 Anthony Green <green@cygnus.com>
9326 * Makefile.in: jv-scan and jvgenmain all require libiberty.
9327 * Make-lang.in: Ditto.
9329 * jv-scan.c: Remove xmalloc and xstrdup definitions.
9332 Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
9334 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
9336 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
9338 Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
9340 Allow uses of interface types to verify. This is not really
9341 type-safe, but it matches what Sun does, and is OK as long as
9342 there are appropriate run-time checks.
9343 * verify.c (merge_types): If merging two interface types,
9344 just set the result to java.lang.Object.
9345 * expr.c (pop_type): Any interface is matches by java.lang.Object.
9347 1998-11-13 Tom Tromey <tromey@cygnus.com>
9349 * gjavah.c (main): Handle --output-class-directory argument.
9350 * jvspec.c (lang_specific_driver): Translate `-d' into
9352 * jcf.h (jcf_write_base_directory): Declare.
9353 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
9354 * lang-options.h: Mention -foutput-class-dir.
9355 * jcf-write.c (jcf_write_base_directory): New global.
9356 (make_class_file_name): Put generated .class file into `-d'
9357 directory, or into source directory if -d not given. Function now
9359 (write_classfile): Free class file name. Handle case where class
9361 (DIR_SEPARATOR): New macro.
9362 Include <sys/stat.h>
9364 * Makefile.in (prefix): New macro.
9366 Thu Nov 12 14:15:07 1998 Per Bothner <bothner@cygnus.com>
9368 * parse.y (patch_invoke): Do less if flag_emit_class_files.
9369 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
9370 here (done in patch_invoke instead).
9371 (case_identity): Moved here from parse.y.
9373 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
9374 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
9375 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
9376 so they can be efficiently scanned without recursion.
9377 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
9378 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
9379 in BLOCK iteratively, rather than recursively.
9381 * parse.y (do_unary_numeric_promotion): New function.
9382 (patch_unaryop, patch_binop, patch_array_ref): Use it.
9384 * parse.y (patch_newarray): Various fixes.
9386 Re-do handling of switch statements (for proper block scoping).
9387 * parse.y: Add just a single block for the enture switch block,
9388 but don't create any "case blocks".
9389 (group_of_labels): Rmeoved unneeded non-terminal.
9390 CASE_EXPR and DEFAULT_EXPR are added to current block.
9391 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
9392 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
9393 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
9394 * parse.y (wfl_operator, print_int_node): Make non-static.
9395 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
9396 as part of recursive scan of block.
9397 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
9398 (patch_switch_statement): Most tests move dinto java_complete_tree.
9400 * parse.y: Make various production be non-typed (void).
9401 * parse.y (parse_error): Merged into issue_warning_error_from_context.
9402 * parse.y (add_stmt_to_compound): Don't create/change extra node.
9403 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
9405 * jcf-write.c (struct jcf_handler): New type.
9406 (struct jcf_switch_state): New type.
9407 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
9408 (alloc_handler, emit_unop, emit_reloc): New functions.
9409 (adjust_typed_op): Add extra parameter ("max type" offset).
9410 (emit_switch_reloc, emit_case-reloc): New function.
9411 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
9412 (generate_bytecode_insns): Support REAL_CST, switch statements,
9413 exception handling, method calls, object/array creation, and more.
9415 * class.c: Remove some unused variables.
9416 * constants.c (find_string_constant): New function.
9417 (count_constant_pool_bytes): Fix to correctly handle wide constants.
9418 * decl.c (complete_start_java_method): Don't _Jv_InitClass
9419 if flag_emit_class_files.
9421 1998-11-12 Tom Tromey <tromey@cygnus.com>
9423 * jcf-io.c (find_class): Added explanatory comment.
9425 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
9426 trailing slash to `.zip' entries.
9428 * jvspec.c (lang_specific_driver): Correctly handle case where
9429 GC_NAME not defined.
9431 1998-11-11 Tom Tromey <tromey@cygnus.com>
9433 * jvspec.c (GC_NAME): New define.
9434 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
9436 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
9438 Wed Nov 11 19:08:52 1998 Per Bothner <bothner@cygnus.com>
9440 * jcf-dump.c (TABLE_SWITCH): Fix typos.
9442 1998-11-11 Tom Tromey <tromey@cygnus.com>
9444 * jcf-dump.c (main): Correctly recognize `--'-style long options.
9446 Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9448 * class.c (is_compiled_class): Call safe_layout_class for class
9449 compiled from source.
9450 * conver.h (convert_to_integer, convert_to_real,
9451 convert_to_pointer): Added prototypes.
9452 * decl.c (init_decl_processing): Non longer push the decls of
9453 `methodtable', `constants', `Class', `Field', `dispatchTable'
9454 `jexception' and `Method'.
9455 * expr.c (build_invokeinterface): New function.
9456 (expand_invoke): static variable CLASS_IDENT now in
9457 build_invokeinterface. Use build_invokeinterface.
9458 (expand_java_field_op): Moved code to inline
9459 java.lang.PRIMTYPE.TYPE into a function.
9460 (build_primtype_type_ref): New function.
9461 * java-tree.def (INSTANCEOF_EXPR): New tree code.
9462 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
9463 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
9464 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
9465 (DECL_LOCAL_STATIC_VALUE): New macro.
9466 (build_invokeinterface, build_primtype_type_ref): New function
9468 (java_parse_abort_on_error): Macro rewritten.
9469 * jcf-parse.c (current_method): Add comment to declaration.
9470 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
9471 Function prototypes fixed.
9472 (jcf_parse_source): push/pop parser context. save/restore global.
9473 (parse_source_file): Fixed leading comment. Now take a
9474 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
9475 classes and pop the parser context anymore.
9476 (yyparse): Push parser context, save globals, parse the source
9477 file, restore globals and pop the parser context when processing a
9479 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
9480 * lex.c (java_parse_doc_section): New function.
9481 (java_lex): Call java_parse_doc_section when appropriate. Build an
9482 operator around INSTANCEOF_TK.
9483 * lex.h (java_lineterminator, java_sprint_unicode,
9484 java_unicode_2_utf8, java_lex_error, java_store_unicode):
9485 Prototypes rewritten.
9486 (java_parse_escape_sequence, java_letter_or_digit_p,
9487 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
9488 java_read_unicode, java_store_unicode, java_read_char,
9489 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
9490 Added function prototypes.
9491 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
9493 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
9495 (struct parser_ctxt): New fields: deprecated,
9496 current_parsed_class_un, gclass_list.
9497 (fix_method_argument_names, issue_warning_error_from_context,
9498 resolve_package, lookup_package_type): New function prototypes.
9499 (resolve_expression_name): Fixed function prototype.
9500 (find_applicable_accessible_methods_list): Fixed indentation, added
9501 extra argument in prototype.
9502 (check_final_assignment, build_null_of_type, check_deprecation,
9503 check_method_redefinition, reset_method_name,
9504 java_check_regular_methods, java_check_abstract_methods,
9505 maybe_build_primttype_type_ref): New function prototype.
9506 * parse.y (conver.h): Include.
9507 (INSTANCEOF_TK): Tagged <operator>.
9508 (single_type_import_declaration): Use REGISTER_IMPORT macro.
9509 (relational_expression:): Build binop for instanceof.
9510 (java_push_parser_context): Remember ctxp->gclass_list across
9512 (java_pop_parser_context): Simply return if no context
9513 exists. Remember gclass_list across contexts.
9514 (issue_warning_error_from_context): New function.
9515 (parse_error_context): Don't setup ctxp->elc here. Call
9516 issue_warning_error_from_context instead.
9517 (parse_warning_context): Likewise.
9518 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
9519 setup. Link new class/interface to ctxp->gclass_list.
9520 (add_superinterfaces): Register interface as incomplete if not
9522 (create_class): Remember class unqualified name in
9523 ctxp->current_parsed_class_un. Check class deprecation.
9524 (register_fields): Check field deprecation. Remember static final
9525 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
9527 (method_header): New local variable ORIG_ARG. Use unqualified
9528 current class name for check on constructor errors. Promote return
9529 type if of record type. Argument list fix moved in
9530 fix_method_argument_names, called here. Check method deprecation.
9531 (fix_method_argument_names): New function.
9532 (method_declarator): Promote record typed arguments.
9533 (safe_layout_class): Check class methods before layout.
9534 (java_complete_class): Compute field layout when patched.
9535 (do_resolve_class): Try to load class after having it renamed
9536 after the package name.
9537 (get_printable_method_name): Use DECL_CONTEXT.
9538 (reset_method_name): New function.
9539 (check_method_redefinition): Use reset_method_name.
9540 (java_check_regular_methods): New local variable
9541 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
9542 names for error report. Check for compile-time error when method
9543 found has default (package) access.
9544 (java_check_abstract_methods): Now takes an interface DECL node as
9545 an argument. Also reinstall real name on unchecked
9546 overriding/hiding methods for error report.
9547 (java_check_methods): Fixed leading comment. Get classes to verify
9548 from ctxp->gclass_list. Use CHECK_METHODS macro and set
9549 CLASS_METHOD_CHECKED_P on class verification.
9550 (lookup_java_method2): Get real method name if necessary.
9551 (find_in_imports): Don't check package class access here.
9552 (resolve_package, lookup_package_type): New functions.
9553 (java_layout_classes): Fixed leading comment. Take classes to be
9554 laid out from ctxp->gclass_list.
9555 (java_complete_expand_methods): Don't expand native and abstract
9557 (java_expand_classes): New function.
9558 (resolve_expression_name): Use additional argument ORIG. Retrieve
9559 values of static final field of primitive types.
9560 (resolve_field_access): Handles static final field of promotive
9562 (resolve_qualified_expression_name): Handle STRING_CST as
9563 primaries and package name resolution. Check deprecation on found
9564 decls. Set where_found and type_found on non static field resolved
9565 during qualification. Layout non primitive field decl types.
9566 (check_deprecation): New function.
9567 (maybe_access_field): Simplified.
9568 (patch_method_invocation_stmt): Local variable CLASS_TYPE
9569 removed. Reverse method's argument when primary is a type. Don't
9570 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
9571 instead. Include abstract class in the list of class searchable
9572 for constructors. Use DECL_CONTEXT of found method for access
9573 checks. Check method deprecation.
9574 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
9575 converting arguments. Handle INVOKE_INTERFACE.
9576 (lookup_method_invoke): Search constructor using existing
9577 infrastructure (don't rely on lookup_java_constructor anymore).
9578 (find_applicable_accessible_methods_list): Extra argument flag
9579 LC. Now include constructor in the search.
9580 (qualify_ambiguous_name): Conditional expression are primaries.
9581 (not_initialized_as_it_should_p): static final are always
9583 (java_complete_tree): Pass extra NULL argument to
9584 resolve_expression_name. Stricter test to carry on patching
9585 assignments. New case for INSTANCEOF_EXPR.
9586 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
9587 (check_final_assignment, maybe_build_primttype_type_ref): New
9589 (patch_assignment): Detect resolved static finals and carry normal
9590 assignment error check on them. Inline PRIMTYPE.TYPE read access.
9591 (try_builtin_assignconv): Access constant 0 on all primitive
9593 (valid_builtin_assignconv_identity_widening_p): Accept identical
9594 types. Accept all promoted type on int type.
9595 (valid_ref_assignconv_cast_p): Accept a null pointer to be
9596 assigned to a reference.
9597 (valid_method_invocation_conversion_p): Accept to check null
9599 (build_binop): Merge declaration and initialization of local
9601 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
9602 numeric types. Improved validity test for qualify operators on
9604 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
9605 and PREINCREMENT_EXPR. Also detect resolved static finals of a
9606 primitive type and issue the appropriate error message.
9607 (resolve_type_during_patch): Mark class loaded when resolved.
9608 (patch_cast): Allow null to be cased to reference types.
9609 (build_null_of_type): New function.
9610 (patch_array_ref): Handle array on references correctly.
9611 (patch_return): Removed unused local variable MODIFY. Force
9612 boolean to be returned as integers. Allows null to be returned by
9613 a function returning a reference.
9614 * typeck.c (convert_to_integer, convert_to_real,
9615 convert_to_pointer): Prototypes moved to convert.h
9616 (lookup_argument_method): Use method real name, if necessary.
9618 1998-10-30 Tom Tromey <tromey@cygnus.com>
9620 * class.c (build_class_ref): Changed name of primitive classes to
9623 * class.c (make_class_data): Renamed fields: nmethods to
9624 method_count, method_count to dtable_method_count. Always set
9626 * decl.c (init_decl_processing): Likewise.
9628 Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9630 * class.c (layout_class): Don't mangle <finit>, produce
9631 __finit<class> instead. Don't verify artificial methods.
9632 * decl.c (finit_identifier_node): New declared global.
9633 (init_decl_processing): finit_identifier_node initialized.
9634 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
9635 * java-tree.h (finit_identifier_node): Declared as extern.
9636 (struct lang_decl): New field called_constructor.
9637 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
9638 (CLASS_HAS_FINIT_P): New macro.
9639 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
9640 explicit constructor invocation.
9641 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
9642 CALL_SUPER_CONSTRUCTOR_P): New macros.
9643 (write_classfile): Added prototype.
9644 * jcf-parse.c (jcf_parse_source): Parse and remember for
9645 generation if the file was seen on the command line.
9646 (parse_source_file): Don't write the class file here.
9647 (yyparse): Loop on files rewritten. Set current_jcf.
9648 (parse_zip_file_entries): Parse class file only if it was found.
9649 * lang.c (init_parse): Don't open command line provided filename
9651 (lang_parse): Don't set main_jcf anymore.
9652 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
9653 (JCONSTRUCTOR_CHECK): New macro.
9654 (JBSC_TYPE_P): New macro.
9655 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
9656 (COMPLETE_CHECK_OP_2): New macro.
9657 (struct parse_ctxt): New field explicit_constructor_p.
9658 (check_class_interface_creation): Fixed prototype indentation.
9659 (patch_method_invocation_stmt): Prototype reflects added argument.
9660 (patch_invoke): Likewise.
9661 (complete_method_declaration, build_super_invocation,
9662 verify_constructor_circularity,
9663 build_this_super_qualified_invocation, get_printable_method_name,
9664 patch_conditional_expr, maybe_generate_finit, fix_constructors,
9665 verify_constructor_super, create_artificial_method,
9666 start_artificial_method_body, end_artificial_method_body,
9667 generate_field_initialization_code): New function prototypes.
9668 * parse.y: Fixed leading comment
9669 (constructor_header:, constructor_body:, block_end:): Rules tagged
9671 (type_declaration:): Call maybe_generate_finit.
9672 (method_declaration:): Action for method_body: placed in new
9673 function complete_method_declaration, called here.
9674 (constructor_declaration:): Defined actions. Removed leading
9676 (constructor_header:): New rule with action.
9677 (constructor_body:): Rule rewritten using block_begin: and
9678 block_end:. Defined actions.
9679 (constructor_declarator:, explicit_constructor_invocation:):
9681 (block:): Use new rules block_begin: block_end:.
9682 (block_begin:, block_end:): New rules and actions.
9683 (block_statements:): Fixed error message for explicit
9685 (method_invocation:): Call build_this_super_qualified_invocation
9686 if primary is `this' or `super' was seen.
9687 (conditional_expression:): Action defined.
9688 (extra_ctxp_pushed_p): New static global flag.
9689 (java_parser_context_save_global): Create parser context if
9690 necessary. Use extra_ctxp_pushed_p to remember it.
9691 (java_parser_context_restore_global): Pop extra parser context if
9693 (build_array_from_name): Array on primitive types are marked
9695 (register_fields): Restore new name in field initializer
9696 expression if type was altered. Non static fields initialized upon
9697 declaration marked initialized.
9698 (maybe_generate_finit): New function.
9699 (maybe_generate_clinit): Use create_artificial_method,
9700 start_artificial_method_body, end_artificial_method_body. Generate
9701 debug info for enclosed initialization statements.
9702 (method_header): Fixed leading comment. Check constructor
9703 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
9705 (complete_method_declaration, constructor_circularity_msg,
9706 verify_constructor_circularity): New functions.
9707 (get_printable_method_name): New function.
9708 (check_method_redefinition): Don't rename <finit> methods. Fix
9709 declared constructor names. Error message for
9710 constructors modified.
9711 (java_check_regular_methods): Local variable seen_constructor
9712 renamed saw_constructor. Skip verification on constructors. Create
9713 default constructor with create_artificial_method.
9714 (java_check_methods): Removed unnecessary empty line.
9715 (create_artificial_method, start_artificial_method_body,
9716 end_artificial_method_body): New functions.
9717 (java_layout_classes): Changed leading comment. Reverse fields
9718 list if necessary. Always layout java.lang.Object if being
9720 (java_complete_expand_methods): Verify constructor circularity.
9721 (java_complete_expand_method): Call fix_constructor on
9722 constructors. Local variable no_ac_found removed. Restore
9723 bindings if method body expansion failed.
9724 (fix_constructors, verify_constructor_super,
9725 generate_field_initialization_code): New function.
9726 (java_expand_classes): Fixed leading comment. Write class file
9728 (resolve_expression_name): Check for illegal instance variable
9729 usage within the argument scope of an explicit constructor
9731 (resolve_qualified_expression_name): Pass extra from_super flag
9732 when invoking patch_method_invocation_stmt. New case for
9733 conditional expression when used as a primary. Check for error
9734 when acquiring super.
9735 (patch_method_invocation_stmt): Added extra argument super. New
9736 local variable is_static_flag. Set class_to_search according to
9737 the nature of the constructor invocation. Don't add `this'
9738 argument when expanding NEW_CLASS_EXPR. Check for illegal method
9739 invocation within the argument scope of explicit constructor
9740 invocation. Set is_static according to is_static_flag. Provide
9741 extra `super' argument to patch_invoke invocation.
9742 (patch_invoke): New argument from_super. Loop on arguments
9743 indentation fixed. Pass from_super to invocation_mode. New switch
9744 case INVOKE_SUPER. Fixed error message in switch default case.
9745 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
9747 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
9748 (lookup_method_invoke): Fixed prototypes in candidates list. Error
9749 message takes constructors into account.
9750 (find_applicable_accessible_methods_list): Fixed indentation.
9751 (qualify_ambiguous_name): Take explicit constructor invocation
9752 into account. Deal with a conditional expression as a primary to
9754 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
9755 case. Added extra argument to patch_method_invocation_stmt.
9756 Register calls made to explicit constructor `this'. Don't call
9757 save_expr in ARRAY_REF case when emitting class files. Check for
9758 illegal use of this when expanding explicit constructor invocation
9760 (complete_function_arguments): Set and reset parser context
9761 explicit_constructor_p field value when appropriate.
9762 (build_super_invocation, build_this_super_qualified_invocation):
9764 (patch_assignment): Fixed typo.
9765 (patch_unaryop): Check on final fields occurs only when a decl
9767 (patch_return): Take constructors into account.
9768 (patch_conditional_expr): New function.
9769 * typeck.c (build_java_signature): Removed unnecessary empty line.
9771 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
9773 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
9775 1998-10-28 Tom Tromey <tromey@cygnus.com>
9777 * decl.c (init_decl_processing): Renamed fields.
9778 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
9779 interface_len, msize fields.
9781 * class.c (make_class_data): Removed subclass_head and
9782 subclass_next fields.
9783 * decl.c (init_decl_processing): Removed subclass_head and
9784 subclass_next fields.
9786 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
9788 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
9789 * mangle.c (emit_unicode_mangled_name): Similarly.
9791 Mon Oct 26 12:17:23 1998 Nick Clifton <nickc@cygnus.com>
9793 * jcf-parse.c (get_constant): Place braces around code to compute
9794 'd' when REAL_ARITHMETIC is not defined.
9796 Sun Oct 25 14:58:05 1998 H.J. Lu (hjl@gnu.org)
9798 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
9801 1998-10-23 Tom Tromey <tromey@cygnus.com>
9803 * lang-specs.h: `.zip' files are input to jc1.
9805 Thu Oct 22 23:01:54 1998 Per Bothner <bothner@cygnus.com>
9807 * jvspecs.c: Add (but don't enable) support for combining multiple
9808 .class and .java input filenames to a single jc1 invocation.
9809 Add support for -C flag (copile to .class files).
9810 Translate -classpath and -CLASSPATH arguments.
9811 * lang-specs.h: Don't set %2 spec.
9813 1998-10-22 Tom Tromey <tromey@cygnus.com>
9815 * jcf-path.c (add_entry): Don't add trailing separator if entry is
9817 (add_path): Don't add trailing separator to non-empty path
9820 * lang.c (lang_decode_option): Check for -fclasspath and
9821 -fCLASSPATH before examining other `-f' options.
9823 * java-tree.h (finalize_identifier_node): Don't declare.
9824 * class.c (make_class_data): Don't push "final" field.
9825 * decl.c (init_decl_processing): Don't push "final" field.
9826 (finalize_identifier_node): Removed.
9827 (init_decl_processing): Don't set finalize_identifier_node.
9829 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
9831 Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
9833 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
9834 (JV_SCAN_SOURCES): New macro.
9835 (JCF_DUMP_SOURCES): Likewise.
9836 (jcf-dump$(exeext)): New target.
9837 (jv-scan$(exeext)): New target.
9839 1998-10-22 Tom Tromey <tromey@cygnus.com>
9841 * Makefile.in (LEX): Removed.
9842 (LEXFLAGS): Likewise.
9843 (SET_BISON): New macro.
9845 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
9846 spurious diffs in parse.c.
9847 ($(PARSE_SCAN_C)): Likewise.
9848 (PARSE_DIR): New macro.
9850 (PARSE_SCAN_C): Likewise.
9851 (PARSE_RELDIR): New macro.
9853 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
9855 * jcf-io.c (find_class): Use saw_java_source to determine when to
9856 look for `.java' file.
9857 * jcf-parse.c (saw_java_source): New global.
9858 (yyparse): Set it if `.java' file seen.
9860 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
9861 (GCJH_SOURCES): Likewise.
9862 * Makefile.in (datadir): New macro.
9863 (libjava_zip): Likewise.
9864 (JAVA_OBJS): Added jcf-path.o.
9865 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
9866 (../gcjh$(exeext)): Likewise.
9867 (jcf-path.o): New target.
9868 * java-tree.h (fix_classpath): Removed decl.
9869 * jcf-parse.c (fix_classpath): Removed.
9870 (load_class): Don't call fix_classpath.
9871 * parse.y (read_import_dir): Don't call fix_classpath.
9872 * lex.h: Don't mention classpath.
9873 * lex.c (java_init_lex): Don't initialize classpath.
9874 * jcf-io.c (classpath): Removed global.
9875 (find_class): Use jcf_path iteration functions. Correctly search
9876 class path for .java file.
9877 (open_in_zip): New argument `is_system'.
9878 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
9879 classpath-related options.
9880 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
9882 (lang_init): Call jcf_path_init.
9883 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
9884 * lang-specs.h: Handle -I. Minor cleanup to -M options.
9885 Correctly put braces around second string in each entry.
9886 * gjavah.c (main): Call jcf_path_init. Recognize all the new
9887 classpath-related options.
9888 (help): Updated for new options.
9889 * jcf.h: Declare functions from jcf-path.c. Don't mention
9891 * jcf-path.c: New file.
9893 * jcf-depend.c: Include jcf.h.
9895 * jcf-write.c (localvar_alloc): Returns `void'.
9896 (localvar_free): Removed unused variable.
9898 * lang.c (OBJECT_SUFFIX): Define if not already defined.
9899 (init_parse): Use OBJECT_SUFFIX, not ".o".
9901 Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9903 * class.c (emit_register_classes): Renamed from
9904 emit_register_class.
9905 * java-tree.h (emit_register_classes): Prototype renamed from
9906 emit_register_class.
9907 * jcf-parse.c (yyparse): Call emit_register_classes once before
9909 * parse.y (java_expand_classes): No longer register classes.
9911 Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9913 * class.c (is_compiled_class): New local variable
9914 seen_in_zip. Identify classes found in currently compiled source
9916 * decl.c (complete_start_java_method): Fixed typo.
9917 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
9918 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
9919 (CLASS_P): Moved around.
9920 (java_parse_abort_on_error): Macro moved from jcf-parse.c
9921 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
9923 (jcf_parse_source): Changed leading comment. Removed unnecessary
9924 fclose and CLASS_FROM_SOURCE_P marking.
9925 (parse_source_file): New local variables remember_for_generation
9926 and filename. Mark parsed file name identifier node. Removed block
9927 executed when parse_only was null. Set remember_for_generation.
9928 Use it as an argument to java_pop_parser_context.
9929 (yyparse): New local variables several_files, list, next node and
9930 current_file_list. Split ampersand separated file names into
9931 current_file_list. Iterate through the list and parse accordingly.
9932 * parse.h (java_pop_parser_context): New function prototype.
9933 * parse.y (ctxp_for_generation): New static global variable.
9934 (java_pop_parser_context): New argument generate. Link popped ctxp
9935 to ctxp_for_generation list accordingly.
9936 (java_complete_expand_methods): Fixed indentation.
9937 (java_expand_classes): New function.
9939 Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
9941 * Makefile.in: Link with libiberty.a instead of memmove.o.
9943 Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9945 * lex.c (setjmp.h): No longer included.
9946 * lex.h (setjmp.h): Included.
9947 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
9948 (duplicate_declaration_error_p): Renamed from
9949 duplicate_declaration_error.
9950 (build_array_from_name): New function prototype.
9951 * parse.y (setjmp.h): No longer included.
9952 (variable_declarator_id): Define action.
9953 (build_array_from_name): New function.
9954 (duplicate_declaration_error_p): Renamed from
9955 duplicate_declaration_error. Fixed leading comment.
9956 (register_fields): Main `for' loop reorganized. Uses
9957 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
9958 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
9959 build_array_from_name.
9960 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
9962 (read_import_dir): Don't try to skip `.' and `..'.
9963 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
9964 build_array_from_name. Main `for' loop reorganized.
9965 (resolve_qualified_expression_name): When building access to a
9966 field, use the type where the field was found, not its own type.
9967 (maybe_access_field): Use field DECL_CONTEXT if the type where the
9968 field was found is null.
9969 (qualify_ambiguous_name): Sweep through all successive array
9972 Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
9974 * java-tree.h (pop_labeled_block, lang_printable_name,
9975 maybe_add_interface, set_super_info, get_access_flags_from_decl,
9976 interface_of_p, inherits_from_p, fix_classpath,
9977 complete_start_java_method, emit_handlers, init_outgoing_cpool,
9978 make_class_data, register_class, alloc_name_constant): New
9979 function prototypes.
9980 * lang.c (lang_decode_option): Set argc argument unused. Fixed
9981 indentation. Added cast to remove warning.
9982 (lang_printable_name): Set v argument unused.
9983 (lang_print_error): Added argument to lang_printable_name call.
9984 (java_dummy_print, print_lang_decl, print_lang_type,
9985 print_lang_identifier, lang_print_xnode): All argument marked
9987 * lex.c (java_unget_unicode): Removed unnecessary argument.
9988 (java_allocate_new_line): Unused local variable is gone.
9989 (java_read_char): Added parenthesis in expressions to remove
9990 warnings. Added final return statement.
9991 (java_read_unicode): Added parenthesis in expression to remove
9993 (java_parse_end_comment): Fixed java_unget_unicode invocation.
9994 (java_parse_escape_sequence): Likewise.
9995 (java_lex): Unused local variables are gone. Fixed
9996 java_unget_unicode invocation.
9997 * lex.h (set_float_handler): Prototype added when JC1_LITE not
9999 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
10000 lang_printable_name invocation in macro.
10001 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
10003 (duplicate_declaration_error): Suppressed unused argument in
10005 (identical_subpath_p): Function declaration is gone.
10006 (patch_invoke): Suppressed unused argument in prototype.
10007 (patch_cast, build_labeled_block, check_thrown_exceptions):
10009 * parse.y (setjmp.h): Included
10010 (toplev.h): Likewise.
10011 (field_declaration:): Suppressed unused local
10012 (label_decl:): Fixed build_labeled_block invocation.
10013 (java_pop_parser_context): Put extra parenthesis around assignment
10015 (yyerror): Suppressed unused local variables.
10016 (variable_redefinition_error): Fixed lang_printable_name
10018 (create_interface): Suppressed unused local variables.
10019 (create_class): Likewise.
10020 (duplicate_declaration_error): Suppressed unused argument. Fixed
10021 lang_printable_name invocation.
10022 (register_fields): Suppressed unused local variable. Fixed
10023 duplicate_declaration_error invocation.
10024 (method_header): Suppressed unused local variable.
10025 (method_declarator, parser_check_super): Likewise.
10026 (java_complete_class): Suppressed unused local variable. Fixed
10027 fatal error message.
10028 (complete_class_report_errors): Added default: in switch.
10029 (java_check_regular_methods): Fixed lang_printable_name
10031 (check_throws_clauses): Likewise.
10032 (java_check_abstract_methods): Suppressed unused local
10033 variable. Fixed lang_printable_name invocation.
10034 (read_import_entry): Added supplemental return statement.
10035 (read_import_dir): Suppressed unused local variables.
10036 (check_pkg_class_access, declare_local_variables): Likewise.
10037 (source_start_java_method): Suppressed unused extern variable
10039 (expand_start_java_method): Suppressed unused extern and local
10040 variable declarations.
10041 (java_complete_expand_methods): Likewise.
10042 (java_complete_expand_method): Suppressed unused local variables.
10043 (make_qualified_name): Likewise.
10044 (resolve_qualified_expression_name): Added default: in
10045 switch. Fixed lang_printable_name invocation.
10046 (class_instance_creation_expression): Added parenthesis around
10048 (patch_method_invocation_stmt): Fixed lang_printable_name and
10049 patch_invoke invocations.
10050 (check_for_static_method_reference): Fixed lang_printable_name
10052 (patch_invoke): Suppressed unused arguments and local variables.
10053 (lookup_method_invoke): Suppressed unused local variables.
10054 (qualify_ambiguous_name): Added default: in switch.
10055 (identical_subpath_p): Function removed.
10056 (patch_assignment): Suppressed unused local variables. Suppressed
10057 unnecessary if statement. Fixed lang_printable_name invocations.
10058 (try_builtin_assignconv): Fixed lang_printable_name invocations.
10059 (valid_ref_assignconv_cast_p): Parenthesis around
10060 expression. Suppressed unused local variables.
10061 (build_binop): Suppressed unused local variables. fixed
10062 lang_printable_name invocations.
10063 (string_constant_concatenation): Suppressed unused local
10065 (patch_unaryop): Fixed lang_printable_name invocation.
10066 (patch_cast): Suppressed unnecessary argument. Fixed
10067 lang_printable_name invocation.
10068 (patch_array_ref): Fixed lang_printable_name invocation.
10069 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
10070 (build_labeled_block): Suppressed unused argument.
10071 (generate_labeled_block): Fixed build_labeled_block invocation.
10072 (build_loop_body): Suppressed unused local variables.
10073 (patch_loop_statement): Likewise.
10074 (patch_exit): Fixed lang_printable_name invocation.
10075 (patch_switch_statement): Likewise.
10076 (case_identity): First argument marked unused.
10077 (patch_try_statement): Fixed lang_printable_name invocations.
10078 (patch_synchronized_statement, patch_throw_statement): Likewise.
10079 (check_thrown_exceptions): Fixed check_thrown_exceptions and
10080 lang_printable_name invocations.
10081 (check_thrown_exceptions_do): Suppressed unused argument.
10083 1998-10-14 Tom Tromey <tromey@cygnus.com>
10085 * jcf-write.c (write_classfile): Add output class file as target.
10086 * lang-options.h: Added -MD, -MMD, -M, and -MM.
10087 * jcf.h: Added declarations for dependency-tracking functions.
10088 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
10089 * lang.c (lang_decode_option): Recognize -MD and -MMD.
10090 (finish_parse): Call jcf_dependency_write.
10091 (dependency_tracking): New global.
10092 (DEPEND_SET_FILE): New define.
10093 (DEPEND_ENABLE): New define.
10094 (init_parse): Enable dependency tracking if required.
10096 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
10097 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
10098 (../gcjh$(exeext)): Likewise.
10099 (jcf-depend.o): New target.
10100 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
10101 (GCJH_SOURCES): Likewise.
10102 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
10104 (find_classfile): Added dep_name argument.
10105 (find_class): Compute name of dependency.
10106 (open_in_zip): Call jcf_dependency_add_file.
10107 * gjavah.c (output_file): No longer global.
10108 (usage): Don't mention "gjavah".
10110 (java_no_argument): Likewise.
10111 (version): Likewise.
10112 (main): Recognize and handle -M family of options.
10113 (print_mangled_classname): Return is void.
10114 (process_file): Handle case where output is suppressed.
10115 (HANDLE_END_FIELD): Likewise.
10116 (HANDLE_METHOD): Likewise.
10117 * jcf-depend.c: New file.
10119 Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
10121 * java-tree.def: Add missing newline at EOF.
10123 1998-10-13 Tom Tromey <tromey@cygnus.com>
10125 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
10126 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
10128 Include <config.h> and "system.h".
10129 (disassemble_method): Undefine RET to avoid clash with
10130 config/i386/i386.h.
10132 Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10134 * decl.c (runtime_exception_type_node, error_exception_type_node):
10135 New global variables.
10136 (init_decl_processing): Initialized.
10137 * expr.c (java_lang_expand_expr): Set caught exception type to
10138 null if catch handler argument doesn't exit.
10139 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
10141 * java-tree.h (runtime_exception_type_node,
10142 error_exception_type_node): Global variables declared.
10143 (DECL_FUNCTION_THROWS): New macro.
10144 (DECL_FUNCTION_BODY): Modified comment.
10145 (DECL_SPECIFIC_COUNT): Likewise.
10146 (struct lang_decl): New field throws_list.
10147 (IS_UNCHECKED_EXPRESSION_P): New macro.
10148 * lex.c (java_lex): Generate location information for THROW_TK.
10149 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
10150 EXCEPTIONS_P): New macros.
10151 (enum jdep_code): New value JDEP_EXCEPTION.
10152 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
10153 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
10154 PATCH_METHOD_RETURN_ERROR): New macros.
10155 (patch_method_invocation_stmt): Added new argument to prototype.
10156 (patch_synchronized_statement, patch_throw_statement,
10157 check_thrown_exceptions, check_thrown_exceptions_do,
10158 purge_unchecked_exceptions, check_throws_clauses): New function
10160 * parse.y Fixed typo in keyword section.
10161 (throw:): Rule tagged <node>.
10162 (THROW_TK): Keyword tagged <operator>.
10163 (method_header:): Last argument to call to method_header passed
10165 (throws:, class_type_list:, throw_statement:,
10166 synchronized_statement:, synchronized:): Defined actions.
10167 (method_header): New local variable current. Register exceptions
10168 from throws clause.
10169 (java_complete_tree): Complete and verify exceptions from throws
10171 (complete_class_report_errors): Error message on exceptions not
10173 (java_check_regular_methods): Fixed typo. Shortcut on private
10174 overriding methods. Changed error message on method
10175 redefinition. Check for throws clause compatibility.
10176 (check_throws_clauses): New function.
10177 (java_check_abstract_methods): Use DECL_NAME for wfl or current
10178 method. Changed error message on method redefinition.
10179 (currently_caught_type_list): New static variable.
10180 (java_complete_expand_methods): Purge unchecked exceptions from
10181 throws clause list. Call PUSH_EXCEPTIONS before walk and
10182 POP_EXCEPTIONS after.
10183 (resolve_qualified_expression_name): Pass new argument as NULL to
10184 patch_method_invocation_stmt.
10185 (patch_method_invocation_stmt): New argument ref_decl. Invoke
10186 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
10187 argument list when appropriate. Use new argument if non null to
10188 store selected method decl.
10189 (patch_invoke): Convert if necessary args of builtin types before
10190 forming CALL_EXPR. Argument list no longer reversed here.
10191 (invocation_mode): Treat final methods as static methods.
10192 (java_complete_tree): New cases for THROW_EXPR: and
10193 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
10195 (complete_function_arguments): No more RECORD_TYPE
10196 conversion. Function parameter nodes no longer saved.
10197 (valid_ref_assignconv_cast_p): Avoid handling null type.
10198 (patch_binop): Fixed null constant reference handling.
10199 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
10200 BUILD_THROW macros.
10201 (patch_try_statement): Fixed comments. Record caught types in
10202 list, push the list, expand try block and pop the list.
10203 (patch_synchronized_statement, patch_throw_statement,
10204 check_thrown_exceptions, check_thrown_exceptions_do,
10205 purge_unchecked_exceptions): New functions.
10206 * typeck.c (lookup_argument_method): Allow WFL in place of method
10207 DECL_NAME during method definition check
10209 1998-10-09 Tom Tromey <tromey@cygnus.com>
10211 * gjavah.c (decode_signature_piece): New function.
10212 (print_c_decl): Use it. Added `name_override' argument.
10213 (print_method_info): Use name_override argument to print_c_decl.
10214 (seen_fields): Removed.
10215 (print_field_info): Don't update seen_fields.
10216 (struct method_name): New structure.
10217 (method_name_list): New global.
10218 (print_method_info): Add new method to list of methods.
10219 (name_is_method_p): New function.
10220 (print_field_info): If field name has same name as method, then
10222 (process_file): Parse methods before fields.
10223 (field_pass): New global.
10224 (HANDLE_END_FIELD): Take field_pass into account.
10226 Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10228 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
10229 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
10231 Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
10233 * jvspec.c: Fix bug in jvgenmain_spec patch.
10235 Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10237 * Makefile.in (lang.o:): Install dependency on java-tree.def.
10238 * decl.c (soft_exceptioninfo_call_node): New global variable.
10239 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
10240 takes extra integer argument. soft_exceptioninfo_call_node
10242 * except.c (java_set_exception_lang_code): New function
10243 (method_init_exceptions): Called here.
10244 (prepare_eh_table_type): New function.
10245 (expand_end_java_handler): Called here.
10246 * expr.c (build_java_throw_out_of_bounds_exception): Now features
10247 one argument. Modified generation of call to
10248 soft_badarrayindex_node to use new argument.
10249 (build_java_arrayaccess): Pass faulty index value to
10250 build_java_throw_out_of_bounds_exception.
10251 (generate_name): New function.
10252 (java_lang_expand_expr): New local variables node, current,
10253 has_finally_p. Expand TRY_EXPR node.
10254 (process_jvm_instruction): Replace top of the stack with thrown
10255 object reference when entering exception handler.
10256 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
10257 specific tree codes.
10258 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
10260 (DECL_SPECIFIC_COUNT): New macro.
10261 (prepare_eh_table_type, java_set_exception_lang_code,
10262 generate_name): New function declarations.
10263 (match_java_method): Declaration deleted.
10264 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
10266 * lex.c (TRY_TK, CATCH_TK): Generate location information.
10267 * parse.h (redefinition_error, refine_accessible_methods_list,
10268 can_cast_to_p): Function declaration removed.
10269 (classitf_redefinition_error, variable_redefinition_error,
10270 parse_jdk1_1_error, find_applicable_accessible_methods_list,
10271 find_most_specific_methods_list, argument_types_convertible,
10272 enter_a_block, valid_builtin_assignconv_identity_widening_p,
10273 valid_cast_to_p, valid_method_invocation_conversion_p,
10274 try_reference_assignconv, add_stmt_to_compound,
10275 build_jump_to_finally, build_tree_list, patch_try_statement,
10276 java_get_catch_block): New function declarations.
10277 * parse.y (string_buffer_type): Global variable deleted.
10278 (group_of_labels, catches, catch_clause, catch_clause_parameter,
10279 finally): Rules tagged <node>.
10280 (TRY_TK, CATCH_TK): Token tagged <operator>.
10281 (class_body_declaration:, class_member_declaration:,
10282 formal_parameter:, explicit_constructor_invocation:,
10283 interface_member_declaration:, constant_declaration:,
10284 primary_no_new_array:, class_instance_creation_expression:,
10285 array_creation_expression:): Issue error on unsuported JDK1.1
10287 (try_statement:, catches:, finally:): Define actions.
10288 (catch_clause_parameter): New rule.
10289 (catch_clause:): Use new rule catch_clause_parameter.
10290 (parse_jdk1_1_error): New function.
10291 (redefinition_error): Renamed classitf_redefinition_error.
10292 (variable_redefinition_error): New function.
10293 (check_class_interface_creation): Call
10294 classitf_redefinition_error.
10295 (java_complete_tree): Added error message on JDEP_TYPE: case.
10296 (complete_class_report_errors): Fixed indentation.
10297 (declare_local_variables): Call variable_redefinition_error.
10298 (source_end_java_method): Call java_set_exception_lang_code and
10299 emit_handlers where appropriate.
10300 (java_method_add_stmt): Call add_stmt_to_block.
10301 (add_stmt_to_block): New function.
10302 (lookup_method_invoke): Fixed outside comment. new local variable
10303 candicates. Call find_applicable_accessible_methods_list and
10304 find_most_specific_methods_list when searching for a
10305 method. Modified error report to list possible candidates when
10307 (find_applicable_accessible_methods_list,
10308 find_most_specific_methods_list, argument_types_convertible): New
10310 (refine_accessible_methods_list): Function deleted.
10311 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
10312 expr (if applicable) before calling patch_array_ref.
10313 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
10314 (enter_block): Fixed comment.
10315 (enter_a_block): New function.
10316 (patch_assignment): Reorganized. Call try_reference_assignconv for
10317 references. Call valid_cast_to_p instead of can_cast_to_p.
10318 (try_reference_assignconv,
10319 valid_builtin_assignconv_identity_widening_p): New functions.
10320 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
10321 (valid_cast_to_p, valid_method_invocation_conversion_p): New
10323 (build_string_concatenation): Don't resolve StringBuffer.
10324 (patch_cast): Fixed inverted arguments.
10325 (patch_array_ref): Code to save array expr deleted. Call
10326 valid_cast_to_p instead of can_cast_to_p.
10327 (generate_labeled_block): Call generate_name.
10328 (build_jump_to_finally, build_try_statement, java_get_catch_block,
10329 patch_try_statement): New functions.
10330 * typeck.c (match_java_method): Function deleted.
10332 Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
10334 * jvspec.c: jvgenmain_spec uses different temporary file names.
10336 Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
10338 * jvspec.c (lang_specific_driver): Fail if user specifies
10339 --main= when not linking.
10341 Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
10343 * class.c (make_class_data): Push value for `thread' field.
10344 * decl.c (init_decl_processing): Added `thread' field to class.
10346 * class.c (add_field): Always make static fields externally
10349 Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
10351 * expr.c (build_java_athrow,
10352 build_java_throw_out_of_bounds_exception, expand_invoke,
10353 build_newarray, expand_java_multianewarray, build_java_monitor):
10354 Update comments to reflect _Jv_* function names.
10356 Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
10358 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
10359 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
10360 * parse.y (expand_start_java_method): Likewise.
10362 Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
10364 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
10366 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
10367 (add_field): No longer need to convert from RECORD_TYPE to pointer,
10368 * expr.c: Remove no-longer-needed calls to promote_type.
10369 * decl.c (give_name_to_locals): Liekwise.
10370 * jcf-parse.c (get_class_constant): Compensate for new signatures.
10371 * parse.y: Add/remove promote_type calls as appropriate.
10372 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
10373 (parse_signature_string): Likewise.
10374 (build_java_array_type): Fix for now signature convenions.
10376 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
10378 Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
10380 * class.c (init_class_processing): libjava function renamed to
10383 Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10385 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
10386 * java-tree.def: Fixed DEFTREECODE third argument.
10387 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
10388 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
10389 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
10390 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
10391 JAVA_THIS_EXPR): Now replaced by tree code definitions.
10392 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
10393 * lang.c (java_tree_code_type, java_tree_code_length,
10394 java_tree_code_name): New arrays.
10395 (lang_init): Append Java tree node definitions to Gcc ones.
10396 * lex.c (expression_obstack): Declared as extern when JC1_LITE
10398 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
10400 (java_lex): Allow declaration of empty string constants. Retain
10401 location information on CASE_TK and DEFAULT_TK.
10402 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
10403 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
10404 Modified to be more robust.
10405 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
10406 (build_new_invocation, try_builtin_assignconv,
10407 patch_switch_statement, string_constant_concatenation,
10408 build_string_concatenation, patch_string_cst, patch_string,
10409 java_expand_switch): New function declarations.
10410 * parse.y: Rules related to switch and EH tagged <node>.
10411 (label_id): Set to NULL_TREE
10412 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
10414 (this_or_super:): Fixed indentation.
10415 (statement:, statement_nsi:, statement_without_trailing_substatement:,
10416 statement_expression:): Removed call to RULE on all sub-rules.
10417 (switch_expression:, switch_labels:): New rules.
10418 (switch_statement:, switch_block:, switch_block_statement_groups:,
10419 switch_block_statement_group:, switch_labels:, switch_label:):
10421 (throw_statement:, synchronized_statement:, try_statement:):
10422 Defined temporary actions.
10423 (class_instance_creation_expression:): Call
10424 build_new_invocation. Fixed indentation.
10425 (field_access): Fixed indentation.
10426 (method_invocation): Likewise.
10427 (make_qualified_primary): Use THIS_EXPR.
10428 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
10429 resolving from SUPER, set *type_found.
10430 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
10431 (java_complete_tree): Removed unused local variable `location'. Case
10432 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
10433 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
10434 on MODIFY_EXPR: and all binary operator tree code cases. Removed
10435 STRING_CST: case. default: checks for patchable strings.
10436 (complete_function_arguments): Transform string constant or
10437 crafted StringBuffer if necessary.
10438 (build_method_invocation): Fixed comments.
10439 (build_new_invocation): New function.
10440 (patch_assignment): Call try_builtin_assignconv to figure a valid
10441 assignment conversion between builtin types.
10442 (try_builtin_assignconv): New function.
10443 (build_binop): Use URSHIFT_EXPR directly to call build.
10444 (operator_string): Use UNARY_PLUS_EXPR.
10445 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
10447 (do_merge_string_cste, merge_string_cste,
10448 string_constant_concatenation, build_string_concatenation,
10449 patch_string, patch_string_cst): New function.
10450 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
10451 (patch_unaryop): Likewise. New test of valid ++/-- operands.
10452 (build_newarray_node): Use NEW_ARRAY_EXPR.
10453 (build_this): Use THIS_EXPR.
10454 (build_return): Enable debug information on return statement.
10455 (build_if_else_statement): Likewise.
10456 (complete_labeled_statement): Fixed related comment.
10457 (build_loop_body): Fixed comment.
10458 (build_bc_statement): Enable debug information on break/continue
10460 (patch_bc_statement): Fixed typos. Handle SWITCH statement
10462 (patch_switch_statement, case_identity, java_expand_switch): New
10465 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
10467 * buffer.h (BUFFER_INIT): New macro.
10468 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
10469 Pass (struct jcf_partial *state) to most functions.
10470 (jcf_block, jcf_relocation): New types.
10471 Support labels, branches, conditionals, loops.
10473 Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
10475 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
10477 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
10479 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
10480 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
10481 not integer_type_node (INT_TYPE_SIZ bits).
10483 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
10485 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
10486 * jcf-dump.c (print_exception_table): New function.
10487 (disassemble_method): Better handling of wide instructions.
10488 Make more robust for bad input.
10490 Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
10492 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
10495 Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
10497 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
10499 Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
10501 * Makefile.in ($(PARSE_H)): Removed target.
10503 Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
10505 * Makefile.in (JAVA_OBJS): Add memmove.o
10506 (memmove.o): New target & rules.
10508 Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
10510 * expr.c (expand_invoke): Don't generate a call to the class init
10513 Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
10515 * Makefile.in: Add many missing dependencies.
10516 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
10518 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
10519 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
10521 Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
10523 * decl.c (complete_start_java_method): If method is static (and
10524 not private) call _Jv_InitClass.
10525 * expr.c (expand_invoke): Don't call build_class_init.
10527 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
10529 Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
10531 * Make-lang.in (GCJ): Define before using.
10533 Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
10535 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
10536 losing due to namespace pollution in GNU getopt.h
10538 Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
10540 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
10541 (java.all.cross): Likewise.
10542 (java.rest.encap): Likewise.
10544 Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
10546 * gjavah.c (print_class_decls): Fix thinko in arglist
10547 * jcv-io.c (find_classfile): Similarly.
10549 Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
10551 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
10553 Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
10555 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
10556 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
10557 * Makefile.in (PARSE_C): New macro.
10558 (PARSE_H): Likewise.
10559 (PARSE_SCAN_C): Likewise.
10560 ($(PARSE_C)): Target renamed from parse.c.
10561 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
10562 (clean): Remove parse-scan.c as well.
10563 (parse.o): Depend on $(PARSE_C).
10565 Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
10567 * README, license.terms: Removed.
10569 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
10570 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
10571 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
10572 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
10573 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
10574 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
10575 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
10576 and Java trademark attribution.
10578 Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
10580 * Makefile.in: Use gcjh, not gjavah.
10581 * config-lang.in (stagestuff): Use gcjh, not gjavah.
10582 * Make-lang.in: Changed gjavah to gcjh everywhere.
10584 Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
10586 * gjavah.c: Support new -prepend -add -append flags.
10587 (print_method_info): Method is not virtual if class is final.
10589 Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10591 * jv-scan.c: Fixed copyright assignment.
10592 * keyword.gperf: Likewise.
10593 * keyword.h: Likewise.
10594 * lex.c: Fixed copyright assignment.
10595 (java_lex): Push unicode back when parsing '<'.
10596 * lex.h: Fixed copyright assignment.
10597 * parse-scan.y: Likewise.
10598 * parse.h: Fixed copyright assignment.
10599 (build_debugable_stmt, complete_for_loop): New function prototypes.
10600 * parse.y: Fixed copyright assignment.
10601 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
10602 size_zero_node when completing a loop with no exit condition.
10603 (for_statement_nsi:): Define action.
10604 (for_init:, for_update:): Return size_zero_node when empty.
10605 (declare_local_variables): Call build_debugable_stmt.
10606 (build_debugable_stmt): New function.
10607 (build_loop_body): Build debugable statement around loop
10609 (complete_loop_body): Take into account the debugable statement
10610 around the EXIT_EXPR.
10611 (complete_loop_body): New function.
10612 (patch_exit_expr): Fixed condition inversion.
10614 Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
10616 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
10617 name of thread define.
10618 * jvspec.c (THREAD_NAME): New macro.
10620 (THREADLIB): Likewise.
10621 (lang_specific_driver): Recognize attempt to link with thread
10622 library or gc library. Recognize -ljava on command line so it
10623 isn't linked against more than once.
10625 Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10627 * parse-scan.y (report_main_declaration): Name of the class
10628 containing `main' can be a qualified name.
10630 Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
10632 * config-lang.in: Changed gjavac to gjc everywhere.
10633 * Make-lang.in: Changed gjavac to gjc everywhere.
10635 Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10637 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
10638 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
10639 and install the files.
10640 * Makefile.in (JAVA_OBJS_LITE): New variable.
10641 (compiler:): Now include jv-scan as a dependency.
10642 (../jv-scan$(exeext), parse-scan.c): New targets.
10643 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
10644 * config-lang.in (compilers): Removed gcj, gjavah from the list.
10645 * jcf-parse.c (parse_source_file): Call java_layout_classes and
10646 check for errors even if parse_only.
10647 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
10649 (yylex): New function. Uses java_lex body.
10650 (java_lex): Removed commented out statement. Remove local variable
10651 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
10652 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
10653 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
10654 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
10655 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
10656 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
10658 (java_lex_error): Empty if JC1_LITE is defined.
10659 (java_get_line_col): Return 0 if JC1_LITE is defined.
10660 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
10661 SET_MODIFIER_CTX): Moved into the section containing the macros
10662 conditionally defined by JC1_LITE.
10663 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
10664 argument if JC1_LITE is defined.
10665 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
10666 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
10668 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
10669 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
10670 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
10671 to different values according to JC1_LITE.
10672 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
10673 declared if JC1_LITE set.
10674 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
10675 defined if JC1_LITE not set.
10676 (struct parser_ctx): Reorganized and skip the jc1 front end part
10678 (java_layout_classes): New function definition.
10679 (java_push_parser_context, java_init_lex, yyparse, yylex,
10680 yyerror): Prototype always declared. All other static function
10681 prototypes declared only if JC1_LITE is not set.
10682 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
10683 declared in parse.h.
10684 (java_layout_classes): New function.
10685 (java_complete_expand_methods): No longer layout the class here.
10686 * parse-scan.y: New file.
10687 * jv-scan.c: New file.
10689 Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
10691 * gjavah.c (main): Handle -friend option.
10692 (friend_specs): New global.
10693 (generate_access): Handle friend_specs.
10694 (process_file): Likewise.
10695 (MAX_FRIENDS): New macro.
10696 (friend_count): New global.
10697 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
10698 Changed all callers.
10700 Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
10702 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
10703 (main): Handle processing all the entries of a named .zip archive.
10704 * jcf-io.c (jcf_trim_old_input): New function.
10705 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
10707 Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
10709 * lang.c (flag_assume_compiled): Make default be on.
10711 Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
10713 * jcf-dump.c: Add bunches of flags to control output more.
10714 (process_class): New function; support printing more than one class.
10715 (main): Support new --print-main and --javap flags.
10716 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
10717 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
10719 Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
10721 Change mangling of dispatch table to match C++ vtable (w/thunks).
10722 * class.c (build_dtable_decl), java-tree.h: New function.
10723 (make_class_data): Call it.
10724 * decl.c (init_decl_processing): Likewise.
10726 Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
10728 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
10729 soft_anewarray; adjust args passed.
10730 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
10731 match _Jv_NewObjectArray.
10733 Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10735 * decl.c (push_labeled_block, pop_labeled_block): New functions.
10736 * expr.c (loopup_label): Call create_label_decl.
10737 (create_label_decl): New function.
10738 (java_lang_expand_expr): Call expand_start_bindings with argument
10740 * java-tree.h Added space after PROTO in function declarations
10742 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
10743 (create_label_decl, push_labeled_block): New function
10745 * lex.c (label_id): Initialize.
10746 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
10748 * parse.h Added space after PROTO in function declarations when
10750 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
10751 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
10752 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
10753 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
10755 (struct parser_ctxt): New fields current_loop,
10756 current_labeled_block.
10757 (build_if_else_statement, patch_if_else_statement,
10758 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
10759 generate_labeled_block, complete_labeled_statement,
10760 build_bc_statement, patch_bc_statement, patch_loop_statement,
10761 build_new_loop, build_loop_body, complete_loop_body): New function
10763 * parse.y (java_warning_count): New global variable.
10764 (label_id): New static variable.
10765 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
10766 (block:): Return size_zero_node when block is empty.
10767 (empty_statement:): Return size_zero_node.
10768 (statement:): Implement supplemental action when for_statement: is
10770 (label_decl:): New rule.
10771 (labeled_statement:): Rewritten using label_decl. Actions
10773 (labeled_statement_nsi:): Likewise.
10774 (if_then_statement): Actions implemented.
10775 (while_expression): New rule.
10776 (while_statement:): Rewritten using while_expression. Actions
10778 (while_statement_nsi:): Likewise.
10779 (do_statement_begin:): New rule.
10780 (do_statement:): Rewritten using do_statement_begin. Actions
10782 (for_statement:): Rewritten using for_begin. Actions implemented.
10783 (for_statement_nsi:): Likewise.
10784 (for_header:, for_begin:): New rules.
10785 (for_init:): Actions implemented.
10786 (statement_expression_list:, break_statement:,
10787 continue_statement:): Likewise.
10788 (yyerror): Count number of issued warning(s).
10789 (java_report_errors): Report error(s) and/or warning(s).
10790 (java_complete_class): Use build_java_argument_signature to
10791 recompute completed method signature.
10792 (java_check_regular_methods): New locals method_wfl and aflags.
10793 Use method_wfl instead of lookup_cl during error reports. Fixed
10794 indentation and modified some error messages. Use
10795 lang_printable_name in method instead of the DECL_NAME. New code
10796 to issue warnings on methods not overriding corresponding methods
10797 private to a different package.
10798 (java_method_add_stmt): Call add_stmt_to_compound.
10799 (add_stmt_to_compound): New function.
10800 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
10801 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
10802 (build_if_else_statement, patch_if_else_statement,
10803 build_labeled_block, generate_labeled_block,
10804 complete_labeled_statement, build_new_loop, build_loop_body,
10805 complete_loop_body, patch_loop_statement, build_bc_statement,
10806 patch_bc_statement, patch_exit_expr): New functions.
10807 * typeck.c (build_java_signature): Build argument signature before
10808 enclosing it in between parenthesis.
10810 Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
10812 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
10813 (JAVA_OBJS): Added reminder comment
10815 Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
10817 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
10818 be interpreted as a long long.
10820 Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
10822 * decl.c (init_decl_processing): Use _Jv_InitClass, not
10823 soft_initialise_class. Use _Jv_NewMultiArray, not
10824 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
10825 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
10826 _Jv_CheckArrayStore, not soft_checkarraystore. Use
10827 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
10829 Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
10831 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
10832 length_identifier_node): New global tree node constants.
10833 * parse.y (kw_super, kw_this, kw_length): Removed globals.
10834 Replace uses by super_identifier_node etc.
10835 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
10837 * parse.y (resolve_field_access): Don't special-case ".length" if
10838 flag_emit_class_files.
10839 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
10840 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
10843 Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
10845 * decl.c (init_decl_processing): Remove unused method_type_node fields.
10846 * class.c (make_method_value): Remove init for removed fields.
10848 * class.c (layout_class): Use build_java_argument_signature.
10849 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
10851 * typeck.c (push_java_argument_signature): Removed. Merged into ...
10852 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
10853 (build_java_signature): Don't use push_java_argument_signature.
10855 * typeck.c (lookup_argument_method): New function.
10856 * parse.y (java_check_regular_methods): Use lookup_argument_method
10857 instead of lookup_java_method2 followed by lookup_java_method.
10859 * parse.y (check_method_redefinition): Minor optimization.
10861 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
10862 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
10864 Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
10866 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
10869 * gjavah.c (java_float_finite): Use K&R-style definition.
10870 (java_double_finite): Likewise.
10871 (generate_access): Now returns void. Changed all callers.
10872 (last_access_generated): Removed.
10873 (process_file): Only make a single pass over the .class file.
10875 Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
10877 * class.c (get_dispatch_table): Add extra dummy vtable entry,
10878 for compatibility for G++ (with -fvtable-thunks).
10879 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
10881 * gjavah.c (process_file): Use public inheritance for super-class.
10883 Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10885 * lex.c (java_init_lex): Initialize ctxp->package.
10886 * parse.h (struct parser_ctxt): package and package_len replaced
10887 by tree package, an identifier node. Field method_decl_list is
10888 gone. Fixed comments.
10889 (lookup_field_wrapper, merge_qualified_name, not_accessible,
10890 class_in_current_package): New function prototypes.
10891 * parse.y (array_type:): Set class loaded flag on primitive type
10893 (package_declaration:): Assign ctxp->package to the
10895 (method_invocation:): Handle invocation of method qualified by
10897 (single_type_import_declaration:): Removed ambiguity check.
10898 (java_pop_parser_context): New local variable `next'. Reset and
10899 set IMPORT_CLASSFILE_NAME flags on current and previous import
10901 (java_accstring_lookup): Use new local macro COPY_RETURN.
10902 (lookup_field_wrapper): New function.
10903 (parser_qualified_classname): Use merge_qualified_name.
10904 (parser_check_super_interface): Broaden error message.
10905 (do_resolve_class): Check for qualified class name in the current
10906 compilation unit if appropriate.
10907 (process_imports): Check for already defined classes.
10908 (check_pkg_class_access): Got rid of call to
10909 get_access_flags_from_decl.
10910 (java_complete_expand_methods): Call safe_layout_class based on
10911 the current class size.
10912 (make_qualified_primary): Build a WFL qualification on primary if
10914 (merge_qualified_name): New function.
10915 (make_qualified_name): Use merge_qualified_name.
10916 (resolve_expression_name): Use safe_lookup_field.
10917 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
10918 (resolve_qualified_expression_name): Likewise. Check on resolved
10919 element accessibility.
10920 (not_accessible_p, class_in_current_package): New functions.
10921 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
10922 (patch_method_invocation_stmt): Merged common pieces. Check
10923 accessibility of invoked method.
10924 (check_for_static_method_reference): Add returned type in error
10926 (invocation_mode): Get rid of bogus check on PRIVATE methods.
10927 (refine_accessible_methods_list): Merged two conditions in test.
10928 (java_complete_class): Sanity check on stabilize_ref gone.
10929 * zextract.c (read_zip_archive): Cast lseek second argument to long.
10931 Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
10933 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
10935 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
10937 * gjavah.c (F_NAN): Removed.
10938 (F_NAN_MASK): New macro.
10939 (F_POSITIVE_INFINITY): Removed.
10940 (F_NEGATIVE_INFINITY): Likewise.
10941 (java_float_finite): Rewrote.
10942 (D_NAN_MASK): Renamed.
10943 (java_double_finite): Rewrote.
10944 (D_POSITIVE_INFINITY): Removed.
10945 (D_NEGATIVE_INFINITY): Likewise.
10947 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
10948 If verbose, print underlying representation of value in hex.
10950 Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
10952 * buffer.h, buffer.c: New files.
10953 * Makefile.in (JAVA_OBJS): Add buffer.o.
10955 Support locals variables and writing their debug entries to .class.
10956 * jcf-write.c: Simplify some by user new buffer type.
10957 (vode_buffer_grow): Removed.
10958 (struct localvar_info): New type.
10959 (localsvars, localvartable): New buffers.
10960 (localvar_alloc, localvar_free): New functions.
10961 (generate_bytecode_insns): Handle local variables.
10962 (generate_classfile): Write LocalVariableTable attribute.
10964 Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
10966 * jcf-io.c (open_in_zip): Check the zipfile magic number.
10967 * zipfile.h (ZIPMAGIC): New macro.
10969 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
10971 * Makefile.in (gjavah.o): Updated dependencies.
10972 (jcf-dump.o): Likewise.
10973 (all.indirect): Use ../gjavah.
10974 (../gjavah$(exeext)): Likewise.
10975 (clean): Don't remove gjavah.
10976 (clean): Remove parse.c, not java/parse.c.
10977 * Make-lang.in (java): Added gjavah.
10978 (gjavah$(exeext)): New target.
10979 (GJAVAH_SOURCES): New macro.
10980 (java.all.build): Added gjavah.
10981 (java.all.cross): Likewise.
10982 (java.rest.encap): Likewise.
10983 * config-lang.in (compilers, stagestuff): Added gjavah.
10985 Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
10987 * gjavah.c (java_float_finite): New function.
10988 (java_double_finite): Likewise.
10989 (F_POSITIVE_INFINITY): New macro.
10990 (F_NEGATIVE_INFINITY): Likewise.
10992 (D_POSITIVE_INFINITY): Likewise.
10993 (D_NEGATIVE_INFINITY): Likewise.
10995 (print_field_info): Use java_float_finite and java_double_finite.
10997 Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
10999 * parse.y (method_header): Name "this" implicit argument.
11001 Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
11003 * jcf-write.c: Write out LineNumberTable attribute in .class file.
11004 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
11005 (put_linenumber): New function.
11006 (generate_bytecode_insns, generate_classfile): Write line numbers.
11008 Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11010 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
11011 (lookup_name, build_known_method_ref, build_class_init,
11012 build_invokevirtual, invoke_build_dtable, match_java_method,
11013 build_field_ref, pushdecl_force_head, build_java_binop,
11014 binary_numeric_promotion, build_decl_no_layout,
11015 build_java_arrayaccess, build_newarray, build_anewarray,
11016 build_java_array_length_access, build_java_arraynull_check): New
11017 extern function prototypes.
11018 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
11019 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
11021 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
11023 * jcf.h (jcf_out_of_synch): New extern function prototype.
11024 * parse.h: Static/global function implemented in parse.y
11025 prototyped and declarations moved at the end of the file.
11026 (DECL_P): Check that the argument isn't null.
11027 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
11028 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
11029 (QUAL_DECL_TYPE): New macro.
11030 (PARAMS): Macro definition removed.
11031 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
11032 (return_statement:): Call build_return.
11033 (field_access:): Call make_qualified_primary in sub rule.
11034 (method_invocation:): Build method invocation and call
11035 make_qualified_primary when processing primaries.
11036 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
11037 get_type_from_signature.
11038 (java_check_regular_method): Extra integer 0 argument when calling
11039 lookup_java_method2.
11040 (lookup_java_interface_method2): Extra method DECL argument when
11041 calling lookup_java_interface_method2.
11042 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
11043 COMPOUND_EXPR node.
11044 (java_complete_expand_method): Layout current class iff not
11045 already done. Don't process interface's methods.
11046 (java_complete_expand_method): Use super class only if it
11047 exists. Use current class otherwise.
11048 (make_qualified_primary): New function.
11049 (resolve_expression_name): Process qualified expression or
11050 expression from primary the same way.
11051 (resolve_expression_name): Two last arguments to
11052 resolve_field_access are now NULL_TREEs.
11053 (resolve_field_access): New variable is_static. Local field must
11054 be DECLs. is_static computed on field DECLs only. Append code in
11055 where_found to the field access if necessary. Use QUAL_DECL_TYPE
11056 to initialize field_type.
11057 (resolve_qualified_expression_name): New local variable,
11058 previous_call_static and is_static. Handle primaries with function
11059 calls, casts, array references and `this'. `super' now handled as
11060 `(super_class)this'. Use is_static to clarify boolean expressions.
11061 Added code to handle case where a proper handle is required to
11062 access a field. Use QUAL_DECL_TYPE where applicable.
11063 (maybe_access_field): New function.
11064 (patch_method_invocation_stmt): New arguments primary, where,
11065 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
11066 deleted. Use `where' as a type to search from if specified. Check
11067 for static method reference where forbidden. Append primary or
11068 current_this to the argument list if not calling constructor nor
11070 (check_for_static_method_reference): New function.
11071 (patch_invoke): Layout the class on which new is done if
11073 (lookup_method_invoke): Changed format to report errors on
11075 (qualify_ambiguous_name): New local variable this_found. Now
11076 handle things from primaries. Method call are considered
11078 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
11079 changed into NULLs.
11080 (not_initialized_as_it_should_p): Comply with the new DECL_P.
11081 (java_complete_tree): New case fo RETURN_EXPR. Process function
11082 call arguments in separate function.
11083 (complete_function_arguments): New function.
11084 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
11086 (patch_assignment): Take the return function slot into account as
11087 a RHS. Distinguish assignment from a return.
11088 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
11089 when checking methods in interfaces.
11090 (resolve_type_during_patch): NULL argument to unresolve_type_p
11091 instead of NULL_TREE.
11092 (patch_newarray): Fixed typo in comment.
11093 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
11094 (build_return, patch_return): New functions.
11095 * typeck.c (lookup_java_constructor): Fixed typo in comment.
11097 Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
11099 * constants.c (find_name_and_type_constant, find_fieldref_index,
11100 find_methodref_index): New methods.
11101 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
11102 just return given method. Also, rename to build_known_method_ref.
11103 (expand_invoke): Rename call to build_invoke_non_interface.
11104 * java-tree.h, parse.h: Update prototype.
11105 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
11106 (such as expand_expr_stmt) if flag_emit_class_files.
11107 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
11108 STACK_TARGET, IGNORE_TARGET): New macros.
11109 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
11110 (generate_bytecode_insn): New function to generate method's bytecode.
11111 (generate_classfile): Node generate Code attribute for a method.
11112 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
11113 push_long_const, field_op, adjust_typed_op, maybe_wide):
11114 New functions used by generate_bytecode_insn.
11116 * typeck.c (signature_include_return): Remove variable.
11117 (push_java_argument_signature, build_java_argument_signature): New.
11118 (build_java_signature): Use push_java_argument_signature.
11119 * parse.y: Use build_java_argument_signature instead of fiddling
11120 with signature_include_return.
11122 Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
11124 * gjavah.c (print_c_decl): Always generate JArray<>* for array
11127 * Makefile.in (all.indirect): Added gjavah$(exeext).
11128 (gjavah$(exeext)): Added $(exeext).
11131 Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11133 * class.c (layout_class): Call to java_layout_parsed_class replace
11134 by safe_layout_class.
11135 * expr.c (build_java_array_length_access): Removed static storage
11136 class in the function definition.
11137 (build_java_arraynull_check): Likewise.
11138 Also fixed typos in two comments.
11139 * lex.c (java_init_lex): Initialize static global kw_length.
11140 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
11141 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
11143 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
11144 * parse.h (resolve_no_layout): New static function declaration.
11145 (get_identifier_in_static): Declaration removed.
11146 (java_layout_parsed_class): Function name declaration changed to
11148 (build_newarray_node, patch_newarray, resolve_type_during_patch,
11149 not_initialized_as_it_should_p, build_this): New static function
11151 (pushdecl_force_head, build_java_binop, int_fits_type_p,
11152 binary_numeric_promotion, stabilize_reference,
11153 build_decl_no_layout, build_java_arrayaccess): Extern function
11154 declarations moved into their own section.
11155 (build_newarray, build_anewarray, build_java_array_length_access,
11156 build_java_arraynull_check): New extern function declarations.
11157 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
11158 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
11160 (CALL_CONSTRUCTOR_P): New macro.
11161 * parse.y (kw_length): New static global tree node.
11162 (return_statement): Tagged <node>.
11163 (RETURN_TK): Tagged <operator>.
11164 (variable_declarator_id:): Build variable declaration with an
11165 empty initialization value if a syntax error was found in the
11166 initialization part of the variable declaration.
11167 (statement_without_trailing_substatement:): return_statement: now
11168 uses the default rule.
11169 (return_statement:): Temporarily fixed to return NULL_TREE.
11170 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
11171 (class_instance_creation_expression:): Class creation rules now
11172 call build_method_invocation upon reduction.
11173 (array_creation_expression:): Rules call build_newarray_node upon
11175 (dim_exprs:): Build a list of dimension expressions.
11176 (dim_expr:): Store location of the OSB_TK in the dimension
11178 (method_invocation:): Added a new error rule.
11179 (build_unresolved_array_type): WFL argument may also be an array
11180 on a primitive type. Name of the argument changed to reflect this.
11181 (method_declarator): Insert argument type at the beginning of the
11182 argument type list and later reverse the list.
11183 (unresolved_type_p): Argument 'returned' may be optionally
11185 (java_layout_class_from_source): Function renamed
11187 (resolve_and_layout): Now call resolve_no_layout and
11189 (resolve_no_layout): New function.
11190 (purify_type_name): New function.
11191 (complete_class_report_errors): Call purify_type_name during error
11192 report on a type not found.
11193 (process_imports): error_found local variable doesn't need to be
11194 initialized to zero.
11195 (declare_local_variables): New local type_wfl. Fixed typo in error
11196 message. type_wfl assigned to unresolved type and used to register
11197 incomplete type. Build a WFL around the variable initialization
11198 statement so that debug info can be generated on it.
11199 (source_start_java_method): Reverse argument list after they've
11201 (current_this): New static global variable.
11202 (java_complete_expand_methods): Set current_this when appropriate.
11203 (resolve_expression_name): Build correct static and non static
11204 field access bearing a simple name.
11205 (resolve_field_access): Resolve the length field of arrays. Handle
11207 (patch_method_invocation_stmt): Set the type of the method
11208 invocation to error_mark_node. This value is later overridden by a
11209 valid type, if any. Don't handle qualified constructor invocation
11210 as qualified method invocation. Call lookup_method_invoke with its
11211 new flag. It's no longer necessary to access the selected method
11212 as the value of a tree list. Handle constructor invocation.
11213 (patch_invoke): Reverse argument list when invoking non interface
11214 methods. Insert call to new as the first argument of the
11216 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
11217 defined within a final class. Return INVOKE_STATIC if the invoked
11218 method is a constructor.
11219 (lookup_method_invoke): New lc argument is a flag to indicate a
11220 constructor lookup. Now handle constructor lookup. Choose the most
11221 specific method in case several were matching the invocation
11222 requirements. Return a method decl instead of a tree list featuring
11223 one single method decl element.
11224 (refine_accessible_methods_list): New lc flag argument to
11225 indicate that a constructor is being looked up.
11226 (not_initialized_as_it_should_p): New function.
11227 (java_complete_tree): Now process fake tree codes
11228 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
11229 save_expr on resolved function call arguments. Case on
11230 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
11231 (patch_assignment): LHS can be a field access expression. When
11232 dealing with reference, lhs_type is the promoted type of the
11233 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
11235 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
11236 (patch_binop): Use not_initialized_as_it_should_p where
11238 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
11239 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
11241 (resolve_type_during_patch): New function.
11242 (patch_cast): Call resolve_type_during_patch to resolve type and
11243 report error accordingly.
11244 (patch_array_ref): Use not_initialized_as_it_should_p where
11245 applicable. Array base expression is saved before being
11246 used. Promote the type of an array elements if it contains non
11248 (build_newarray_node, patch_newarray, build_this): New functions.
11250 Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
11252 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
11253 increment it in `for' statement.
11254 (print_field_info): If number is inf or nan, don't print it.
11255 (print_method_info): If method name is `delete', just ignore it.
11256 (print_c_decl): Special-case jstringArray.
11258 * gjavah.c (help): New function.
11259 (no_argument): New function.
11260 (usage): Changed text.
11261 (main): Rewrote argument handling. Now handles -v, --help,
11263 (version): New function.
11264 (found_error): New global.
11265 (main): Return found_error.
11266 (generate_access): Set found_error.
11267 (print_c_decl): Likewise.
11269 Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
11271 * gjavah.c (print_c_decl): Don't print "," when examining field.
11272 Skip type name when looking at "[L" types.
11273 (process_file): Now static.
11274 (generate_access): Now returns int.
11275 (last_access_generated): New global.
11276 (process_file): Clear last_access_generated; make multiple passes
11278 (print_field_info): Just return if generate_access returns true.
11279 (print_method_info): Likewise. Also, allow <init> functions to
11281 (print_c_decl): Added is_init argument. Print constructors
11283 (print_cxx_classname): Use UTF8_GET to extract characters from
11285 (print_base_classname): New function.
11286 (print_class_decls): New function.
11287 (process_file): Use it.
11288 (utf8_cmp): New function.
11290 Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
11292 * lang-options.h: Format changed to match changes in gcc/toplev.c
11293 to implement a --help option.
11295 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
11297 * decl.c (init_decl_processing): Revert change to dtable_type.
11299 Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
11301 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
11303 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
11305 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
11307 * lang.c (lang_init): Default flag_exceptions to 1, without
11308 checking to see if it's 2 first.
11310 Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
11312 * constants.c: Include "system.h".
11313 * decl.c: Likewise.
11314 * lang.c (flag_new_exceptions): Get via extern now.
11315 (lang_init_options): New functions. Turn on flag_new_exceptions.
11317 Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11319 * lex.c (java_lex): Return 0 when we see an invalid character in
11322 * lex.c (java_read_char): Specify extra argument when calling
11324 (java_read_unicode, java_parse_end_comment,
11325 java_parse_escape_sequence): Likewise,
11326 (java_lex): Specify extra argument when calling
11327 java_lex_error. Test that IDs are beginning with a legal character
11328 for IDs. Handle invalid characters with an error message and a
11329 call to java_lex_error.
11330 (java_lex_error): Adjust column position by new argument
11331 `forward'. Issue an error even if in the middle of reporting an
11334 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
11336 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
11337 we don't explicitly put a null pointer when we're copying it.
11339 Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
11341 * gjavah.c (print_cxx_classname): New function.
11342 (super_class_name): Likewise.
11343 (print_super_fields): Removed.
11344 (in_super): Removed.
11345 (print_field_info): Never generate #defines.
11346 (print_c_decl): Changed generated types to match JNI. No longer
11347 print class name before method name.
11348 (print_method_info): Print "static" before static methods.
11349 Print "virtual" before non-final methods.
11350 (usage): Use exit(1), not exit(-1).
11352 (print_field_info): Use %.17g to print a double.
11353 (last_access): New globals.
11354 (process_file): Initialize last_access.
11355 (usage): Now static.
11356 (ACC_VISIBILITY): New define.
11357 (generate_access): New function.
11358 (print_field_info): Call it.
11359 (print_method_info): Likewise. Also, generate information for all
11360 methods, not just native methods. Return void.
11361 (print_c_decl): Return void.
11362 (print_field_info): Return void.
11364 Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11366 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
11367 processing the jc1 grammar file. Prefix bison functions and
11368 variables with java_.
11369 (parse.c): Dependencies on parse.h and lex.h
11370 * expr.c (build_java_arrayaccess): Function now global.
11371 * java-tree.h: Comment reorganized to carry on previous
11372 classification effort.
11373 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
11374 RESOLVE_TYPE_NAME_P): New flags on WFLs.
11375 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
11376 java_parse (new prefix java_ generated by bison).
11377 (java_layout_parsed_class, java_register_parsed_class): Function
11379 (yyparse): Removed unnecessary call to init_outgoing_cpool.
11380 * lex.c (static tree wfl_op): Variable deleted.
11381 (java_init_lex): Initialize kw_super and kw_this. Initialize more
11382 ctxp fields to NULL_TREE.
11383 (java_lex): No longer create WFL for operators. Filename caching
11384 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
11385 created as STRING_CST and later expanded. Removed extra argument
11386 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
11388 (build_wfl_node): Removed code in comments.
11389 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
11390 store token and location data in the current bison token.
11391 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
11392 static/extern function declaration at the beginning of the file.
11393 (struct qualification): Data structure definition deleted.
11394 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
11395 (qualify_ambiguous_name): Function declaration modified. Function
11396 now returns nothing.
11397 (build_array_ref, patch_array_ref, make_qualified_name,
11398 resolve_qualified_expression_name, maybe_generate_clinit,
11399 resolve_field_access): New static function declarations.
11400 (build_java_arrayaccess): New extern function declaration.
11401 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
11402 (CALL_EXPR_PRIMARY): Macro deleted.
11403 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
11404 (struct parser_ctxt): Field initialized_final
11405 removed. non_static_initialized, static_initialized: New fields.
11406 * parse.y (static tree kw_super, static tree kw_this): New global
11408 (%union): tree wfl field of operator member replaced by int
11409 location. WFLs are non longer created for operators.
11410 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
11411 (qualified_name:): Now calls make_qualified_name to build the
11413 (type_declaration:): Consider generating <clinit> when class
11415 (variable_declarator:): Directly build an assignment node when the
11416 variable is initialized when declared.
11417 (this_or_super:): Build a WFL and set current location when THIS
11418 or SUPER are parsed.
11419 (expression_statement:): Wrap statement around a WFL.
11420 (primary_no_new_array:): Fixed typo. Changed value returned by
11421 THIS_TK because of its new type (temporary).
11422 (dim_exprs:): Temporary fix because of OSB_TK's new type.
11423 (field_access:): Build qualified name with SUPER.
11424 (method_invocation:): Fixed returned value because of SUPER's new
11426 (array_access:): Use OSB_TK location information.
11427 (post_increment_expression:, post_decrement_expression:,
11428 unary_expression:, pre_increment_expression:,
11429 pre_decrement_expression:, unary_expression_not_plus_minus:,
11430 cast_expression:, multiplicative_expression:,
11431 additive_expression:, shift_expression:, relational_expression:,
11432 equality_expression:, and_expression:, exclusive_or_expression:,
11433 inclusive_or_expression:, conditional_and_expression:,
11434 conditional_or_expression:, assignment:): Use new location/token
11435 information available on operators.
11436 (create_class): Set super_decl_type to NULL_TREE when processing
11438 (register_fields): Field initialization is now a MODIFY_EXPR
11439 node. Chain initialization code to the matching lists (according
11440 the the field declaration modifiers).
11441 (maybe_generate_clinit): New function.
11442 (method_header): Don't set method's DECL_NAME to a WFL when adding
11443 methods to java.lang.Object.
11444 (resolve_and_layout): Now can return NULL_TREE if the type
11445 resolution fails. Otherwise, return the class DECL instead of its
11447 (check_method_redefinition): Don't patch method DECL_NAME if it
11448 belongs to java.lang.Object.
11449 (process_imports): Simply assign error_found to the value returned
11450 by check_pkg_class_access.
11451 (declare_local_variables): Don't use their init statements (if
11452 any) when parsing error were previously found. Reuse MODIFY_EXPR
11453 build during parsing as an init statement.
11454 (java_method_add_stmt): Now return the current method body.
11455 (java_layout_parsed_class, java_register_parsed_class): Functions
11457 (java_complete_expand_methods): Initialize the constant pool on a
11458 per class basis. Layout the classes before expanding their method
11459 bodies. Don't try expand artificial constructor code if error were
11460 found. Make the classes data and register them if no error were
11462 (java_complete_expand_method): Retrieve an artificial constructor
11463 argument list before entering its body. Assign the top block to
11464 the artificial constructor function body and set types of declared
11465 blocks and compound statements to void. Walk method body if not an
11466 artificial constructor.
11467 (make_qualified_name, cut_identifier_in_qualified): New functions.
11468 (resolve_expression_name): Fixed comments. Save/restore the
11469 current class CLASS_LOADED_P flag value. Build non qualified
11470 static field access and handle qualified expression names.
11471 (resolve_field_access, resolve_qualified_expression_name): New
11473 (patch_method_invocation_stmt): Use the new expression resolution
11474 scheme, calling resolve_field_access when the function call is
11475 resolved as an expression.
11476 (qualify_ambiguous_name): Function rewritten to work on qualified
11477 expression produced by make_qualified_name.
11478 (java_complete_tree): Promote type when function's argument are
11479 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
11480 the assignment to discover further errors if RHS is a expression
11481 name that fails to evaluate. Declare LHS initialized even though
11482 the assignment failed. Don't use the location variable and removed
11483 extra argument in patch function calls. Now handle the ARRAY_REF
11484 case and build internal string representation when STRING_CSTs are
11486 (build_method_invocation): Don't wrap function call around a WFL.
11487 (build_assignment): Likewise. Use the operator location
11489 (patch_assignment): Handle array access LHSs. Handle error
11490 provenance, resulting in a better error report.
11491 (build_binop): Use op_location from operator as binop location
11493 (build_unaryop, build_incdec, build_cast): Likewise.
11494 (patch_binop): Extract location information from the node. Fixed
11495 typo in error message.
11496 (patch_unary_op): Extract location information from the node.
11497 (build_array_ref, patch_array_ref): New functions.
11499 Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
11501 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
11502 match _Jv_IsInstanceOf.
11503 * decl.c (init_decl_processing): Use _Jv_NewArray, not
11504 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
11506 Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
11508 * decl.c (init_decl_processing): Functions are now named
11509 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
11511 Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
11513 * java-tree.h (load_class): Add prototype.
11514 * class.c (is_compiled_class): Add missing arg to load_class.
11515 * expr.c (expand_java_NEW): Call load_class.
11516 * parse.y (process_import): Removed bogus use of void return value.
11518 Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
11520 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
11521 Function name is "_Jv_Throw" instead of "soft_athrow".
11522 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
11523 Function name is "_Jv_AllocObject" instead of "soft_new".
11524 Takes an extra parameter (object size).
11525 * expr.c: Update calls.
11527 Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
11529 * lex.c (java_get_line_col): Handle end-of-file.
11530 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
11532 Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
11534 * lang.c (lang_init): Make -fexceptions the default.
11535 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
11536 exception handling is not turned on.
11538 Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
11540 * lang.c (flag_new_exceptions): Make this this default.
11541 * decl.c (end_java_method): Call emit_handlers.
11542 * except.c (method_init_exceptions): Set language code and version.
11543 (expand_start_java_handler): Enable exception, and call
11544 expand_eh_region_start.
11545 (expand_end_java_handler): Enable exception, and set up catch blocks.
11546 (emit_handlers): New routine to generate the saved handlers.
11547 * java-except.h (emit_handlers): Add prototype.
11549 Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
11551 We used to have three different representations of the constant pool:
11552 the CPool structure, the tree_constant_pool, and the constructures
11553 used to build the Class object (which may need class and string
11554 constants) in compiled code. None were appropriate for compiling
11555 to .class files, so I did a major overhaul.
11557 First, the tree_constant_pool array was removed. Things were
11558 modified to the CPool structure in the JCF could be used.
11559 Second, a "capacity" field was added to the CPool, and functions
11560 written to search for a matching constant, adding one if not found.
11561 The code that generated the Class object was changed to use a CPool.
11562 The actual TREE_LISTs used to build the CONSTRUCTORs used for
11563 the static Class object are now only in build_constants_constructor.
11564 Finally, I wrote code which can generate a .class file (including its
11565 constant pool) from the RECORD_TYPE of a class. This is a big step
11566 on the way to compiling Java source into .class files.
11568 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
11569 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
11571 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
11572 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
11573 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
11574 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
11575 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
11576 (lang_type): Removed constant_pool field.
11577 * jcf.h (CPool): Renamed size to count. Added field capacity.
11578 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
11579 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
11580 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
11582 * constants.c (current_constant_pool_tags, current_constant_pool_data,
11583 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
11584 * constants.c (build_constants_constructor): Use new outgoing_cpool.
11585 (set_constant_entry, find_constant1, find_constant2,
11586 find_class_constant, count_constant_pool_bytes, write_constant_pool,
11587 find_utf8_constant, find_class_or_string_constant): New functions.
11589 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
11590 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
11591 (give_name_to_class, get_class_constant): Likewise.
11592 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
11593 (get_name_and_type_constant, get_ref_constant): Removed.
11594 * parse.h (parser_ctxt): Remove field tree_constant_pool.
11595 * parse.y: Don't save/restore tree_constant_pool.
11596 * verify.c (verify_jvm_instructions): Update for new approach.
11597 * expr.c (expand_invoke, expand_java_field_op): Likewise.
11599 * lang-options.h: Added -femit-class-file, -femit-class-files.
11600 * lang.c (flag_emit_class_files), java-tree.h: New flag.
11601 (lang_f_options): Added "emit-class-file(s)".
11603 * expr.c (build_java_arrayaccess): Generate more efficient array
11604 bounds checking, by using unsigned compare.
11606 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
11608 Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11610 * parse.h: New comment on the handling of unresolved type
11611 identifiers. JDEPs are now part of the jdep_code enum.
11612 (typedef struct jdep): Now use enum jdep_code or int, depending on
11613 availability. Both are narrowed down to an 8 bits bitfield.
11614 (CALL_EXPR_PRIMARY): Fixed comment.
11616 Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
11618 * Make-lang.in (java): Added gjavac and jvgenmain.
11619 (java.start.encap): Depend on gjavac.
11620 (java.rest.encap): Depend on jvgenmain.
11622 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
11623 (JAVA_CROSS_NAME): Likewise.
11624 (java.all.build): Depend on jvgenmain and gjavac.
11625 (java.all.cross): Depend on jvgenmain and gjavac-cross.
11626 (jvgenmain$(exeext)): New target.
11627 (java.install-common): Wrote.
11628 * config-lang.in (compilers, stagestuff): Added gjavac and
11631 Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
11633 * lang.c (lang_decode_option): New argc/argv interface.
11635 Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11637 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
11638 * decl.c (build_decl_no_layout): New function.
11639 * expr.c (java_lang_expand_expr): Layout declarations found in
11640 blocks before they're pushed.
11641 * jcf-parse.c (load_class): Save current line when parsing class
11643 (parse_source_file): Register class before expanding their
11645 * lang.c (put_decl_node): Produce `null' when `void *' is
11647 * lex.c (static tree wfl_op): New static global, for error report
11649 (java_init_lex): wfl_operator and wfl_op initialized
11650 here. Filename caching added for wfl_op. Return wfl_op when `(' is
11652 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
11653 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
11654 build_unresolved_array_type): New static function definitions.
11655 (build_decl_no_layout): New extern function declared.
11656 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
11657 faulty modifier exists.
11658 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
11659 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
11660 (UNARY_PLUS_EXPR): New fake operator.
11661 (struct parser_ctxt): New field osb_number.
11662 * parse.y (static tree wfl_operator): New static WFL for operator
11663 bound error messages.
11664 (DECR_TK, INCR_TK): Moved.
11665 (OP_TK): Tagged <operator>.
11666 (array_type:): Now call build_unresolved_array_type.
11667 (dim_expr:): Count the number of '[' seen.
11668 (post_increment_expression, post_decrement_expression,
11669 pre_increment_expression, pre_decrement_expression,
11670 unary_expression_not_plus_minus, unary_expression:): Actions are
11671 now building the corresponding unary expressions.
11672 (cast_expression:): Actions are now building cast expressions.
11673 (build_unresolved_array_type): New function.
11674 (create_interface): Reset the number of declared interfaces.
11675 (create_class): Likewise.
11676 (method_header): Methods declared within the scope of an interface
11677 are now implicitly set public and abstract.
11678 (java_complete_class): Variable's and parameter's type are patched
11679 with a promoted type.
11680 (declare_local_variables): Resolved non builtin types are promoted
11681 before being used to build a variable decl. Removed type patch
11682 posted on variable initialization statement.
11683 (source_start_java_method): Use build_decl_no_layout to build the
11684 decl of a parameter of incomplete type.
11685 (java_register_parsed_class): Process interfaces too. Call
11686 rest_of_decl_compilation on each processed class declarations.
11687 (java_complete_expand_methods): Don't attempt to expand things in
11689 (java_complete_tree): Process CONVERT_EXPR, even though it always
11690 has a type. Propagate error_mark_node to node's type too. Promote
11691 method's call argument type and return error_mark_node if
11692 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
11693 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
11694 handle unary operator nodes.
11695 (build_assignment): Added comment.
11696 (print_int_node): New function.
11697 (patch_assignment): New second argument. New error handling. Use
11698 print_int_node. Handle references. Use can_cast_to_p to issue
11699 different error message according to the context and check upon
11700 the initialization of the RHS.
11701 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
11702 (operator_string): Handle more operators.
11703 (patch_binop): No longer use a function static
11704 wfl_operator. Improved error message on shift distance.
11705 (build_unaryop, build_incdec, build_cast, patch_unaryop,
11706 patch_cast): New functions.
11708 Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
11710 * jvspec.c: New file.
11711 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
11713 * java-tree.h (identifier_subst): Add declaration.
11715 Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
11717 * jvgenmain.c (main): Generate call to JvRunMain.
11719 * class.c (make_class_data): Push value for "sync_info" field.
11720 * decl.c (init_decl_processing): Push "sync_info" field.
11722 Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
11724 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
11725 Java (source) name, not signature.
11726 Set TYPE_ALIGN to (at least) that of element_type.
11728 Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
11730 * class.c: Moved classname-mangling-rekated code to ...
11731 * mangle.c: ... this new file.
11732 * jvgenmain.c: New program (needs mangle.c) to generate main program.
11733 * Makefile.in: Update for above changes.
11735 Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11737 * expr.c (truthvalue_conversion): Convert integer and floating
11738 point value to their truth value.
11739 * lex.c (java_lex): Handle the `null' literal.
11740 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
11741 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
11742 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
11745 * parse.y: Reorganization/documentation on token declaration.
11746 (binop_lookup[]): New added new tree codes.
11747 (relational_expression): Build corresponding binary operators.
11748 (equality_expression, conditional_and_expression,
11749 conditional_or_expression): Likewise.
11750 (java_complete_class): Fix crash in debug message.
11751 (java_complete_tree): Check initialization of method call
11752 arguments. Further bogus node evaluation to detect more error
11753 during assignments. Handles more binary operators.
11754 (patch_assignment): Use DECL_P.
11755 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
11757 (operator_string): Handle more case. Compacted source.
11758 (patch_binop): Changed function comment. Checking for
11759 uninitialized first operand takes the compound assignment into
11760 account and uses DECL_P. Checking for uninitialized second operand
11761 delayed to routine's end. Use macros to issue type bound error
11762 messages and issue messages on both operands if their types are
11763 different. Force fixed type into node. Handle all binary
11766 Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11768 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
11769 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
11770 build operator node and return tokens.
11771 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
11772 * parse.h (java_complete_tree): Changed returned type in prototype.
11773 (build_method_invocation, build_assignment, patch_assignment,
11774 patch_binop): New static function declarations.
11775 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
11776 BUILD_EXPR_WFL): New macros.
11777 * parse.y (enum tree_code binop_lookup[]): New static for token to
11779 (%union): Parser union has new sub-structure `operator'.
11780 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
11781 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
11782 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
11783 ASSIGN_ANY_TK): Tokens tagged `operator'.
11784 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
11785 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
11786 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
11787 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
11788 (assignment_operator:): Rule tagged `operator'.
11789 (expression_statement:): Re-installed default rule.
11790 (method_invocation:): Sub rules call build_method_invocation.
11791 (postfix_expression:): Don't attempt to resolve name here. Just
11793 (multiplicative_expression:): Sub-rules build corresponding binop
11795 (additive_expression:, shift_expression:, and_expression:,
11796 exclusive_or_expression:, inclusive_or_expression:): Likewise.
11797 (assignment:): Sub rule invoke build_assignment.
11798 (assignment_operator:): Default rules on sub rules.
11799 (force_error): Added documentation on this variable.
11800 (declare_local_variables): Build initialization calling
11802 (expand_start_java_method): Removed unused rtx declaration. Mark
11803 arguments as already initialized.
11804 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
11805 (java_complete_expand_methods): Don't process next method if
11806 completion of the previous one triggered errors.
11807 (java_complete_expand_method): Call source_end_java_method if no
11808 error were found during completion.
11809 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
11810 locals declaratilon. Handle names found within a class. Return
11811 error_mark_node when things aren't found.
11812 (patch_method_invocation_stmt): Return error_mark_node on failures.
11813 (patch_invoke): Removed unused local. Return the correct node.
11814 (java_complete_tree): Now returns a value. The BLOCK section binds
11815 local identifiers and the type of a BLOCK is now void. Assign the
11816 result of operand completion on COMPOUND_EXPR. Assign the
11817 encapsulated node of a WFL to the result of its completion, except
11818 when the node is an identifier. Now handle MODIFY_EXPR and several
11819 binary operators. Return error_mark_node on errors.
11820 (build_method_invocation, build_assignment, patch_assignment,
11821 build_binop, operator_string, patch_binop): New functions.
11822 * typeck.c (binary_numeric_promotion): New function.
11824 Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
11826 * class.c (identifier_subst): New convenience wrapper for ident_subst.
11827 Replace most uses of ident_subst by identifier_subst.
11829 * class.c (push_class_static_dummy_field): Removed function.
11830 (build_class_ref): Find Class object decl by looking up "CNAME.class",
11831 instead of looking got "class" static field. Create that decl here.
11832 (class_identifier_node): Removed; no longer needed.
11833 (init_class_processing): Don't init class_identifier_node.
11834 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
11835 Do nreverse 0 times (instead of twice) for Object and Class.
11836 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
11838 Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
11840 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
11841 while initializing linenumber_count and linenumber_table.
11842 Do it before init_function_start (which calls emit_line_note).
11843 * expr.c (expand_byte_code): Don't need to clear lineno here.
11845 Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
11847 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
11848 then mangle number as _N_.
11850 * class.c (mangle_class_field): New function.
11851 (build_class_ref): Set assembler name of class reference using
11852 mangle_class_field.
11853 (push_class_static_dummy_field): Likewise.
11855 Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
11857 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
11858 of assigning to TREE_CODE. The latter method exploits a feature
11859 of GCC that is not ANSI compliant.
11861 Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11863 * decl.c (pushdecl_force_head): New function.
11864 (pushlevel): Removed conditional printf.
11865 (complete_start_java_method): Don't enter local variable scope if
11866 function is compiled from source code.
11867 * expr.c: parse.h now included
11868 (java_lang_expand_expr): New function.
11869 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
11870 printf. Terminate buffer when doing directories.
11871 * jcf-parse.c (parse_source_file): Call lang_init_source before
11872 parsing and before code generation.
11873 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
11874 use printf if the macro is defined.
11875 * lang.c (lang_init): Install lang_expand_expr hook on
11876 java_lang_expand_expr.
11877 (java_dummy_print): New function.
11878 (lang_init_source): New function.
11879 * lex.c (java_lex): Remember location of an opening brace at the
11880 second nesting level.
11881 (java_is_eol): Unget character seen after a CR if it is EOF.
11882 * parse.h: Now includes lex.h
11883 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
11884 printf if the macro is defined.
11885 (expand_start_java_method, build_expr_block, enter_block,
11886 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
11887 New static function declarations.
11888 (pushdecl_force_head): New extern function declaration.
11889 (INCOMPLETE_TYPE_P): New macro.
11890 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
11891 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
11892 BLOCK_EXPR_ORIGIN): New macros.
11893 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
11894 DECL_SOURCE_LINE_LAST): New macros.
11895 (struct parser_ctxt): Removed field current_method_decl, redundant
11896 with the field current_function_decl. Added fields
11897 first_ccb_indent1 and pending_block.
11898 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
11899 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
11901 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
11902 (compilation_unit:): Cosmetic on sub rule.
11903 (type_declaration:): Cosmetic on sub rules. Added an error rule.
11904 (variable_initializer:): Installed default rule on expression:.
11905 (method_declaration:): method_header: starts a new
11906 method. method_body: installs the function body, absorbs blocks
11907 emitted for temporary variable scopings, pops function's body block
11908 and merges function's last statement lineno in DECL_SOURCE_LINE.
11909 (method_body:): Installed default rules.
11910 (block:): Call enter_block when an opening brace is seen. Absorb
11911 scoping blocks and call exit_block when a closing brace is seen.
11912 (block_statement:): Cosmetic changes.
11913 (method_invocation:): Create WFL around CALL_EXPR node.
11914 (patch_stage): Added comment around definition.
11915 (method_header): Try to use first_ccb_indent1 as the first line of
11916 the method, so BP debug info are emitted at the first opening
11917 brace of the function. If the function has no body, use the
11918 location of the function's name. Override currently defined method
11919 name with the matching WFL so we can point redefinition errors
11920 using the location where the function's name was declared.
11921 (check_abstract_method_header): Interprets DECL_NAME as an
11922 identifier or as a WFL, accordingly.
11923 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
11924 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
11925 location and name information out of it and reinstall DECL_NAME to
11926 its original identifier node value.
11927 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
11928 function's source code).
11929 (read_import_dir): Test the value returned by find_class and issue
11930 a fatal accordingly.
11931 (declare_local_variables): Push a new block for the scope of the
11932 new variable(s) if code has been already generated at that nesting
11933 level. Pinpoint redefinition errors using the variable id
11934 WFLs. Generate initialization code if necessary. If the variable
11935 type is incomplete, register a patch on its decl.
11936 (source_start_java_method): Rewritten. Define a new block for the
11937 function's parameters. Build parameter decl out of function's
11938 arguments and register them for a patch if their types are
11940 (expand_start_java_method): Includes the part of
11941 source_start_java_method that was pushing the parameter decls and
11942 completing the method start code.
11943 (source_end_java_method): Removed call the expand_end_bindings and
11944 poplevel (already taken care of). Reinstall function's arguments
11945 and get function's last line of code before calling
11946 expand_function_end.
11947 (java_method_add_stmt): New comment before the function's
11948 code. Complement the second operand of the current COMPOUND_EXPR
11950 (java_complete_expand_methods): Don't generate debug info on line
11951 zero when expanding a generated constructor.
11952 (java_complete_expand_method): Set start and end line numbers for
11953 a artificially generated constructor to one and manually call
11954 enter_block and exit_block when defining it. For all methods:
11955 expand function's start calling the new expand_start_java_method
11956 and invoke java_complete_tree on the effective method's body, if
11958 (resolve_expression_name): Now use lookup_name_in_blocks to search
11959 local variable decls and print out an error when variables are
11961 (patch_method_invocation_stmt): Inserted comment before the
11963 (lookup_method_invoke): Chain method's arguments using chainon
11964 with the current arg list as a second argument. Inserted missing
11965 IDENTIFIER_POINTER when reporting an error on methods not found.
11966 (refine_accessible_methods_list): Don't retain constructors.
11967 (patch_arguments): Function removed.
11968 (java_complete_tree): Inserted comment before the function's
11969 code. New case for BLOCKs. Moved the WFL case a bit
11970 further. Complete function's arguments.
11971 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
11972 maybe_absorb_scoping_blocks): New functions.
11974 Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
11976 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
11978 * jcf-parse.c (parse_source_file, java_error_count): New forward
11979 and extern declarations.
11980 (java_parse_abort_on_error): Macro moved.
11981 (jcf_parse_source): fatal called if fopen fails. Now calls
11983 (parse_source_file): New parse_only parameter. Reflects the
11984 elimination of the second pass.
11985 (yyparse): parse_source_file called with argument set to 0.
11986 * jcf.h (JCF_ZERO): Sets java_source to zero.
11987 * lex.c (java_init_lex): pass argument is gone. Function modified
11988 to be called once during the analysis of a file.
11989 (java_unget_unicode): Fixed typo in fatal message.
11990 (java_get_line_col): Likewise.
11991 (java_lval): Likewise. String literals no longer built during
11993 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
11995 * parse.h (MODIFIER_WFL): New macro.
11996 (parse_check_super, parser_check_super_interface): Now return int.
11997 (parser_chain_incomplete_item, not_builtin_p,
11998 complete_method_decl): Declarations removed.
11999 (build_method_invocation_stmt, build_invoke): Renamed using the
12000 `patch' instead of `build'
12001 (register-incomplete_type, obtain_incomplete_type,
12002 java_complete_tree, java_complete_expand_method,
12003 unresolved_type_p, create_jdep_list): New function declarations.
12004 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
12005 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
12006 (jdep): New typedef on new struct _jdep.
12007 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
12008 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
12009 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
12010 JDEP_RESOLVED_P): New macros.
12011 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
12012 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
12013 JDEP_VARIABLE): New enum values and jdep kinds.
12014 (jdeplist): New typedef on struct _jdeplist.
12015 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
12017 (CALL_EXPR_PRIMARY): New macro.
12018 (struct parser_ctxt): Fields java_pass, current_method_decl,
12019 method_decl_list deleted. New field jdeplist.
12020 (INCOMPLETE_P): Macro deleted.
12021 * parse.y (single_type_import_declaration:): Removed pass switch.
12022 (type_import_on_demand_declaration): Likewise.
12023 (field_declaration:): Removed pass switch on all sub rules.
12024 (class_declaration:): Call the complete_class_decl removed on
12026 (method_declaration:): Removed second pass switch. No longer chain
12027 methods decl when method_header reduced.
12028 (method_header:): Sub rules no longer depend on pass switch.
12029 (method_declarator:): Likewise.
12030 (method_body:): Likewise.
12031 (abstract_method_declaration:): Likewise.
12032 (block_statement:): Likewise.
12033 (local_variable_declaration:): Likewise.
12034 (argument_list:): Likewise.
12035 (method_invocation:): Likewise. Call to build_method_invocation_stmt
12036 removed. Partial CLASS_EXPR tree node built instead.
12037 (postfix_expression:): Removed pass switch on all sub rules.
12038 (java_pop_parser_context): Free classd_list content.
12039 (yyerror): Call obstrack_grow0 to finalize error message.
12040 (check_class_interface_creation): Comment modified to reflect new
12041 returned value meaning. Removed second pass switch. Return 1 if an
12042 error was found, 0 otherwise. Adjust pointer on filename if a
12043 leading path separator was found.
12044 (maybe_create_class_interface_decl): Removed first pass switch
12045 when linking the class decl to the class_list. Install a new
12046 jdep_list for the class.
12047 (add_superinterfaces): List of unresolved interfaces is
12048 gone. Unresolved interfaces are directly added to the current
12050 (create_interface): Second pass shortcut removed.
12051 ctpx->modifier_ctx access through MODIFIER_WFL.
12052 (create_class): Second pass shortcut removed. Call to
12053 register_incomplete_type replaces the call to
12054 parser_chain_incomplete_item.
12055 (complete_class_decl): Function removed.
12056 (duplicate_declaration_error): New way of retrieving redeclared
12058 (register_fields): Call to lookup_modifier_cl replaced by
12059 MODIFIER_WFL. New way of handling unresolved type, using
12060 unresolved_type_p and obtain_incomplete_type.
12061 register_incomplete_type replaces call to parser_chain_incomplete_item.
12062 (patch_stage): New static global variable.
12063 (method_header): New way of handling unresolved type, using
12064 unresolved_type_p and obtain_incomplete_type. patch_stage used to
12065 indicates that the method decl needs to be patched.
12066 (check_abstract_method_header): Call to lookup_modifier_cl
12067 replaced by MODIFIER_WFL.
12068 (method_declarator): Incomplete argument type are registered
12069 calling register_incomplete_type. Patch on the declared method is
12070 issued in that case.
12071 (unresolved_type_p): New function.
12072 (parser_check_super_interface): New comment to reflect function's
12073 modified returned type (int). Function and has a new argument
12074 this_wfl. Call to parse_error_context uses this_wfl instead of
12075 relying on lookup_cl.
12076 (parser_check_super): Comment reflects function's new returned
12077 type (int). Function returns non zero value on error.
12078 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
12079 register_incomplete_type, jdep_resolve_class): New functions to
12080 handle incomplete types in declarations.
12081 (java_complete_class): Rewritten to work with the new incomplete
12082 type handling scheme.
12083 (complete_class_report_errors): Likewise.
12084 (complete_method_decl): Removed: it jobs is now handled by
12085 java_complete_class.
12086 (do_resolve_class): Class loaded in not already loaded and not
12087 found in Java source code.
12088 (java_check_regular_methods, java_check_abstract_methods): Don't
12089 call complete_method_decl anymore.
12090 (lookup_modifier_cl, not_builtin_p): Functions deleted.
12091 (read_import_dir): Got rid of the pass number dependency.
12092 (declare_local_variables): New handling of unresolved types (patch
12094 (source_start_java_method): New parameter level. Function called
12095 with level set to 1 when argument types are potentially
12096 unresolved. Called to complete the job with level set to 2 once
12097 types are complete.
12098 (source_end_java_method): Call to permanent_allocation
12099 removed. Waiting to be replaced by a more suitable obstack
12101 (java_complete_expand_methods, java_complete_expand_method,
12102 java_expand_finals): New functions.
12103 (build_method_invocation_stmt): Renamed
12104 patch_method_invocation_stmt. Extracts function call expression
12105 (wfl) and arguments (args) from CALL_EXPR tree operands.
12106 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
12107 call. Patch the function and argument operand of the CALL_EXPR
12109 (patch_argument, java_complete_tree): New functions.
12111 Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
12113 Recover from missing fields and methods (i.e. error instead of fatal).
12114 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
12115 * expr.c (expand_invoke): Recover from missing method.
12116 (expand_java_field_op): Recover from missing field.
12117 Inline references to java.lang.{Integer,Char,...}.TYPE.
12118 * typeck.c (get_type_from_signature), java-tree.h: New function.
12119 * class.c (add_method): Use get_type_from_signature.
12120 (build_class_ref): Handle a class that was not found.
12121 * typeck.c (convert): Handle conversion to pointers (for convenience).
12122 * verify.c (verify_jvm_instructions): Use get_type_from_signature
12123 instead of lookup_field to handle missing fields.
12125 * jcf-parse.c (process_zip_dir): Set java_source.
12127 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
12129 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
12131 Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12133 * jcf-parse.c (load_class): Don't change input_filename before
12134 calling jcf_parse_source (but still do it before calling
12136 (jcf_parse_source): Assign input_filename after having saved the
12138 * lex.c (java_init_lex): Chain a WFL node to the import on demand
12139 list. ctxp->modifier_ctx zeroed according to its new
12140 definition. ctxp->filename initialized. Removed
12141 JAVA_MODIFIER_CTX_UNMARK.
12142 (java_unget_unicode): Update the character based column position.
12143 (java_allocate_new_line): ref_count not used anymore. Always free
12144 ctxp->p_line. Initialize c_line->char_col to 0.
12145 (java_get_unicode): Update the character based column position.
12146 (java_lex): Use ctxp->elc to store current position in source
12147 file, at the beginning of the parsed token. Set modifier_ctx entry
12148 corresponding to the parse modifier to a WFL node. Return a WFL
12149 node when an identifier is parsed.
12150 (java_lex_error): Now uses ctxp->elc to store current position in
12152 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
12153 * lex.h (build_wfl_node): New function definitions.
12154 (struct java_line): ref_count and next fields are gone. New field
12156 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
12157 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
12158 (JAVA_COLUMN_DELTA): New macro.
12159 (java_lc): New typedef on new struct _java_lc.
12160 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
12161 (parse_error_context, parse_warning_context): Changed prototypes.
12162 (java_get_line_col): Added as an available global function.
12163 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
12164 (IC_DECL): Replaced by macro IC_TYPE
12165 (DEPEND_WFL): New macro.
12166 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
12168 (exit_java_complete_class): Removed a commented out statement.
12169 (struct parser_ctxt): Added comments on fields. modifier_ctx is
12170 now an array of tree nodes. Deleted fields line_list and
12171 e_line. New field elc, to replace e_line.
12172 * parse.y (array_type:): Build WFL node.
12173 (qualified_name:): Build a single WFL node out of two. Retain
12174 the location information of the first node in the resulting node.
12175 (package_declaration:): Use package name as a WFL node
12176 (single_type_import_declaration:): Use imported name as a WFL node.
12177 (type_import_on_demand_declaration:): Use root of the imported
12178 packages as a WFL node.
12179 (field_declaration:): Removed unused local variable cl.
12180 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
12181 (yyerror): New static elc. Removed static error_line, error_pos.
12182 New local code_from_source. Save ctxp->elc into elc at the first
12183 pass. Call java_get_line_col to get a string of the line where
12184 the error occurred.
12185 (debug_line): Removed static function.
12186 (parse_error_context, parse_warning_context): Parameter cl is now
12187 a WFL node. Use its value to initialize ctxp->elc.
12188 (redefinition_error): Parameter cl is now a WFL node.
12189 (parse_add_interface): New parameter wfl. No longer call
12190 lookup_cl, use wfl instead.
12191 (check_class_interface_creation): Parameter cl is now a WFL node.
12192 (maybe_create_class_interface_decl): Likewise.
12193 (add_superinterfaces): New function.
12194 (create_interface): Removed local cl, node, super_decl,
12195 super_decl_type. Function now uses id as a WFL node. Better
12196 warning/error report on obsolete or forbidden mix of
12197 modifiers. Now calls add_superinterfaces to register interfaces.
12198 (create_class): Removed local cl, node. Local variable id is used
12199 as a WFL node. Better error report on forbidden modifier
12200 mix. Uses add_superinterfaces to register interfaces.
12201 (find_field): Argument cl is now a WFL node. Now store the WFL
12202 node of a fields that needs to be checked for their
12204 (method_header): Local variable node non longer used. Local
12205 variable id replaces cl.
12206 (check_modifiers_consistency): Local variable cl is now a WFL
12208 (method_declarator): Local variable cl replaced by parameter id.
12209 (parser_qualified_name): Now uses parameter name as a WFL node.
12210 (parser_check_super_interface): New parameter wfl, for achieve
12211 greater accuracy during error reports.
12212 (parser_chain_incomplete_item): New parameter named location. Used,
12213 along the decl, to construct the incomplete item node.
12214 (java_complete_class): resolve_class now uses WFL node extracted
12215 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
12217 (complete_method_decl): Unresolved function's argument types are WFL.
12218 (resolve_class): Parameter cl is now a WFL node.
12219 (resolve_and_layout): Likewise.
12220 (do_resolve_class): Likewise. Try first to use cl and then do the
12221 lookup on the decl when calling check_pkg_class_access.
12222 (complete_class_report_errors): Use IC_TYPE in place of
12223 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
12224 instead of doing a lookup over the decl.
12225 (java_check_final): Use WFL info from field tree list.
12226 (lookup_cl): Rewritten and returns a statically defined WFL node.
12227 (lookup_modifier_cl): Now uses information from WFL nodes.
12228 (process_imports): Likewise.
12229 (read_import_dir): name and cl arguments replaced by a single WFL
12230 node. Function modified accordingly.
12231 (find_in_imports_on_demand): Now uses WFL node.
12232 (check_pkg_class_access): cl argument is now a WFL node.
12233 (declare_local_variables): Fixed to use WFL nodes.
12234 (resolve_expression_name): Likewise.
12235 (build_method_invocation_stmt): name_combo argument renamed
12236 wfl. Function modified to use WFL nodes.
12237 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
12238 (lookup_method_invoke): cl is now a WFL node. Added missing
12239 IDENTIFIER_POINTER to class type decl name.
12241 Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
12243 * lang.c (init_parse): Now returns char* containing the filename.
12245 Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
12247 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
12249 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
12250 * class.c (make_class_data): If flag_assume_compiled, initial class
12251 state is CSTATE_PREPARED; make superclass and interfaces direct
12252 references, rather than constant pool indexes.
12254 Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12256 * parser.y: Include flags.h. Removed debug variable pl.
12257 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
12258 (block:): Likewise.
12259 (labeled_statement_nsi:): Generate debug info when reducing
12260 expression_statement:.
12261 (check_pkg_class_access): get_access_flags_from_decl invokation
12262 fixed for new CLASS_* flags location.
12263 (source_end_java_method): Save/restore parser context when
12264 entering/leaving this routine. Restore lineno to its right value
12265 before calling expand_end_bindings.
12266 (build_method_invocation_stmt): build_invoke called with the
12267 current line information.
12268 (build_invoke): New argument cl. Wrap the function call around a
12270 (refine_accessible_methods_list): Changed comment, removed
12272 * parse.h: Fixed typo in comments.
12273 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
12274 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
12275 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
12277 * lex.c (java_lex): Record the last closing curly bracket of a
12279 * jcf-parse.c (jcf_parse_source): Now calls
12280 java_check_methods. Clarified comment, fixed typo.
12282 1998-04-09 Dave Brolley <brolley@cygnus.com>
12284 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
12285 (finish_parse): Expose for non USE_CPPLIB builds.
12287 Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
12289 * lang.c (lang_print_xnode): New function.
12291 Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
12293 * decl.c (class_dtable_decl), java-tree.h: New tree node.
12294 * class.c (get_dispatch_vector, get_dispatch_table): New functions
12295 used to build a class's dispatch table.
12296 (make_class_data): Generate dispatch table if flag_assume_compiled.
12297 Set dtable of class object to address of class_dtable_decl.
12299 * decl.c (int_decl_processing): Make soft_badarrayindex_node
12300 be volatile and have side effects - generates better code.
12302 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
12303 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
12305 * expr.c (expand_invoke): If class is final, method is
12306 effectively final, so can call it directly.
12308 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
12310 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
12312 Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12314 * parse.y (build_method_invocation_stmt): Removed extra argument
12317 Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12319 * expr.c (dtable_indent): Now static global.
12320 (expand_invoke): Now call invoke_build_dtable and
12321 build_invokevirtual.
12322 (invoke_build_dtable, build_invokevirtual): New functions.
12323 * jcf-io.c (find_class): Defer issuing a warning by setting
12324 jcf->outofsynch to 1.
12325 * jcf-parse.c (jcf_out_of_synch): New function.
12326 (load_class): Test this_jcf.outofsynch flag and call
12327 jcf_out_of_synch accordingly.
12328 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
12329 comment indentation.
12330 * lex.c (java_get_unicode): Fixed code indentation.
12331 (java_lex): Create string literal. Fixed typo. Removed several
12332 premature obstack_free.
12333 * parse.h: New enums for name resolution and invocation mode.
12334 (struct qualification): New data structure.
12335 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
12336 (do_resolve_class, build_method_invocation_stmt,
12337 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
12338 debug_line, identical_subpath_p, invocation_mode,
12339 refine_accessible_methods_list, build_invoke,
12340 lookup_method_invoke): New functions declared.
12341 (build_invokevirtual, invoke_build_dtable, match_java_method,
12342 build_field_ref, jcf_out_of_synch): New references to external
12344 (struct parse_ctxt): Removed artificial_constructor field.
12345 * parse.y: (array_type:): Type defined for this rule.
12346 (class_type:): Installed default rule for interface_type:.
12347 (array_type:): Now build Java array type.
12348 (qualified_name:): Now use obstack_grow0.
12349 (method_declaration:): Skip the artificial constructor added to
12351 (abstract_method_declaration:): Execute the code only during pass 1.
12352 (block:): Installed default rule in block_statements:.
12353 (block_statement:): Add the statement to the method during pass 2.
12354 (statement_expression): Installed default rule for
12355 method_invocation:.
12356 (argument_list:): Added code to build the argument list.
12357 (method_invocation:): Added call to create the method invocation
12359 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
12360 (debug_line): New function for debug.
12361 (complete_class_decl): No longer do something during pass 1.
12362 (method_header): Use BUILD_PTR_FROM_NAME.
12363 (parser_qualified_classname): Use obstack_grow0. Removed bogus
12365 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
12366 function's main comment.
12367 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
12369 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
12370 (resolve_class): Now works with arrays.
12371 (do_resolve_class, resolve_and_layout): New functions.
12372 (java_check_regular_methods): Reverse method list before and after
12373 having processed it. No longer set ctxp->artificial_constructor.
12374 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
12375 accordingly. Fixed typo in issued error message. Now use
12377 (find_in_imports_on_demand): Now use obstack_grow0.
12378 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
12379 (source_end_java_method): Call expand_expr_stmt instead of
12380 expand_expr. Calls it before calling expand_function_end.
12381 (java_method_add_stmt): Do nothing if errors were found during
12383 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
12384 (build_method_invocation_stmt, build_invoke, invocation_mode,
12385 lookup_method_invoke, refine_accessible_methods_list,
12386 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
12388 * typeck.c (build_java_signature): Properly end method signature
12389 if return type skipped.
12390 (match_java_method): New function.
12392 Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
12394 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
12396 Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12398 * expr.c (build_invoke_non_interface): New function.
12399 (methods_ident, ncode_ident): Now static globals.
12400 (expand_invoke): Use build_invoke_non_interface.
12401 * java-tree.h (struct lang_decl): New field function_decl_body.
12402 (DECL_FUNCTION_BODY): New macro.
12403 * jcf-parse.c (jcf_parse_source): Deeper check before setting
12404 CLASS_FROM_SOURCE_P.
12405 (parse_source_file): Fixed typos. Call java_layout_parsed_class
12406 before starting pass 2. Call to java_generate_parsed_class replaced
12407 by java_register_parsed_class.
12408 * lex.c: Fixed typo in header. Some line width related formating.
12409 * lex.h: Some line width related formating.
12410 * parse.h (source_end_java_method, resolve_expression_name,
12411 complete_class_decl, maybe_create_class_interface_decl,
12412 check_class_interface_creation): New static function declarations.
12413 (java_layout_parsed_class, java_method_add_stmt): New function
12415 (struct parser_ctxt): Field mark_class_generate removed. New
12416 fields class_list and artificial_constructor.
12417 * parse.y: Fixed typo in header.
12418 (class_declaration:): Call complete_class_decl when class body
12420 (method_declaration:): Call source_end_java_method in pass 2 when
12421 the method body is defined.
12422 (postfix_expression:): Do expression name resolution on sub-rule
12423 name during pass 2.
12424 (create_class, create_interface): Merged common pieces.
12425 (check_class_interface_creation, maybe_create_class_interface_decl):
12427 (complete_class_decl): New function.
12428 (register_fields): Fixed line width related typo.
12429 (method_header): Correctly skip first argument when fixing
12430 argument line. Changed the loop.
12431 (java_check_circular_reference): Now use ctxp->class_list.
12432 (java_complete_class): Removed start/stop marking.
12433 (java_check_regular_methods): Now takes a class decl as an
12434 argument. Add default constructor if none were encountered.
12435 (java_check_methods): Now use ctxp->class_list. Changed call to
12436 java_check_regular_methods.
12437 (source_start_java_method): Set DECL_ARG_TYPE for each function
12439 (source_end_java_method, java_method_add_stmt): New functions.
12440 (java_generate_parsed_class): No longer exists.
12441 (java_layout_parsed_class, java_register_parsed_class): New functions.
12442 (resolve_expression_name): New function.
12444 Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12446 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
12447 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
12448 until pass initializations are done. Call read_import_dir with
12450 * parse.h: (lookup_modifier_cl): New function declared.
12451 (INTERFACE_FIELD_MODIFIERS): New macro.
12452 (OBSOLETE_MODIFIER_WARNING): New macro.
12453 * parse.y: (register_fields): Class type and current field name in
12454 local variables. Check modifier(s) if adding field(s) to an interface.
12455 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
12456 and report errors using the faulty modifier line context.
12457 (lookup_modifier_cl): New function.
12458 (read_import_dir): Detect and report default import processing
12461 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
12463 Add a pair of -fassume-compiled/-fno-assume-compiled options.
12464 * class.c (is_compiled_class): Return 1 after making sure it
12465 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
12466 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
12467 * java-tree.h (flag_assume_compiled): Add decl.
12468 * lang.c (lang_f_options): Add the flag.
12469 (flag_assume_compiled): Add decl, default to 0.
12471 Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
12473 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
12474 (is_compiled_class): Likewise.
12475 (layout_class): Likewise.
12476 (layout_class): Detect and lay out classes defined in source code.
12477 (interface_of_p, add_interface_do, may_add_interface): New
12479 (add_interface): Now use add_interface_do.
12480 (add_method_1): New function.
12481 (add_method): Now use add_method_1.
12482 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
12483 (complete_start_java_method): New function.
12484 (start_java_mehod): Now call complete_start_java_method.
12485 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
12486 (expand_invoke): Likewise and fixed typo.
12487 *gjava.c: (print_super_field): Use new argument to find_class
12490 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
12491 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
12492 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
12494 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
12495 (add_method_1, push_class): New prototypes.
12496 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
12497 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
12498 directory where the class was found.
12499 (find_class): New argument DO_CLASS_FILE. Function find_class
12500 modified accordingly.
12501 *jcf-parse.c: (fix_class_path): New function.
12502 (load_class): Use new VERBOSE argument. load_class now finds and
12503 loads/parses .class/.java files. Save read_state of current_jcf
12505 (java_parser_abort_on_error): New macro.
12506 (jcf_parse_source, parse_source_file): New function.
12507 (jcf_parse): Fixed typo.
12508 (yyparse): Call parse_source_file () only.
12509 (process_zip_dir): Fixed typo, fix zdir->filename_length when
12510 writing the real class name back in the zip directory entry.
12511 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
12512 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
12513 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
12514 (find_class): Prototype fixed.
12515 *lex.c: Added 1998 time stamp.
12516 Removed all static global variables, moved into the parser
12517 context data structure.. Now include unistd.h if SEEK_SET not
12519 (java_init_lex): Rewritten.
12520 (java_sneak_unicode): Modified current unicode access in current line.
12521 (java_unget_unicode): Likewise.
12522 (java_allocate_new_line): New allocation management.
12523 (java_read_char): Modified access and storage of unget_utf8_value.
12524 New way of processing current unicode.
12525 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
12526 (java_get_unicode): Now use the parser context.
12527 (java_lineterminator): Likewise.
12528 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
12529 of the reentrant parser implementation. Function now use the
12530 parser context data structure and java_lval. Fixed production of
12531 the float and double constant "out of range" error message. Fixed
12532 obstack use. Return integer value when hitting a modifier. Now
12533 return type for TRUE, FALSE and other predefined types. Return
12534 identifier as a TREE_LIST list containing the current line context
12535 as the TREE_VALUE sub-node.
12536 (java_unicode_2_utf8): Fixed typo in declaration.
12537 (java_lex_error): Now use the parser context data structure.
12538 *lex.h: Added 1998 time stamp.
12539 (struct java_line): New fields ref_count and next.
12540 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
12541 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
12542 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
12543 *parse.h: Added 1998 time stamp.
12544 (java_parse_source_file): Renamed from parse_source_file.
12545 (YYERROR_NOW, YYNOT_TWICE): Fixed.
12546 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
12547 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
12548 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
12549 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
12550 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
12551 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
12552 (struct parser_ctxt): New data structure to keep the parser context.
12553 *parse.y: Added 1998 time stamp, got rid of static global variables.
12554 (java_error_count, ctxp): New global variables.
12555 (%union): New value field.
12556 (numeric_type, integral_type): Rules removed.
12557 (primitive_type): Rule defined to handle integral, float, double and
12559 (qualified_name, package_declaration,
12560 single_type_import_declaration, type_import_on_demand_declaration,
12561 modifiers, class_declaration, super, interfaces,
12562 interface_type_list, class_body, field_declaration,
12563 field_declaration, variable_declarators, variable_declarator,
12564 variable_declarator_id, method_declaration, method_header,
12565 formal_parameter_list, formal_parameter, method_body, block,
12566 static, interface_declaration, extends_interfaces,
12567 abstract_method_declaration, local_variable_declarators): Rules now
12569 (force_error, do_warning): New global statics.
12570 (push_parser_context, parser_context_save_global,
12571 parser_context_restore_global, pop_parser_context): New functions.
12572 (yyerror): Now uses the global parser context. Fixed use of obstack.
12573 (parse_error, parse_error_context, parse_warning_context,
12574 java_accstring_lookup, redefinition_error, check_modifiers,
12575 parser_add_interface, create_interface, create_class, find_field,
12576 duplicate_declaration_error, register_fields, method_header,
12577 check_modifiers_consistency, check_abstract_method_header,
12578 method_declarator, parser_qualified_classname,
12579 parser_check_super_interface, parser_check_super,
12580 parser_chain_incomplete_item, java_check_circular_reference,
12581 layout_class_from_source, java_complete_class,
12582 complete_method_decl, resolve_class, complete_class_report_errors,
12583 java_check_final, check_method_redefinition,
12584 java_check_regular_methods, java_check_abstract_methods,
12585 java_check_methods, lookup_java_interface_method2,
12586 lookup_java_method2, lookup_cl, find_name_in_single_imports,
12587 process_imports, find_in_imports, read_import_entry,
12588 read_import_dir, find_in_imports_on_demand,
12589 check_pkg_class_access, not_builtin_p, declare_local_variables,
12590 source_start_java_method, java_generate_parsed_class): New
12592 *typeck.c: (signature_include_return): New global variable.
12593 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
12594 to add the function returned type in the signature.
12596 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
12598 * jcf-io.c (open_in_zip): Use strncmp and LEN.
12600 Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
12602 * Make-lang.in (java.info): Added.
12603 (java.install-info): Added
12605 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
12607 * Makefile.in (clean): Also remove java/parse.c.
12609 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
12611 Add a pair of -fbounds-check/-fno-bounds-check options.
12612 * lang.c (lang_decode_option): Add code to grok arguments.
12613 (flag_bounds_check): Add decl.
12614 (lang_f_options): New array w/ the option in it.
12615 * java-tree.h (flag_bounds_check): Add decl.
12616 * lang-options.h: New file.
12617 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
12618 of a static macro value.
12619 (JAVA_ARRAY_EXCEPTION): Delete macro.
12621 Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
12623 * typeck.c (build_java_array_type): Fix two bugs in previous change.
12624 * expr.c (build_anewarray): Add missing promote_type.
12626 Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
12628 Add array types with known length to optimize bounds checking.
12629 * typeck.c (build_java_array_type): Take length parameter.
12630 (java_array_type_length, build_prim_array_type): New functions.
12631 * java-tree.h: Update for new functions.
12632 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
12633 * class.c: Use build_prim_array_type.
12634 * expr.c (can_widen_reference_to): Handle known-length array types.
12635 (verify_jvm_instructions): Keep track of integer push instructions
12636 followed by newarray/anewarray, so we can build known-length arrays.
12637 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
12638 (java_array_data_offset): New function.
12639 (build_java_array_length_access): New function. Optimize if constant.
12640 (build_java_arrayaccess): Constant fold bounds check.
12641 (expand_java_newarray, expand_java_anewarray): Replaced by ...
12642 (build_newarray, build_anewarray): New functions.
12643 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
12644 * verify.c (merge_types): Handle known-lengh array types.
12646 Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
12648 * expr.c (expand_byte_code): Fix performace bug, which caused
12649 searching linenumber_table to be linear rather than constant.
12651 Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
12653 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
12655 * decl.c, java-tree.h (soft_fmod_node): New global.
12656 * decl.c (init_decl_processing): Define __builtin_fmod.
12657 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
12658 using __builtin_fmod.
12660 Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12662 * keyword.h: New file, output of keyword.gperf as processed by
12664 * lex.c (java_lex_init): Initialize java_error_flag.
12665 * parse.c (YYERROR_NOW): Uses java_error_flag.
12666 * parse.y: New static java_error_flag. Useless definition of
12668 * parse.y (java_error): Portable error recovery using
12669 java_error_flag (not yet completely tuned).
12671 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
12673 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
12675 Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12677 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
12678 (parse.c, lex.c, keyword.h): New rules for Java source code
12680 * parse.c: Renamed into jcf-parse.c.
12681 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
12682 * keyword.gperf: New file, Java keywords.
12683 * parse.y: New file, Java language grammar.
12684 * parse.h: New file, Java language grammar definitions.
12685 * lex.c: New file, Java language lexer.
12686 * lex.h: New file, Java language lexer definitions.
12688 Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
12690 * decl.c (clinit_identifier_node), java-tree.h: New global.
12691 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
12692 * verify.c (verify_jvm_instructions): Inline use of removed macros.
12693 * expr.c (expand_java_field_op): Check for invalid assignment
12696 * jcf-reader.c (get_attribute): Test for wrong attribute length.
12698 Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
12700 * verify.c (verify_jvm_instructions): When processing a handler,
12701 attempt to set the current_subr to the right value.
12702 (More complicated code combines Sep 17 and Oct 22 versions.)
12704 Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
12706 * class.c (push_class): Figure out (guess) name of source file.
12707 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
12708 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
12709 (parse_class_file): Change return type from int to void.
12710 Call debug_start_source_file/debug_end_source_file.
12712 * expr.c (build_java_binop): Fix masking 2nd operand.
12713 * decl.c (init_decl_processing): Set sizetype first.
12715 Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
12717 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
12718 (Revert Sep 17 change.)
12720 Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12722 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
12723 .class extension in their name and fix thing so we don't process
12724 them parse_zip_file_entries().
12725 (parse_zip_file_entries): Cleaned unused local variables.
12727 Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
12729 * expr.c (can_widen_reference_to): Allows equal array element types.
12730 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
12731 * jcf-dump.c (RET): Get (and print) index.
12733 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
12734 Promote element type to POINTER_TYPE.
12736 Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12738 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
12739 find_in_current_zip, jcf_figure_file_type): Moved from
12740 jcf-reader.c to parse.c.
12741 * zextract.c: (read_zip_archive): takes file_comment_length possible
12742 field into account.
12744 Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
12746 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
12748 * verify.c (merge_types): Handle array types even better ...
12750 Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
12752 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
12754 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
12755 * class.c (make_class_data): Don't build fields_decl if no fields.
12756 When building fields_decl, skip if DECL_ARTIFICIAL.
12758 * expr.c (java_stack_swap): Update stack_type_map.
12759 * verify.c (merge_types): Handle array types better.
12761 Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
12763 * class.c (add_field): Don't promote short integral fields to
12764 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
12765 * expr.c (push_value): Promote and convert short integral values.
12767 * decl.c, java-tree.h (integer_two_node): New constant node.
12768 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
12770 Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12772 * class.c (append_gpp_mangled_type): Use function argument
12773 unpromoted type to generate mangled name.
12775 Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12777 * constants.c (build_constant_data_ref): Now uses current_class
12778 instead of main_class.
12779 (build_constants_constructor): Now uses current_class instead of
12781 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
12782 of the global variable SeepZipFiles done here.
12783 * zextract.c (read_zip_archive): extra_field optional field taken
12784 into account while computing the position of the class file in the
12786 * verify.c (verify_jvm_instructions): Use current_jcf to search
12788 * parse.c (load_class): First search for the class to load in the
12789 current zip file. Saves current_jcf (restored before returning
12790 from that function). Don't call JCF_FINISH in the class was found
12791 in the current ZIP file.
12792 (jcf_parse): If the class was found in the current ZIP file, save
12793 its tree_constant_pool (for later reuse).
12794 (parse_class_file): New function. Process each method defined in
12795 the current class and record the class as to be later registered.
12796 (yyparse): Rewritten. Figure the type of the current file and switch
12798 * lang.c: New global variable current_jcf.
12799 (lang_init): Removed compiling_from_source test (done later, in
12800 yyparse). Removed call the jcf_parse ().
12801 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
12802 (typedef struct JCF): New fields seen_in_zip (to mark a class found
12803 in the current ZIP file) and zip_offset (offset to the class data in
12804 the current zip file).
12805 * jcf-reader.c: zipfile.h included.
12806 localToFile: New ZipFileCache static global variable
12807 (parse_zip_file_entries): New function. Browse the current ZIP
12808 file directory and process each class found.
12809 (process_zip_dir): New function. Register each class found in the
12810 ZIP file directory. The class aren't parsed but a valid JCF is
12811 link to each of them.
12812 (find_in_current_zip): New function. Search for a class in the
12813 current ZIP file directory. If found, prepare the class so that it
12815 (jcf_figure_file_type): New function. Examine the file structure
12816 to figure a class file, a ZIP file. If none of these categories are
12817 matched, a source file is assumed.
12818 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
12819 SeenZipFile: New global variable.
12820 (open_in_zip): Use zipmember's length to accelerate the search for
12821 a member. If zipmember was NULL and zip file successfully read,
12823 * java-tree.h: New global variable current_jcf declared. Added
12824 declaration for current_constant_pool_tags, current_constant_pool_data,
12825 current_constant_pool_length, current_constant_pool_data_ref.
12826 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
12827 store the JCF of classes seen in a zip file) and tree *constant_pool
12828 (to save a loaded class constant pool). current_class declared here.
12829 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
12830 retrieve method_ref_constant.
12831 (PUSHC): java_push_constant_from_pool now uses current_jcf.
12832 (OBJECT): get_class_constant now uses current_jcf.
12833 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
12834 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
12835 (expand_invoke): Now uses current_class instead of main_class
12836 (build_class_init): Now uses current_class instead of main_class
12837 * class.c: New static global variable registered_class.
12838 (register_class): New function.
12839 (emit_register_class): Modified to use registered_class instead of
12841 (is_compiled_class): Now take into account class seen in the archive.
12843 Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
12845 * except.h: Renamed to: java-except.h.
12846 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
12847 * except.c: Add semi-working (commented out) implementation.
12849 * expr.c (expand_iinc): Add needed flush_quick_stack.
12850 * parse.c (set_source_filename): New function.
12851 (give_name_to_class): Set input_filename from package.classname.java.
12853 * jcf-io.c (find_class): Don't look first in ".".
12855 Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12857 * zextract.c (read_zip_archive): Now takes into account the
12859 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
12861 Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
12863 * constants.c, java-tree.h (build_internal_class_name): New function.
12864 (alloc_class_constant): Re-implement using build_internal_class_name.
12865 * class.c (make_class_data): Likewise.
12866 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
12868 Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
12870 * verify.c (verify_jvm_instructions): Temporarily set current_subr
12871 to NULL before pushing an exception handler target.
12873 * expr.c (flush_quick_stack): Save from low stack indexes to high.
12874 (java_stack_swap, java_stack_dup): Re-write to be safe from
12875 clobbering registers.
12876 (build_class_init): New function.
12878 Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12880 * typeck.c (build_java_array_type): Temporary use
12881 permanent_obstack to create the array 'length' field.
12882 * expr.c (lookup_label): Temporay use permanent_obstack to create
12883 label if not found.
12884 * class.c (push_super_field): Tempory use permanent_obstack.
12886 Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12888 * typeck.c (type_for_mode): Now handles double_type_node and
12890 * verify.c (verify_jvm_instructions): The instruction following
12891 the wide bytecode is checked. OPCODE_ret added to the list of
12894 Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
12896 * class.c (make_class): Temporary use permanent_obstack. Set the
12897 class CLASS_P field to 1.
12898 (push_class): Temporary use permanent_obstack.
12899 (set_super_info): Temporary use permanent_obstack.
12900 (add_method): Temporary use permanent_obstack, set
12901 METHOD_TRANSIENT().
12902 (add_field): Temporary use permanent_obstack. Sets
12903 FIELD_VOLATILE() and FIELD_TRANSIENT().
12904 (build_class_ref): Temporary use permanent_obstack if the class
12906 (build_static_field_ref): Temporary use permanent_obstack when
12907 creating field's rtl.
12908 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
12909 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
12910 and fields. Function finalized, as far as flag handling.
12911 (push_class_static_dummy_field): Temporary use permanent_obstack.
12912 (emit_register_class): Force generation of class registration at
12914 * decl.c (end_java_method): Call permanent_allocation() before
12916 * expr.c (can_widen_reference_to): Added comment to interface
12917 handling, fixed typo.
12918 (lookup_field): Now uses CLASS_P() to correct FIXME
12919 (expand_invoke): Verification on public && !static &&
12920 !abstract moved into soft_lookupinterfacemethod (kaffe).
12921 Use Object class dtable if objectref is an array when expanding
12923 (java_push_constant_from_pool): Temporary use permanent_obstack
12924 for CONSTANT_string
12925 * parse.c (get_ref_constant): Temporary use permanent_obstack to
12926 create constant references.
12927 (get_constant): Temporary use permanent_obstack to create constant.
12928 (load_class): Temporary use permanent_obstack to load class.
12929 (jcf_parse): Temporary use permanent_obstack to perform class
12931 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
12932 (build_java_signature): Temporary use permanent_obstack.
12933 * verify.c: (verify_jvm_instruction): removed unnecessary verification
12935 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
12936 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
12939 Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
12941 * class.c (append_gpp_mangled_type): Fix typo.
12942 (emit_register_class): Use main_class to get class object, rather
12943 than looking for no-longer-existing static decl starting with _CL.
12944 * typeck.c (parse_signature_type): Promote array element type
12945 if it is a RECORD_TYPE.
12947 Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
12949 * class.c (push_class_static_dummy_field): New function.
12950 (mangle_static_field): New. Do G++-style mangling of static fields.
12951 (layout_class): Mandle static fields here, not in add_field.
12952 (build_class_ref): The class object is now a dummy static field.
12953 * decl.c (find_local_variable): Look for best, instead of first match.
12954 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
12955 (build_java_athrow): Don't check here if exception is Throwable.
12956 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
12957 (TYPE_USED): Removed. No longer used ...
12958 * parse.c (jcf_parse): Call push_class_static_dummy_field.
12959 * verify.c (push_pending_label): New function.
12960 (push_pending_block): Renamed to check_pending_block.
12961 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
12962 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
12963 re-checking possible handlers) after a store (less wasted work).
12964 Check for null handler (finally) before calling add_handler.
12965 Various changes to (finally?) correctly handle try/finally.
12967 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
12969 * class.c: Include stdio.h.
12971 Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
12973 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
12974 to make sure class is initialized before static/special invoke.
12976 * verify.c (verify_jvm_instructions): On a store instruction,
12977 call find_local_variable to force pre-allocation of decl and rtx.
12978 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
12980 Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
12982 * class.c (build_class_ref): Strip off "promoted_" if need be.
12983 (make_field_value): Call build_java_signature when needed.
12984 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
12985 * expr.c (build_java_athrow): Don't push_value of exception.
12986 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
12987 match specification of [fd]cmp[lg] for NaNs.
12988 (expand_byte_code): Add support for exception handler ranges.
12989 * except.c: Add skeleton for EH code-generation.
12990 * verify.c (merge_types): Treat all promoted integral types as equal.
12991 * constants.c (build_constants_constructor): To force creation of
12992 current_constant_pool_data_ref, call build_constant_data_ref.
12994 * javaop.def (lload): Fix typo.
12995 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
12997 Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
12999 * parse.c: Don't include function.h.
13001 Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
13003 * except.[ch]: New files.
13004 * Makefile.in (JAVA_OBJS): Add except.o
13005 * expr.c: Temporary warning about unimplemented exceptions.
13006 * verify.c: Verify exception handlers.
13008 * jcf-dump.c (disassemble_method): Print exception table.
13010 Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
13012 * expr.c (verify_jvm_instructions): Started a thorough
13013 verification of invoke* bytecodes.
13014 (expand_byte_code): flush quick stack if PC is the target of a
13015 branch. and undef RET (conflicting with config/i386/i386.h).
13016 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
13018 (expand_invoke): Now handles invokeinterface and do more
13019 verification according to the bytecode.
13020 (lookup_field): Don't try to load the class if processing
13022 (can_widen_reference_to): Now handles interfaces.
13023 * decl.c (init_decl_processing): New global variable
13024 soft_lookupinterfacemethod_node, declared in java-tree.h.
13025 Call set_super_info on string_type_node.
13026 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
13028 * class.c (set_super_info): Fills the CLASS_* flags according to
13030 (get_access_flags_from_decl): Handles all class flags.
13032 Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
13034 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
13035 * parse.c (yyparse): Check for abstract method, and missing code.
13036 * expr.c (expand_byte_code): Change interface.
13037 * lang.c (put_decl_node): Print promoted types prettier.
13038 * verify.c (verify_jvm_instruction): Change interface.
13039 Partial support for scanning exception table.
13040 For load instructions, handle promoted integral types.
13042 Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
13044 * verify.c: New file, with contents moved from expr.c.
13045 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
13046 * typeck.c (is_array_type_p): Moved here from expr.c.
13047 * java-tree.h: Add some now-needed function declarations.
13048 * Makefile.in (JAVA_OBJS): Added verify.o.
13050 Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
13052 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
13053 METHOD_ABSTRACT flag.
13055 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
13056 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
13057 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
13059 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
13061 (start_java_method): Hook for SYNCHRONIZED methods.
13063 * expr.c (build_java_jsr, build_java_ret): New functions
13064 (JSR,PRE): New macros
13065 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
13066 (verify_jvm_instructions): tableswitch, lookupswitch,
13067 monitorenter, monitorexit, goto_w: verified.
13068 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
13069 (build_java_monitor): New function.
13070 (MONITOR_OPERATION): Modified to call build_java_monitor()
13071 (verify_jvm_instructions): Started a thorough verification of
13074 Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
13076 Support verification of jsr/ret subroutines (used for try/finally).
13077 * decl.c (return_address_type_node): New type node.
13078 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
13079 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
13080 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
13081 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
13082 TYPE_USED): New macros for special types in type_map.
13084 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
13085 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
13087 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
13089 * expr.c (can_widen_reference_to): New function.
13090 (pop_type): Use it.
13091 (merge_type_state): Support handling start of subroutine.
13092 (push_pending_block): Return char* error message, instead of calling
13093 fatal on an error. Also handle subroutines.
13094 (verify_jvm_instructions): Handle errors from push_poending_block.
13095 Support jsr and ret instructions.
13097 Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
13099 * jcf-io.c (find_classfile): Fix thinko.
13100 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
13102 Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
13104 * Makefile.in (BISON): Remove.
13106 Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
13108 * Makefile.in: Convert to autoconf.
13109 * config-lang.in (outputs): Added java/Makefile.
13111 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
13112 Rename cc1java to jc1.
13114 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
13115 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
13117 * class.c (class_depth): Do load_class if needed.
13119 Mostly better verification.
13120 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
13121 (init_decl_processing): Change return type of soft_checkcast.
13122 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
13123 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
13124 lang_print_error): New functions.
13125 (lang_init): Set global hook print_error_function to lang_print_error.
13126 * expr.c: In the type_map ptr_type_node is only used for null now.
13127 (pop_type, merge_types): Hence ptr_type_node matches any reference.
13128 (merge_types): Dererence pointer to record types before comparing.
13129 (decode_newarray_type, merge_types): On error just return NULL.
13130 (build_java_binop): Add preliminary implementation (with warning)
13131 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
13132 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
13133 (expand_compare, expand_java_goto, expand_java_call): Don't
13134 push_pending_block, since that only makes sense when verifying.
13135 (merge_type_state): Different return codes.
13136 (push_pending_block): A block may need to be verified more than once.
13137 (expand_byte_code): Warn about unused code at code generation time.
13138 (verify_jvm_instruction): Changed logic, since code may need to be
13139 re-verified if type-state has changed. Also, better error handling.
13140 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
13141 Improve newarray, anewarray, ?aload, athrow,
13142 * java-tree.h (LABEL_CHANGED): New macro.
13144 Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
13146 * decl.c (soft_athrow_node): New global variable initialized.
13147 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
13148 * typeck.c (convert): Added support for REAL_TYPE.
13149 (convert_to_char): New function.
13150 (convert): Handle CHAR_TYPE.
13151 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
13152 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
13153 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
13155 (verify_jvm_instructions): Added break a the end of bogus unop: label.
13156 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
13157 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
13158 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
13159 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
13160 to Use The Right Things.
13161 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
13162 compatible with INT. BOOLEAN is made equivalent to BYTE.
13163 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
13164 OPCODE_ifnonnull): Now supported.
13165 (build_java_athrow): New function.
13167 Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
13169 Rename method name <init> to match G++ (and fix mangling).
13170 * class.c (layout_class): Replace method name of <init> by class name.
13171 (make_method_value): Do inverse renaming of constructor from <init>.
13172 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
13173 * typeck.c (lookup_java_constructor): New function.
13174 * expr.c (expand_invoke): If method_name is <init>, call
13175 lookup_java_constructor to find constructor.
13177 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
13179 Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
13181 * parse.c (get_class_constant): Modified to handle array "classes"
13182 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
13184 (convert): Modified to handle real type.
13185 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
13186 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
13187 variables declared.
13188 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
13189 soft_multianewarray, soft_newarray_node, soft_throw_node): New
13190 global variables initialized.
13191 (find_local_variable): Handles the case of a pointer
13192 (end_java_method): Restore the use of one more scope
13193 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
13194 build_java_array_length_access, expand_java_arrayload,
13195 expand_java_arraystore, expand_java_array_length,
13196 expand_java_multianewarray, expand_java_anewarray,
13197 build_java_check_indexed_type, is_array_type_p,
13198 build_java_throw_out_of_bound_exception): New functions.
13199 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
13200 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
13201 OPCODE_<t>aload): Implemented code for verification.
13202 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
13203 ARRAY_NEW_MULTI): Macro defined.
13204 (CONVERT): Modified to invoke convert().
13205 (case OPCODE_aload2): Fixed index typo from 2 to 1.
13207 Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
13209 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
13210 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
13211 (make_class_data): Field name needs '/' as package prefix.
13212 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
13214 Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
13216 Implement debug information for local variables.
13217 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
13218 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
13219 DECL_LOCAL_SLOT_CHAIN): New macros.
13220 (struct lang_decl_var): New type.
13221 * parse.c (give_name_to_locals): Move to decl.c.
13222 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
13223 (start_java_method): Re-write parameter handling.
13224 (pending_local_decls): New global variable.
13225 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
13226 (find_local_variable): Accept pc so we can skips decls not in range.
13227 (struct binding_level): Add end_pc field.
13228 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
13229 (various): Change so current pc gets passed to find_local_variable.
13231 * decl.c (init_decl_processing): Re-arrange fields in
13232 class_type_node and and method_type_node to match kaffe 0.9.1.
13233 * class.c (make_method_value, make_class_data): Update
13234 initializations to match.
13236 Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
13238 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
13239 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
13240 (push_super_field): New function.
13241 (make_class_data): Handle inheritance of class static initializer.
13242 (layout_class): New name mangling.
13243 * constants.c (build_constant_data_ref): Init type of data array
13244 to a one-element array.
13245 (build_constants_constructor): Set DECL_SIZE from complete array type.
13246 * decl.c: Rename class_type, object_type etc to class_type_node,
13247 object_type_node etc. Make former inherit from latter.
13248 * expr.c (expand_invoke): Add cast of function address.
13249 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
13250 * parse.c (yyparse): Don't call layout_class here.
13251 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
13253 Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
13255 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
13256 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
13257 (alloc_class_constant): New.
13258 * expr.c (expand_invoke): Make sure method's class is initialized.
13259 * class.c (interits_from_p, emit_register_class): New functions.
13260 * parse.c (yyparse): Call emit_register_class.
13262 Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
13264 * constants.c: New file, to handle constant pool.
13265 * Makefile.in (JAVA_OBJS): Add constants.o.
13266 * decl.c (init_decl_processing): Update, fix, finish various structs.
13267 (pushdecl_top_level): New.
13268 * parse.c (layout_class): Moved to class.c.
13269 * expr.c (java_push_constant_from_pool): New function.
13270 * class.c (build_class_ref): Make work fully
13271 (make_class_data): Emit super-class, constant pool, interface vector.
13273 Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
13275 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
13276 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
13277 * class.c (class_depth): New function.
13278 (lookup_named_class): Replaced by new function lookup_class.
13279 * decl.c (object_type_node, string_type_node): New.
13280 Remove various types that we no longer need.
13281 * expr.c (verify_jvm_instructions): New separate verifier pass.
13282 (push_type, pop_type): New functions for verifier.
13283 (type_stack_dup, pop_argument_types, merge_types): Likewise.
13284 (expand_byte_code): Simplify, since we assume already verified.
13285 (expand_invoke): Now mostly works.
13286 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
13287 * lang.c (main_class): Move to parse.c. Don't make_class yet.
13288 * parse.c: Wait to allocate class object until we know its name.
13289 (layout_class): Calculate DECL_VINDEX for each virtual method.
13290 * typeck.c (get_array_type): Rename to ...
13291 (build_java_array_type): ... and provide working implementation.
13292 (build_java_signature): New function - build Java signature of type.
13293 (set_java_signature): New function - cache signature with type.
13294 (lookup_java_method): New function.
13296 Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
13298 * class.c (ident_subst): Take extra SUFFIX parameter.
13299 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
13300 (set_constant_value, build_static_field_ref, is_compiled_class): New.
13301 (build_class_ref): Actually implement.
13302 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
13303 * decl.c (builtin_function): New.
13304 (init_decl_processing): Update for current Kaffe. Declare some
13305 builtin Kaffe functions.
13306 * expr.c (build_address_of): New.
13307 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
13308 Renamed (from expand_java_new etc), and added working implementations.
13309 (build_field_ref): Now also handle static fields.
13310 (expand_invoke): Implement invokestatic, and start implement rest.
13311 * java-opcodes.h: Use javaop.def to avoid duplicated list.
13312 * javaop.def: Rename invokevirt -> invokevirtual.
13313 * lang.c (use_handles): Removed.
13314 * parse.c: Add support for ConstantValue attribute.
13315 Handle nested loading of a class. (JPOOL_UTF): New.
13317 Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
13319 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
13321 Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
13323 * Make-lang.in (java.install-man): New empty rule.
13324 * typeck.c (set_local_type): New function.
13325 * expr.c (STORE_INTERNAL): Call find_local_variable,
13326 not find_stack_slot. Call set_local_type.
13328 Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
13330 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
13331 and building RECORD_TYPE CONSTRUCTORs.
13332 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
13334 * lang.c (use_handles): Change the default to 0.
13335 * decl.c: Define and build class_type, field_type, utf8const_type.
13336 * class.c (make_class_data, make_field_value,
13337 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
13338 hashUtf8String, strLengthUtf8, mangled_classname:
13339 Functions to build reflective data structures.
13340 * parse.c (yyparse): Call make_class_data.
13342 * jcf-io.c (open_class, find_classfile): New functions.
13343 * jcf-dump.c: Support reading classfile from explicitly-named
13344 class file (without CLASSPATH searching).
13346 Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
13348 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
13349 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
13350 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
13351 (get_constant): Now trivial for CONSTANT_Utf8.
13353 * jcf.h: Make NEW_CPOOL the default.
13354 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
13356 Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>