OSDN Git Service

e3ba451ad4a7e10dd3855fa8326afc41d1b0acd3
[pf3gnuchains/gcc-fork.git] / gcc / java / ChangeLog
1 2001-12-31  Tom Tromey  <tromey@redhat.com>
2
3         * parse.y (dump_java_tree): New function.
4         (source_end_java_method): Call it.
5         (end_class_declaration): Likewise.
6         * lang.c (java_decode_option): Call dump_switch_p.
7
8 2001-12-28  Tom Tromey  <tromey@redhat.com>
9
10         * gen-table.pl: Don't process characters after \uffff.  Added
11         comment pointing to input file.
12
13 2001-12-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
14
15         * gen-table.pl: Const-ify output.  Document the location of a
16         suitable unicode input file.
17
18         * chartables.h: Regenerate.
19
20 2001-12-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
21
22         * chartables.h: Const-ify.
23         * gjavah.c (options): Likewise.
24         * jcf-dump.c (options): Likewise.
25         * jv-scan.c (options): Likewise.
26         * lex.c (java_start_char_p, java_part_char_p): Likewise.
27         * parse.y (binop_lookup): Likewise.
28
29 2001-12-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
30
31         * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
32         the static arrays that are output.
33         * jvspec.c (jvgenmain_spec): Make static.
34         * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
35         * keyword.h: Regenerate.
36         * lang.c (string_option, process_option_with_no, lang_f_options,
37         lang_W_options): Const-ify.
38         * lex.c (java_lex): Likewise.
39
40 2001-12-21  Richard Henderson  <rth@redhat.com>
41
42         * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
43         (get_boehm_type_descriptor): ... here.  Arrange for the
44         TREE_TYPE to get set properly.
45
46 2001-12-21  Richard Henderson  <rth@redhat.com>
47
48         * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
49         only if the target requires collect2.
50
51         * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
52
53 2001-12-20  Tom Tromey  <tromey@redhat.com>
54
55         For PR java/4509:
56         * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
57         CAN_COMPLETE_NORMALLY for the node.
58         * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
59         generate code for second branch if first branch can't complete
60         normally.
61         (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
62         the loop head if the loop body can't complete normally.
63
64 2001-12-20  Tom Tromey  <tromey@redhat.com>
65
66         For PR java/4766:
67         * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
68         case where `finally' clause can't complete normally.
69
70 2001-12-20  Tom Tromey  <tromey@redhat.com>
71
72         Fixes PR java/5057:
73         * parse.y (analyze_clinit_body): Added this_class parameter.
74         Check for more cases where we must keep <clinit>.
75         (maybe_yank_clinit): Cleaned up flow control.
76
77 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
78
79         * decl.c (java_init_decl_processing): Don't initialize 
80         finit_leg_identifier_node.
81         * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
82         (finit_leg_identifier_node): Remove.
83         (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
84
85 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
86
87         * mangle.c (mangle_member_name): Don't special-case for 
88         NO_DOLLAR_IN_LABEL.
89         * mangle_name.c (unicode_mangling_length): Likewise.
90         (append_unicode_mangled_name): Likewise.
91         * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
92         code.
93
94 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
95
96         * expr.c (build_java_array_length_access): Don't force null pointer
97         check unless flag_check_references is set.
98
99 2001-12-20  Tom Tromey  <tromey@redhat.com>
100
101         Fix for PR java/3417:
102         * parse.y (patch_assignment): Added special processing for
103         `return'.
104         (patch_return): Don't convert booleans to integers, and don't
105         special-case `null'.
106
107 2001-12-20  Joseph S. Myers  <jsm28@cam.ac.uk>
108
109         * config-lang.in (diff_excludes): Remove.
110
111 2001-12-17  Joseph S. Myers  <jsm28@cam.ac.uk>
112
113         * gcj.texi: Update link to GCC manual.
114
115 2001-12-17  Tom Tromey  <tromey@redhat.com>
116
117         * parse.y (link_nested_class_to_enclosing): Removed useless
118         statement.
119
120 2001-12-16  Tom Tromey  <tromey@redhat.com>
121
122         * mangle.c (mangle_method_decl): Never emit `C2' constructor.
123         Fixes PR java/5088.
124
125 2001-12-16  Joseph S. Myers  <jsm28@cam.ac.uk>
126
127         * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
128         jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
129         spelling errors.
130
131 2001-12-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
132
133         * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
134
135 2001-12-16  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
136
137         * decl.c (java_init_decl_processing): Build otable_type correctly.
138         otable_decl is an otable_type.
139
140 2001-12-15  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
141
142         * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
143         otable_type, otable_ptr_type, method_symbol_type, 
144         method_symbols_array_type, method_symbols_array_ptr_type): New
145         field/global tree definitions.
146         (flag_indirect_dispatch): New flag.
147         * decl.c (java_init_decl_processing): Initialize new otable and 
148         otable_syms type nodes and decls. Add new field "index" to
149         method_type_node.
150         * class.c (build_method_symbols_entry): New function.
151         (make_method_value): Set "index" to to method's vtable index for
152         virtual methods when indirect-dispatch is not used.
153         (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
154         and set vtable_method_count to -1. Set otable and otable_syms field
155         if indirect-dispatch is used and there was something to put in them.
156         (build_method_symbols_entry): New function.
157         (emit_offset_symbol_table): New function.
158         * expr.c (get_offset_table_index): New function.
159         (build_invokevirtual): Build array reference to otable at the index 
160         returned by get_offset_table_index, and use the result as the vtable
161         offset.
162         (build_invokeinterface): Similar.
163         * jcf-parse.c (yyparse): If indirect-dispatch, call 
164         emit_offset_symbol_table at the end of compilation, after all classes 
165         have been generated.
166         * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
167         * lang.c (flag_indirect_dispatch): Define.
168         (lang_f_options): Add indirect-dispatch flag.
169
170 2001-12-14  Matthias Klose  <doko@debian.org>
171
172         * gcj.texi: Markup for man page generation. Document missing
173         options printed by <tool> --help.
174         Terminate description of gij's -ms option with a dot.
175         * Make-lang.in ($(srcdir)/java/*.1): New targets.
176         (java.generated-manpages java.install-man, java.uninstall,
177         java-maintainer-clean) Updated.
178
179 2001-12-14  Hans Boehm  <Hans_Boehm@hp.com>
180
181         * class.c (get_dispatch_table): Fix java vtable layout
182         for TARGET_VTABLE_USES_DESCRIPTORS.
183         * decl.c (java_init_decl_processing): Initialize
184         alloc_no_finalizer_node, finalize_identifier_node.
185         * expr.c (class_has_finalize_method): New function.
186         (expand_java_NEW): Generate calls for finalizer-free allocation.
187         (build_invokevirtual): Fix java vtable layout for
188         TARGET_VTABLE_USES_DESCRIPTORS.
189         * java-tree.h (enum java_tree_index): New entries: 
190         JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
191         (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
192         (class_has_finalize_method): declare.
193         (HAS_FINALIZER_P): New macro.
194         * parse.y (patch_invoke): Generate calls for finalizer-free
195         allocation.
196
197 2001-12-12  Matthias Klose  <doko@debian.org>
198
199         * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
200         whitespace at end of line.
201
202 2001-12-11  Tom Tromey  <tromey@redhat.com>
203
204         * lex.c (java_init_lex): Define wfl_to_string as
205         gnu.gcj.runtime.StringBuffer unless generating bytecode.
206
207 2001-12-11  Jeff Sturm  <jsturm@one-point.com>
208
209         * class.c (make_method_value): Use null_pointer_node to
210         represent empty exception table.
211
212 2001-12-10  Tom Tromey  <tromey@redhat.com>
213
214         * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
215
216 Mon Dec 10 06:09:57 2001  Douglas B. Rupp  <rupp@gnat.com>
217
218         * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
219
220 2001-12-09  Per Bothner  <per@bothner.com>
221
222         * check-init.c (current_switch_has_default):  New static field.
223         (check_init):  Case DEFAULT_EXPR: Set current_switch_has_default.
224         Case SWITCH_EXPR:  Save/restore current_switch_has_default.  If no
225         DEFAULT_EXPR seen, simulate a default alternative that copies state.
226
227 2001-12-09  Tom Tromey  <tromey@redhat.com>
228
229         * check-init.c (check_init): Don't allow pre- or post- increment
230         or decrement of final variable.
231         (final_assign_error): Minor error message rewording.
232
233 2001-12-08  Tom Tromey  <tromey@redhat.com>
234
235         * java-tree.h: Fixed typo.
236
237         * gjavah.c (decompile_method): Don't decompile to `return this'
238         for static methods.
239
240         * gjavah.c (cxx_keywords): Re-sorted.
241         * lex.c (cxx_keywords): Re-sorted.
242
243         * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
244         else.
245
246         * gjavah.c (print_namelet): Clear subnamelets.
247         (HANDLE_METHOD): Set `method_printed' earlier.
248
249 2001-12-07  Tom Tromey  <tromey@redhat.com>
250
251         * lang.c (lang_f_options): Added
252         optimize-static-class-initialization.
253         (java_decode_option): Removed special case.
254
255 2001-12-07  Per Bothner  <per@bothner.com>
256
257         * check-init.c (check_init):  Fix typo freeing memory twice.
258
259 2001-12-05  Per Bothner  <per@bothner.com>
260
261         Restore support for static class initialization optimization.
262         * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
263         * check-init.c (check_int):  At end of BLOCK handle initialization
264         blocks, which used to be done in java_complete_expand_method but did
265         not handle the case where check_for_initialization might allocate
266         more than a word of bits.
267         * decl.c (lang_make_tree):  The smic field is now a tree.
268         * expr.c (build_class_init):  Set DECL_FUNCTION_INIT_TEST_CLASS field.
269         * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE):  New macro.
270
271         * parse.y (emit_test_initialization):  Combine hash_lookup calls.
272
273         * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
274         Change from a hash table to a list.
275         (struct_lang_decl):  Change field 'smic' to match.
276         * class.c (add_method_1):  Initialize
277         DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
278         * parse.y (adjust_init_test_initialization):  Removed - inlined into -
279         (java_expand_method_bodies): -here, since 'smic' is now a list.
280         (patch_invoke):  Add to 'smic' list, instead of hash_lookup.
281
282         * check-init.c (WORD_SIZE):  Use BITS_PER_UNIT.
283
284         * class.c (java_hash_compare_tree_node):  Fix casts.
285
286 2001-12-04  Per Bothner  <per@bothner.com>
287
288         * check-init.c:   Handle definite unassignment to finals in addition
289         to definite assignment.
290         (loop_current_locals):  New field.
291         (num_current_locals, int start_current_locals, num_current_words):
292         Make static.
293         (SET_P, CLEAR_P, SET_BIT):  Add needed but missing parentheses.
294         (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
295         CLEAR_ASSIGNED, CLEAR_UNASSIGNED):  New macros.
296         (get_variable_decl, check_final_reassigned):  New functions.
297         (check_init, check_bool_init):  Modify as needed for checking finals.
298         (check_for_initialization):  Take extra parameter and return void.
299         Do extra start-up logic to check final fields for assignment.
300         * parse.y (check_static_final_variable_assignment_flag,
301         reset_static_final_variable_assignment_flag, check_final_assignment,
302         check_final_variable_local_assignment_flag,
303         reset_final_variable_indirect_assignment_flag,
304         reset_final_variable_global_assignment_flag):  Remove functions.
305         (java_complete_expand_methods, outer_field_access_fix,
306         patch_assignment): Remove no-longer used logic.
307         * java-tree.h (DECL_FIELD_FINAL_IUD):  Change usage and comments.
308         * parse.y (register_fields, java_complete_tree):  Update accordingly.
309
310         * check-init.c (ALLOC_WORDS/FREE_WORDS):  Use xmalloc/free, not alloca.
311         (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER):  New.
312         (check_cond_init, check_bool2_init):  Use DECLARE_BUFFERS.
313
314         * java-tree.h (STATIC_CLASS_INIT_OPT_P):  Temporarily turn off.
315
316         * java-tree.h (DECL FINAL):  New bit-field.
317         (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL):  Define as DECL_FINAL.
318         (LOCAL_FINAL_P):  Use DECL_FINAL rather than old LOCAL_FINAL.
319         (DECL_INIT_CALLS_THIS):  New macro.
320         (struct lang_decl):  New bit-field init_calls_this.
321         (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
322         DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
323         (DECL_BIT_INDEX):  Change to use pointer_alias_set since we now
324         use it for both local variables and final fields.
325         (struct lang_decl_var):  Remove bit-fields final_liic, final_ierr,
326         and local_final.
327         (struct lang_type):  Remove hfv bit-field.
328         (check_for_initialization):  Change to return void.
329
330         * java-tree.h (IS_ARRAY_LENGTH_ACCESS):  New macros.
331         * expr.c (build_java_array_length_access):  Set IS_ARRAY_LENGTH_ACCESS.
332         * check-init.c (final_assign_error):  New helper function.
333         (check_final_reassigned, check_init):  Use it.
334         (check_init):  Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
335         
336         * java-tree.h (struct lang_decl, struct lang_decl_var):  Change all
337         bit-fields to unsigned.
338
339 2001-12-03  Per Bothner  <per@bothner.com>
340
341         * parse.y (patch_binop):  Minor constant folding.
342
343         * parse.y (build_current_thisn):  Shorter 'buffer'.
344
345 2001-12-03  Per Bothner  <per@bothner.com>
346
347         * decl.c (complete_start_java_method):  Now generate TRY_FINALLY_EXPR
348         instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
349         * jcf-write.c (generate_bytecode_insns):  Remove support for
350         CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
351         * check-init.c (check_init):  Likewise.
352
353 2001-12-03  Per Bothner  <per@bothner.com>
354
355         * verify.c (subroutine_nesting):  New function.
356         (verify_jvm_instructions):  Use it to fix logic for checking that
357         we're done with the current subroutine.
358
359         * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
360         OPCODE_instanceof use POP_TYPE macro for better diagnostics.
361
362 2001-12-03  Per Bothner  <per@bothner.com>
363
364         * jcf.h:  Fix obvious typo in comment.
365         * typeck.c (build_null_signature):  Add comment.
366
367 2001-12-03  Neil Booth  <neil@daikokuya.demon.co.uk>
368
369         * expr.c: Remove leading capital from diagnostic messages, as
370         per GNU coding standards.
371         * jcf-io.c: Similarly.
372         * jcf-parse.c: Similarly.
373         * jv-scan.c: Similarly.
374         * jvspec.c: Similarly.
375         * mangle.c: Similarly.
376
377 2001-12-02  Tang Ching-Hui  <nicholas@cs.nthu.edu.tw>
378             Alexandre Petit-Bianco  <apbianco@redhat.com>
379
380         * expr.c (build_java_arrayaccess): Call save_expr on array for 
381         correct evaluation order, modified comment, fixed indentation.
382         * parse.y: (patch_assignment): Correctly extract the array base
383         from the tree generate by build_java_arrayaccess, added comments.
384         (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
385         Fixes PR java/3096, PR java/3803, PR java/3965.
386
387 2001-12-01  Neil Booth  <neil@daikokuya.demon.co.uk>
388
389         * expr.c (expand_byte_code): Remove trailing periods from messages.
390         * jcf-parse.c (load_class, jcf_parse): Similarly.
391         * jcf-write.c (generate_classfile): Similarly.
392         * lex.c (java_lex): Similarly.
393
394 2001-11-30  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
395
396         * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
397
398 2001-11-29  Joseph S. Myers  <jsm28@cam.ac.uk>
399
400         * Make-lang.in (java.generated-manpages): New dummy target.
401
402 2001-11-27  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
403
404         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
405         ASM_FINAL_SPEC.
406         (lang_specific_pre_link): Use set_input to set input_filename.
407         Append `main' here.
408         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
409         (main): Fix definition.
410         Strip `main' from classname.
411         Fixes PR java/227.
412
413 2001-11-18  Roger Sayle <roger@eyesopen.com>
414
415         * parse.h (java_expand_switch): Remove old prototype.
416
417 2001-11-18  Tom Tromey  <tromey@redhat.com>
418
419         Fix for PR java/1401:
420         * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
421         arg0 is null.
422         (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
423         correctly.
424
425 2001-11-18  Neil Booth  <neil@daikokuya.demon.co.uk>
426
427         * lang.c (finish_parse): Rename to java_finish.
428         (LANG_HOOKS_FINISH, java_finish): New.
429
430 2001-11-15  Neil Booth  <neil@daikokuya.demon.co.uk>
431
432         * decl.c (init_decl_processing): Rename java_init_decl_processing.
433         * java-tree.h: New prototype.
434         * lang.c (java_init): Update prototype.  Combine with old init_parse.
435
436 2001-11-13  Tom Tromey  <tromey@redhat.com>
437
438         * gjavah.c (method_signature): New global.
439         (HANDLE_METHOD): Set it.
440         (decompile_return_statement): New function.
441         (decompile_method): Use it.
442         (print_method_info): Removed `synth' argument.
443
444 2001-11-09  Neil Booth  <neil@daikokuya.demon.co.uk>
445
446         * java-tree.h (java_set_yydebug): New.
447         * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
448         * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
449         (print_lang_decl, print_lang_type, print_lang_identifier,
450         print_lang_statistics, lang_print_xnode): Remove.
451
452 2001-11-09  Neil Booth  <neil@daikokuya.demon.co.uk>
453
454         * jcf-parse.c (init_lex): Remove.
455         * lang.c (language_string, lang_identify): Remove.
456         (struct lang_hooks): Constify.
457         (LANG_HOOKS_NAME): Override.
458         (init_parse): Update.
459
460 2001-11-08  Andreas Franck  <afranck@gmx.de>
461
462         * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle 
463         program_transform_name the way suggested by autoconf.
464         (java.install-common): Also transform auxiliary program names with
465         program_transform_name.
466
467 2001-11-08  Tom Tromey  <tromey@cygnus.com>
468
469         * parse.y (trap_overflow_corner_case): New rule.
470         (unary_expression): Use it.
471         * lex.c (java_init_lex): Don't set minus_seen.
472         (yylex): Don't use minus_seen.  Communicate overflow to parser for
473         it to handle.
474         (error_if_numeric_overflow): New function.
475         * parse.h (minus_seen): Removed field.
476         (JAVA_RADIX10_FLAG): New define.
477
478 2001-11-07  Tom Tromey  <tromey@redhat.com>
479
480         Patch for PR java/1414:
481         * parse.y (case_label_list): New global.
482         (goal): Register case_label_list with GC.
483         (java_complete_lhs): Save new case on case_label_list.
484         (patch_switch_statement): Check for duplicate case labels.
485
486 2001-11-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
487
488         * parse.y (patch_assignment): Removed unused third argument.
489         (java_complete_lhs): Removed unused third argument to patch_assignment.
490
491 2001-11-06  Neil Booth  <neil@cat.daikokuya.demon.co.uk>
492
493         * lang.c: Include langhooks-def.h.
494         * Make-lang.in: Update.
495
496 2001-10-31  Zack Weinberg  <zack@codesourcery.com>
497
498         * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
499
500 2001-10-29  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
501
502         * mangle.c (find_compression_record_match): Don't match compression
503         records for package name elements unless they occur at the start of
504         the name. Fix for PR java/4717.
505
506 2001-10-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
507
508         * expr.c (expand_java_field_op): Don't special-case references to
509         java.lang.PRIMTYPE.TYPE.
510         (build_primtype_type_ref): Removed.
511         * java-tree.h (build_primtype_type_ref): Remove prototype.
512         * parse.y (maybe_build_primttype_type_ref): Removed.
513         (complete_function_arguments): Don't special-case references to
514         java.lang.PRIMTYPE.TYPE.
515         (patch_assignment): Likewise.
516         (array_constructor_check_entry): Likewise.
517
518 2001-10-24  Alexandre Petit-Bianco  <apbianco@redhat.com>
519
520         * mangle.c (static tree compression_table): Fixed leading comment.
521         * parse.h (struct parser_ctxt): Fixed field comment.
522         * parse.y (check_pkg_class_access): New prototype, fixed leading
523         comment, new parameter used to emit error only if passed as true.
524         (parse_check_super): Pass extra argument to check_pkg_class_access.
525         (do_resolve_class): Likewise.
526         (process_imports): Likewise.
527         (read_import_dir): Fixed indentation.
528         (find_in_imports_on_demand): New local class_type_name. Local
529         node_to_use deleted. while loop changed into for loop. Report
530         multiple definition only for accessible classes. Improved error
531         message.
532         (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
533         assigned to parameter list, fixed indentation. while loop changed
534         into for loop, restore TREE_CHAIN on local `tem' before the next
535         iteration.
536
537 Tue Oct 23 14:02:17 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
538
539         * lang.c (lang_get_alias_set): Deleted.
540
541 2001-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
542
543         * gjavah.c (jni_print_char): Fix thinko in last change.
544
545         * gjavah.c (jni_print_char, decode_signature_piece): Use
546         safe-ctype macros and/or fold extra calls into fewer ones.
547         * lex.c (java_read_unicode, java_lex): Likewise.
548         * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
549         JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
550         * mangle_name.c (append_unicode_mangled_name,
551         unicode_mangling_length): Likewise.
552
553 2001-10-17  Richard Henderson  <rth@redhat.com>
554
555         * Make-lang.in (java/lang.o): Depend on langhooks.h.
556
557 2001-10-15  Alexandre Petit-Bianco  <apbianco@redhat.com>
558
559         * lang.c (langhooks.h): Included.
560         (LANG_HOOKS_INIT): Redefined.
561         (LANG_HOOKS_INIT_OPTIONS): Likewise.
562         (LANG_HOOKS_DECODE_OPTION): Likewise.
563         (struct lang_hooks lang_hooks): New initialization.
564
565 2001-10-11  Per Bothner  <per@bothner.com>
566
567         * parse.y (patch_synchronized_statement):  Use a TRY_FINALLY_EXPR
568         rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
569         The former is simpler, and jcf-write.c handles it better.
570         (java_complete_lhs):  No longer need to handle CLEANUP_POINT_EXPR
571         or WITH_CLEANUP_EXPR.
572         * jcf-write.c:  Revert Alex's change from 2000-10-18.  It is no
573         longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
574
575         * parse.y (patch_if_else_statement):  If the condition is constant,
576         optimize away the test.
577
578 2001-10-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
579
580         * parse.y (patch_cast): Call patch_string on the first operand of
581         the incoming node, update it if necessary. Fixes PR java/4510.
582
583 2001-10-09  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
584
585         * parse.y (find_as_inner_class): Don't disregard the enclosing scope
586         when name qualifier matches a package name.
587
588 2001-10-08  Tom Tromey  <tromey@redhat.com>
589
590         Fix for PR java/4489:
591         * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
592         force a new label when computing `body_block'.
593
594 2001-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
595
596         * jcf-io.c (format_uint): Const-ify.
597         * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
598         * lex.c (java_get_line_col): Likewise.
599         * parse.y (build_incdec): Likewise.
600
601 2001-10-05  Alexandre Petit-Bianco  <apbianco@redhat.com>
602
603         * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
604         a NULL enclosing context if appropriate. Fixes PR java/4466.
605
606 2001-10-03  Alexandre Petit-Bianco  <apbianco@redhat.com>
607
608         * parse.y (patch_assignment): Use lvalue's original TYPE when
609         building the final COMPOUND_EXPR.
610         (try_reference_assignconv): Fixed leading comment.
611
612 2001-09-26  Alexandre Petit-Bianco  <apbianco@redhat.com>
613
614         * parse.y (check_final_variable_indirect_assignment): For
615         COMPOUND_EXPR, return only if finals were found initialized
616         properly, if not, keep on checking.
617         (check_final_variable_global_assignment_flag): New local
618         error_found, set when appropriate and used to decide whether to
619         report uninitialized finals. Fixed typo in comment.
620
621 2001-09-22  Alexandre Petit-Bianco  <apbianco@redhat.com>
622
623         * decl.c (init_decl_processing): Fixed typo in predef_filenames
624         last three initializations. Fixes PR java/4360.
625
626 2001-09-21  Richard Henderson  <rth@redhat.com>
627
628         * class.c (get_dispatch_table): Handle function descriptors.
629         (build_dtable_decl): Likewise.
630         * expr.c (build_invokevirtual): Likewise.
631
632 2001-09-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
633
634         * parse.y (patch_method_invocation): Build class initialization
635         when static finals are used to qualify method invocation.
636         Fixes PR java/4366.
637
638 2001-09-19  Alexandre Petit-Bianco  <apbianco@redhat.com>
639
640         * parse.h: (WFL_STRIP_BRACKET): Re-written using
641         build_type_name_from_array_name.
642         (STRING_STRIP_BRACKETS): New macro.
643         * parse.y (build_type_name_from_array_name): New function.
644         (array_creation_expression:): Accumulate []s instead of [s.
645         (cast_expression:): Accumulate []s instead of [s after cast type
646         name.
647         (build_array_from_name): Local string deleted, use
648         build_type_name_from_array_name.
649         (build_unresolved_array_type): Accumulate []s instead of [s after
650         type name.
651         (register_fields): Fixed comment.
652         (resolve_class): Local name, base deleted, new locals tname and
653         array_dims. Use build_type_name_from_array_name. Use array_dims to
654         build array type.
655         (purify_type_name): Use STRING_STRIP_BRACKETS.
656
657 2001-09-18  Andreas Jaeger  <aj@suse.de>
658
659         * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
660         * jv-scan.c: Likewise.
661
662 2001-09-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
663
664         * parse.y (patch_method_invocation): Inner class creation context
665         check not enforced within constructors. Fixes PR java/1873.
666
667 2001-09-16  Tom Tromey  <tromey@redhat.com>
668
669         * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
670         NOTE_PUSH for single-case push.  Fixes PR java/4189.
671
672 2001-09-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
673
674         * java-tree.h (TYPE_IMPORT_LIST): New macro.
675         (TYPE_IMPORT_DEMAND_LIST): Likewise.
676         (struct lang_type): New fields import_list and import_demand_list.
677         * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
678         TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
679         (do_resolve_class): New local saved_enclosing_type, initialized,
680         passed as parameter to find_in_imports and find_in_imports_on_demand.
681         (find_in_imports): Added paramater enclosing_type, use its
682         TYPE_IMPORT_LIST when applicable.
683         (find_in_imports_on_demand): Added parameter enclosing_type, use
684         its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
685         declaration and initialization.
686         (fold_constant_for_init): Switch/restore current_class to the
687         appropriate context.
688
689 2001-09-13  Mark Mitchell  <mark@codesourcery.com>
690
691         * verify.c (verify_jvm_instructions): Fix typo.
692
693 2001-09-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
694
695         * expr.c (expand_invoke): Const-ification.
696         * parse.y (patch_method_invocation): Likewise.
697
698 2001-09-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
699
700         * gjavah.c (cxx_keywords): Const-ification.
701         * keyword.gperf (java_keyword): Likewise.
702         * lang.c (java_tree_code_name): Likewise.
703         * lex.c (cxx_keywords): Likewise.
704         * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
705
706 2001-09-11  Richard Henderson  <rth@redhat.com>
707
708         * parse.h (ctxp_for_generation): Mark extern.
709
710 2001-09-10  Richard Henderson  <rth@redhat.com>
711
712         * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
713
714 2001-09-07  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
715
716         * typeck.c (java_array_type_length, build_prim_array_type):
717         Represent empty arrays by NULL index.
718
719 2001-09-06  Alexandre Petit-Bianco  <apbianco@redhat.com>
720
721         * java-tree.h (compile_resource_file): Grouped with other prototypes.
722         * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
723
724 2001-09-06  Anthony Green  <green@redhat.com>
725
726         * class.c (O_BINARY): Define if necessary.
727         (registerResource_libfunc): Declare.
728         (init_class_processing): Initilize registerResource_libfunc.
729         (compile_resource_file): New function.
730         * java-tree.h (resource_name): Declare.
731         (compile_resource_file): Declare.
732         * jcf-parse.c (yyparse): Handle compiling java resource files.
733         * lang.c (java_decode_option): Handle -fcompile-resource option.
734         * jvspec.c (lang_specific_driver): Handle -R flag for compiling
735         resource files.
736         * gcj.texi (Code Generation): Add documentation for -R flag.
737
738 2001-09-05 Alexandre Petit-Bianco  <apbianco@redhat.com>
739
740         * jcf-write.c (generate_classfile): Issue an error in case of
741         field/initial value mismatch.
742         * parse.y (analyze_clinit_body): Keep <clinit> if an array is
743         being initialized and we're generating bytecode.
744         (java_complete_lhs): In MODIFY_EXPR section: added comments,
745         set DECL_INITIAL properly when appropriate.
746         Fixes PR java/4230
747         Fixes PR java/4204
748
749 2001-09-01  Per Bothner  <per@bothner.com>
750
751         * parse.y (maybe_yank_clinit):  A field without an initializer is not
752         relevant.  All initializers except static final and constant require
753         <clinit>, regardless of flag_emit_class_files.
754
755 2001-08-31  Per Bothner  <per@bothner.com>
756
757         * class.c (set_constant_value):  When not emiting class files, then a
758         String ConstantValue is a utf8const_ptr_type.
759
760 2001-08-30  Per Bothner  <per@bothner.com>
761
762         * jcf-write.c (generate_classfile):  Check that field is primitive
763         or string before emitting ConstantValue attribute.
764
765 2001-08-30  Per Bothner  <per@bothner.com>
766
767         * parse.y (resolve_qualified_expression_name):  If creating a
768         COMPOUND_EXPR, set it's type correctly.
769
770 2001-08-30  Per Bothner  <per@bothner.com>
771
772         * jcf-io.c (open_class):  Set filename field.
773
774         * jcf-parse,c (parse_class_file):  Set current_function_decl
775         for better error message when Code attribute is missing.
776
777         * lang.c (put_decl_node, lang_print_error):  Re-arrange for
778         better diagnostics, especially for constructors.
779
780 2001-08-30  Per Bothner  <per@bothner.com>
781
782         * jcf-write.c (generate_classfile):  Don't write ConstantValue
783         attribute if field is not final, for compatibility with jdk.
784
785         * jcf-write.c (generate_classfile):  Convert ConstantValue values
786         to correct type.  Work-around for front-end bug.
787         * class.c (set_constant_value):  Error if constant has wrong type.
788
789 2001-08-30  Per Bothner  <per@bothner.com>
790
791         * jcf-dump.c (print_constant):  Fix fencepost error so "Float" and
792         "Double" are printed at verbosity 1.
793
794         * jcf-dump.c (main):  Disable flag_print_attributes if --javap.
795
796         * jcf-dump.c (SPECIAL_IINC):  Remove unneeded casts to long.
797
798 2001-08-30  Alexandre Petit-Bianco  <apbianco@redhat.com>
799
800         * parse.y (patch_assignment): Don't verify final re-assignment here.
801         (java_complete_lhs): Verify assignments to finals calling
802         patch_assignment. Verify re-assignments to finals before calling
803         patch_assignment.
804
805 2001-08-29  Alexandre Petit-Bianco  <apbianco@redhat.com>
806
807         * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
808         Fixes PR java/1413
809
810 2001-08-28  Alexandre Petit-Bianco  <apbianco@redhat.com>
811
812         * lex.c (java_lex): new local found_hex_digits. Set and then used
813         in test to reject invalid hexadecimal numbers.
814         * parse.y (java_complete_tree): Prevent unwanted cast with
815         initialized floating point finals.
816         (patch_binop): Emit a warning when detecting a division by zero,
817         mark result not constant, don't simplify non integer division.
818
819 2001-08-28  Per Bothner  <per@bothner.com>
820
821         * jcf-write.c  (generate_bytecode_insns):  For increments and
822         decrements just recurse to push constant.  Improvement on Mark's patch.
823
824 2001-08-28  Mark Mitchell  <mark@codesourcery.com>
825
826         * jcf-write.c (generate_bytecode_insns): Generate an integer to
827         real conversion for increments and decrements of reals.
828
829 2001-08-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
830
831         * parse.y (resolve_qualified_expression_name): Handle unresolved
832         qualified expressions, prevent numerical qualifiers, fixed typo.
833         Fixes PR java/4141
834
835 2001-08-24  Alexandre Petit-Bianco  <apbianco@redhat.com>
836
837         * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
838         don't report anything but deprecated class when marked so. Handle
839         VAR_DECL.
840         (patch_method_invocation): Check deprecation on methods and types.
841         (patch_binop): code becomes an enum tree_code, added default: to
842         switch to handle that. Detect division by zero, try to fold and
843         return before using a subroutine.
844
845 2001-08-23  Alexandre Petit-Bianco  <apbianco@redhat.com>
846
847         * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
848         file smaller than 4 bytes.
849         * parse.y (check_inner_circular_reference): New function.
850         (check_circular_reference): Likewise.
851         (array_initializer:): Accept {,}.
852         (java_check_circular_reference): Rewritten using
853         check_circular_reference and check_inner_circular_reference.
854         (java_complete_expand_method): Unconditionally save and restore
855         the unpurged exception list.
856         (build_dot_class_method_invocation): Unmangle signature parameter.
857
858 2001-08-21  Tom Tromey  <tromey@redhat.com>
859
860         * decl.c (init_decl_processing): Add `throws' field to method
861         descriptor.
862         * class.c (make_method_value): Compute `throws' field for method.
863
864 2001-08-22  Alexandre Petit-Bianco  <apbianco@redhat.com>
865
866         * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
867         circularity is detected.
868         (ctors_unchecked_throws_clause_p): Fixed leading comment.
869
870 2001-08-17  Richard Henderson  <rth@redhat.com>
871
872         * class.c (emit_register_classes): Add align parameter to
873         call to assemble_integer.
874
875 2001-08-16  Alexandre Petit-Bianco  <apbianco@redhat.com>
876
877         * jcf-parse.c (load_class): New locals saved and class_loaded. If
878         loading a class_or_name fails, try considering an innerclass name
879         and load the enclosing context.
880         * parse.y (resolve_inner_class): New function.
881         (find_as_inner_class): Added leading comment.
882         (register_incomplete_type): Keep the current context as enclosing
883         context for JDEP_FIELD dependencies.
884         (do_resolve_class): Locals new_class_decl and super initialized to
885         NULL. Call resolve_inner_class, explore the enclosing context
886         superclass if necessary.
887         Fixes PR java/4007
888
889 2001-08-16  Tom Tromey  <tromey@redhat.com>
890
891         * jcf-dump.c (main): Updated for change to jcf_path_seal.
892         * gjavah.c (main): Updated for change to jcf_path_seal.
893         * lang.c (version_flag): New global.
894         (java_decode_option): Recognize `-version'.
895         (java_init): Update for change to jcf_path_seal.
896         * jcf.h (jcf_path_seal): Added `print' argument.
897         * jcf-path.c (jcf_path_seal): Added `print' argument.
898
899 2001-08-13  Zack Weinberg  <zackw@panix.com>
900
901         * Make-lang.in (java/decl.o): Update dependencies.
902         * decl.c: Include libfuncs.h, don't include toplev.h.
903
904 2001-08-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
905
906         * decl.c (init_decl_processing): exception_type_node,
907         class_not_found_type_node, and no_class_def_found_type_node
908         initialized. predef_filenames augmented accordingly.
909         instinit_identifier_node initialized.
910         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
911         * java-tree.h (enum java_tree_index): New entries
912         JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
913         JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
914         (exception_type_node): New macro.
915         (class_not_found_type_node): Likewise.
916         (no_class_def_found_type_node): Likewise.
917         (instinit_identifier_node): Likewise.
918         (PREDEF_FILENAMES_SIZE): Adjusted.
919         (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
920         (struct lang_type): Fixed typo in bitfield name.
921         (DECL_INSTINIT_P): New macro.
922         (ID_INSTINIT_P): Likewise.
923         * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
924         attribute.
925         * parse.y (encapsulate_with_try_catch): New function.
926         (generate_instinit): Likewise.
927         (build_instinit_invocation): Likewise.
928         (ctors_unchecked_throws_clause_p): Likewise.
929         (add_instance_initializer): Deleted.
930         (build_instance_initializer): Likewise.
931         (in_instance_initializer): Likewise.
932         (check_method_redefinition): instinit$ not to be verified.
933         (java_complete_expand_methods): Generate instinit$, simplified code.
934         (build_dot_class_method): Eliminated unnecessary locals. Use
935         encapsulate_with_try_catch, removed unnecessary code.
936         (fix_constructors): New local iii. Use build_instinit_invocation.
937         (patch_method_invocation): Added comment.
938         (maybe_use_access_method): Don't consider instinit$.
939         (find_applicable_accessible_methods_list): Shorten the search for
940         instinit$ too.
941         (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
942         (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
943         (patch_throw_statement): Likewise. Fixed typo.
944
945 2001-08-12  David Edelsohn  <edelsohn@gnu.org>
946
947         Revert:
948         2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
949         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
950         ASM_FINAL_SPEC.
951         (lang_specific_pre_link): Use set_input to set input_filename.
952         Append `main' here.
953         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
954         (main): Fix definition.
955         Strip `main' from classname.
956         Fixes PR java/227.
957
958 2001-08-11  Zack Weinberg  <zackw@panix.com>
959
960         * lex.h: Don't include setjmp.h.  Don't define
961         SET_FLOAT_HANDLER or prototype set_float_handler.
962
963 2001-08-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
964
965         * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
966         `poplevel' in the right order.
967
968 2001-08-09  Richard Henderson  <rth@redhat.com>
969
970         * Make-lang.in (class.o): Depend on TARGET_H.
971         * class.c (emit_register_classes): Use target hooks instead of
972         assemble_constructor and assemble_destructor.
973
974 2001-08-08  Alexandre Petit-Bianco  <apbianco@redhat.com>
975
976         * check-init.c (flags.h): Include
977         (check_init): Don't report uninitialized static class
978         initialization flags, don't free bit index when doing static class
979         initialization optimization.
980         (check_for_initialization): Return type changed to `unsigned int.'
981         (attach_initialized_static_class): New function.
982         * class.c (add_method_1): Create the initialized static class
983         table if necessary.
984         (finish_class): Always emit deferred inline methods.
985         * decl.c (emit_init_test_initialization): Moved to expr.c
986         (complete_start_java_method): Don't traverse
987         DECL_FUNCTION_INIT_TEST_TABLE.
988         (lang_mark_tree): Mark hash tables in function decls.
989         * expr.c (emit_init_test_initialization): Moved from decl.c.
990         (build_class_init): Create LAG_DECL_SPECIFIC for the static class
991         initialization flag, set DECL_CONTEXT and
992         LOCAL_CLASS_INITIALIZATION_FLAG.
993         (java_lang_expand_expr): Emit initialization code for static class
994         initialized flags when entering block, if necessary.
995         * gcj.texi (-fno-optimize-static-class-initialization): Documented.
996         * java-tree.h (flag_optimize_sci): New global variable declaration.
997         (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
998         (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
999         (LOCAL_FINAL_P): Fixed typo in comment.
1000         (FINAL_VARIABLE_P): Likewise.
1001         (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
1002         (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
1003         (struct lang_decl): New fields `ict', `smic' and `cif.'
1004         (check_for_initialization): New returned value for global.
1005         (attach_initialized_static_class): New global function.
1006         (STATIC_CLASS_INIT_OPT_P): New macro.
1007         * lang-options.h (-fno-optimize-static-class-initialization): New flag.
1008         * lang.c (java_decode_option): Handle
1009         `-fno-optimize-static-class-initialization'
1010         * parse.y (start_complete_expand_method): New function.
1011         (java_expand_method_bodies): Likewise.
1012         (attach_init_test_initialization_flags): Likewise.
1013         (adjust_init_test_initialization): Likewise.
1014         (emit_test_initialization): Likewise.
1015         (java_complete_expand_methods): Nullify abstract and native method
1016         bodies.
1017         (java_complete_expand_method): New locals `fbody', `block_body'
1018         and `exception_copy.' Reorganized: directly return on empty method
1019         bodies, call `start_complete_expand_method', remember definitely
1020         initialized static class in function, don't expand method bodies.
1021         (java_expand_classes): Call `java_expand_method_bodies' before
1022         `finish_class' when compiling to native.
1023         (resolve_expression_name): Use `orig' after building outer class
1024         field access.
1025         (patch_invoke): Remember static method invokations.
1026
1027 2001-08-06  Richard Henderson  <rth@redhat.com>
1028
1029         * class.c (emit_register_classes): Pass a symbol_ref and priority
1030         to assemble_constructor.
1031
1032 2001-08-02  Alexandre Petit-Bianco  <apbianco@redhat.com>
1033
1034         * java-tree.h (all_class_filename): New macro.
1035         (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
1036         (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
1037         newly created IDENTIFIER_NODE to `all_class_filename.'
1038
1039 2001-08-01  Jeff Sturm  <jsturm@one-point.com>
1040
1041         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
1042         Use ggc_add_tree_root to register roots.
1043
1044 2001-07-31  Alexandre Petit-Bianco  <apbianco@redhat.com>
1045
1046         * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
1047         second operand calling check_init.
1048         * decl.c (complete_start_java_method): Swaped second and third
1049         arguments while creating WITH_CLEANUP_EXPR node.
1050         * jcf-write.c (generate_bytecode_insns): Use second operand
1051         instead of third when handling WITH_CLEANUP_EXPR.
1052         * parse.y (java_complete_lhs): Expand second operand of
1053         WITH_CLEANUP_EXPR nodes.
1054         (patch_synchronized_statement): Swaped second and third arguments
1055         while creating WITH_CLEANUP_EXPR node.
1056
1057 2001-07-18  Alexandre Petit-Bianco  <apbianco@redhat.com>
1058
1059         * parse.y (create_interface): Avoid cyclic inheritance report when
1060         syntax error encountered during class definition.
1061         Fixes PR java/2956
1062
1063 2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1064
1065         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1066         ASM_FINAL_SPEC.
1067         (lang_specific_pre_link): Use set_input to set input_filename.
1068         Append `main' here.
1069         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1070         (main): Fix definition.
1071         Strip `main' from classname.
1072         Fixes PR java/227.
1073
1074 2001-07-18  Tom Tromey  <tromey@redhat.com>
1075
1076         For PR java/2812:
1077         * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
1078         * lex.c (java_new_lexer): Use ICONV_CONST.
1079         (java_read_char): Likewise.
1080         * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
1081         (jv-scan$(exeext)): Likewise.
1082
1083 2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
1084
1085         * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
1086         * parse.y (check_class_interface_creation): Allow `private' if the
1087         enclosing is not an interface.
1088         (create_interface): Interface tagged public if the enclosing
1089         context is an interface.
1090         (create_class): Class tagged public if the enclosing context
1091         is an interface.
1092         Fixes PR java/2959
1093
1094 2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
1095
1096         * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
1097         Fixes PR java/2665
1098
1099 2001-07-14  Tim Josling  <tej@melbpc.org.au>
1100
1101         * check-init.c (check_init): Remove references to EXPON_EXPR.
1102
1103 2001-07-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
1104
1105         * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
1106         TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
1107         Fixes PR java/3602
1108
1109 2001-07-13  Tom Tromey  <tromey@redhat.com>
1110
1111         * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
1112         invocation.
1113
1114 2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
1115
1116         * parse.y (patch_method_invocation): Don't override primary if one
1117         is already provided, but let this$<n> be built. Fixed comment.
1118
1119 2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
1120
1121         * parse.y (empty_statement:): Report empty statement error only
1122         when found at class declaration level.
1123         Fixes PR java/3635
1124
1125 2001-07-12  Tom Tromey  <tromey@redhat.com>
1126
1127         * expr.c (expand_load_internal): New function.
1128         (LOAD_INTERNAL): Use it.
1129
1130 2001-07-11  Alexandre Petit-Bianco  <apbianco@redhat.com>
1131
1132         * parse.y (verify_constructor_super): Compare anonymous class ctor
1133         args with `valid_method_invocation_conversion_p.'
1134         Fixes PR java/3285
1135
1136 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
1137
1138         * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
1139         `-fsyntax-only.' Fixes PR java/3248
1140
1141 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
1142
1143         * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
1144
1145 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
1146
1147         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
1148         current function is static. Fixes PR java/1970
1149
1150 2001-07-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
1151
1152         * parse.y (patch_method_invocation): Add enclosing context to ctor
1153         calls if necessary. Fixes PR java/2953
1154
1155 2001-07-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
1156
1157         * parse.y (resolve_package): Abort if qualified expression member
1158         isn't right.
1159         (qualify_ambiguous_name): Don't qualify as type if `this' in use.
1160         Fixes PR java/1391
1161
1162 2001-07-07  Zack Weinberg  <zackw@stanford.edu>
1163
1164         * verify.c: Don't use // comments.
1165
1166 2001-07-05  Tom Tromey  <tromey@redhat.com>
1167
1168         * lang.c (flag_assume_compiled): Removed.
1169         * java-tree.h (flag_assume_compiled): Removed.
1170         * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
1171         -fhash-synchronization, -fuse-divide-subroutine,
1172         -fcheck-references, -femit-class-file, -femit-class-files,
1173         -fassume-compiled.  Updated --encoding information.  Changed
1174         -foutput-class-dir to `-d'.
1175
1176 2001-07-04  Daniel Berlin  <dan@cgsoftware.com>
1177
1178         * jcf-parse.c (parse_class_file): Add lineno parameter to
1179         debug_start_source_file call.
1180
1181 2001-07-04  Joseph S. Myers  <jsm28@cam.ac.uk>
1182
1183         * gcj.texi: Use gpl.texi.
1184         * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
1185         dependencies and use doc/include in search path.
1186
1187 2001-07-03  Jeff Sturm  <jsturm@one-point.com>
1188
1189         * parse.y (fix_constructors): Test if a CALL_EXPR invokes
1190         `this'.  If so, don't build instance initializers.
1191
1192 2001-07-03  Alexandre Petit-Bianco  <apbianco@redhat.com>
1193
1194         * parse.y (resolve_expression_name): Improved error message for
1195         inner class cases. Fixes PR java/1958
1196
1197 2001-06-28  Gabriel Dos Reis  <gdr@codesourcery.com>
1198
1199         * lang.c: #include diagnostic.h
1200         (lang_print_error): Add a `diagnostic_context *' parameter.
1201         (java_dummy_print): Likewise.
1202         * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
1203
1204 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
1205
1206         * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
1207         * jcf.h (typedef struct JCF): New bitfield `finished.'
1208         (JCF_FINISH): Set `finished.'
1209         (JCF_ZERO): Reset `finished.'
1210         Fixes PR java/2633
1211
1212 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
1213
1214         * parse.y (class_body_declaration:): Don't install empty instance
1215         initializers.
1216         Fixes PR java/1314
1217
1218 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
1219
1220         * class.c (set_super_info): Call `set_class_decl_access_flags.'
1221         (set_class_decl_access_flags): New function.
1222         * java-tree.h (set_class_decl_access_flags): New prototype.
1223         * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
1224         (parse_class_file): New local `decl_max_locals.' Take wide types
1225         into account to compute DECL_MAX_LOCALS.
1226         * parse.y (type_import_on_demand_declaration:): Ignore duplicate
1227         imports on demand.
1228
1229 2001-06-22  Jan van Male  <jan.vanmale@fenk.wau.nl>
1230
1231         * zipfile.h: Use GCC_JCF_H instead of JCF_H.
1232
1233 2001-06-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
1234
1235         * class.c (java_hash_tree_node): Fixed indentation in leading comment.
1236         * parse.y (do_resolve_class): Moved comments out to leading comment
1237         section. Removed local `start', New local `_ht' and
1238         `circularity_hash.'  Record `enclosing' in hash table and search
1239         it to detect circularity.  Use `enclosing' as an argument to
1240         `lookup_cl.' Free the hash table when done.
1241
1242 2001-06-19  Tom Tromey  <tromey@redhat.com>
1243
1244         * lex.c (java_read_char): Disallow invalid and overlong
1245         sequences.  Fixes PR java/2319.
1246
1247 2001-06-05  Jeff Sturm  <jsturm@one-point.com>
1248
1249         * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
1250
1251 2001-06-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
1252
1253         * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
1254         arguments accordingly.
1255
1256 2001-06-02  Joseph S. Myers  <jsm28@cam.ac.uk>
1257
1258         * gcj.texi: Move contents to just after title page.
1259
1260 2001-06-01  Alexandre Petit-Bianco  <apbianco@redhat.com>
1261
1262         * parse.y (type_literals:): Use `build_incomplete_class_ref' with
1263         builtin type.
1264         (patch_incomplete_class_ref): Build the class ref, build the class
1265         init if necessary, complete the tree.
1266         Fixes PR java/2605
1267
1268 2001-05-31  Alexandre Petit-Bianco  <apbianco@redhat.com>
1269
1270         * parse.y (lookup_field_wrapper): Test `name' code.
1271         (resolve_qualified_expression_name): Test `qual_wfl' code.
1272         (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
1273         handle `qual_wfl' by code.
1274         (maybe_build_primttype_type_ref): Test `wfl' code.
1275
1276 2001-05-23  Theodore Papadopoulo  <Theodore.Papadopoulo@sophia.inria.fr>
1277
1278         * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
1279         fdl.texi.
1280         (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls.  Create
1281         the dvi file in the java directory.
1282
1283 2001-05-25  Sam TH  <sam@uchicago.edu>
1284
1285         * gen-table.pl javaop.h jcf.h lex.h,
1286         parse.h: Fix header include guards.
1287
1288 2001-05-23  Joseph S. Myers  <jsm28@cam.ac.uk>
1289
1290         * jv-scan.c (version): Update copyright year.
1291
1292 2001-05-21  Per Bothner  <per@bothner.com>
1293
1294         * jcf-parse.c (read_class):  If class is from .class or .zip file
1295         and it's already been read, don't push/pop parser context.
1296
1297 2001-05-18  Per Bothner  <per@bothner.com>
1298
1299         * jvspec.c (lang_specific_pre_link):  Re-arrange the linker
1300         command line so the jvgenmain-generated main program comes first.
1301
1302 2001-05-15  Tom Tromey  <tromey@redhat.com>
1303
1304         * class.c (build_utf8_ref): Don't generate identifier based on
1305         utf8const contents.
1306
1307 2001-05-12  Richard Henderson  <rth@redhat.com>
1308
1309         * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
1310         * expr.c (java_lang_expand_expr): Expand it.
1311         (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
1312         calling build_exception_object_ref.
1313         * parse.y (catch_clause_parameter): Likewise.
1314         (build_dot_class_method): Likewise.
1315         (try_reference_assignconv): Likewise.
1316         * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
1317         * jcf-write.c (generate_bytecode_insns): Likewise.
1318
1319 2001-05-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
1320
1321         * parse.y (build_unresolved_array_type): Set
1322         EXPR_WFL_QUALIFICATION on the newly created wfl.
1323         Fixes PR java/2538. Fixes PR java/2535.
1324
1325 2001-05-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
1326
1327         * parse.y (fix_constructors): Removed unnecessary assignment to
1328         local. Moved assignment to `this$<n>', fixed comments and
1329         indentation.
1330         (build_wfl_wrap): Fixed indentation.
1331         Fixes PR java/2598, java/2579 and java/2658.
1332
1333 2001-05-03  Mo DeJong  <mdejong@redhat.com>
1334
1335         * lex.c (java_new_lexer): Call iconv_close on temp handle used to
1336         check for byte swap.
1337
1338 2000-05-02  Jeff Sturm  <jsturm@one-point.com>
1339
1340         * expr.c (build_class_init): Move MODIFY_EXPR
1341         outside of COND_EXPR.  Remove variable `call'.
1342
1343 2001-05-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1344
1345         * decl.c: NULL_PTR -> NULL.
1346         * jcf-write.c: Likewise.
1347
1348 2001-05-01  Tom Tromey  <tromey@redhat.com>
1349
1350         * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
1351         (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
1352         * gcj.texi: Updated copyright text.  Include fdl.texi.
1353         (Top): Link to new node.
1354
1355 2001-05-01  Per Bothner  <per@bothner.com>
1356
1357         * parse.h (REGISTER_IMPORT):  Use tree_cons instead of chainon.
1358
1359 2001-05-01  Per Bothner  <per@bothner.com>
1360
1361         * parse.y (java_pop_parser_context):  The TREE_VALUE of a link in the
1362         import_list contains the name, not the TREE_PURPOSE.
1363
1364 2001-04-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1365
1366         * jcf-io.c (read_zip_member): Cast to long in comparison with
1367         signed value.
1368
1369         * jvspec.c (lang_specific_driver): Initialize variables.
1370
1371         * mangle.c (find_compression_record_match): Likewise.
1372
1373         * typeck.c (build_null_signature): Provide static prototype.  Mark
1374         parameter with ATTRIBUTE_UNUSED.
1375
1376         * verify.c (verify_jvm_instructions): Initialize variable.
1377
1378 2001-04-27  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1379
1380         * parse.y (do_resolve_class): Check for cyclic inheritance during
1381         inner class resolution.
1382
1383 2001-04-27  Per Bothner  <per@bothner.com>
1384
1385         * parse.y (java_expand_classes):  Don't change ctxp_for_generation
1386         while iterating, since that could cause gc to lose stuff.
1387
1388 2001-04-26  Per Bothner  <per@bothner.com>
1389
1390         Fix method search wrt scope of inner classes to match JLS2.
1391         * typeck.c (build_null_signature):  New static function.
1392         (has_method):  New function.  Uses build_null_signature and lookup_do.
1393         * java-tree.h (has_method):  New declaration.
1394         * parse.y (find_applicable_accessible_methods_list):  Do not search
1395         context of inner classes here.
1396         (patch_method_invocation):  Search scope, ie. current and outer clases,
1397         for method matching simple name, to find class.
1398
1399 2001-04-26  Per Bothner  <per@bothner.com>
1400
1401         * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
1402         Fix thinko:  If a single case, use if_icmpeq, not ifeq.
1403
1404         * constants.c (find_methodref_with_class_index):  New function.
1405         (find_methodref_index):  Use find_methodref_with_class_index.
1406         * java-tree.h (find_methodref_with_class_index):  New declaration.
1407         * jcf-write.c (generate_bytecode_insns case CALL_EXPR):  Don't change
1408         DECL_CONTEXT, instead use new find_methodref_with_class_index function.
1409         If context changed from interface to class, don't use invokeinterface.
1410
1411 2001-04-25  Per Bothner  <per@bothner.com>
1412
1413         * verify.c (verify_jvm_instructions):  For field instructions,
1414         check that field index is valid.  For invoke instructions, check that
1415         method index is valid.
1416
1417 2001-04-25  Alexandre Oliva  <aoliva@redhat.com>
1418
1419         * config-lang.in (target_libs): Copy from $libgcj_saved.
1420
1421 2001-04-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1422
1423         * decl.c (init_decl_processing): Add new class "protectionDomain"
1424         field.
1425         * class.c (make_class_data): Set initial value for "protectionDomain".
1426
1427 2001-04-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1428
1429         * jvspec.c (lang_specific_driver): Fix memory allocation
1430         deficit, by using concat in lieu of xmalloc/sprintf.
1431
1432 2001-04-20  Per Bothner  <per@bothner.com>
1433
1434         Fixes to compile multiple .class files at once.
1435         * decl.c (init_decl_processing):  Don't set CLASS_LOADED_P.
1436         * java-tree.h (CLASS_PARSED_P):  New macro.
1437         (CLASS_LOADED_P):  Re-define to use TYPE_SIZE and CLASS_PARSED_P.
1438         * jcf-parse.c (jcf_parse_source):  Inline into read_class.
1439         (read_class):  Avoid some code duplication.
1440         Don't call JCF_FINISH for a .class file - might be needed later.
1441         (jcf_parse):  Don't call layout_class here.  Check/set CLASS_PARSED_P
1442         rather than CLASS_LOADED_P, since latter implies class laid out.
1443         (yyparse):  Do layout_class and JCF_FINISh here instead, in pass 2.
1444         * parse.y:  Don't need to set CLASS_LOADED_P for array types.
1445
1446 2001-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1447
1448         * Make-lang.in (java/boehm.o): Depend on toplev.h.
1449
1450         * boehm.c: Include toplev.h.
1451
1452 2001-04-06  Tom Tromey  <tromey@redhat.com>
1453             Alexandre Petit-Bianco  <apbianco@redhat.com>
1454
1455         Fix for PR gcj/1404 and PR gcj/2332:
1456         * parse.y (build_array_from_name): If we use the type_wfl then
1457         accumulate dimensions from the original type as well.
1458         (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
1459
1460 2001-04-06  Tom Tromey  <tromey@redhat.com>
1461
1462         * parse.y (analyze_clinit_body): Return true if the second operand
1463         of a METHOD_EXPR is nonzero.
1464
1465 2001-04-06  Tom Tromey  <tromey@redhat.com>
1466
1467         * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
1468         directory.
1469         ($(srcdir)/java/parse.c): Likewise.
1470
1471 2001-04-05  Alexandre Petit-Bianco  <apbianco@redhat.com>
1472
1473         * gcj.texi: Use `which-gcj' instead of `which-g77.'
1474         (version-gcc): Initialized.
1475         (which-gcj): Likewise.
1476
1477 2001-04-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
1478
1479         * java-tree.h (struct lang_decl): New macro
1480         `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
1481         * parse.y (build_instance_initializer): New function.
1482         (add_instance_initializer): Use it.
1483         (java_fix_constructors): Set `current_class' before fix pass.
1484         (fix_constructors): Just return if already fixed. Move `super()'
1485         invokation ahead. Use `build_instance_initializer.'
1486         Fixes PR java/1315.
1487
1488 2001-04-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
1489
1490         * parse.y (resolve_qualified_expression_name): Pass field's
1491         DECL_CONTEXT to `not_accessible_p.'
1492         (not_accessible_p): Changed parameters order in `inherits_from_p'
1493         invokation.
1494
1495 2001-03-27  Andrew Haley  <aph@cambridge.redhat.com>
1496
1497         * lang-options.h: Add flag_check_references.
1498
1499 2001-04-04  Per Bothner  <per@bothner.com>
1500
1501         * java-tree.h (CONSTANT_VALUE_P):  New macro.
1502         * jcf-write.c (generate_classfile):  Use CONSTANT_VALUE_P.
1503         * parse.y (maybe_build_class_init_for_field):  New static function.
1504         (resolve_expression_name, resolve_field_access):  Use
1505         maybe_build_class_init_for_field instead of build_class_init
1506         This does not do the init if the field is compile-time-constant.
1507         (resolve_field_access):  Simplify.
1508
1509         * parse.y (fold_constant_for_init):  Merge test into switch.
1510
1511 2001-04-03  Zack Weinberg  <zackw@stanford.edu>
1512
1513         * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
1514         on gansidecl.h.
1515         * buffer.c, jvgenmain.c: Don't include gansidecl.h.
1516
1517 2001-04-02  Zack Weinberg  <zackw@stanford.edu>
1518
1519         * expr.c (pop_type_0): Save the result of the first
1520         lang_printable_name call in a scratch buffer, so it
1521         won't be clobbered by the second call.
1522
1523 2001-03-30  Alexandre Petit-Bianco  <apbianco@redhat.com>
1524
1525         * parse-scan.y (array_type:): Rewritten.
1526         (type_declaration:): `empty_statement' replaces `SC_TK.'
1527         (class_member_declaration:): `empty statement' added.
1528         (method_body:): Simplified.
1529         (static_initializer:): Likewise.
1530         (primary_no_new_array:): Use `type_literals.'
1531         (type_literals:): New rule.
1532         (dims:): Set and update `bracket_count.'
1533         Fixes PR java/1074. Fixes PR java/2412.
1534
1535 2001-03-28  Hans Boehm  <boehm@acm.org>
1536
1537         * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
1538         (get_boehm_type_descriptor): Set type on returned value to be a
1539         pointer length integer.
1540
1541 2001-03-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1542
1543         * expr.c (pop_type_0): Call `concat' rather than building the
1544         string manually.
1545         (pop_type): Add format specifier in call to `error'.
1546
1547         * parse.y (patch_method_invocation): Avoid casting away
1548         const-ness.
1549
1550 2001-03-28  Jeffrey Oldham  <oldham@codesourcery.com>
1551
1552         * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
1553
1554 2001-03-28  Richard Henderson  <rth@redhat.com>
1555
1556         IA-64 ABI Exception Handling:
1557         * Make-lang.in (except.o): Don't depend on eh-common.h.
1558         * check-init.c (check_init): Handle EXC_PTR_EXPR.
1559         * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
1560         [soft_exceptioninfo_call_node]: Remove.
1561         [eh_personality_libfunc, lang_eh_runtime_type]: New.
1562         (end_java_method): No emit_handlers.
1563         * except.c (java_set_exception_lang_code): Remove.
1564         (method_init_exceptions): Don't call it.
1565         (prepare_eh_table_type): No CATCH_ALL_TYPE.
1566         (build_exception_object_ref): New.
1567         (expand_end_java_handler): Update for except.h name changes.
1568         (emit_handlers, expand_resume_after_catch): Remove.
1569         * expr.c (java_lang_expand_expr): Update for except.h name changes.
1570         (process_jvm_instruction): Use build_exception_object_ref.
1571         * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
1572         (soft_exceptioninfo_call_node): Remove.
1573         (build_exception_object_ref): Declare.
1574         * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
1575         soft_exceptioninfo_call_node.  Move processing ...
1576         [EXC_PTR_EXPR]: ... here.
1577         * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
1578         * parse.y (catch_clause_parameter): Use build_exception_object_ref.
1579         (source_end_java_method): No java_set_exception_lang_code or
1580         emit_handlers.
1581         (build_dot_class_method): Use build_exception_object_ref.
1582         (try_reference_assignconv): Check EXC_PTR_EXPR not
1583         soft_exceptioninfo_call_node.
1584
1585 2001-03-28  Richard Henderson  <rth@redhat.com>
1586
1587         * java-tree.h (throw_node): Define as a single member of
1588         java_global_trees instead of a separate array.
1589         (JTI_THROW_NODE): New.
1590         * decl.c (throw_node): Don't declare.
1591         (init_decl_processing): Init a scalar throw_node.
1592         Don't register it for gc.
1593         * check-init.c (check_init): Reference scalar throw_node.
1594         * expr.c (build_java_athrow): Likewise.
1595         * jcf-write.c (generate_bytecode_insns): Likewise.
1596         * parse.h (BUILD_THROW): Likewise.
1597
1598 2001-03-28  Richard Henderson  <rth@redhat.com>
1599
1600         * decl.c (end_java_method): Do not save and restore
1601         flag_non_call_exceptions.
1602         * parse.y (source_end_java_method): Likewise.
1603         * lang.c (flag_exceptions): Don't declare.
1604         (java_init_options): Set flag_non_call_exceptions.  Set
1605         flag_exceptions here ...
1606         (java_init): ... not here.
1607
1608 2001-03-27  Richard Henderson  <rth@redhat.com>
1609
1610         * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
1611         exceptions_via_longjmp.
1612
1613         * lang.c (flag_new_exceptions): Don't declare it.
1614         (java_init_options): Or set it.
1615
1616 2001-03-27  Richard Henderson  <rth@redhat.com>
1617
1618         * decl.c (end_java_method): Rename asynchronous_exceptions to
1619         flag_non_call_exceptions.
1620         * parse.y (source_end_java_method): Likewise.
1621
1622 2001-03-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1623
1624         * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
1625
1626 2001-03-26  Mark Mitchell  <mark@codesourcery.com>
1627
1628         * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
1629
1630 2001-03-26  Alexandre Petit-Bianco  <apbianco@redhat.com>
1631
1632         * parse.y (find_as_inner_class): Follow current package
1633         indications not to mistakingly load an unrelated class.
1634
1635 2001-03-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1636
1637         * constants.c (PUTN): Use memcpy, not bcopy.
1638
1639         * lex.c (java_read_char): Use memmove, not bcopy.
1640
1641         * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
1642
1643 2001-03-23  Per Bothner  <per@bothner.com>
1644
1645         * verify.c (verify_jvm_instructions):  Replace 3 pop_type by POP_TYPE
1646         macro for better error pin-pointing.
1647         * java-tree.h:  Fix typo in comment.
1648
1649         * jcf-write.c (generate_bytecode_insns):  Changes to TRY_FINALLY_EXPR.
1650         Don't include jsr/goto in exception range.
1651         Check if start and end of exception range are the same (also TRY_EXPR).
1652         Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
1653         However, do emit the following goto even if try_block is empty.
1654         Defer freeing exception_decl until after the finalizer, to make
1655         sure the local isn't reused in the finalizer.  Fixes PR java/1208.
1656
1657         * parse.y (java_complete_lhs):  If the try-clause is empty, just
1658         return the finally-clause and vice versa.
1659
1660 2001-03-23  Alexandre Petit-Bianco  <apbianco@redhat.com>
1661
1662         * gcj.texi (Input Options): documented the check for attribute
1663         `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
1664         * java-tree.h (flag_force_classes_archive_check): Declared extern.
1665         * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
1666         (jcf_parse): Check for the right classes archive if necessary.
1667         * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
1668         (jcf_parse_fields): Fixed indentation.
1669         * jcf-write.c (append_gcj_attribute): New function.
1670         (generate_classfile): Compute the attribute count, invoke
1671         `append_gcj_attribute'.
1672         * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
1673         turned into bit fields. New bit field `right_zip.'
1674         (JCF_ZERO): Set `right_zip' to zero.
1675         * lang-options.h (-fforce-classes-archive-check): Added flag.
1676         * lang.c (flag_force_classes_archive_check): New flag.
1677         (lang_f_options): New entry `force-classes-archive-check.'
1678         Fixes PR java/1213.
1679
1680 2001-02-07  Andrew Haley  <aph@redhat.com>
1681
1682         * gcj.texi (Configure-time Options): Add -fcheck-references.
1683         * expr.c (build_java_indirect_ref): New function.
1684         (java_check_reference): New function.
1685         (build_java_array_length_access): Use build_java_indirect_ref to
1686         check for null references.
1687         (build_java_arrayaccess): Likewise.
1688         (build_get_class): Likewise.
1689         (build_field_ref): Likewise.
1690         (invoke_build_dtable): Likewise.
1691         (build_invokeinterface): Likewise.
1692         * lang.c (lang_f_options): Add flag_check_references.
1693         * jvspec.c (jvgenmain_spec): Add flag_check_references.
1694         * java-tree.h (flag_check_references): New variable.
1695         * lang.c (flag_check_references): Likewise.
1696         * parse.y (patch_invoke): Use java_check_reference.
1697         (patch_assignment): Allow for extra nesting in
1698         _Jv_CheckArrayStore.
1699
1700 2001-03-23  Bryce McKinlay  <bryce@albatross.co.nz>
1701
1702         * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
1703         * lex.c (cxx_keywords): Likewise.
1704
1705 2001-03-21  Alexandre Petit-Bianco  <apbianco@redhat.com>
1706
1707         * parse.y (qualify_ambiguous_name): Broaden `length'
1708         recognition. Help MODIFY_EXPR be resolved as expression names.
1709         Fixes PR java/2066. Fixes PR java/2400.
1710
1711 2001-03-21  Bryce McKinlay  <bryce@albatross.co.nz>
1712
1713         * gjavah.c (process_file): Mark interface definitions with
1714         "__attribute__ ((java_interface))".
1715
1716 2001-03-21  Alexandre Petit-Bianco  <apbianco@redhat.com>
1717
1718         * class.c (layout_class): Fixed push_super_field's second
1719         argument. Fixes PR java/2333.
1720         (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
1721         too early to lay innerclasses out.
1722
1723 2001-03-20  Tom Tromey  <tromey@redhat.com>
1724             Alexandre Petit-Bianco <apbianco@redhat.com>
1725
1726         * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
1727         inside an array reference. Insertion of the array store check
1728         rewritten. Fixes PR java/2299.
1729
1730 2001-03-20  Tom Tromey  <tromey@redhat.com>
1731
1732         * lex.c (java_read_unicode): Only accept leading `u's.
1733
1734 2001-03-20  Tom Tromey  <tromey@redhat.com>
1735
1736         * jcf-parse.c (read_class): Initialize `class'.
1737
1738 2001-03-20  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
1739
1740         * jcf_parse.c (jcf_parse): Eliminate unused variable.
1741
1742 2001-03-19  Mark Mitchell  <mark@codesourcery.com>
1743
1744         * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
1745         (layout_class): Likewise.
1746         (layout_class_method): Likewise.
1747         (emit_register_classes): Likewise.
1748         * decl.c (builtin_function): Likewise.
1749         (give_name_to_locals): Likewise.
1750
1751 2001-03-19  Per Bothner  <per@bothner.com>
1752
1753         * jcf-parse.c (load_inner_classes):  Check CLASS_LOADED_P
1754         before trying to load an inner class.
1755
1756         Fixes to process to command-line .class files in two passes.
1757         * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P):  New flags.
1758         (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P):  Rename to ..
1759         (CLASS_FROM_CURRENTLY_COMPILED_P):  ... because it is more general now.
1760         * class.c (is_compiled_class):  Fix for renamed flag.
1761         * parse.y (maybe_create_class_interface_decl):  Likewise.
1762         * jcf-parse.c (yyparse):  Also set if compiling .class files.
1763         * jcf-parse.c (read_class);  Read current_class.
1764         (jcf_parse):  Make static.
1765         (load_inner_classes):  New function, with code moved from jcf_parse,
1766         because we need to inner classes after the command-line files are read.
1767         (yyparse):  Set finput to NULL when it doesn't need to be closed.
1768         Reduce use of main_jcf (basically only for archive) and
1769         use finput instead of main_jcf->read_state.
1770         Inline jcf_figure_file_type into yyparse.
1771         Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
1772         Defer load_inner_classes and parse_class_file to a second pass,
1773         after we've correctly mapped command-line .clas fiels to classes.
1774         (jcf_figure_file_type):  Removed.
1775         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE):  Removed flags.
1776         (JCF_ZERO):  Also clear zipd field.
1777         * zipfile.h:  Conditionalize on JCF_H insread of JCF_ZIP.
1778
1779 2001-03-18  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
1780
1781         * jcf-parse.c (yyparse): Change ch from char * to char.
1782
1783 2001-03-19  Per Bothner  <per@bothner.com>
1784
1785         * jvspec.c (lang_specific_driver):  Check for .zip and .jar files.
1786         Add constructed filelist-file at end, following -xjava.  Thus any .o
1787         and library files are not affected by the -xjava.  Also wrap
1788         explicit @FILE with -xjava and -xnone.
1789
1790 2001-03-19  Andrew Haley  <aph@cambridge.redhat.com>
1791
1792         * class.c (build_static_field_ref): Call make_decl_rtl() after
1793         setting the DECL_EXTERNAL flag.
1794
1795 2001-03-17  Per Bothner  <per@bothner.com>
1796
1797         * decl.c (clear_binding_level):  Fix initializer (broke 03-15).
1798
1799         * jcf-write.c (generate_bytecode_insns):  Handle emitting iinc
1800         when result is is needed (target is STACK_TARGET).
1801
1802         * parse.h (JDEP_SOLV):  Removed.
1803         * parse.y (register_incomplete_type):  Use JDEP_TO_RESOLVE instead.
1804
1805         * parse.y (incomplete_class_list): Removed.
1806         (obtain_incomplete_type): Don't use or set incomplete_class_list.
1807         It doesn't work if resolve_class changes the name of an array type
1808         that is on the list and then someone else looks for the modified name.
1809         Also, seems liable to break when compiling multiple source files at
1810         once.  So the simplest is to just remove incomplete_class_list -
1811         it is only a minor space win and it is not even clear it saves time.
1812
1813         * parse.y (resolve_class):  Remove unneeded promote_type.
1814
1815 2001-03-15  Per Bothner  <per@bothner.com>
1816
1817         * java-tree.h (BLOCK_IS_IMPLICIT):  New flag.
1818         * parse.h (BLOCK_EXPR_ORIGIN):  Removed macro.
1819         * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
1820         Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
1821
1822         * jcf-parse.c (yyparse):  Set/reset input_filename for source file.
1823         * parse.y (java_expand_classes):  Likewise.
1824
1825         * parse.y (expand_start_java_method):  Was only called once and had a
1826         misleading name, so inline in caller java_complete_expand_method.
1827         (enter_a_block):  Likewise inline in enter_block and remove.
1828
1829         Remove junk from when gcc/java was created (by copying from C/C++).
1830         * decl.c (keep_next_level_flag, keep_next_if_subblocks):  Remove.
1831         (struct binding_level):  Remove fields keep, keep_if_subblocks,
1832         more_cleanups_ok, have_cleanups (which have never been used).
1833         (pushlevel, poplevel):  Remove related useless code.
1834
1835         * class.c (make_class_data):  The class_dtable_decl (i.e. the
1836         vtable for Class) should be external, except when compiling Class.
1837
1838         * jvspec.c (lang_specific_driver):  Fix -C handling.
1839         Check -save-temps to see if temp @FILE should be deleted.
1840         Follow-up to/fix for February 16 patch.
1841
1842         * verify.c (verify_jvm_instructions):  Better error msgs for dup.
1843         (type_stack_dup):  Remove no-longer neded error check.
1844
1845 2001-03-15  Bryce McKinlay  <bryce@albatross.co.nz>
1846
1847         * mangle.c (mangle_record_type): Rename 'from_pointer' argument
1848         to 'for_pointer'. If this type is for a pointer (argument) mangling,
1849         don't surround the element with 'N..E' if the type name is
1850         unqualified.
1851
1852 2001-03-14  Mark Mitchell  <mark@codesourcery.com>
1853
1854         * class.c (build_static_field_ref): Use COPY_DECL_RTL,
1855         DECL_RTL_SET_P, etc.
1856         (make_method_value): Likewise.
1857         (get_dispatch_table): Likewise.
1858
1859         * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
1860
1861 2001-03-07  Tom Tromey  <tromey@redhat.com>
1862
1863         * config-lang.in (lang_requires): Define.
1864
1865 2001-03-07  Brad Lucier  <lucier@math.purdue.edu>
1866
1867         * typeck.c (convert): Check flag_unsafe_math_optimizations,
1868         not flag_fast_math.
1869
1870 2001-03-05  Per Bothner  <per@bothner.com>
1871
1872         Fix a problem where rest_of_decl_compilation applied to
1873         class_dtable_decl causes problems because it was done too early,
1874         before output file was opened.
1875         * decl.c (init_decl_processing):  Remove init of class_dtable_decl.
1876         * class.c (class_dtable_decl):  Add macro - element of class_roots.
1877         (make_class_data):  Define class_dtable_decl.
1878         * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl):  Removed.
1879
1880 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
1881
1882         * java/class.c, java/decl.c, java/java-tree.h: Replace all
1883         uses of 'boolean' with 'bool'.
1884
1885 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
1886
1887         * lang-specs.h: Add zero initializer for cpp_spec field to all
1888         array elements.
1889
1890 2001-02-16  Per Bothner  <per@bothner.com>
1891
1892         Handle compiling multiple input files at once, and @FILE syntax.
1893         * gcj.texi:  Updated documentation to match.
1894         * java-tree.h (flag_filelist_file, init_src_parse):  New declarations.
1895         * jcf-parse.c (parse_source_file):  Split into ...
1896         (parse_source_file_1):  New function - and:
1897         (parse_source_file_2):  New function.
1898         (yyparse):  On -ffilelist-file, open and scan named file.
1899         On first pass over files, only do parse_source_file_1.
1900         A new second pass calls parse_source_file_2 for each file to compile.
1901         (init_jcf_parse):  Call init_src_parse.
1902         * jvspec.c (INDIRECT_FILE_ARG):  New flag.
1903         (lang_specific_driver):  Support @FILELIST-FILE syntax, as well
1904         as multiple input file combined in one compilation.
1905         * lang-options.h:  Add -ffilelist-file
1906         * lang.c (flag_filelist_file):  New flag variable.
1907         (lang_f_options):  Handle -ffilelist-file.
1908         * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
1909         * parse.h (struct parse_ctxt):  Remove fields incomplete_class and
1910         gclass_list - use global fields of src_parse_roots instead.
1911         * parse.y (src_parse_roots):  New array.
1912         (incomplete_class_list, gclass_list):  New macros.
1913         (push_parser_context, java_pop_parser_context,
1914         java_parser_context_resume):  Don't fiddle with deleted fields.
1915         (various):  Use incomplete_class gclass_list and global macros
1916         instead of parse_ctxt fields - the lists are global.
1917         (init_src_parse):  New function.
1918
1919 Fri Feb 23 15:28:39 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1920
1921         * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
1922
1923 2001-02-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
1924
1925         * parse.y (check_inner_class_access): Moved declaration of local
1926         `enclosing_decl_type' to the right location.
1927
1928 2001-02-19  Bryce McKinlay  <bryce@albatross.co.nz>
1929
1930         * parse.y (parser_check_super_interface): Don't call
1931         check_pkg_class_access for an inner interface.
1932         (parser_check_super): Don't call check_pkg_class_access for inner
1933         class.
1934         (do_resolve_class): Simplify enclosing type loop. Don't call
1935         check_pkg_class_access if CL and DECL are not set.
1936         (find_in_imports_on_demand): Set DECL if class_type needed to be
1937         loaded. Don't call check_pkg_class_access for an inner class.
1938         (check_inner_class_access): Rewritten to implement member access
1939         rules as per spec 6.6.1.
1940         (check_pkg_class_access): Handle the empty package correctly.
1941         (in_same_package): New function. Determine if two classes are in the
1942         same package.
1943
1944 2001-02-18  Bryce McKinlay  <bryce@albatross.co.nz>
1945
1946         * typeck.c (build_java_array_type): Don't try to poke a public `clone'
1947         method into array types.
1948         * parse.y (patch_method_invocation): Bypass access check on clone call
1949         to array instance.
1950
1951 2001-02-15  Alexandre Petit-Bianco  <apbianco@redhat.com>
1952
1953         * expr.c (build_instanceof): Check for arrays when trying fold to
1954         false.
1955
1956 2001-02-15  Jim Meyering  <meyering@lucent.com>
1957
1958         * Make-lang.in (java.install-common): Depend on `installdirs'.
1959         (java.install-info): Likewise.
1960
1961 2001-02-15  Bryce McKinlay  <bryce@albatross.co.nz>
1962
1963         * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
1964
1965 2001-02-14  Tom Tromey  <tromey@redhat.com>
1966             Alexandre Petit-Bianco  <apbianco@cygnus.com>
1967
1968         Fix for PR java/1261.
1969         * typeck.c (build_java_array_type): Add public `clone' method to
1970         arrays.
1971         * parse.y (resolve_qualified_expression_name): Use current_class
1972         when checking for inaccessibility.
1973         (patch_method_invocation): Fixed error message when accessibility
1974         denied.  Added `from_super' argument.
1975
1976 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
1977
1978         * parse.y (resolve_class): Don't build a fake decl. Use the one
1979         already built.
1980         * typeck.c (build_java_array_type): Build and assign decl to array
1981         type.
1982
1983 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
1984
1985         * parse.y (not_accessible_p): Changed leading comment. Added extra
1986         `where' argument. Use it to enforce protected access rules.
1987         (resolve_qualified_expression_name): Added extra argument to
1988         not_accessible_p.
1989         (patch_method_invocation): Use argument `primary' to provide
1990         not_accessible_p with an extra argument.
1991         (lookup_method_invoke): Added extra argument to not_accessible_p.
1992         (search_applicable_method_list): Likewise.
1993
1994 2001-02-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
1995
1996         * parse.y (resolve_qualified_expression_name): Try to resolve as
1997         an inner class access only if `decl' is a TYPE_DECL.
1998
1999 2001-02-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2000
2001         * decl.c (classdollar_identifier_node): Initialize.
2002         * java-tree.h (enum java_tree_index): New entry
2003         `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
2004         (classdollar_identifier_node): New macro.
2005         (ID_CLASSDOLLAR_P): Likewise.
2006         * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
2007         (build_dot_class_method_invocation): Likewise.
2008         (find_applicable_accessible_methods_list): `class$' can't be
2009         inherited.
2010
2011 2001-02-09  Raja R Harinath  <harinath@cs.umn.edu>
2012
2013         * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
2014
2015 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2016
2017         * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
2018         * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
2019         gone.
2020
2021 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2022
2023         * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
2024         outside of the `__U' sequence too.
2025         (unicode_mangling_length): Count `_' or `U' outside of the `__U'
2026         sequence too.
2027
2028 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2029
2030         * jvgenmain.c (error): Reversed 2001-02-01 deletion.
2031
2032 2001-02-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2033
2034         * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
2035         (JVGENMAIN_OBJS): Likewise.
2036         * java-tree.h (append_gpp_mangled_name): New prototype.
2037         * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
2038         Removed cast calling `gcc_add_root.'
2039         * jvgenmain.c (mangle_obstack): New global, initialized.
2040         (main): Use it.
2041         (do_mangle_class): Constify local `ptr.'
2042         Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
2043         append_gpp_mangle_name and update `count' if necessary.
2044         Use `mangle_obstack.'
2045         * mangle.c (append_unicode_mangled_name): Removed.
2046         (append_gpp_mangled_name): Likewise.
2047         (unicode_mangling_length): Likewise.
2048         (mangle_member_name): Return type set to `void.'
2049         (mangle_field_decl): Don't append `U' in escaped names.
2050         (mangle_method_decl): Likewise.
2051         (mangle_member_name): Just use `append_gpp_mangled_name.'
2052         * mangle_name.c: New file.
2053
2054 2001-02-07  Per Bothner  <per@bothner.com>
2055
2056         * check-init.c (check_init):  Fix TRY_FINALLY_EXPR logic.
2057
2058         * check-init.c (check_init):  Don't call done_alternative after
2059         processing loop code, as a LOOP_EXPR never terminates normally.
2060
2061 2001-02-08  Joseph S. Myers  <jsm28@cam.ac.uk>
2062
2063         * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
2064
2065 2001-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2066
2067         * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
2068         DECLs.
2069
2070 2001-02-06  Tom Tromey  <tromey@redhat.com>
2071
2072         * lex.c (java_new_lexer): Longer error message.
2073
2074 2001-02-05  Jeff Sturm  <jeff.sturm@commerceone.com>
2075             Alexandre Petit-Bianco  <apbianco@cygnus.com>
2076
2077         * typeck.c (build_prim_array_type): Added leading comment.
2078         (build_java_array_type): Moved locals out of
2079         block. Always create the `data' field, fixed alignment to match
2080         C++.
2081
2082 2001-02-04  Tom Tromey  <tromey@redhat.com>
2083
2084         * expr.c (java_lang_expand_expr): Don't bother recomputing
2085         `length'.  Use rest_of_decl_compilation, not make_decl_rtl.
2086         Fixes PR java/1866.
2087
2088 2001-02-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2089
2090         * parse.y (process_imports): Save the original name of the import
2091         for better error report.
2092
2093 2001-02-04  Bryce McKinlay  <bryce@albatross.co.nz>
2094
2095         * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
2096         of macros used when compiling jvspec.c.
2097         * jvspec.c (lang_specific_driver): Link with the shared
2098         libgcc by default.
2099
2100 Sun Feb  4 15:52:44 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2101
2102         * check-init.c (check_init): Call internal_error instead of fatal.
2103         * expr.c (java_lang_expand_expr): Likewise.
2104         * jcf-parse.c (get_constant): Likewise.
2105         * mangle.c (java_mangle_decl): Likewise.
2106         * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
2107         (operator_string): Likewise.
2108         * check-init.c (check_init): Call abort instead of fatal.
2109         * class.c (build_class_ref): Likewise.
2110         * constants.c (write_constant_pool): Likewise.
2111         * decl.c (start_java_method): Likewise.
2112         * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
2113         (java_stack_dup, encode_newarray_type): Likewise.
2114         (build_java_array_length_access): Likewise.
2115         (build_java_check_indexed_type, expand_java_pushc): Likewise.
2116         (build_java_soft_divmod, build_invokeinterface): Likewise.
2117         * java-tree.h (INNER_CLASS_P): Likewise.
2118         * jcf-parse.c (parse_signature, get_name_constant): Likewise.
2119         (give_name_to_class, get_class_constant): Likewise.
2120         * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
2121         (find_constant_index, generate_bytecode_conditional): Likewise.
2122         (generate_bytecode_insns, perform_relocations): Likewise.
2123         * lex.c (java_unget_unicode, java_lex): Likewise.
2124         * mangle.c (mangle_type, mangle_record_type): Likewise.
2125         (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
2126         (finish_mangling): Likewise.
2127         * parse.h (MARK_FINAL_PARMS): Likewise.
2128         * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
2129         (obtain_incomplete_type, java_complete_class): Likewise.
2130         (java_check_regular_methods, java_complete_expand_method): Likewise.
2131         (cut_identifier_in_qualified, check_deprecation): Likewise.
2132         (patch_invoke, find_applicable_accessible_methods_list): Likewise.
2133         (java_complete_lhs, lookup_name_in_blocks): Likewise.
2134         (check_final_variable_indirect_assignment, build_unaryop): Likewise.
2135         * typeck.c (set_local_type, parse_signature_type): Likewise.
2136         (parse_signature_string, build_java_signature): Likewise;
2137         (set_java_signature): Likewise.
2138         * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
2139         * class.c (add_method): Call fatal_error instead of fatal.
2140         (build_static_field_ref): Likewise.
2141         * expr.c (build_known_method_ref, expand_invoke): Likewise.
2142         * jcf-parse.c (get_constant, jcf_parse): Likewise.
2143         * lex.c (java_new_new_lexer): Likewise.
2144         * jv-scan.c (main): Likewise.
2145         (fatal_error): Renamed from fatal.
2146         * jcf-parse.c (yyparse): Call fatal_io_error instead of
2147         pfatal_with_name.
2148         * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
2149         (yyparse): Likewise.
2150         * jcf-write.c (make_class_file_name, write_classfile): Likewise.
2151         * lex.c (java_get_line_col): Likewise.
2152         * jcf-parse.c (load_class): Make errors non-fatal.
2153         * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
2154
2155 2001-02-01  Bryce McKinlay  <bryce@albatross.co.nz>
2156
2157         * jvgenmain.c (class_mangling_suffix): Remove unused string.
2158         (error): Remove unused function.
2159         (main): Don't use "__attribute__ alias" on generated class symbol.
2160
2161 2001-01-30  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2162
2163         * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
2164         argument.
2165         * parse.y (finish_method_declaration): Code accounting for WFLed
2166         method DECL_NAMEs deleted.
2167         (check_abstract_method_definitions): Likewise.
2168         (resolve_type_during_patch): Layout resolved type.
2169         * typeck.c (lookup_do): Removed unused local.
2170
2171 2001-01-30  Bryce McKinlay  <bryce@albatross.co.nz>
2172
2173         * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
2174         * decl.c (init_decl_processing): Use integer_minus_one_node, not
2175         integer_negative_one_node.
2176         * expr.c (build_java_binop): Likewise.
2177
2178 2001-01-24  Jeff Sturm  <jeff.sturm@commerceone.com>
2179
2180         * zextract.c (read_zip_archive): Read file_offset before writing
2181         zipd and consequently clobbering the header contents.
2182
2183 2001-01-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2184
2185         * Make-lang.in: Remove all dependencies on defaults.h.
2186         * decl.c: Don't include defaults.h.
2187         * expr.c: Likewise.
2188         * parse.y: Likewise.
2189
2190 2001-01-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2191
2192         * ChangeLog (2001-01-21): Fixed typo.
2193         * class.c (layout_class_method): Code accounting for WFLed
2194         method DECL_NAMEs deleted.
2195         * constant.c (find_methodref_index): Likewise.
2196         * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
2197         * java-tree.h (DECL_FUNCTION_WFL): New macro.
2198         (struct lang_decl): New field `wfl'.
2199         (java_get_real_method_name): Prototype deleted.
2200         * mangle.c (mangle_method_decl): Code accounting for WFLed
2201         method DECL_NAMEs deleted.
2202         * parse.h (GET_METHOD_NAME): Macro deleted.
2203         * parse.y (reset_method_name): Deleted.
2204         (method_header): Set DECL_FUNCTION_WFL.
2205         (check_abstract_method_header): Code accounting for WFLed method
2206         DECL_NAMEs deleted.
2207         (java_get_real_method_name): Deleted.
2208         (check_method_redefinition): Code accounting for WFLed method
2209         DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
2210         (java_check_regular_methods): Likewise.
2211         (java_check_abstract_methods): Likewise.
2212         (java_expand_classes): Don't call `reset_method_name.'
2213         (search_applicable_method_list): Use DECL_NAMEs instead of
2214         GET_METHOD_NAME.
2215         * typeck.c (lookup_do): Code accounting for WFLed method
2216         DECL_NAMEs deleted.
2217
2218 2001-01-25  Richard Earnshaw  <rearnsha@arm.com>
2219
2220         * lex.c (java_read_char): Check for EOF from getc first.
2221
2222 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2223
2224         * class.c (layout_class): Don't lay the superclass out if it's
2225         already being laid out.
2226         * jcf-parse.c (handle_innerclass_attribute): New function.
2227         (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
2228         handle_innerclasses_attribute.
2229         (jcf_parse): Don't load an innerclasses if it's already being
2230         laid out.
2231         * jcf-write.c (append_innerclass_attribute_entry): Static
2232         `anonymous_name' and its initialization deleted. `ocii' and `ini'
2233         to be zero for anonymous classes.
2234
2235 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2236
2237         * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
2238         necessary.
2239         * jcf-parse.c (set_source_filename): Use
2240         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
2241
2242 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2243
2244         * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
2245         gets a unique asm name.
2246
2247 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2248
2249         * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
2250         (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
2251         if necessary.
2252         (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
2253         * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
2254         * parse.y (lookup_package_type_and_set_next): Deleted.
2255         (resolve_package): Removed unnecessary code.
2256         (find_applicable_accessible_methods_list): `finit$' can't be
2257         inherited.
2258         * verify.c (pop_argument_types): Added missing prototype.
2259
2260 2001-01-23  Bryce McKinlay  <bryce@albatross.co.nz>
2261
2262         * config-lang.in: Disable java by default.
2263
2264 2001-01-23  Tom Tromey  <tromey@redhat.com>
2265
2266         * gcj.texi (Copying): New node.
2267         Added copyright information.
2268
2269 2001-01-21  Per Bothner  <per@bothner.com>
2270
2271         Various fixes to allow compiling a compressed .jar/.zip archive.
2272         * zipfile.h (struct ZipFileCache):  Replace by struct ZipFile.
2273         (struct ZipFile):  Add fields name and next (from  ZipFileCache).
2274         (struct ZipDirectory):  New field zipf points to owning ZipFile.
2275         * jcf.h (struct ZipDirectory):  Add forward declaration.
2276         (struct JCF):   Declare zipd field to have type struct ZipDirectory.
2277         Remove seen_in_zip and zip_offset fields.
2278         (JCF_SEEN_IN_ZIP):  New macro.
2279         * zextract.c (read_zip_archive):  Set ZipDirectory's zipf field.
2280         * jcf-io.c:  Change all ZipFileCache to ZipFile.
2281         (read_zip_member):  New function.
2282         (open_in_zip):  Call read_zip_member.
2283         * jcf-parse.c (find_in_current_zip):  Remove function.
2284         (read_class):  Merge in find_in_current_zip functionality.
2285         Call read_zip_member if needed.
2286         (parse_zip_file_entries):  Use read_zip_member.
2287         (process_zip_dir):  Update for removed and added JCF fields.
2288         (jcf_figure_file_type):  Re-use, don't copy initial ZipFile struct.
2289
2290 2001-01-21  Per Bothner  <per@bothner.com>
2291
2292         Minor optimization of static ggc roots.
2293         * jcf-parse.c (parse_roots):  New static field.
2294         (current_field, current_method, current_file_list):  Replace by macros
2295         naming fields of parse_roots.
2296         (init_jcf_parse):  Combine 3 ggc_add_tree_root calls to 1.
2297         * class.c (class_roots):  New static field.
2298         (registered_class, fields_ident, info_ident, class_list):
2299         New macros naming fields of parse_roots.
2300         (build_static_field_ref):  Don't register roots here.
2301         (layout_class):  Static field list replaced by macro class_list.
2302         (init_class_processing):  Call ggc_add_tree_root for 4 roots.
2303         Initialize fields_ident and info_ident here.
2304
2305 2001-01-21  Per Bothner  <per@bothner.com>
2306
2307         * jcf-parse.c (ggc_mark_jcf):  New function.
2308         (init_jcf_parse):  Register current_jcf as ggc root.
2309
2310 2001-01-21  Per Bothner  <per@bothner.com>
2311
2312         * lang.c (put_decl_node):  Print method's name.
2313
2314 2001-01-21  Per Bothner  <per@bothner.com>
2315
2316         * verify.c (VERIFICATION_ERROR_WITH_INDEX):  New macro.
2317         (verify_jvm_instructions):  Use it, for better error messages on loads.
2318
2319 2001-01-21  Per Bothner  <per@bothner.com>
2320
2321         * verify.c (merge_type_state):  Still may have to merge even if
2322         LABEL_VERIFIED (label).
2323
2324 2001-01-21  Per Bothner  <per@bothner.com>
2325
2326         * parse.y (method_header):  Don't set the DECL_NAME of a FUNCTION_DECL
2327         to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
2328
2329 2001-01-19  Per Bothner  <per@bothner.com>
2330
2331         * expr.c (pop_type_0):  Only return object_ptr_type_node on mismatch
2332         if expeting an interface type.  Refines Tom's change of 2000-09-12.
2333
2334 2001-01-18  Per Bothner  <per@bothner.com>
2335
2336         * gcj.texi (Input Options): Mention .java files.
2337
2338 2001-01-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2339
2340         * lang-options.h (-Wunsupported-jdk11): Removed.
2341         * lang.c (flag_not_overriding): Deleted.
2342         (flag_static_local_jdk1_1): Likewise.
2343         (lang_W_options): Removed "unsupported-jdk11" entry.
2344         * parse.y (java_check_methods): Removed dead code.
2345
2346 2001-01-17  Tom Tromey  <tromey@redhat.com>
2347
2348         Changes suggested by Per Bothner:
2349         * gcj.texi (Input Options): Don't mention input files.
2350         (Code Generation): Updated --main information.
2351         (Invoking jcf-dump): Mention that --javap is incomplete.
2352         From Alexandre Petit-Bianco:
2353         (Warnings): Don't mention -Wunsupported-jdk11.
2354         My stuff:
2355         (Compatibility): Mention JDK 1.2-ness of libraries.
2356         (Resources): Mention resources used when writing gcj.
2357
2358 2001-01-17  Tom Tromey  <tromey@redhat.com>
2359
2360         * gcj.texi: New file.
2361         * Make-lang.in ($(srcdir)/java/gcj.info): New target.
2362         (java.info): Depend on gcj.info.
2363         (java/gcj.dvi): New target.
2364         (java.dvi): Depend on gcj.dvi.
2365         (java.install-info): Wrote.
2366
2367 2001-01-16  Jeff Sturm  <jeff.sturm@appnet.com>
2368
2369         * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
2370         having called make_decl_rtl.
2371
2372 2001-01-14  Per Bothner  <per@bothner.com>
2373
2374         Various patches to emit better messages on verification errors.
2375         * expr.c (push_type_0):  Return error indication on stack overflow,
2376         instead of callinfg fatal.
2377         (push_type):  Now just call push_type_0 (nd fatal on overflow).
2378         (pop_type_0):  Return detailed error message (in a char** argument).
2379         (pop_type):  If pop_type_0 fails, print error message.
2380         (pop_argument_types):  Moved to verify.c.
2381         * verify.c (pop_argument_types):  Moved from expr.c.
2382         Return a (possible) error message, rather than void.
2383         (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING):  New macros.
2384         (verify_jvm_instruction):  Use new macros, improving error messages.
2385         For case OPCODE_astore use object_ptr_type_node.
2386         * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED):  New macros.
2387         (pop_type_0, push_type_0, pop_argument_types):  Update accordingly.
2388
2389         * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
2390         constant, return body without wrapper.  (Improves constant folding.)
2391         * lex.c (build_wfl_node):  Clear TREE_TYPE from returned node.
2392
2393 2001-01-13  Per Bothner  <per@bothner.com>
2394
2395         * expr.c (expand_java_field_op):  Assigning to a final field outside
2396         an initializer does not violate JVM spec, so should be warning, not
2397         error.  (Sun's verifier does not complain - though MicroSoft's does.)
2398
2399 2001-01-12  Joseph S. Myers  <jsm28@cam.ac.uk>
2400
2401         * gjavah.c (version), jcf-dump.c (version): Update copyright year
2402         to 2001.
2403
2404 2001-01-11  Bryce McKinlay  <bryce@albatross.co.nz>
2405
2406         * parse.y (resolve_expression_name): Permit instance variables from
2407         enclosing context in super constructor call.
2408         (resolve_qualified_expression_name): Permit enclosing class's qualified
2409         "this" in super constructor call.
2410
2411 2001-01-10  Mark Mitchell  <mark@codesourcery.com>
2412
2413         * class.c (build_utf8_ref): Remove last argument in call to
2414         make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
2415         (build_class_ref): Likewise.
2416         (build_static_field_ref): Likewise.
2417         (get_dispatch_table): Likewise.
2418         (layout_class_method): Likewise.
2419         (emit_register_classes): Likewise.
2420         * constants.c (build_constant_data_ref): Likewise.
2421         * decl.c (builtin_function): Likewise.
2422         (create_primitive_vtable): Likewise.
2423         * expr.c (build_known_method_def): Likewise.
2424         (build_jni_stub): Likewise.
2425         (java_lang_expand_expr): Likewise.
2426
2427 2001-01-10  Tom Tromey  <tromey@redhat.com>
2428
2429         * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
2430
2431 2001-01-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2432
2433         * java-tree.h (lang_printable_name_wls): New prototype.
2434         * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
2435         rather than `current_class' to print type name. Don't prepend type
2436         names when printing constructor names.
2437         (lang_printable_name_wls): New function.
2438         * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
2439         `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
2440         * parse.y (patch_method_invocation): Message tuned for constructors.
2441         (not_accessible_p): Grant `private' access from within
2442         enclosing contexts.
2443
2444 2001-01-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2445
2446         All files with updated copyright when applicable.
2447         * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
2448         * class.c (mangle_class_field): Function removed.
2449         (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
2450         (utf8_cmp, cxx_keyword_p): Moved to lex.c.
2451         (build_class_ref): Call `java_mangle_class_field' instead of
2452         `mangle_class_field.'
2453         (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
2454         (layout_class): Call `java_mangle_decl' instead of
2455         `mangle_static_field.'
2456         (cxx_keywords): Initialized static array moved to `lex.c.'
2457         (layout_class_method): Changed leading comment. Simplified to
2458         call `java_mangle_decl.' Local `ptr' moved in for loop body.
2459         * decl.c (lang_mark_tree): Mark field `package_list.'
2460         * java-tree.h (TYPE_PACKAGE_LIST): New macro.
2461         (struct lang_type): New field `package_list.'
2462         (unicode_mangling_length): Prototype removed.
2463         (append_gpp_mangled_name, append_gpp_mangled_classtype,
2464         emit_unicode_mangled_name): Likewise.
2465         (cxx_keyword_p): New prototype.
2466         (java_mangle_decl, java_mangle_class_field,
2467         java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
2468         * jcf-parse.c (jcf_parse_source): Constify `file' argument to
2469         `build_expr_wfl.'
2470         * jvgenmain.c (main_method_prefix): Global variable removed.
2471         (main_method_suffix): Likewise.
2472         (do_mangle_classname): New function.
2473         (main): Call it. Format changed to accommodate new mangling scheme.
2474         * lex.c: (utf8_cmp): Conditionally prototyped.
2475         (cxx_keywords): Moved from class.c, conditionally defined.
2476         (utf8_cmp, cxx_keyword_p): Likewise.
2477         * mangle.c (obstack.h, ggc.h): Included.
2478         (mangle_field_decl): New function.
2479         (mangle_method_decl, mangle_type, mangle_pointer_type,
2480         mangle_array_type, mangle_record_type,
2481         find_compression_pointer_match, find_compression_array_match,
2482         find_compression_record_match,
2483         find_compression_array_template_match, set_type_package_list,
2484         entry_match_pointer_p, emit_compression_string, init_mangling,
2485         finish_mangling, compression_table_add, mangle_member_name): Likewise.
2486         (mangle_obstack): New global.
2487         (MANGLE_RAW_STRING): New macro.
2488         (unicode_mangling_length): Turned static.
2489         (append_unicode_mangled_name): Renamed from
2490         `emit_unicode_mangled_name.'  Turned static. `mangle_obstack'
2491         replaces `obstack', removed from the parameter list.
2492         (append_gpp_mangled_name): Turned static. `mangle_obstack'
2493         replaces parameter `obstack', removed from the parameter list. Call
2494         `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
2495         (append_gpp_mangled_classtype): Removed.
2496         (compression_table, compression_next): New static variables.
2497         * parse.y (temporary_obstack): Extern declaration removed.
2498
2499 2001-01-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2500
2501         * parse.y (patch_binop): Compute missing type in error situations.
2502
2503 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
2504
2505         * class.c (make_class_data): Push initial value for "arrayclass".
2506         * decl.c (init_decl_processing): Add new class field "arrayclass".
2507
2508 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
2509
2510         From patha@softlab.ericsson.se:
2511         * parse.y (switch_label): Use build, not build1, to construct
2512         DEFAULT_EXPR.
2513
2514 2001-01-04  Neil Booth  <neil@daikokuya.demon.co.uk>
2515
2516         * lang.c (lang_decode_option): Change -MA to -MP.
2517         * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
2518         Update to new prototype; do quote targets.
2519         (jcf_dependency_write): Update.
2520
2521 2000-12-22  Bryce McKinlay  <bryce@albatross.co.nz>
2522
2523         Shorten primitive array allocation path:
2524         * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
2525         to create new primitive arrays.
2526         * expr.c (build_newarray): If generating native code, call
2527         soft_newarray_node with a reference to the primitive TYPE identifier
2528         instead of type_value.
2529
2530 2000-12-17  Bryce McKinlay  <bryce@albatross.co.nz>
2531
2532         Fix for PRs gcj/312 and gcj/253:
2533         * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
2534         dest if they arn't already.
2535         * class.c (layout_class): Call maybe_layout_super_class on
2536         superinterfaces also, but only if compiling from bytecode.
2537
2538         Fix for PR gcj/373:
2539         * parse.y (create_class): Set ACC_STATIC if class is declared in an
2540         interface.
2541
2542 2000-12-15  Tom Tromey  <tromey@redhat.com>
2543
2544         * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
2545         set.
2546
2547 2000-12-14  Andrew Haley  <aph@redhat.com>
2548
2549         * boehm.c (mark_reference_fields): Change test to correctly detect
2550         bitmap overflow.
2551
2552 2000-12-15  Andreas Jaeger  <aj@suse.de>
2553
2554         * config-lang.in (lang_dirs): Added.
2555
2556 2000-12-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2557
2558         * parse.y (end_artificial_method_body): Fixed undefined behavior.
2559         Credits go to rth for finding it.
2560
2561 2000-12-13  Mike Stump  <mrs@wrs.com>
2562
2563         * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
2564
2565 2000-11-07  Tom Tromey  <tromey@cygnus.com>
2566
2567         * Make-lang.in (JAVA_LEX_C): Added chartables.h.
2568         * lex.c (java_ignorable_control_p): Removed.
2569         (java_letter_or_digit_p): Removed.
2570         (java_start_char_p): New function.
2571         (java_read_char): Return `int', not `unicode_t'.  Changed
2572         callers.
2573         (java_read_unicode): Likewise.
2574         (java_read_unicode_collapsing_terminators): Likewise.
2575         (java_get_unicode): Likewise.
2576         (java_new_lexer): Initialize hit_eof.
2577         (java_parse_end_comment): Take `int' argument.
2578         (java_parse_doc_section): Likewise.
2579         (java_parse_escape_sequence): Don't allow backlash-newline.
2580         Return `int'.
2581         * lex.h (JAVA_DIGIT_P): Removed.
2582         (_JAVA_LETTER_OR_DIGIT_P): Removed.
2583         (_JAVA_IDENTIFIER_IGNORABLE): Removed.
2584         (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
2585         (JAVA_PART_CHAR_P): New macro.
2586         (UEOF): Now -1.
2587         (JAVA_CHAR_ERROR): Now -2.
2588         (java_lexer): New field `hit_eof'.
2589         * chartables.h: New file.
2590         * gen-table.pl: new file.
2591
2592 2000-11-20  Tom Tromey  <tromey@cygnus.com>
2593             Alexandre Petit-Bianco  <apbianco@cygnus.com>
2594
2595         * parse.y (java_complete_lhs): Only allow compound assignment of
2596         reference type if type is String.
2597
2598 2000-12-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2599
2600         * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
2601         jcf-path.c: Likewise.
2602
2603 2000-12-09  Anthony Green  <green@redhat.com>
2604
2605         * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
2606         filestart and filename_length as int values.
2607
2608 2000-12-07  Mo DeJong  <mdejong@redhat.com>
2609
2610         * jcf-io.c (find_class): Correct the logic that tests to see if a
2611         .java file is newer than its .class file. The compiler was
2612         incorrectly printing a warning when file mod times were equal.
2613
2614 2000-12-07  Zack Weinberg  <zack@wolery.stanford.edu>
2615
2616         * jvgenmain.c: Use ISPRINT not isascii.
2617
2618 2000-12-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2619
2620         * parse.y (end_artificial_method_body): Fixed typo.
2621
2622 2000-12-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2623
2624         * parse.y (patch_method_invocation): Pick the correct enclosing
2625         context when creating inner class instances.
2626         Fixes gcj/332.
2627
2628 2000-11-26  Joseph S. Myers  <jsm28@cam.ac.uk>
2629
2630         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
2631         Update copyright year to 2000.
2632
2633 2000-11-23  Anthony Green  <green@redhat.com>
2634
2635         * jcf-parse.c (init_jcf_parse): Register current_file_list root.
2636         Move current_file_list out of yyparse and make it static.
2637
2638         * expr.c: Declare quick_stack and tree_list_free_list as static
2639         (init_expr_processing): Register quick_stack and
2640         tree_list_free_list roots.
2641
2642 2000-11-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2643
2644         * parse.y (build_outer_field_access): New local `decl_ctx', use
2645         it. Check for field's context and current class immediate outer
2646         context inheritance.
2647         (outer_field_access_p): Consider fields inherited from the last
2648         enclosing context.
2649         (build_access_to_thisn): Stop at the last enclosing context if
2650         necessary.
2651         Fixes gcj/367.
2652
2653 Thu Nov 23 02:19:14 2000  J"orn Rennecke <amylaar@redhat.com>
2654
2655         * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
2656
2657 2000-11-22  Bryce McKinlay  <bryce@albatross.co.nz>
2658
2659         * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
2660         scratch buffer.
2661
2662 2000-11-20  Tom Tromey  <tromey@cygnus.com>
2663
2664         * jv-scan.c (help): Document --complexity.
2665         (options): Added --complexity.
2666         (flag_complexity): New global.
2667         (main): Call `report'.
2668         * parse-scan.y (complexity): New global.
2669         (if_then_statement, if_then_else_statement,
2670         if_then_else_statement_nsi, switch_block_statement_group,
2671         while_expression, do_statement, for_begin, continue_statement,
2672         throw_statement, catch_clause, finally, method_invocation,
2673         conditional_and_expression, conditional_or_expression,
2674         conditional_expression): Update complexity.
2675         (reset_report): Reset complexity.
2676         (report): New function.
2677
2678 2000-11-20  Tom Tromey  <tromey@cygnus.com>
2679
2680         * lex.c (yylex): Added STRICT_TK case.
2681         * parse.y (STRICT_TK): Added.
2682         * parse-scan.y (STRICT_TK): Added.
2683         * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
2684         `;'.  Use 4, not 3, with -k option.  Correctly rename resulting
2685         file.
2686         * keyword.h: Rebuilt.
2687         * keyword.gperf (strictfp): Added.
2688
2689 2000-11-20  Tom Tromey  <tromey@cygnus.com>
2690
2691         * lex.c (yylex): Recognize floating point constants with leading
2692         0.
2693
2694 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2695
2696         * java-tree.h (cyclic_inheritance_report): Constify.
2697         * parse.y (cyclic_inheritance_report): Likewise.
2698
2699 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
2700
2701         * parse.y (goal): Remove call to ggc_add_string_root.
2702
2703 2000-11-16  Zack Weinberg  <zack@wolery.stanford.edu>
2704
2705         * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
2706         Create string in scratch buffer, then pass to build_string.
2707
2708 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
2709
2710         * parse.y (issue_warning_error_from_context): Add
2711         ATTRIBUTE_PRINTF.
2712
2713 2000-11-11  Anthony Green  <green@redhat.com>
2714
2715         * jcf-parse.c (process_zip_dir): Add finput parameter.
2716         (jcf_figure_file_type): Call process_zip_dir with appropriate
2717         argument.
2718
2719 2000-11-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2720
2721         * decl.c (copy_lang_decl): Use memcpy, not bcopy.
2722         * jcf-parse.c (jcf_figure_file_type): Likewise.
2723
2724 2000-11-09  Joseph S. Myers  <jsm28@cam.ac.uk>
2725
2726         * parse.y (create_new_parser_context): Use memset () instead of
2727         bzero ().
2728
2729 2000-11-08  Tom Tromey  <tromey@cygnus.com>
2730
2731         * gjavah.c (process_file): Only include gcj/cni.h when generating
2732         CNI stubs.
2733
2734 2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>
2735
2736         * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
2737         (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
2738         instead of bzero ().
2739
2740 2000-11-05  Tom Tromey  <tromey@cygnus.com>
2741
2742         * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
2743         * lex.c (IS_ZERO): New define.
2744         (java_perform_atof): Error on floating point underflow.
2745
2746 2000-11-04  Tom Tromey  <tromey@cygnus.com>
2747
2748         * lex.c (java_parse_escape_sequence): Only read two octal
2749         characters if the first one is greater than 3.  Don't allow
2750         "octal" numbers to include the digits 8 or 9.
2751
2752 2000-11-05  Joseph S. Myers  <jsm28@cam.ac.uk>
2753
2754         * Make-lang.in (java.distdir): Remove.
2755
2756 2000-11-03  Tom Tromey  <tromey@cygnus.com>
2757
2758         * Make-lang.in (java.dvi): New target.
2759         Partial fix for PR other/567.
2760
2761         * lang-options.h: Mention -Wout-of-date.
2762         * jcf-dump.c (flag_newer): New global.
2763         * gjavah.c (flag_newer): New global.
2764         * jcf-io.c (find_class): Only warn when flag_newer set.
2765         * lang.c (flag_newer): New global.
2766         (struct string_option): New declaration.
2767         (lang_W_options): New global.
2768         (process_option_with_no): New function.
2769         (lang_decode_option): Use it.
2770
2771         * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
2772         * gjavah.c (cxx_keyword_subst): Handle any number of trailing
2773         `$'.
2774
2775         * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
2776         (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
2777         * lex.c (java_read_unicode): Removed `term_context' argument.
2778         Recognize any number of `u' in `\u'.
2779         (java_read_unicode_collapsing_terminators): New function.
2780         (java_get_unicode): Use it.
2781         (java_lineterminator): Removed.
2782         (yylex): Produce error if character literal is newline or single
2783         quote.  Return if eof found in middle of `//' comment.  EOF in
2784         `//' comment is only an error if pedantic.
2785         (java_ignorable_control_p): New function.
2786         (java_parse_end_comment): Return if eof found in middle of
2787         comment.
2788         Include flags.h.
2789         * jv-scan.c (pedantic): New global.
2790
2791 2000-10-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2792
2793         * parse.y (outer_field_access_p): Inherited fields aren't
2794         consider outer fields.
2795         (maybe_build_thisn_access_method): Use
2796         PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
2797         (resolve_expression_name): Trigger an error if a static field
2798         is being accessed as an outer field.
2799
2800 2000-10-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2801
2802         * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
2803         Fixes gcj/365.
2804
2805 2000-10-27  Zack Weinberg  <zack@wolery.stanford.edu>
2806
2807         * Make-lang.in: Move all build rules here from Makefile.in,
2808         adapt to new context.  Wrap all rules that change the current
2809         directory in parentheses.  Expunge all references to $(P).
2810         When one command depends on another and they're run all at
2811         once, use && to separate them, not ;.  Add OUTPUT_OPTION to
2812         all object-file generation rules.  Delete obsolete variables.
2813
2814         * Makefile.in: Delete.
2815         * config-lang.in: Delete outputs= line.
2816
2817 2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2818
2819         * parse.y (patch_method_invocation): NULLify this_arg when already
2820         inserted.
2821         (maybe_use_access_method): Handle call to methods unrelated to the
2822         current class. Fixed comment.
2823         Fixes gcj/361.
2824
2825 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2826
2827        * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
2828        scope.
2829
2830 2000-10-24  Tom Tromey  <tromey@cygnus.com>
2831
2832         * lex.c (java_new_lexer): Initialize new fields.  Work around
2833         broken iconv() implementations.
2834         (java_read_char): Swap bytes if required.  Use fallback decoder if
2835         required.
2836         (byteswap_init, need_byteswap): New globals.
2837         (java_destroy_lexer): Only close iconv handle if it is in use.
2838         * lex.h (java_lexer): New fields read_anything, byte_swap,
2839         use_fallback.
2840         Made out_buffer unsigned.
2841
2842 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2843
2844         * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
2845         where an enclosing context can be set on the jdep.
2846         (do_resolve_class): Fixed identation.
2847
2848 2000-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2849
2850         * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
2851
2852         * jcf-reader.c (peek_attribute, skip_attribute): Only define
2853         when requested.
2854
2855         * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
2856
2857         * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
2858
2859 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2860
2861         * jcf-write.c (OP1): Update `last_bc'.
2862         (struct jcf_block): Fixed indentation and typo in comments.  New
2863         field `last_bc'.
2864         (generate_bytecode_insns): Insert `nop' if `jsr' immediately
2865         follows `monitorenter'.
2866         * parse.y (patch_synchronized_statement): New local `tmp'. Call
2867         `patch_string'.
2868         Fixes gcj/232.
2869
2870 2000-10-16  Tom Tromey  <tromey@cygnus.com>
2871
2872         * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
2873         * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
2874         * lang-options.h: Added -MA, -MT, -MF..
2875         * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
2876         (DEPEND_TARGET_SET): New macro.
2877         (DEPEND_FILE_ALREADY_SET): Likewise.
2878         (init_parse): Handle new flags.
2879         * jcf.h (jcf_dependency_print_dummies): Declare.
2880         * Make-lang.in (s-java): Added mkdeps.o.
2881         * Makefile.in (BACKEND): Added mkdeps.o.
2882         (../gcjh$(exeext)): Added mkdeps.o.
2883         (../jcf-dump$(exeext)): Added mkdeps.o.
2884         * jcf-depend.c: Include mkdeps.h.
2885         (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
2886         add_entry): Removed.
2887         (jcf_dependency_reset): Rewrote.
2888         (dependencies): New global.
2889         (jcf_dependency_set_target): Rewrote.
2890         (jcf_dependency_add_target): Likewise.
2891         (jcf_dependency_add_file): Likewise.
2892         (munge): Removed.
2893         (print_ents): Removed.
2894         (jcf_dependency_write): Rewrote.
2895         (print_dummies): New global.
2896         (jcf_dependency_print_dummies): New function
2897         (jcf_dependency_write): Call deps_dummy_targets if required.
2898
2899 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2900
2901         * gjavah.c (add_class_decl): Removed unused variables `tname',
2902         `tlen' and `name_index'.
2903         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
2904         * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
2905         in `wfl_operator' with value.
2906         (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
2907         (jcf_figure_file_type): Fixed identation.
2908         * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
2909         * parse.y (analyze_clinit_body): New function.
2910         (static_initializer:): Reset `current_static_block'.
2911         (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
2912         `wfl_operator' with new value.
2913         (lookup_cl): Use EXPR_WFL_FILENAME.
2914         (maybe_yank_clinit): Handle bogus <clinit> bodies, call
2915         analyze_clinit_body.
2916         (build_outer_field_access): Access to this$<n> built from
2917         current_class, not its outer context.
2918         (build_access_to_thisn): Fixed leading comment. Tidied things up.
2919         (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
2920         (patch_method_invocation): Use `is_static_flag' when already
2921         initialized.
2922         (patch_newarray): Removed assignment in ternary operator.
2923
2924 2000-10-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2925
2926         * except.c (free_eh_ranges): Don't free `whole_range'.
2927
2928 2000-10-15  Anthony Green  <green@redhat.com>
2929
2930         * decl.c (init_decl_processing): Call init_class_processing before
2931         anything else.
2932
2933 2000-10-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2934
2935         * check-init.c (check_init): Fixed leading comment. Use
2936         LOCAL_FINAL_P.
2937         * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
2938         (give_name_to_locals): Likewise.
2939         (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
2940         fields in lang_decl_var.
2941         * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
2942         DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
2943         (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
2944         (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
2945         DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
2946         (LOCAL_FINAL): Rewritten.
2947         (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
2948         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
2949         (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
2950         `init_final' fields.
2951         (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
2952         `final_uid', `final_liic', `final_ierr' and `local_final' fields.
2953         (TYPE_HAS_FINAL_VARIABLE): New macro.
2954         (struct lang_type): Added `afv' field.
2955         * parse.y (check_static_final_variable_assignment_flag): New function.
2956         (reset_static_final_variable_assignment_flag): Likewise.
2957         (check_final_variable_local_assignment_flag): Likewise.
2958         (reset_final_variable_local_assignment_flag): Likewise.
2959         (check_final_variable_indirect_assignment): Likewise.
2960         (check_final_variable_global_assignment_flag): Likewise.
2961         (add_inner_class_fields): Use LOCAL_FINAL_P.
2962         (register_fields): Handle local finals and final variables.
2963         (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
2964         (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
2965         (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
2966         on local finals.
2967         (java_complete_expand_methods): Loop to set
2968         TYPE_HAS_FINAL_VARIABLE. Call
2969         `reset_final_variable_local_assignment_flag' and
2970         `check_final_variable_local_assignment_flag' accordingly before
2971         and after constructor expansion. Call
2972         `reset_static_final_variable_assignment_flag'
2973         before expanding <clinit> and after call
2974         `check_static_final_variable_assignment_flag' if the
2975         current_class isn't an interface. After all methods have been
2976         expanded, call `check_final_variable_global_assignment_flag' and
2977         `check_static_final_variable_assignment_flag' if the current class
2978         is an interface.
2979         (maybe_yank_clinit): Fixed typo in comment.
2980         (build_outer_field_access_methods): Removed old sanity check. Use
2981         FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
2982         Don't create access methods for finals.
2983         (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
2984         (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
2985         existing DECL_INIT has been processed.
2986         (java_complete_lhs): Likewise.
2987         (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
2988         Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
2989         logic.
2990         (patch_assignment): Use LOCAL_FINAL_P.
2991         (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
2992         DECL_INITIAL is nullified.
2993         Fixes gcj/163.
2994
2995 2000-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2996
2997         * Make-lang.in (parse.c, parse-scan.c): Create atomically.
2998
2999         * Makefile.in (parse.c, parse-scan.c): Likewise.
3000
3001 2000-10-12  Mark Mitchell  <mark@codesourcery.com>
3002
3003         * class.c (temporary_obstack): Remove.
3004         (make_class): Don't mess with obstascks.
3005         (push_class): Likewise.
3006         (set_super_info): Likewise.
3007         (add_method_1): Likewise.
3008         (add_method): Likewise.
3009         (add_field): Likewise.
3010         (build_utf8_ref): Likewise.
3011         (build_class_ref): Likewise.
3012         (build_static_field_ref): Likewise.
3013         (finish_class): Likewise.
3014         (push_super_field): Likewise.
3015         (layout_class): Likewise.
3016         (layout_class_methods): Likewise.
3017         (init_class_processing): Likewise.
3018         * constants.c (get_tag_node): Likewise.
3019         (build_constant_data_ref): Likewise.
3020         * decl.c (ggc_p): Remove.
3021         (copy_lang_decl): Use ggc_alloc.
3022         (complete_start_java_method): Don't mess with obstacks.
3023         (start_java_method): Likewise.
3024         (end_java_method): Likewise.
3025         * except.c (link_handler): Use xmalloc.
3026         (free_eh_ranges): New function.
3027         (method_init_exceptions): Use it.
3028         (add_handler): Use xmalloc.
3029         (expand_start_java_handler): Don't mess with obstacks.
3030         (prepare_eh_table_type): Likewise.
3031         (expand_end_java_handler): Likewise.
3032         * expr.c (push_value): Likewise.
3033         (create_label_decl): Likewise.
3034         (build_jni_stub): Likewise.
3035         (java_lang_expand_expr): Likewise.
3036         (note_instructions): Use xrealloc.
3037         (java_push_constant_from_pool): Don't mess with obstacks.
3038         (process_jvm_instruction): Likewise.
3039         * java-tree.h (cyclic_inheritance_report): Remove duplicate
3040         declaration.
3041         * jcf-parse.c (get_constant): Don't mess with obstacks.
3042         (read_class): Likewise.
3043         (jcf_parse): Likewise.
3044         * lex.c (expression_obstack): Remove.
3045         (java_lex): Don't use obstack_free.
3046         * parse.h (exit_java_complete_class): Don't mess with obstacks.
3047         (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
3048         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
3049         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
3050         * parse.y (gaol): Add more GC roots.
3051         (add_inner_class_fields): Adjust calls to MANGLE_* macros.
3052         (lookup_field_wrapper): Likewise.
3053         (obtain_incomplete_type): Don't mess with obstacks.
3054         (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
3055         macros.
3056         (craft_constructor): Don't mess with obstacks.
3057         (safe_layout_class): Likewise.
3058         (java_complete_class): Likewise.
3059         (source_end_java_method): Likewise.
3060         (build_outer_field_access_methods): Likewise.
3061         (build_outer_method_access_method): Likewise.
3062         (maybe_build_thisn_access_method): Likewise.
3063         (build_dot_class_method_invocation): Likewise.
3064         (java_complete_tree): Likewise.
3065         (java_complete_lhs): Likewise.
3066         (do_merge_string_cste): Likewise.
3067         (patch_string_cst): Likewise.
3068         (array_constructor_check_entry): Likewise.
3069         * typeck.c (build_java_array_type): Likewise.
3070         (parse_signature_string): Likewise.
3071         (build_java_signature): Likewise.
3072
3073 2000-10-12  Tom Tromey  <tromey@cygnus.com>
3074
3075         Fix for PR gcj/356:
3076         * gjavah.c (add_class_decl): Don't special-case inner classes.
3077         (add_namelet): Likewise.
3078
3079 2000-10-11  Rodney Brown  <RodneyBrown@mynd.com>
3080
3081         * java-tree.h: Constify current_encoding.
3082         * lang.c: Constify current_encoding.
3083
3084 2000-10-10  Jeff Sturm  <jeff.sturm@appnet.com>
3085
3086         * jvgenmain.c (class_mangling_suffix): Omit `.'.
3087         (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
3088
3089 2000-10-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3090
3091         * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
3092         patch. Fixes gcj/340.
3093
3094 2000-10-10  Tom Tromey  <tromey@cygnus.com>
3095
3096         * lex.c (java_new_lexer): Initialize out_first and out_last
3097         fields.
3098         * lex.h (java_lexer): Added out_buffer, out_first, out_last.
3099
3100 2000-10-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3101
3102         * parse.y (pop_current_osb): New function.
3103         (array_type:): Use `dims:', changed actions
3104         accordingly. Suggested by Anthony Green.
3105         (array_creation_expression:): Used pop_current_osb.
3106         (cast_expression:): Likewise.
3107         (search_applicable_method_list): Fixed indentation.
3108
3109 2000-10-08  Anthony Green  <green@redhat.com>
3110
3111         * parse.y (array_type_literal): Remove production.
3112         (type_literals): Refer to array_type, not array_type_literal.
3113
3114 2000-10-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3115
3116         Patch contributed by Corey Minyard.
3117         * decl.c (check_local_named_variable): New function.
3118         (tree check_local_unnamed_variable): Likewise.
3119         (find_local_variable): Splitted. Call check_local_{un}named_variable.
3120
3121 2000-10-07  Anthony Green  <green@redhat.com>
3122
3123         * class.c (layout_class): Handle case where superclass can't be
3124         layed out yet.
3125
3126 2000-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
3127
3128         * Makefile.in (keyword.h): Refer to GNU FTP site for updated
3129         gperf.
3130
3131 2000-10-05  Tom Tromey  <tromey@cygnus.com>
3132
3133         * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
3134         * jvgenmain.c (class_mangling_prefix): Removed.
3135         (class_mangling_suffix): New global.
3136         (main): Use it.
3137         * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
3138         `$'.
3139         (print_method_info): Handle overrides for static and final
3140         methods.
3141         (process_file): Generate declaration for class object field.
3142         * class.c (cxx_keywords): New array.
3143         (utf8_cmp): New function.
3144         (cxx_keyword_p): New function.
3145         (layout_class_method): Mangle C++ keywords by appending `$'.
3146         (mangle_field): New function.
3147         (mangle_class_field): Use mangle_field.  Mangle class name as
3148         `class$'.
3149         (mangle_static_field): Use mangle_field.
3150
3151 Tue Oct  3 13:44:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3152
3153         * decl.c (find_local_variable): Removed uncessary type check and
3154         fixed range check typo. From Corey Minyard.
3155
3156 Wed Sep 13 16:06:52 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3157
3158         * decl.c (give_name_to_locals): New local `code_offset'. Call
3159         `maybe_adjust_start_pc'.
3160         * expr.c (note_instructions): New function.
3161         (expand_byte_code): Don't collect insn starts here.
3162         (peek_opcode_at_pc): New function.
3163         (maybe_adjust_start_pc): Likewise.
3164         * java-tree.h (maybe_adjust_start_pc): Declare.
3165         (note_instructions): Likewise.
3166         * jcf-parse.c (parse_class_file): Call `note_instructions'.
3167
3168 Wed Sep 13 11:50:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3169
3170         * parse.y (field_access:): Fixed indentation.
3171         (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
3172
3173 2000-09-07  Tom Tromey  <tromey@cygnus.com>
3174
3175         Fix for PR gcj/307:
3176         * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
3177         JPRIMITIVE_TYPE_P, for arithmetic operators.
3178         (patch_method_invocation): Indentation fix.
3179         (try_builtin_assignconv): Handle boolean specially.  Fixed typo.
3180         (valid_builtin_assignconv_identity_widening_p): Handle boolean.
3181         (do_unary_numeric_promotion): Cleaned up code.
3182         (valid_cast_to_p): Handle boolean correctly.
3183
3184 2000-09-27  Tom Tromey  <tromey@cygnus.com>
3185
3186         * lex.c (java_read_unicode): Reset bs_count when finished with
3187         `\u' sequence.
3188
3189 2000-10-01  Mark Mitchell  <mark@codesourcery.com>
3190
3191         Convert to GC.
3192         * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
3193         * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
3194         (typeck.o): Depend on ggc.h.
3195         * class.c (add_method_1): Use GC functions for allocation.
3196         (init_class_processing): Register roots.
3197         * decl.c (ggc_p): Set to 1.
3198         (pending_local_decls): Make it static.
3199         (push_jvm_slot): Use GC functions for allocation.
3200         (init_decl_processing): Register roots.
3201         (give_name_to_locals): Use GC functions for allocation.
3202         (lang_mark_tree): New function.
3203         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
3204         functions for allocation.
3205         * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
3206         * lex.c (java_lex): Use build_string, rather than replicating it
3207         inline.
3208         * parse.y (goal): Add more roots.
3209         (mark_parser_ctxt): New function.
3210         * typeck.c: Include ggc.h.
3211
3212 2000-09-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3213
3214         * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
3215         contains something else than MODIFY_EXPR.
3216
3217 2000-09-23  Mark Mitchell  <mark@codesourcery.com>
3218
3219         * Make-lang.in (JAVA_SRCS): Include java-tree.h.
3220         * Makefile.in (parse.o): Depend on ggc.h.
3221         (class.o): Likewise.
3222         (constants.o): Likewise.
3223         (decl.o): Likewise.
3224         (expr.o): Likewise.
3225         (jcf-parse.o): Likewise.
3226         (jcf-write.o): Likewise.
3227         (mangle.o): Likewise.
3228         * class.c: Include ggc.h.
3229         (build_static_field_ref): Register GC roots.
3230         (layout_class): Likewise.
3231         (init_class_processing): Likewise.
3232         * constants.c: Include ggc.h.
3233         (current_constant_pool_data_ref): Remove.
3234         (tag_nodes): Move it to ...
3235         (get_tag_node): ... here.  Register GC roots.
3236         * decl.c: Include ggc.h.  Remove many global tree definitions.
3237         (throw_node): Define.
3238         (java_global_trees): Likewise.
3239         (predef_filenames): Make the size a constant.
3240         (init_decl_processing): Adjust accordingly.
3241         (init_decl_processing): Call init_jcf_parse.  Register GC roots.
3242         * expr.c: Include ggc.h.
3243         (init_expr_processing): Register GC roots.
3244         (build_invokeinterface): Likewise.
3245         * java-tree.h: Replace extern tree declarations with macros.
3246         (java_global_trees): New variable.
3247         (java_tree_index): New enumeration.
3248         (init_jcf_parse): Declare.
3249         * jcf-parse.c: Include ggc.h.
3250         (current_class): Remove declaration.
3251         (main_class): Likewise.
3252         (all_class_list): Likewise.
3253         (predefined_filename_p): Adjust for constant size of
3254         predef_filenames.
3255         (init_jcf_parse): New function.
3256         * jcf-write.c: Include ggc.h.
3257         (generate_classfile): Register GC roots.
3258         (append_synthetic_attribute): Likewise.
3259         (append_innerclass_attribute_entry): Likewise.
3260         * lang.c: Include ggc.h.
3261         (lang_print_error): Register GC roots.
3262         * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
3263         with macros.
3264         * parse.y: Include ggc.h.
3265         (wfl_operator): Remove.
3266         (goal): Register GC roots.
3267         (java_pop_parser_context): Adjust for new field names.
3268         (java_parser_context_save_global): Likewse.
3269         (java_parser_context_restore_global): Likewise.
3270         (java_parser_context_suspend): Likewise.
3271         (java_parser_context_resume): Likewise.
3272         (verify_constructor_circularity): Register GC roots.
3273         (lookup_cl): Likewise.
3274         (java_reorder_fields): Likewise.
3275         (build_current_this): Likewise.
3276         (class_in_current_package): Likewise.
3277         (argument_types_convertible): Likewise.
3278         (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
3279
3280 2000-09-14  Tom Tromey  <tromey@cygnus.com>
3281
3282         * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
3283
3284 2000-09-13  Tom Tromey  <tromey@cygnus.com>
3285
3286         * jcf-parse.c: Include <locale.h>.
3287         * jv-scan.c: Include <locale.h>.
3288
3289 2000-09-12  Tom Tromey  <tromey@cygnus.com>
3290
3291         * expr.c (pop_type_0): Return `Object' if trying to merge two
3292         interface types.
3293         * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
3294         interface types; `Object' is always a valid supertype.
3295
3296 2000-09-12  Tom Tromey  <tromey@cygnus.com>
3297
3298         Fix for PR gcj/33:
3299         * jv-scan.c (help): Document --encoding.
3300         (options): Added `encoding' entry.
3301         (OPT_ENCODING): New define.
3302         (main): Handle --encoding.
3303         Include <langinfo.h> if nl_langinfo exists.
3304         * lang-options.h: Document --classpath, --CLASSPATH, --main, and
3305         --encoding.
3306         * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
3307         (parse_source_file): Correctly call java_init_lex.  Added `finput'
3308         argument.  Use nl_langinfo to determine default encoding.
3309         * java-tree.h (current_encoding): Declare.
3310         * parse.y (java_parser_context_restore_global): Don't restore
3311         `finput'.
3312         (java_parser_context_save_global): Don't set `finput' field.
3313         (java_pop_parser_context): Don't restore `finput'.  Free old lexer
3314         if required.
3315         * lang.c (current_encoding): New global.
3316         (lang_decode_option): Recognize `-fencoding='.
3317         (finish_parse): Don't close finput.
3318         * parse.h (struct parser_ctxt): Removed `finput' and
3319         `unget_utf8_value' fields.  Added `lexer' field.
3320         (java_init_lex): Fixed declaration.
3321         * lex.c (java_new_lexer): New function.
3322         (java_destroy_lexer): Likewise.
3323         (java_read_char): Added `lex' argument.  Handle iconv case.
3324         (java_read_unicode): Added `lex' argument.  Count backslashes in
3325         lexer structure.
3326         (java_init_lex): Added `finput' and `encoding' arguments.  Set
3327         `lexer' field in ctxp.
3328         (BAD_UTF8_VALUE): Removed.
3329         (java_lex): Handle seeing UEOF in the middle of a string literal.
3330         * lex.h: Include <iconv.h> if HAVE_ICONV defined.
3331         (java_lexer): New structure.
3332         (UNGETC): Removed.
3333         (GETC): Removed.
3334         (DEFAULT_ENCODING): New define.
3335         (java_destroy_lexer): Declare.
3336
3337 2000-09-12  Tom Tromey  <tromey@cygnus.com>
3338
3339         Fix for PR gcj/343:
3340         * lex.c (java_init_lex): Initialize java_io_serializable.
3341         * parse.y (java_io_serializable): New global.
3342         (valid_ref_assignconv_cast_p): An array can be cast to
3343         serializable.
3344
3345 2000-09-10  Zack Weinberg  <zack@wolery.cumb.org>
3346
3347         * decl.c, expr.c: Include defaults.h if not already included.
3348         Don't define the *_TYPE_SIZE macros.
3349
3350 2000-09-09  Geoffrey Keating  <geoffk@cygnus.com>
3351
3352         * typeck.c (build_java_array_type): Correct first parameter
3353         in ADJUST_FIELD_ALIGN invocation.
3354
3355 2000-09-06  Tom Tromey  <tromey@cygnus.com>
3356
3357         * lang-specs.h: Also recognize `-femit-class-files'.
3358
3359 2000-09-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3360
3361         * verify.c (merge_types): Load the types to merge if necessary.
3362
3363 2000-09-02  Anthony Green  <green@redhat.com>
3364
3365         * jcf-io.c: Include zlib.h.
3366         (open_in_zip): Read compressed class file archives.
3367         * zipfile.h (ZipDirectory): Add uncompressed_size and
3368         compression_method fields.
3369         * zextract.c (read_zip_archive): Collect file compression info.
3370
3371 2000-08-15  Bryce McKinlay  <bryce@albatross.co.nz>
3372
3373         * parse.y (do_resolve_class): Also explore superclasses of
3374         intermediate enclosing contexts when searching for inner classes.
3375
3376 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3377
3378         * parse.y (variable_declarator_id:): Better error message.
3379         (expression_statement:): Use YYNOT_TWICE.
3380         (cast_expression:): Likewise.
3381         (assignment:): Likewise.
3382
3383 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3384
3385         * parse.y (do_merge_string_cste): New locals. Create new
3386         STRING_CSTs each time, use memcpy. Fixes gcj/311.
3387
3388 2000-08-07  Hans Boehm  <boehm@acm.org>
3389
3390         * boehm.c (mark_reference_fields): Set marking bits for all words in
3391         a multiple-word record.
3392         (get_boehm_type_descriptor): Use the procedure marking descriptor for
3393         java.lang.Class.
3394
3395 2000-08-31  Mike Stump  <mrs@wrs.com>
3396
3397         * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
3398         jcf-dump$(exeext)): Make parallel safe.
3399
3400 2000-08-29  Zack Weinberg  <zack@wolery.cumb.org>
3401
3402         * jcf-parse.c (set_source_filename): Constify a char *.
3403         * jcf-write.c (append_innerclasses_attribute,
3404         make_class_file_name): Constify a char *.  Don't recycle a
3405         variable for an unrelated purpose.
3406         * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
3407         (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
3408
3409 2000-08-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3410
3411         * expr.c (can_widen_reference_to): Fixed indentation.
3412         * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
3413         * parse.y: `finit$' replaces `$finit$' in comments.
3414         (try_builtin_assignconv): Fixed leading comment.
3415
3416 2000-08-25  Greg McGary  <greg@mcgary.org>
3417
3418         * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
3419
3420 2000-08-24  Greg McGary  <greg@mcgary.org>
3421
3422         * lang.c (lang_decode_option): Use ARRAY_SIZE.
3423         * parse.y (BINOP_LOOKUP): Likewise.
3424
3425 2000-08-22  Andrew Haley  <aph@cygnus.com>
3426
3427         * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
3428         sign extending. Fixes gcj/321.
3429         * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
3430         combining to make a jlong. Fixes gcj/321.
3431
3432 2000-08-21  Nix  <nix@esperi.demon.co.uk>
3433
3434         * lang-specs.h: Do not process -o or run the assembler if
3435         -fsyntax-only.
3436
3437 2000-08-16  Andrew Haley  <aph@cygnus.com>
3438
3439         * typeck.c (build_java_array_type): Rewrite code to do array
3440         alignment.  Take into account back-end macros when aligning array
3441         data.  Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
3442         user to set alignment. Fixes gcj/252 and 160.
3443
3444 2000-08-09  Tom Tromey  <tromey@cygnus.com>
3445
3446         * parse.y (check_abstract_method_definitions): Now return `int'.
3447         Check implemented interfaces.  Fixes PR gcj/305.
3448
3449         * parse.y (patch_switch_statement): Disallow `long' in switch
3450         expressions.  Fixes PR gcj/310.
3451
3452 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3453
3454         * decl.c (finit_leg_identifier_node): New global.
3455         (init_decl_processing): Use `finit$' to initialize
3456         finit_identifier_node. Use `$finit$' to initialize
3457         finit_leg_identifier_node.
3458         * expr.c (expand_java_field_op): Use ID_FINIT_P.
3459         * java-tree.h (finit_identifier_node): Changed attached comment.
3460         (finit_leg_identifier_node): New declaration.
3461         (ID_FINIT_P): Take finit_identifier_node and
3462         finit_leg_identifier_node into account. This is a backward
3463         compatibility hack.
3464
3465 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3466
3467         * jcf-write.c (generate_bytecode_conditional): Re-installed lost
3468         Jan 6 2000 patch.
3469         (generate_bytecode_insns): Check `nargs' before emitting it.
3470         * verify.c (merge_type_state): Fixed typo.
3471         * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
3472         generate_bytecode_{conditional,insns}.
3473
3474 Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
3475
3476         * check-init.c (check_init): Add case for BIT_FIELD_REF (required
3477         for -pg builds).
3478
3479 2000-08-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3480
3481         * class.c (maybe_layout_super_class): Fixed indentation.
3482         * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
3483         (java_check_methods): New function declaration.
3484         * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
3485         instead of `str_ptr'.
3486         * jcf-write.c (generate_bytecode_insns): Emit number the of args
3487         of a `invokeinterface' at the right time.
3488         * parse.h (WFL_STRIP_BRACKET): New macro.
3489         (SET_TYPE_FOR_RESOLUTION): Use it.
3490         * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
3491         (check_class_interface_creation): Don't check for cross package
3492         innerclass name clashes.
3493         (method_header): Behave properly if MDECL is `error_mark_node'.
3494         (method_declarator): Return `error_mark_node' if bogus current
3495         class.
3496         (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
3497         (resolve_and_layout): New local `decl_type', set and used. Call
3498         java_check_methods.
3499         (java_check_methods): New method.
3500         (java_layout_classes): Use it.
3501         (resolve_qualified_expression_name): No EH check necessary in
3502         access$<n>.
3503         (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
3504         `case' statement.
3505         (patch_assignment): Set DECL_INITIAL on integral final local.
3506
3507 2000-08-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3508
3509         * java-tree.h (flag_extraneous_semicolon): New extern.
3510         * lang-options.h: (-Wextraneous-semicolon): New option.
3511         * lang.c (flag_redundant): Fixed typo in leading comment.
3512         (flag_extraneous_semicolon): New global.
3513         (lang_decode_option): Set `flag_extraneous_semicolon' when
3514         -Wall. Decode `-Wextraneous-semicolon'.
3515         * parse.y (type_declaration:): Removed `SC_TK' hack, added
3516         `empty_statement' rule.
3517         (class_body_declaration): Likewise.
3518         (method_body:): Accept `;' as a method body.
3519         (static_initializer:): Removed `SC_TK' hack.
3520         (constructor_block_end:): Likewise.
3521         (empty_statement:): Report deprecated empty declaration. Fixes
3522         gcj/295
3523
3524 2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3525
3526         * parse.y (build_dot_class_method_invocation): Changed parameter
3527         name to `type'. Build signature from `type' and convert it to a
3528         STRING_CST if it's an array.
3529         (patch_incomplete_class_ref): `build_dot_class_method_invocation'
3530         to use `ref_type' directly.
3531
3532 Sun Aug  6 00:47:24 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
3533
3534         * lang-options.h: Added a comma after the last element to avoid
3535         syntax errors when other languages define additional options.
3536
3537 2000-08-04  Zack Weinberg  <zack@wolery.cumb.org>
3538
3539         * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
3540         * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
3541         (jc1): Link with $(BACKEND).
3542         (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
3543
3544 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
3545
3546         * jvspec.c: Adjust type of second argument to
3547         lang_specific_driver, and update code as necessary.
3548
3549         * class.c (build_dtable_decl): Initialize dummy.
3550
3551 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3552
3553         * parse.y (maybe_yank_clinit): When generating bytecode: non empty
3554         method bodies not to rule out discarding `<clinit>'; don't use
3555         <clinit> to initialize static fields with constant initializers.
3556
3557 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3558
3559         * gjavah.c (print_method_info): Added `synth' parameter. Skip
3560         synthetic methods.
3561         (method_synthetic): New global.
3562         (HANDLE_METHOD): Recognize synthetic method and tell
3563         `print_method_info' about it.
3564         (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
3565         processing a synthetic method.
3566         * jcf-reader.c (skip_attribute): New function.
3567         ( skip_attribute): Likewise.
3568
3569 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3570
3571         * parse.y (build_outer_field_access): Fixed comments.
3572         (fix_constructors): Emit the initialization of this$<n> before
3573         calling $finit$.
3574         (resolve_qualified_expression_name): Build an access to `decl' if
3575         necessary.
3576
3577 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3578
3579         * parse-scan.y (curent_class): Non longer const.
3580         (inner_qualifier, inner_qualifier_length): Deleted.
3581         (current_class_length): New global.
3582         (bracket_count): Fixed typo in leading comment.
3583         (anonymous_count): New global.
3584         (class_instance_creation_expression:): Handle anonymous classes.
3585         (anonymous_class_creation:): New rule.
3586         (push_class_context): Rewritten.
3587         (pop_class_context): Likewise.
3588         (INNER_QUALIFIER): Macro deleted.
3589         (report_class_declaration): call `push_class_context' when
3590         entering the function. `fprintf' format modified not to use
3591         INNER_QUALIFIER.
3592         (report_class_declaration): Assign `package_name' and
3593         `current_class' to NULL separately.
3594
3595 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3596
3597         * expr.c (build_invokeinterface): Call layout_class_methods on
3598         target interface.
3599
3600 2000-07-27  Tom Tromey  <tromey@cygnus.com>
3601             Anthony Green  <green@cygnus.com>
3602             Alexandre Petit-Bianco  <apbianco@cygnus.com>
3603
3604         * class.c (make_class_data): Create vtable for abstract classes.
3605         (get_dispatch_table): Changed to cope with abstract classes.
3606
3607 2000-07-27  Tom Tromey  <tromey@cygnus.com>
3608
3609         * parse.y (patch_method_invocation): Don't reverse the argument
3610         list when dealing with anonymous class constructors. Fixed typo in
3611         comment.
3612
3613 2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3614
3615         * parse.y (build_alias_initializer_parameter_list): Reverse
3616         crafted list when building aliases for anonymous class
3617         constructors.
3618
3619 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3620
3621         * parse.y (jdep_resolve_class): Don't bother checking potential
3622         innerclass access if `decl' is NULL.
3623         (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
3624         WFL.
3625
3626 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3627
3628         * parse.c: Remove (again.)
3629
3630 2000-07-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3631
3632         * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
3633         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
3634         outside the `if' statement, alias to innerclass removed, `decl'
3635         used to mark the class complete.
3636
3637 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3638
3639         * parse.y (simple_name:): Fixed typo in error message.
3640
3641 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3642
3643         * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
3644         or its first operand can be error marks.
3645
3646 2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3647
3648         * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
3649         * parse.y (method_header): Likewise.
3650
3651 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3652
3653         * parse.y (process_imports): Consider that one might be trying to
3654         import an innerclass. Fixes gcj/254
3655
3656 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3657
3658         * parse.y (find_as_inner_class): Handle the case where the
3659         enclosing context of an innerclass has been loaded as bytecode.
3660
3661 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3662
3663         * parse.y (simple_name:): Reject `$' in type names.
3664         (resolve_type_during_patch): Use `type' as a second
3665         argument to resolve_no_layout. Fixes gcj/257.
3666
3667 2000-07-18  Bryce McKinlay  <bryce@albatross.co.nz>
3668
3669         * parse.y (find_most_specific_methods_list): Select the only
3670         non-abstract method even if max has been set.
3671         Fixes gcj/285, gcj/298.
3672
3673 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
3674
3675         * lang-specs.h: Added %(jc1) to java compiler options.
3676
3677 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
3678
3679         * .cvsignore: New file.
3680
3681 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3682
3683         * parse.y (not_accessible_p): Access granted to innerclasses
3684         (indirectly) extending the reference type. Fixes gcj/249.
3685
3686 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3687
3688         * parse.y (patch_method_invocation): Fixed comment.
3689         (maybe_use_access_method): Build this$<n>s to the context of the
3690         target method, or a type that extends it. Fixes gcj/242.
3691
3692 2000-07-13  Mark Mitchell  <mark@codesourcery.com>
3693
3694         * parse.c: Remove.
3695
3696 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3697
3698         * parse.y (fold_constant_for_init): Avoid bullish conversion.
3699
3700 2000-07-13  Tom Tromey  <tromey@cygnus.com>
3701
3702         * lang-specs.h: Added %{I*}.
3703
3704 2000-07-13  Zack Weinberg  <zack@wolery.cumb.org>
3705
3706         * lang-specs.h: Use the new named specs.  Remove unnecessary braces.
3707
3708 2000-07-12  Mark Mitchell  <mark@codesourcery.com>
3709
3710         * parse-scan.c: Remove.
3711
3712 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3713
3714         * class.c (set_super_info): Handled protected inner classes.
3715         (common_enclosing_context_p): Bail early if arguments aren't both
3716         inner classes.
3717         (get_access_flags_from_decl): Handle private and protected inner
3718         classes.
3719         * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
3720         (CLASS_PROTECTED): Likewise.
3721         (struct lang_type): New bitfield `poic'.
3722         * parse.y (jdep_resolve_class): Call check_inner_class_access on
3723         inner classes only.
3724         (check_inner_class_access): Renamed arguments, added
3725         comments. Handles protected inner classes (fixes gcj/225)
3726         (not_accessible_p): Fixed comments. Avoid handling inner classes.
3727
3728 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3729
3730         * parse.y (resolve_qualified_expression_name): Verify qualified
3731         access to `this'. Fixes gcj/239.
3732
3733 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3734
3735         * jcf-write.c (generate_classfile): Don't install ConstantValue
3736         for null pointers.
3737
3738 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3739
3740         * parse.y (resolve_qualified_expression_name): Handle inner class
3741         access. Fixes gcj/256.
3742
3743 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3744
3745         * jcf-write.c (generate_classfile): Properly install the
3746         ConstantValue attribute and the initial value constant pool index
3747         on string constants.
3748         * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
3749         class files.
3750
3751 2000-07-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3752
3753         * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
3754         construct.
3755         * parse.y (find_as_inner_class): Fixed typo.
3756         (do_resolve_class): Explore enclosing contexts when searching for
3757         innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
3758         (check_inner_class_access): Check `decl' which can be null in case
3759         of previous errors.
3760
3761 2000-07-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3762
3763         * java-tree.h (java_debug_context): Declared `extern'.
3764         (safe_layout_class): Likewise.
3765         * parse.y (resolve_field_access): Field must be `static' in order
3766         to be replaced by its initial value. Added comments.
3767         (find_applicable_accessible_methods_list): Fixed typo.
3768         (find_most_specific_methods_list): Methods found in innerclasses
3769         take over methods founds in the enclosing contexts.
3770         (java_complete_tree): Loosen restrictions on the type of DECLs
3771         that can be replaced by their initialization values.
3772         (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
3773
3774 2000-07-05  Tom Tromey  <tromey@cygnus.com>
3775
3776         * Make-lang.in (PARSE_DIR): New macro.
3777         (PARSE_RELDIR): Likewise.
3778         (PARSE_C): Likewise.
3779         (PARSE_SCAN_C): Likewise.
3780         ($(PARSE_C)): New target.
3781         ($(PARSE_SCAN_C)): Likewise.
3782         (SET_BISON): New macro.
3783         (BISONFLAGS): Likewise.
3784         (JAVABISONFLAGS): Likewise.
3785
3786 2000-07-02  Bryce McKinlay  <bryce@albatross.co.nz>
3787
3788         * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
3789         argument on the first pass for CNI as well as JNI.
3790         (print_method_info): Set up method name on the first pass only.
3791
3792 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3793
3794         * parse.y (parser_qualified_classname): Removed parameter
3795         `is_static'.
3796         (create_interface): Removed first passed parameter to
3797         parser_qualified_classname.
3798         (create_class): Likewise. Don't install alias on static
3799         innerclasses. Fixes gcj/275.
3800
3801 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3802
3803         * parse.y (maybe_generate_pre_expand_clinit): Don't build a
3804         debugable statement with empty_stmt_node. Fixes gcj/272
3805
3806 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3807
3808         * expr.c (build_instanceof): Layout type after it's loaded. Fixes
3809         gcj/271.
3810
3811 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3812
3813         * jcf-write.c (push_long_const): Appropriately cast short negative
3814         constant to jword.
3815
3816 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3817
3818         * parse.y (verify_constructor_super): Use loop variable
3819         `m_arg_type' initialized with `mdecl_arg_type'.
3820
3821 2000-06-29  Tom Tromey  <tromey@cygnus.com>
3822
3823         * parse.y (resolve_field_access): Handle case where `type_found'
3824         is NULL.
3825
3826 2000-06-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3827
3828         * expr.c (lookup_field): The same field can be found through two
3829         different interface. Don't declare it ambiguous in that case.
3830
3831 2000-06-27  Tom Tromey  <tromey@cygnus.com>
3832
3833         * lex.c (java_lineterminator): Don't recognize \r after \n.  If \r
3834         follows \r, then unget it at a lower level.
3835
3836 2000-06-26  Tom Tromey  <tromey@cygnus.com>
3837
3838         * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
3839         java_complete_tree.
3840
3841 2000-06-25  Tom Tromey  <tromey@cygnus.com>
3842
3843         * parse.y (for_statement): Wrap expression in a WFL if it is a
3844         constant.  For PR gcj/268.
3845
3846 2000-06-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3847
3848         * parse.y (do_resolve_class): Minor optimiztion in the package
3849         list search. Removed unnecessary test and return statement.
3850         (valid_ref_assignconv_cast_p): Order of arguments to
3851         enclosing_context_p fixed.
3852
3853 2000-06-24  Tom Tromey  <tromey@cygnus.com>
3854
3855         * expr.c (lookup_field): Print error and return error_mark_node if
3856         field reference is ambiguous.
3857
3858         * parse.y (check_abstract_method_definitions): Also check if
3859         `other_method' is abstract.
3860
3861 2000-06-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3862
3863         * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
3864         classes.
3865         * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
3866         (struct lang_type): New field `pic'.
3867         (CLASS_PRIVATE): New macro.
3868         * parse.y (check_inner_class_access): New function.
3869         (jdep_resolve_class): Call it.
3870
3871 2000-06-23  Tom Tromey  <tromey@cygnus.com>
3872
3873         * parse.y (patch_incomplete_class_ref): Initialize the returned
3874         class.  For PR gcj/260.
3875
3876 2000-06-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3877
3878         * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
3879
3880 2000-06-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3881
3882         * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
3883         Java specific checks.
3884         * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
3885         screened by DECL_P.
3886         * java-tree.def (CASE_EXPR): Marked 'e'.
3887         (DEFAULT_EXPR): Likewise.
3888         * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
3889         screened by DECL_P.
3890         * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
3891         Java specific checks.
3892         (generate_bytecode_insns): Test try_block for BLOCK before using
3893         BLOCK_EXPR_BODY.
3894         * parse.y (build_wfl_wrap): Added `location' argument. Set
3895         EXPR_WFL_LINECOL accordingly.
3896         (dim_expr:): Wrap constants with WFLs.
3897         (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
3898         (resolve_package): Check for `stmt' not being a BLOCK before
3899         building a debuggable statement with it.
3900         (make_qualified_primary): Added extra parameter to build_wfl_wrap
3901         invocation.
3902         (resolve_field_access): Make sure `decl' is a DECL before treating
3903         it as such.
3904         (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
3905         IDENTIFIER_NODE before treating it as such.
3906         (patch_new_array_init): Make sure `elt' is a TREE_LIST before
3907         treating it as such.
3908         (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
3909         to be applied only on non array types.
3910
3911 2000-06-16  Per Bothner  <per@bothner.com>
3912
3913         * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN):  Don't
3914         define in terms of DECL_RESULT, as that fails when --enable-checking.
3915
3916 2000-06-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3917
3918         * jcf-write.c (CHECK_PUT): Add static prototype.  Make pointer
3919         types the same in comparison.
3920         (CHECK_OP): Add static prototype.
3921
3922 2000-06-13  Jakub Jelinek  <jakub@redhat.com>
3923
3924         * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
3925         * parse.y (java_complete_class): Set DECL_USER_ALIGN.
3926         * parse.c: Rebuilt.
3927
3928 2000-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3929
3930         * decl.c (create_primitive_vtable): Prototype.
3931
3932         * jcf-write.c (generate_bytecode_insns): Initialize variable
3933         `saved_context'.
3934
3935         * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
3936
3937 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
3938
3939         * parse.y (find_applicable_accessible_methods_list): Use a hashtable
3940         to track searched classes, and do not search the same class more than
3941         once. Call find_applicable_accessible_methods_list on immediate
3942         superclass, instead of search_applicable_method_list on all ancestors.
3943         Fix for PR gcj/238.
3944
3945 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
3946
3947         * parse.y (register_fields): Permit static fields in inner classes
3948         if they are final. Fix for PR gcj/255.
3949
3950 2000-06-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3951
3952         * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
3953         * parse.y (find_in_imports): Returned type changed to void,
3954         leading comment fixed.
3955         (register_package): New function.
3956         (qualify_and_find): Likewise.
3957         (package_declaration:): Use `register_package'.
3958         (single_type_import_declaration:): Removed local variable
3959         `node'. Added missing `;' for consistency.
3960         (type_import_on_demand_declaration:): Use `chainon' to link new
3961         entries.
3962         (lookup_field_wrapper): Lookup local variables defined in outer
3963         contexts first.
3964         (java_complete_class): Don't reverse the list of imported on demand.
3965         (do_resolve_class): Reorganized. Removed local variable
3966         `original_name'. Call `qualify_and_find' with the current package
3967         name, invoke `find_in_imports_on_demand' right after. Call
3968         `qualify_and_find' with the packages we've seen so far. Fixed
3969         operations numbering in comments.
3970         (java_expand_class): Don't reverse `package_list'.
3971         (find_most_specific_methods_list): New local variables `abstract'
3972         and `candidates'. Use them to pick the right method.
3973
3974 Tue Jun  6 11:39:05 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
3975
3976         * parse.y (check_modifiers_consistency): Don't subtract out
3977         `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
3978
3979 2000-06-04  Philipp Thomas  <pthomas@suse.de>
3980
3981         * Makefile.in (INTLLIBS): New.
3982         (LIBS): Add above.
3983         (DEPLIBS): Ditto.
3984
3985 Fri Jun  2 16:48:55 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3986
3987         * class.c (get_dispatch_table): Build the vtable dummy entry list
3988         element with a null purpose. Fixed leading comment.
3989         (build_dtable_decl): Build an accurate dtable type when appropriate
3990         and use it.
3991
3992 2000-06-02  Richard Henderson  <rth@cygnus.com>
3993
3994         * lang.c (lang_get_alias_set): New.
3995
3996 2000-05-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3997
3998         * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
3999         before using it as the accessed field.
4000
4001 2000-05-31  Tom Tromey  <tromey@cygnus.com>
4002
4003         * java-tree.h (boolean_array_vtable, byte_array_vtable,
4004         char_array_vtable, short_array_vtable, int_array_vtable,
4005         long_array_vtable, float_array_vtable, double_array_vtable):
4006         Declare.
4007         * expr.c (get_primitive_array_vtable): New function.
4008         (create_primitive_vtable): New function.
4009         (java_lang_expand_expr): Enable code to statically generate
4010         arrays.
4011         * decl.c (init_decl_processing): Create primitive vtables.
4012         (boolean_array_vtable, byte_array_vtable, char_array_vtable,
4013         short_array_vtable, int_array_vtable, long_array_vtable,
4014         float_array_vtable, double_array_vtable): Define.
4015
4016 2000-05-26  Zack Weinberg  <zack@wolery.cumb.org>
4017
4018         * java/parse.y (find_applicable_accessible_methods_list):
4019         Don't add an uninitialized value to the list.
4020
4021 2000-05-25  Tom Tromey  <tromey@cygnus.com>
4022
4023         * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
4024         when trying to see if field's class should be initialized.  Always
4025         initialize field's declaring class, not qualified class.
4026         For PR gcj/162.
4027
4028         * parse.y (array_constructor_check_entry): Pass `wfl_value', not
4029         `wfl_operator', to maybe_build_primttype_type_ref.
4030         Fixes PR gcj/235.
4031
4032 2000-05-23  Bryce McKinlay  <bryce@albatross.co.nz>
4033
4034        * parse.y (patch_method_invocation): Don't try to lookup methods
4035        in primitive types.
4036
4037 2000-05-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4038
4039         * parse.y (resolve_field_access): Call the appropriate <clinit>
4040         before accessing the length of a static array. Craft a decl for
4041         the field while its time. Fixes PR gcj/129.
4042
4043 2000-05-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4044
4045         * parse.y (resolve_package): Correctly set `*next' (was off by
4046         one.)
4047         (resolve_qualified_expression_name): Fixed comment.
4048
4049 Thu Apr 27 17:47:34 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4050
4051         * jcf-parse.c (jcf_parse_source): Reset current_class and
4052         current_function_decl to NULL before parsing a new file.
4053
4054 Thu Apr 27 17:25:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4055
4056         * parse.y (block_end:): If the collected block doesn't feature a
4057         statement, insert an empty statement.
4058
4059 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4060
4061         * parse.y (maybe_yank_clinit): New function.
4062         (maybe_generate_pre_expand_clinit): Always link <clinit> at the
4063         end of the list of methods belonging to a class.
4064         (java_complete_expand_method): Check whether <clinit> is really
4065         necessary and expand it accordingly.
4066
4067 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4068
4069         * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
4070         processed by the method's switch statement.
4071
4072 2000-05-19  Tom Tromey  <tromey@cygnus.com>
4073
4074         * java-tree.h: Added init state enum.
4075         * decl.c (emit_init_test_initialization): Initialize class
4076         initialization check variable by looking at class' state.
4077
4078 2000-05-19  Tom Tromey  <tromey@cygnus.com>
4079
4080         * java-tree.h (build_instanceof): Declare.
4081         (build_get_class): Declare.
4082         * parse.y (patch_binop): Use build_instanceof.
4083         * expr.c (build_instanceof): New function.  If class is final,
4084         don't make a function call.
4085         (expand_java_INSTANCEOF): Use it.
4086         (build_get_class): New function.
4087
4088 2000-05-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
4089
4090         * jcf-write.c (generate_classfile): Scan the source_file for
4091         slashes with the right pointer variable.
4092
4093 Wed May 17 17:27:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
4094
4095         * lang.c (lang_decode_option): Update -Wunused flags by calling
4096         set_Wunused.
4097         * decl.c (poplevel): Replace warn_unused with warn_unused_label.
4098
4099 2000-05-09  Zack Weinberg  <zack@wolery.cumb.org>
4100
4101         * check_init.c (check_init): Constify local char *.
4102         * class.c (push_class): Constify local char *.
4103         * java_tree.h: Update prototypes.
4104         * jcf-io.c (open_class): Constify filename parameter and
4105         return value.
4106         (find_class): Remove redundant string copy.  Cast return from
4107         open_class.
4108         * jcf-parse.c (read_class, parse_class_file, yyparse):
4109         Constify local char *.
4110         * jcf-write.c (generate_bytecode_insns, generate_classfile):
4111         Constify local char *.
4112         * jcf.h (JCF): Constify filename and classname.
4113         (JCF_FINISH): Cast args to FREE to char * when appropriate.
4114         * lang.c (init_parse): Constify parameter and return value.
4115         * lex.c (java_get_line_col): Constify filename parameter.
4116         * parse.h: Constify parser_ctxt.filename.  Update prototypes.
4117         * parse.y (java_parser_context_suspend,
4118         issue_warning_error_from_context, safe_layout_class): Constify
4119         local char *.
4120         * parse.c: Regenerate.
4121
4122 2000-05-08  Tom Tromey  <tromey@cygnus.com>
4123
4124         * expr.c (build_jni_stub): Cache the result of
4125         _Jv_LookupJNIMethod.
4126
4127 2000-05-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4128
4129         * decl.c (predef_filenames_size): Now 7.
4130         (predef_filenames): New seventh entry.
4131
4132 2000-05-04  Tom Tromey  <tromey@cygnus.com>
4133
4134         * boehm.c (mark_reference_fields): Don't mark RawData fields.
4135         Keep track of when we've seen a reference field after a
4136         non-reference field.
4137         (get_boehm_type_descriptor): Handle case where we see
4138         non-reference fields but no trailing reference field.
4139         * decl.c (rawdata_ptr_type_node): Define.
4140         (init_decl_processing): Initialize rawdata_ptr_type_node.
4141         * java-tree.h (rawdata_ptr_type_node): Declare.
4142
4143 2000-05-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4144
4145         * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
4146         specifiers in calls to fprintf.
4147
4148 2000-05-03  Andrew Haley  <aph@cygnus.com>
4149
4150         * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
4151
4152         * javaop.h (WORD_TO_INT): New function.
4153         (IMMEDIATE_s4): Use WORD_TO_INT.
4154         * jcf.h (JPOOL_INT): Ditto.
4155
4156         * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
4157         separator.
4158
4159 2000-04-19  Tom Tromey  <tromey@cygnus.com>
4160
4161         * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
4162         on native function.
4163         * jcf-parse.c (parse_class_file): Call build_jni_stub for native
4164         JNI methods.
4165         * expr.c (build_jni_stub): New function.
4166         * lang-specs.h: -fjni and -femit-class-file are incompatible.
4167         * parse.c: Rebuilt.
4168         * parse.y (java_complete_expand_methods): Expand a native method
4169         and call build_jni_stub if -fjni given.
4170         * lang-options.h: Document -fjni.
4171         * lang.c (flag_jni): New global.
4172         (lang_f_options): Added `jni' entry.
4173         * java-tree.h (soft_lookupjnimethod_node,
4174         soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
4175         Declare.
4176         (flag_jni): Declare.
4177         (build_jni_stub): Declare.
4178         (struct lang_decl): Added `native' flag.
4179         (METHOD_NATIVE): Redefined to use `native' field of lang specific
4180         structure.
4181         * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
4182         soft_jnipopsystemframe_node): New globals.
4183         (init_decl_processing): Set them.  _Jv_InitClass only takes one
4184         argument.
4185
4186         * java-tree.def: Put into `C' mode.
4187
4188 2000-04-27  Tom Tromey  <tromey@cygnus.com>
4189
4190         Fix for PR gcj/2:
4191         * expr.c (expand_invoke): Generate check to see if object pointer
4192         is null in nonvirtual invocation case.
4193         * java-tree.h (soft_nullpointer_node): Declare.
4194         * decl.c (soft_nullpointer_node): New global.
4195         (init_decl_processing): Initialize soft_nullpointer_node.
4196         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
4197         or `private' methods.
4198         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
4199
4200 Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4201
4202         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
4203         from <clinit>
4204
4205 2000-04-26  Tom Tromey  <tromey@cygnus.com>
4206
4207         * zextract.c (find_zip_file_start): New function.
4208         (read_zip_archive): Use it.
4209
4210 2000-04-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4211
4212         * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
4213
4214 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4215
4216         * class.c (common_enclosing_context_p): New function.
4217         * java-tree.h (common_enclosing_context_p): Added prototype.
4218         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
4219         classes sharing an outer context with the current instance.
4220         * parse.y (build_access_to_thisn): Fixed leading comment.
4221         (verify_constructor_super): New local `supper_inner'. Skip
4222         enclosing context argument in the case of inner class constructors.
4223         (patch_method_invocation): Insert proper context as second
4224         parameter to pure inner class constructor super invocations.
4225
4226 Mon Apr 24 14:59:36 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4227
4228         * parse.y (end_class_declaration): Reset the interface number
4229         counter.
4230
4231 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4232
4233         * parse.y (source_start_java_method): Deleted unnecessary code.
4234         (patch_method_invocation): Fixed comment.
4235
4236 2000-04-24  Robert Lipe <robertlipe@usa.net>
4237
4238         * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
4239
4240 2000-04-23  Tom Tromey  <tromey@cygnus.com>
4241
4242         * boehm.c (mark_reference_fields): Use int_byte_position.
4243
4244 2000-04-22  Tom Tromey  <tromey@cygnus.com>
4245
4246         * boehm.c (mark_reference_fields): Only call byte_position on
4247         non-static fields.
4248
4249 2000-04-22  Tom Tromey  <tromey@cygnus.com>
4250
4251         * boehm.c (mark_reference_fields): Added `last_view_index'
4252         argument.  Use DECL_FIELD_OFFSET to determine field's offset.
4253
4254 Thu Apr 20 17:41:28 2000  Mo DeJong  <mdejong@cygnus.com>
4255
4256         * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
4257         * parse.y (check_class_interface_creation): Fixed comments. Select
4258         permitted modifiers for (inner) interfaces. Changed error message
4259         to report rejected modifiers used with local classes.
4260
4261 2000-04-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4262
4263         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
4264         of directly inherited type considered in scope.
4265         * parse.y (do_resolve_class): Search inherited classes for inner
4266         classes.
4267
4268 2000-04-20  Tom Tromey  <tromey@cygnus.com>
4269
4270         * parse.y (not_accessible_p): Use member's class, not current
4271         class, when doing inheritance check for protected reference.
4272         Fixes PR gcj/124.
4273
4274 Thu Apr 20 18:20:58 2000  Jason Schroeder  <shrode@subnature.com>
4275
4276         * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
4277
4278 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4279
4280         * parse.y (lookup_field_wrapper): Search for final local aliases.
4281         (resolve_expression_name): Let lookup_field_wrapper search for
4282         final local aliases. Force the value of `name' if one is found.
4283         (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
4284         an expression name. Fixed comments.
4285
4286 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4287
4288         * parse.y (yyerror): `msg' can be null, don't use it in that case.
4289
4290 2000-04-19  Tom Tromey  <tromey@cygnus.com>
4291
4292         * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
4293
4294 2000-04-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4295
4296         * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
4297
4298 2000-04-18  Tom Tromey  <tromey@cygnus.com>
4299
4300         PR gcj/211:
4301         * gjavah.c (utf8_cmp): Changed return value.
4302         (cxx_keyword_subst): Handle all C++ keywords.  Allocate new return
4303         result.
4304         (cxx_keywords): New global.
4305         (get_field_name): Handle new result of cxx_keyword_subst.
4306         (print_method_info): Likewise.
4307
4308 2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
4309
4310         * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
4311         with a newline, for CNI.
4312         (print_stub_or_jni): Print a space or newline before method name for
4313         CNI as well as JNI.
4314         (print_cxx_classname): Don't write leading "::" in CNI stub method.
4315         (process_file): Include gcj/cni.h if generating CNI stubs.
4316
4317 2000-04-16  Tom Tromey  <tromey@cygnus.com>
4318
4319         * gjavah.c (decompile_method): Use print_field_name.
4320         Fixes PR gcj/205.
4321
4322 2000-04-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4323
4324         * parse.y (java_expand_classes): Reverse the package list once.
4325         (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
4326         reduction.
4327         (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
4328         the `==' and `!=' operators.
4329
4330 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4331
4332         * jcf-write.c (generate_bytecode_insns): At invokation time,
4333         always relate an interface method to the type of its selector.
4334
4335 2000-04-05  Tom Tromey  <tromey@cygnus.com>
4336
4337         Fix for PR gcj/2:
4338         * expr.c (expand_invoke): Generate check to see if object pointer
4339         is null in nonvirtual invocation case.
4340         * java-tree.h (soft_nullpointer_node): Declare.
4341         * decl.c (soft_nullpointer_node): New global.
4342         (init_decl_processing): Initialize soft_nullpointer_node.
4343         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
4344         or `private' methods.
4345         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
4346
4347 2000-04-05  Tom Tromey  <tromey@cygnus.com>
4348
4349         Fix for PR gcj/140:
4350         * parse.y (check_final_assignment): Recognize assignments to the
4351         `length' field of an array when generating class files.
4352
4353 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4354
4355         * class.c (decl_hash): Prototype removed.
4356         (decl_compare): Likewise.
4357
4358 2000-04-05  Tom Tromey  <tromey@cygnus.com>
4359
4360         * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
4361         * parse.y (check_modifiers_consistency): Check for final/volatile
4362         clash.  Fixes PR gcj/164.
4363
4364 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4365
4366         * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
4367         made global.
4368         (java_hash_compare_tree_node): Renamed from `decl_compare, made
4369         global.
4370         (add_method_1): Use `java_hash_hash_tree_node' and
4371         `java_hash_compare_tree_node'.
4372         * java-tree.h: (java_hash_hash_tree_node): Prototyped.
4373         (java_hash_compare_tree_node): Likewise.
4374         * parse.y (find_applicable_accessible_methods_list): Create,
4375         delete and use a hash table to remember already searched interfaces.
4376
4377 2000-04-03  Matt Welsh  <mdw@cs.berkeley.edu>
4378
4379         * jcf-depend.c (add_entry): Fixed bug where list was always replaced
4380         with latest entry.
4381
4382 2000-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4383
4384         * boehm.c (mark_reference_fields, set_bit): Prototype.
4385         (set_bit): Un-ANSI-fy definition.
4386
4387         * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
4388         Prototype.
4389
4390         * decl.c (emit_init_test_initialization): Likewise.
4391
4392         * gjavah.c (jni_print_char): Likewise.
4393
4394         * parse.y (create_new_parser_context): Likewise.
4395
4396 Thu Mar 30 15:26:56 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4397
4398         * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
4399         patch missing hunk. Fixed indentation.
4400
4401 2000-03-30  Tom Tromey  <tromey@cygnus.com>
4402
4403         * gjavah.c (D_NAN_MASK): Only define as word-reversed when
4404         HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
4405
4406 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4407
4408         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
4409         when negative *before* using it as an array index.
4410         * ChangeLog: Fixed typo.
4411
4412 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4413
4414         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
4415         to 0 when it reaches -1.
4416
4417 2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4418
4419         * jcf-parse.c (get_constant): Properly cast `num' during the
4420         invocation of `add_double'.
4421         * jcf-write.c (push_long_const): Properly cast `lo' before
4422         comparing it to short bounds.
4423         * parse-scan.y (interface_declaration:): Rule re-arrange so that
4424         `interface_body:' is reduced after the current interface is
4425         pushed.
4426
4427 2000-03-26  Tom Tromey  <tromey@cygnus.com>
4428
4429         * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
4430         Java-specific `-f' option.
4431
4432 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4433
4434         * decl.c (init_decl_processing): Only call initialize_sizetypes once.
4435         Adjust order of making types.
4436         Make bitsize_*_node values.
4437
4438 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4439
4440         * class.c (make_field_value): Use byte_position.
4441         * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
4442         (java_array_data_offset): Likewise.
4443         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
4444         bzero call.
4445
4446 2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4447
4448         * parse.y (check_abstract_method_definitions): New local
4449         `end_type_reached'. Make sure we also consider `end_type'.
4450         (java_check_abstract_method_definitions): Make sure we eventually
4451         consider `java.lang.Object'.
4452         (maybe_use_access_method): Don't use access method if not in the
4453         context of a pure inner class or if the method's context is right.
4454         (find_applicable_accessible_methods_list): New static flag
4455         `object_done'. Don't search abstract classes as interfaces. Fixed
4456         indentation. Fixed the `java.lang.Object' only search. Search
4457         class interface(s) first, then fully search enclosing contexts.
4458         (find_most_specific_methods_list): Pick the closest candidate when
4459         they're all abstract.
4460
4461 Mon Mar 20 08:58:51 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4462
4463         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
4464         properly initialize `finished_label'. Don't emit gotos for empty
4465         try statements.
4466
4467 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
4468
4469         * except.c (emit_handlers): Clear catch_clauses_last.
4470
4471 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4472
4473         * parse.y (check_method_types_complete): New function.
4474         (create_class): Reset anonymous class counter only when seeing an
4475         non inner classe.
4476         (java_complete_class): JDEP_METHOD: Don't recompute signature
4477         if incomplete.
4478
4479 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4480
4481         * class.c (build_static_ref): Fixed indentation in comment.
4482         * java-tree.def (TRY_EXPR): Fixed typo in name.
4483         (CLASS_LITERAL): Likewise.
4484         * java-tree.h: (TYPE_DOT_CLASS): New macro.
4485         (struct lang_type): New field `dot_class'.
4486         * jcf-write.c (generate_bytecode_insns): Fixed error message.
4487         (generate_classfile): Method `class$' is synthetic.
4488         * parse.y (build_do_class_method): New function.
4489         (build_dot_class_method_invocation): Likewise.
4490         (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
4491         (resolve_qualified_expression_name): Handle CLASS_LITERAL.
4492         (qualify_ambiguous_name): Likewise.
4493         (patch_incomplete_class_ref): Invoke synthetic method if necessary.
4494         (build_try_statement): Fixed leading comment.
4495
4496 Fri Mar 17 08:09:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4497
4498         * class.c (make_field_value): Properly handle sizes.
4499         (get_dispatch_vector): Use tree_low_cst and host_integerp.
4500         (layout_class_method): Count using trees.
4501         * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
4502         * expr.c (java_array_data_offset): Use int_bit_position.
4503         (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
4504         (build_invokevirtual): Use tree_low_cst and do computations with trees.
4505
4506 2000-03-16  Tom Tromey  <tromey@cygnus.com>
4507
4508         * lang.c (flag_hash_synchronization): New global.
4509         (lang_f_options): Added `hash-synchronization'.
4510         * lang-options.h: Mention -fhash-synchronization.
4511         * java-tree.h (flag_hash_synchronization): Declare.
4512         * expr.c (java_lang_expand_expr): Only push `sync_info' value when
4513         hash table synchronization is disabled.
4514         * decl.c (init_decl_processing): Only push `sync_info' value when
4515         hash table synchronization is disabled.
4516         * class.c (make_class_data): Only push `sync_info' field when hash
4517         table synchronization is disabled.  Removed dead code.
4518
4519 2000-03-16  Tom Tromey  <tromey@cygnus.com>
4520
4521         * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
4522
4523 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4524
4525         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
4526         classes.
4527         * parse.y (patch_method_invocation): Handle anonymous classes
4528         creation in static context.
4529
4530 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4531
4532         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
4533         * parse.y (resolve_qualified_expression_name): Use it.
4534         (patch_method_invocation): Likewise.
4535
4536 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4537
4538         * parse.y (register_incomplete_type): JDEP_ENCLOSING set
4539         depending on the type of dependency which dictates what the
4540         current class is.
4541         (unresolved_type_p): Resolved types limited to the current class.
4542
4543 2000-03-15  Tom Tromey  <tromey@cygnus.com>
4544
4545         * decl.c (init_decl_processing): Set type of `sync_info' to be
4546         pointer to Object.
4547
4548         * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
4549         Correctly compute bit number for current slot.  Zero `high' and
4550         `low' in DS_LENGTH case.  Don't skip inherited fields.  Use
4551         mark_reference_fields.
4552         (mark_reference_fields): New function.
4553
4554 Tue Mar 14 17:15:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4555
4556         * parse.y (register_incomplete_type): Fixed initialization of
4557         JDEP_ENCLOSING.
4558
4559 2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4560
4561         * parse-scan.y (inner_qualifier, inner_qualifier_length): New
4562         static globals.
4563         (push_class_context, pop_class_context): New function.
4564         (class_body:): Call pop_class_context.
4565         (interface_body:): Likewise.
4566         (INNER_QUALIFIER): New macro.
4567         (report_class_declaration): Changed output format and use
4568         INNER_QUALIFIER. Call push_class_context.
4569
4570 2000-02-14  Andrew Haley  <aph@cygnus.com>
4571
4572         * check-init.c (check_init): Add new cases for unary and binary
4573         tree nodes.
4574
4575 2000-03-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4576
4577         * parse.y (resolve_package): Set `next' once a type name has been
4578         progressively discovered.
4579         (resolve_qualified_expression_name): Propagate resolution only if
4580         there are remaining qualifiers. Take into account `q' might have
4581         been cleared after re-qualification.
4582         * parse.y (patch_method_invocation): New local `resolved'.
4583         Section dealing with qualified expression rewritten to use
4584         resolve_field_access.
4585
4586 Mon Mar 13 12:21:13 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4587
4588         * parse.h (PUSH_CPC): Fixed indentation.
4589         (DEBUG_CPC): New macro.
4590         (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
4591         SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
4592         * parse.y (class_body_declaration:): Use
4593         SET_CPC_INSTANCE_INITIALIZER_STMT.
4594         (method_declaration:): Check for null current_function_decl.
4595         (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
4596         (java_parser_context_pop_initialized_field): Better handling of
4597         empty lists.
4598         (maybe_make_nested_class_name): Mark nested class name as
4599         qualified when necessary.
4600         (end_class_declaration): Don't call java_parse_context_resume when
4601         one or more error occurred.
4602         (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
4603         (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
4604         SET_CPC_INITIALIZER_STMT.
4605         (method_header): Check for inner classes declaring static methods.
4606         (resolve_qualified_expression_name): Handle situation where `this'
4607         is implied.
4608
4609 Mon Mar 13 11:36:51 2000  Hans Boehm <boehm@acm.org>
4610
4611         * typeck.c (build_prim_array_type): Correctly set the high word too.
4612
4613 2000-03-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4614
4615         * parse.y (java_complete_expand_methods): Leave <clinit> out of
4616         ordinary methods.
4617         (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
4618         list of methods for interfaces.
4619
4620 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4621
4622         * parse.y (qualify_ambiguous_name): Properly handle expressions
4623         using `null'.
4624
4625 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4626
4627         * parse.y (check_final_assignment): Extended to process
4628         COMPOUND_EXPR.
4629         (patch_assignment): Have check_final_assignment called only once.
4630
4631 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4632
4633         * java-tree.h (IS_INIT_CHECKED): New flag.
4634         * check-init.c (check_init): Test and set IS_INIT_CHECKED.
4635         * parse.y (patch_string): Call force_evaluation_order on the
4636         completed string concatenation tree.
4637         * expr.c (force_evaluation_order): Call force_evaluation_order on
4638         function's arguments too.
4639
4640 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4641
4642         * decl.c (emit_init_test_initialization): Mark KEY as unused.
4643         * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
4644         (build_anewarray): Likewise.
4645         * parse.y (patch_newarray): Likewise.
4646         * parse.c: Regenerated.
4647
4648 2000-03-06  Bryce McKinlay  <bryce@albatross.co.nz>
4649
4650         * decl.c (init_decl_processing): Added new class fields `depth',
4651         `ancestors', and `idt' to class_type_node. Use
4652         _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
4653         * class.c (make_class_data): Push initial values for new fields.
4654         * java-tree.h: Updated prototype for `build_invokeinterface'.
4655         * expr.c (build_invokeinterface): Changed parameters to accept
4656         `method' tree. Calculate index of `method' in its declaring
4657         interface. Build call to _Jv_LookupInterfaceMethodIdx.
4658         (expand_invoke): Call `build_invokeinterface' with new parameters.
4659         * parse.y (patch_invoke): Call `build_invokeinterface' with new
4660         parameters.
4661
4662 2000-03-06  Bryce McKinlay <bryce@albatross.co.nz>
4663
4664         * typeck.c (lookup_do): Search superinterfaces first
4665         when looking up an interface method. From Godmar Back
4666         <gback@cs.utah.edu>
4667
4668 2000-03-06  Tom Tromey  <tromey@cygnus.com>
4669
4670         * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
4671
4672 2000-03-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4673
4674         * java-tree.h (lookup_argument_method2): Declared.
4675         (safe_layout_class): Prototype moved from parse.h.
4676         * parse.h (safe_layout_class): Prototype moved to java-tree.h.
4677         * parse.y (java_check_regular_methods): Local `super_class' gone.
4678         Call lookup_argument_method2 instead of lookup_argument_method.
4679         Perform modifier match for methods found declared in implemented
4680         interfaces. Fixed indentation problem. Overriding/hiding error
4681         report to take place only for methods found in classes.
4682         * typeck.c (lookup_argument_method): Changed leading
4683         comment. Re-written by calling lookup_do.
4684         (lookup_argument_method2): New function.
4685         (lookup_java_method): Re-written by calling lookup_do.
4686         (lookup_do): New function.
4687
4688 Thu Mar  2 15:18:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4689
4690         * check-init.c (check_init): Removed dead code. Handle (blank)
4691         final variables.
4692         * parse.y (declare_local_variables): New local `final_p', set it
4693         and use it to initialize LOCAL_FINAL.
4694         (check_final_assignment): Only check FIELD_DECLs.
4695
4696 2000-02-17  Tom Tromey  <tromey@cygnus.com>
4697
4698         * Makefile.in (JAVA_OBJS): Added boehm.o.
4699         (boehm.o): New target.
4700         * Make-lang.in (JAVA_SRCS): Added boehm.c.
4701         * java-tree.h (flag_use_boehm_gc): Declare.
4702         (get_boehm_type_descriptor): Declare.
4703         * lang.c (lang_f_options): Added `use-boehm-gc'.
4704         (flag_use_boehm_gc): New global.
4705         * lang-options.h: Added -fuse-boehm-gc.
4706         * boehm.c: New file.
4707         * class.c (get_dispatch_table): If class uses a Boehm type
4708         descriptor, put it in the vtable.
4709         (make_class_data): Removed dead code.
4710
4711 2000-03-03  Per Bothner  <per@bothner.com>
4712
4713         * decl.c (init_decl_processing):  Initialize sizetype properly.
4714
4715 2000-03-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4716
4717         * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
4718         (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
4719         * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
4720         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
4721         (jcf_parse): New local `current'. Load innerclasses seen in outer
4722         context being processed.
4723         * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
4724         * jcf-write.c (append_innerclasses_attribute): New function.
4725         (append_innerclasses_attribute_entry): Likewise.
4726         (get_access_flags): Handle static classes. Set anonymous and local
4727         classes to be private.
4728         (generate_classfile): Attribute count adjusted. Call
4729         append_innerclasses_attribute.
4730         * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
4731         PURE_INNER_CLASS_TYPE_P.
4732         * parse.y (parser_qualified_classname): New parameter `is_static',
4733         produce non qualified name accordingly.
4734         (block_statement:): Set LOCAL_CLASS_P when declaring local class.
4735         (create_interface): Added argument to parser_qualified_classname.
4736         (create_class): Added argument to parser_qualified_classname. Setup
4737         alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
4738         (add_inner_class_fields): Fixed indentation.
4739         (method_declarator): Use PURE_INNER_CLASS_DECP_P.
4740         (method_declarator): Fixed typo in comment.
4741         (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
4742         (build_current_thisn): Likewise.
4743         (patch_method_invocation): Likewise.
4744
4745 2000-03-01  Martin von Loewis  <loewis@informatik.hu-berlin.de>
4746
4747         * decl.c (current_function_decl): Move to toplev.c.
4748
4749 Mon Feb 28 08:20:42 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4750
4751         * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
4752         (DECL_BIT_INDEX): Use underlying representation.
4753         * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
4754
4755 Sun Feb 27 16:40:33 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4756
4757         * expr.c (build_java_ret): Pass proper type to size_binop.
4758
4759 2000-02-25  Anthony Green  <green@cygnus.com>
4760
4761         * expr.c (build_class_init): Mark the decl to be ignored by
4762         check_init.
4763         * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
4764         * check-init.c: Move DECL_BIT_INDEX to java-tree.h
4765         * class.c (init_test_hash_newfunc): New function.
4766         (decl_hash): New function.
4767         (decl_compare): New function.
4768         * decl.c (emit_init_test_initialization): New function.
4769         (complete_start_java_method): Traverse the init test hashtable,
4770         calling emit_init_test_initialization.
4771         (always_initialize_class_p): Define.
4772         * expr.c (build_class_init): Use initialization tests when
4773         emitting class initialization code.
4774         (always_initialize_class_p): Declare.
4775         * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
4776         1.
4777         * java-tree.h: Include hash.h.
4778         (DECL_FUNCTION_INIT_TEST_TABLE): Define.
4779         (struct lang_decl): Add init_test_table field.
4780         (init_test_hash_entry): Define.
4781
4782 Fri Feb 25 18:41:31 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4783
4784         * gjavah.c (main): Avoid using `argi' to report unimplemented
4785         options.
4786
4787 Fri Feb 25 18:47:25 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4788
4789         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
4790         initialize locals to avoid warnings. Local `exception_type' moved
4791         into if statement.
4792
4793 Fri Feb 25 18:00:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4794
4795         * parse.y (resolve_expression_name): Use `orig' as a second
4796         argument to resolve_field_access.
4797         (resolve_field_access): Removed unnecessary code when dealing with
4798         static fields.
4799
4800 Wed Feb 23 17:41:50 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4801
4802         * class.c (push_super_field): Don't push the field twice.
4803         * jcf-parse.c (parse_source_file): Call java_reorder_fields.
4804         * parse.h (java_reorder_fields): Prototyped.
4805         * parse.y (java_reorder_fields): New function.
4806         (java_layout_class): Simplified not to worry about re-ordering.
4807
4808 2000-02-23  Tom Tromey  <tromey@cygnus.com>
4809
4810         * gjavah.c (print_name): In JNI case, correctly quote string.
4811         (print_method_info): Don't handle overrides in JNI mode.
4812
4813 2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4814
4815         * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
4816         value type set to `boolean_type_node'.
4817
4818 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
4819
4820         * jcf-dump.c (main): Test for correct condition after
4821         output file creation.
4822
4823 2000-02-19  Anthony Green  <green@cygnus.com>
4824
4825         * jcf-depend.c (add_entry): Fix test for first list entry.
4826
4827 Sat Feb 19 18:43:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4828
4829         * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
4830         * constants.c (build_constants_constructor): Likewise.
4831
4832 2000-02-19  Anthony Green  <green@cygnus.com>
4833
4834         * jcf-depend.c (add_entry): Add entries to the end of the list.
4835
4836 Wed Nov 03 02:16:00 PST 1999  Pekka Nikander  <pekka.nikander@hut.fi>
4837
4838         * decl.c (INT_TYPE_SIZE): Define if necessary.
4839         (expand_java_return): Handle the case of a native integer smaller
4840         than a JVM integer.
4841
4842 2000-02-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
4843
4844         * gjavah.c (help): Use GCCBUGURL.
4845         * jv-scan.c (help): Likewise.
4846         * jcf-dump.c (help): Likewise.
4847
4848 Thu Feb 17 14:30:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4849
4850         * jcf-write.c (generate_bytecode_insns): Don't generate empty
4851         `finally' clauses.
4852
4853 Thu Feb 17 13:20:58 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4854
4855         * jcf-parse.c (load_class): Call `fatal' if no file containing
4856         the target class are found.
4857
4858 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
4859
4860         * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
4861         lex.c, lex.h, and PARSE_H to...
4862         (parse.o, parse-scan.o): ...here, respectively.
4863
4864         * lex.c: Split out code that may trigger SIGFPE from yylex()
4865         to its own function.
4866         * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
4867
4868 2000-02-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4869
4870         * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
4871
4872 2000-02-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4873
4874         * parse.y (outer_field_access_p): Stop in time when outer contexts
4875         are exhausted.
4876         (resolve_qualified_expression_name): Properly qualify *everything*
4877         after a package.type to be resoled as expression names.
4878         (find_applicable_accessible_methods_list): Save/restore `class' to
4879         isolate it from a possible outer context search.
4880
4881 2000-02-15  Tom Tromey  <tromey@cygnus.com>
4882
4883         * gjavah.c (jni_print_char): New function.
4884         (print_full_cxx_name): Use it.
4885         (decode_signature_piece): Likewise.
4886         (print_cxx_classname): Likewise.
4887
4888 2000-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4889
4890         * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
4891         version.o.
4892         (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
4893
4894         * gjavah.c: Include version.h.
4895
4896         * jcf-dump.c: Likewise.
4897
4898         * jv-scan.c: Likewise.
4899
4900 Sat Feb 12 04:34:04 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4901
4902         * parse.y (outer_field_access_fix): First parameter now a tree
4903         node. Check for assignement to final. First argument to
4904         build_outer_field_access_fix modified to accommodate prototype.
4905         (build_outer_field_access): Don't check for assignment to final
4906         here.
4907         (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
4908         possibly returned by outer_field_access_fix. Changed
4909         outer_field_access_fix's first argument.
4910         (check_final_assignment): $finit$'s context is OK.
4911         (patch_unaryop): Use node instead of its line/column value when
4912         calling outer_field_access_fix.
4913
4914 Fri Feb 11 17:38:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4915
4916         * parse.y (interface_declaration:): No longer tagged
4917         <node>. Re-installed default action.
4918         (class_member_declaration:): Handle inner interfaces.
4919         (interface_member_declaration): Handle inner interfaces and
4920         classes.
4921         (create_interface): Push error if one seen. Suspend parsing
4922         context when processing an inner interface.
4923         (register_fields): Inner class static field limitations not to
4924         apply to inner interfaces.
4925
4926 Thu Feb 10 22:07:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4927
4928         * jcf-parse.c (load_class): Update `java_error_count' when a
4929         class' file can't be found.
4930         (parse.y): Avoid (byte)code generation when errors seen.
4931
4932 Thu Feb 10 20:10:43 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4933
4934         * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
4935         decodes a valid node.
4936         (patch_binop): Handle TRUNC_DIV_EXPR.
4937
4938 Thu Feb 10 16:04:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4939
4940         * parse.y (resolve_package): New local `acc'. Try to progressively
4941         build and guess a package and type name.
4942
4943 Thu Feb 10 12:52:09 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4944
4945         * parse.y (find_applicable_accessible_methods_list): Load and
4946         layout the search class if necessary.
4947         (java_complete_tree): Keep to original type of the folded initial
4948         value.
4949
4950 2000-02-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4951
4952         * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
4953         Generate error message if circularity is detected. New static
4954         local `list'.
4955         * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro.  *
4956         * jcf-write.c (generate_bytecode_insns): Very simply handle
4957         SAVE_EXPR.
4958         * parse.y (java_check_circular_reference): Use
4959         `cyclic_inheritance_report' during report, if necessary.
4960         (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
4961         walking NEW_ARRAY_INIT twice.
4962
4963 2000-02-09  Tom Tromey  <tromey@cygnus.com>
4964
4965         * parse.y (check_class_interface_creation): Allow inner classes to
4966         be `private' or `protected', check modifiers' consistency. Prevent
4967         block local classes from bearing any modifiers.
4968
4969 2000-02-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4970
4971         * except.c (check_start_handlers): Re-add prototype lost in last
4972         patch.
4973         (maybe_start_try): Remove excess argument to `check_start_handlers'.
4974
4975 2000-02-09  Andrew Haley  <aph@cygnus.com>
4976
4977         * decl.c (clear_binding_level): Remove excess initializer.
4978         (maybe_poplevels): Remove unused variable.
4979         (force_poplevels): Ditto.
4980         (struct binding_level): Add comment.
4981
4982 2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4983
4984         * jcf-write.c (generate_classfile): Don't consider
4985         pre-initialization with reference value (use <clinit> instead.)
4986         * parse.y (java_fix_constructors): No generated constructor for
4987         interfaces.
4988         (build_outer_field_access): Removed debug message.
4989         (outer_field_expanded_access_p): Adapted to bytecode generation.
4990         (build_outer_field_access_method): Use fix_method_argument_names.
4991         (build_outer_method_access_method): Fixed indentation. Added
4992         comment. Handle access method generation for static and also void
4993         methods.
4994         (build_access_to_thisn): Inserted debug message.
4995         (maybe_build_thisn_access_method): Use fix_method_argument_names.
4996         (resolve_qualified_expression_name): Fixed comment.
4997         (not_accessible_p): Adapted to bytecode generation. Added comment.
4998         (patch_method_invocation): Added comment.
4999         (maybe_use_access_method): Fixed leading comment. Handle static
5000         methods.
5001         (java_complete_lhs): Don't shortcut handling of initialized upon
5002         declaration String type static fields when generating bytecode.
5003         (patch_unaryop): Handle outer field access when generating
5004         bytecode.
5005
5006 Thu Feb  3 20:23:19 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5007
5008         * java-tree.h (FIELD_THISN): New macro.
5009         * jcf-write.c (append_synthetic_attribute): New function.
5010         (generate_classfile): Set "Synthetic" attribute on this$<n>,
5011         val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
5012         * parse.y (add_inner_class_fields): Set FIELD_THISN for created
5013         this$<n> fields.
5014         (build_outer_field_access): Turned on access functions usage and
5015         generation when compiling to bytecode.
5016         (maybe_use_access_method): Likewise.
5017
5018 2000-01-25  Andrew Haley  <aph@cygnus.com>
5019
5020         * java-except.h (struct eh_range): Add `expanded' field.
5021         (maybe_start_try): Add end_pc arg.
5022         (maybe_end_try): Ditto.
5023         * java-tree.h (force_poplevels): new function.
5024         * expr.c (expand_byte_code): Don't call maybe_start_try or
5025         maybe_end_try.
5026         * except.c (add_handler): Reset expanded.
5027         (expand_start_java_handler): Set expanded.
5028         (check_start_handlers): Don't expand a start handler that's
5029         already been expanded.
5030         (maybe_start_try): Add end_pc arg.  Only expand a handler which
5031         ends after end_pc.
5032         (expand_end_java_handler): call force_poplevels.
5033         (force_poplevels): new function.
5034         * decl.c (binding_level): Add start_pc of binding level.
5035         (maybe_pushlevels): Call maybe_start_try when pushing binding
5036         levels.
5037         (maybe_poplevels): Call maybe_end_try when popping binding levels.
5038         (LARGEST_PC): Define.
5039         (clear_binding_level): Use LARGEST_PC.
5040
5041         * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
5042         * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
5043         (binding_depth, is_class_level, current_pc): new variables.
5044         (struct binding_level): ditto.
5045         (indent): new function.
5046         (push_jvm_slot): add debugging info.
5047         (maybe_pushlevels): ditto.
5048         (maybe_poplevels): ditto.
5049         (pushlevel): ditto.
5050         (poplevel): ditto.
5051         (start_java_method): ditto.
5052         (give_name_to_locals): comment only.
5053         * except.c (binding_depth, is_class_level, current_pc):
5054         new variables.
5055         (expand_start_java_handler): add debugging info.
5056         (expand_end_java_handler): ditto.
5057
5058 2000-02-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5059
5060         * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
5061         (print_name_for_stub_or_jni, process_file): Constify a char*.
5062
5063 2000-02-03  Tom Tromey  <tromey@cygnus.com>
5064
5065         * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
5066
5067 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
5068
5069         * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
5070         assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
5071         defined to be 1.
5072
5073 Wed Feb  2 18:43:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5074
5075         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
5076         * java-tree.h (TYPE_II_STMT_LIST): New macro.
5077         (struct lang_type): New field `ii_block'.
5078         * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
5079         CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
5080         * parse.h (struct parser_ctxt): New field `instance_initializers'.
5081         (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
5082         CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
5083         CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
5084         macros.
5085         * parse.y (add_instance_initializer): New function.
5086         (in_instance_initializer): New static global.
5087         (class_body_declaration:): Link instance initializer block.
5088         (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
5089         (array_creation_expression:): Remove unused local.
5090         (java_parser_context_push_initialized_field): Fixed leading
5091         comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
5092         CPC_INSTANCE_INITIALIZER_LIST.
5093         (java_parser_context_pop_initialized_field): Likewise.
5094         (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
5095         (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
5096         CPC_INITIALIZER_STMT.
5097         (fix_constructors): New local `class_type'. Use it. Call
5098         add_instance_initializer.
5099         (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
5100         (patch_return): Forbid return in instance initializers.
5101         (patch_throw_statement): Enforce exception handling in the context
5102         of instance initializers.
5103
5104 2000-02-03  Tom Tromey  <tromey@cygnus.com>
5105
5106         * Make-lang.in (java.mostlyclean): Remove executables in
5107         `mostlyclean'.
5108
5109 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
5110
5111         * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
5112         HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
5113         (java_float_finite): Convert to use union Word from javaop.h.
5114         (java_double_finite): Convert to use union DWord from javaop.h.
5115
5116 2000-02-02  Tom Tromey  <tromey@cygnus.com>
5117
5118         * gjavah.c (options): Added `jni' entry.
5119         (help): Document -jni.
5120         (flag_jni): New global.
5121         (process_file): Handle JNI output.  Don't print text from
5122         -prepend, -add, etc, when generating stubs.  Only remove `.class'
5123         suffix if it actually exists.
5124         (main): Create a `.c' file when run with `--jni --stubs'.  Create
5125         correct output file name with `--jni'.
5126         (print_include): Mangle header name differently in JNI case.
5127         (HANDLE_METHOD): In JNI mode, call print_method_info to generate
5128         method list.
5129         (print_method_info): Handle JNI case.  Put signature info into
5130         method name.  Handle case when STREAM is NULL.
5131         (print_name_for_stub_or_jni): New function.
5132         (print_stub_or_jni): Renamed from `print_stub'.  Handle JNI.
5133         (print_cxx_classname): Handle JNI.
5134         (print_full_cxx_name): Likewise.
5135         (decode_signature_piece): Likewise.
5136         (overloaded_jni_method_exists_p): New function.
5137         (struct method_name): Added `signature' and `sig_length' fields.
5138         (HANDLE_END_FIELD): Do nothing in JNI mode.
5139
5140 2000-02-02  Tom Tromey  <tromey@cygnus.com>
5141
5142         * jv-scan.c: Include version.c, <getopt.h>.
5143         (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
5144         (options): New array.
5145         (usage): New function.
5146         (version): New function.
5147         (main): Use getopt_long to parse command line.
5148         * jcf-dump.c: Include version.c, <getopt.h>.
5149         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
5150         OPT_JAVAP): New macros.
5151         (options): New array.
5152         (usage): Return `void'.  Changed message.
5153         (help): New function.
5154         (version): New function.
5155         (main): Use getopt_long_only to parse command line.
5156         * gjavah.c: Include <getopt.h>.
5157         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
5158         OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
5159         OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
5160         (options): New array.
5161         (java_no_argument): Removed.
5162         (help): Updated with missing options.
5163         (main): Use getopt_long_only to parse command line.
5164         (usage): Changed message.
5165
5166 Tue Feb  1 22:23:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5167
5168         * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
5169         * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
5170         ANONYMOUS_ARRAY_INITIALIZER): New access macros.
5171         * parse.y (array_creation_expression:): Handle anonymous arrays.
5172         (build_array_from_name): Don't set `ret_name' if null.
5173         (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
5174         (qualify_ambiguous_name): Likewise.
5175         (java_complete_expand_class): Likewise.
5176
5177 Tue Feb  1 14:59:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5178
5179         * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
5180         * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
5181         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
5182         (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
5183         (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
5184         AIPL_FUNCTION_COMPLETED_INVOCATION.
5185         (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
5186         AIPL_FUNCTION_INVOCATION_READY.
5187         (AIPL_FUNCTION_DECLARATION): New enum entry.
5188         * parse.y (reorder_static_initialized): New function.
5189         (java_parser_context_pop_initialized_field): Use it.
5190         (add_inner_class_fields): Use
5191         MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
5192         augmented. Install marker after last alias initializer, if any.
5193         (generate_finit): Fixed typo. Don't try to retain only the used
5194         fields.
5195         (method_header): Compute and set DECL_FUNCTION_NAP.
5196         (method_declarator): Fixed comment. Insert alias initializer in
5197         parameter list.
5198         (build_alias_initializer_parameter_list): Fixed leading
5199         comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
5200         replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
5201         (java_complete_expand_class): Code to retain only used aliases
5202         removed.
5203         (java_complete_expand_methods): New local `first_decl'. Generate
5204         $finit$ first, then expand the constructors, regular methods and
5205         <clinit>.
5206         (java_complete_expand_method): Don't report error on missing
5207         return statement if previously detected bogus.
5208         (fix_constructors): Don't patch constructor parameters list.
5209         (patch_method_invocation): Use new AIPL enum values. Reverse
5210         alias initializer list for anonymous classes.
5211
5212 2000-01-30  Anthony Green  <green@redhat.com>
5213
5214         * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
5215         determine how many stack slots to pop.
5216
5217 2000-01-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5218
5219         * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
5220         error handling/recovery.
5221         * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
5222
5223 Fri Jan 28 20:10:57 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5224
5225         * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
5226         FIELD_LOCAL_ALIAS_USED): New macros.
5227         (DECL_FUNCTION_NAP): New macro.
5228         (struct lang_decl): New field `nap'.
5229         (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
5230         (struct lang_type): New fields `finit_stmt_list' and
5231         `clinit_stmt_list'.
5232         (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
5233         * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
5234         (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
5235         UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
5236         (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
5237         AIPL_FUNCTION_INVOCATION_READY): New enum fields.
5238         (BUILD_THROW): Macro line separator re-indented.
5239         * parse.y (end_class_declaration): New function.
5240         (maybe_generate_pre_expand_clinit): New name for
5241         java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
5242         pre-expand static fields.
5243         (maybe_generate_clinit): Function deleted.
5244         (check_for_static_method_reference): Prototype's parameter list
5245         indented.
5246         (generate_finit): New name for maybe_generate_finit. Changed
5247         leading comment. Function rewritten to use
5248         TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
5249         (build_alias_initializer_parameter_list): New function.
5250         (java_parser_context_pop_initialized_field): Likewise.
5251         (add_inner_class_fields): Likewise.
5252         (type_declaration:): Call end_class_declaration.
5253         (class_member_declaration:): Likewise.
5254         (formal_parameter_list:): Fixed typos.
5255         (formal_parameter:): Use ARG_FINAL_P to mark created tree list
5256         element. Improved error handling.
5257         (block_statement:): Call end_class_declaration.
5258         (anonymous_class_creation:): Likewise.
5259         (create_anonymous_class): Fixed comments.
5260         (create_class): Call add_inner_class_fields.
5261         (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
5262         (method_header): Use MARK_FINAL_PARMS.
5263         (finish_method_declaration): Use UNMARK_FINAL_PARMS.
5264         (method_declarator): Propagate final argument flag.
5265         (craft_constructor): New local `artificial'. Call
5266         build_alias_initializer_parameter_list. Use
5267         CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
5268         (source_start_java_method): Mark parm decls with LOCAL_FINAL if
5269         necessary.
5270         (complete_expand_class): Get rid of unused outer context local
5271         alias fields.
5272         (java_complete_expand_methods): Fixed leading
5273         comment. Generate/pre-expand <clinit> first. Changed method
5274         expansion order to regular, $finit$, constructors, <clinit>.
5275         (java_complete_expand_method): Set current_function_decl.
5276         (fix_constructors): Fix constructor parameter list to account for
5277         outer context local alias initializers.
5278         (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
5279         (resolve_expression_name): Lookup outer context local aliases. New
5280         local `access', use it.
5281         (patch_method_invocation): Patch inner class ctor invocation with
5282         outer context local aliases initialization values. $finit$
5283         invocation patching now includes things generated with
5284         build_alias_initializer_parameter_list.
5285         (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
5286         (build_super_invocation): Likewise.
5287         (patch_assignment): Changed comment.
5288
5289 2000-01-27  Andrew Haley  <aph@cygnus.com>
5290
5291         * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
5292         (emit_if): Ditto.
5293         (emit_jsr): Ditto.
5294
5295 2000-01-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5296
5297         * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
5298         concatenation.
5299         (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
5300
5301         * parse.y (register_fields): Don't pass a format specifier to
5302         OBSOLETE_MODIFIER_WARNING.
5303         (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
5304         instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
5305         specifier.
5306         (check_modifiers): Change function into a macro.
5307         (check_class_interface_creation): Pass a literal format string.
5308
5309 2000-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5310
5311         * buffer.h: PROTO -> PARAMS.
5312         * check-init.c: Likewise.
5313         * class.c: Likewise.
5314         * constants.c: Likewise.
5315         * convert.h: Likewise.
5316         * decl.c: Likewise.
5317         * except.c: Likewise.
5318         * expr.c: Likewise.
5319         * gjavah.c: Likewise.
5320         * java-except.h: Likewise.
5321         * java-tree.h: Likewise.
5322         * jcf-depend.c: Likewise.
5323         * jcf-dump.c: Likewise.
5324         * jcf-parse.c: Likewise.
5325         * jcf-path.c: Likewise.
5326         * jcf-reader.c: Likewise.
5327         * jcf-write.c: Likewise.
5328         * jcf.h: Likewise.
5329         * jv-scan.c: Likewise.
5330         * jvgenmain.c: Likewise.
5331         * jvspec.c: Likewise.
5332         * lang.c: Likewise.
5333         * lex.c: Likewise.
5334         * lex.h: Likewise.
5335         * parse-scan.y: Likewise.
5336         * parse.h: Likewise.
5337         * parse.y: Likewise.
5338         * typeck.c: Likewise.
5339         * verify.c: Likewise.
5340         * xref.c: Likewise.
5341         * xref.h: Likewise.
5342         * zextract.c: Likewise.
5343         * zipfile.h: Likewise.
5344
5345 2000-01-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5346
5347         * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
5348         (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
5349         * constants.c (build_constant_data_ref): Check for cached
5350         current_constant_pool_data_ref. Cache current_constant_pool_data_ref
5351         in TYPE_CPOOL_DATE_REF.
5352         * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
5353         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
5354         (struct lang_type): New fields `cpool' and `cpool_data_ref'.
5355         (LOCAL_FINAL): New macro.
5356         * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
5357         constant pool -- don't try to reuse.
5358         (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
5359         TYPE_LANG_SPECIFIC.
5360         (find_in_current_zip): Use TYPE_JCF.
5361         * parse.h (java_check_final): Prototype removed.
5362         * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
5363         (maybe_create_class_interface_decl,
5364         check_class_interface_creation): Likewise.
5365         (java_expand_finals): Function removed.
5366         (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
5367         (block_statement:): Fixed comment.
5368         (anonymous_class_creation:): Likewise.
5369         (check_class_interface_creation): Reversed Jan 12, 2000 extra
5370         argument patch.
5371         (check_class_interface_creation): Loosened error report on (inner)
5372         public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
5373         (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
5374         (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
5375         argument patch.
5376         (create_interface): Likewise.
5377         (anonymous_class_counter): New static global.
5378         (create_anonymous_class): Reversed Jan 12, 2000 extra argument
5379         patch. Fixed comments.
5380         (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
5381         anonymous_class_counter when declaring a toplevel class.
5382         (craft_constructor): Fixed constructor name when handling
5383         anonymous classes. Anonymous class constructors to feature hidden
5384         this$<n> parameter.
5385         (java_fix_constructors): Added comment.
5386         (java_check_final): Function removed.
5387         (java_complete_expand_methods): Fixed comment. Don't generate
5388         class data, save its outgoing constant pool instead.
5389         (verify_constructor_super): Skip anonymous class constructor
5390         hidden this$<n> parameter.
5391         (java_expand_classes): New local `saved_ctxp'. Removed call to
5392         java_expand_finals and java_check_final. Expand anonymous class
5393         constructors. Generate class data.
5394         (build_super_invocation): Skip anonymous class hidden this$<n>
5395         parameter.
5396         * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
5397         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
5398         (set_java_signature): Likewise.
5399
5400 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
5401
5402         * gjavah.c: Delete ACC_VISIBILITY define.
5403         * jcf.h: Add ACC_VISIBILITY define.
5404         * parse.y: final: rule tagged <value>.
5405         (java_check_regular_methods): Use ACC_VISIBILITY define for
5406         default package access check.
5407         (local_variable_declaration_statement): Use final: rule.
5408
5409 Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
5410
5411         * parse.y (format_parameter:): Use final: rule instead of modifiers:.
5412         (final:): New rule.
5413
5414 2000-01-17  Tom Tromey  <tromey@cygnus.com>
5415
5416         * gjavah.c (print_field_info): Allow non-static final fields.
5417
5418 Fri Jan 14 18:03:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5419
5420         * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
5421         * parse.y (patch_anonymous_class): New function.
5422         (create_anonymous_class): Register incomplete type when the
5423         class/interface to extends/implement isn't known yet.
5424         (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
5425         (verify_constructor_super): Tuned error message.
5426
5427 Fri Jan 14 00:14:24 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5428
5429         * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
5430         (ANONYMOUS_CLASS_P): New macro.
5431         (TYPE_SIGNATURE, TYPE_JCF): New macros.
5432         (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
5433         * parse.y (create_class): Added leading argument.
5434         (maybe_create_class_interface_decl,
5435         check_class_interface_creation): Likewise.
5436         (craft_constructor): New function.
5437         (verify_constructor_super): Added argument in prototype.
5438         (class_declaration:): Inserted leading argument.
5439         (for_begin:): Use FOR_LOOP_P.
5440         (anonymous_class_creation): Create WFL of the anonymous class to
5441         instantiate. Call build_new_invocation. Added comments.
5442         (check_class_interface_creation): Handle parameter `anonymous' in
5443         verbose mode class creation announce.
5444         (link_nested_class_to_enclosing): Exclude anonymous classes.
5445         (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
5446         anonymous class, even though they appear to have an enclosing
5447         context.
5448         (create_interface): Pass extra argument to
5449         check_class_interface_creation.
5450         (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
5451         (create_class): Call check_class_interface_creation and
5452         maybe_create_class_interface_decl with extra new argument. Don't
5453         add private this$<n> to anonymous classes.
5454         (method_declarator): Insert hidden this$<n> to anonymous class
5455         constructors.
5456         (java_fix_constructors): Deleted code creating default
5457         constructor. Call craft_constructor instead.
5458         (java_check_regular_methods): Set `saw_constructor' to 1 for
5459         anonymous classes.
5460         (fix_constructors): Pass extra argument to verify_constructor_super.
5461         (verify_constructor_super): New local `sdecl', use it. Search for
5462         matching constructor (possibly featuring arguments) in super
5463         class.
5464         (lookup_method_invoke): Craft constructor according to arguments
5465         list when dealing with anonymous class constructors.
5466         (build_super_invocation): Pass arguments to anonymous class super
5467         constructors.
5468         (search_loop): Use FOR_LOOP_P.
5469         (labeled_block_contains_loop_p): Likewise.
5470
5471 Wed Jan 12 00:38:47 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5472
5473         * class.c (set_super_info): Set CLASS_STATIC when appropriate.
5474         (enclosing_context_p): New function.
5475         (get_access_flags_from_decl): Handle CLASS_STATIC.
5476         (maybe_layout_super_class): Extra first argument passed to
5477         do_resolve_class.
5478         (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
5479         ID_INIT_P.
5480         * decl.c (access0_identifier_node): New global.
5481         (init_decl_processing): access0_identifier_node initialized.
5482         (pushdecl): Set DECL_CONTEXT only on non type decls.
5483         * expr.c (lookup_field): Lookup inner class fields in enclosing
5484         contexts.
5485         (expand_invoke): Use ID_INIT_P.
5486         (expand_java_field_op): Use DECL_CLINIT_P.
5487         * java-tree.def (CLASS_LITERAL): New tree code.
5488         * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
5489         DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
5490         (struct lang_decl): New field `inner_access'.
5491         (enclosing_context_p): Prototyped.
5492         (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
5493         ID_CLINIT_P): New macros.
5494         (CLASS_STATIC): New macro.
5495         (CLASS_ACCESS0_GENERATED_P): New macro.
5496         (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
5497         TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
5498         INNER_CLASS_P): New macros.
5499         (DECL_INNER_CLASS_LIST): New macro.
5500         * jcf-parse.c (yyparse): Avoid the use of ANSI string
5501         concatenation.
5502         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
5503         the shift value to int. Fixed typo in comment.
5504         * lex.c (inst_id, wpv_id): Initialize.
5505         * mangle.c (unicode_mangling_length): Take `$' into account.
5506         * parse.h (DRECOVER, RECOVER): Terminate properly.
5507         (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
5508         (typedef struct _jdep): New field `enclosing'.
5509         (JDEP_ENCLOSING): New macro.
5510         (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
5511         (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
5512         (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
5513         GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
5514         GET_ENCLOSING_CPC_CONTEXT): New macros.
5515         (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
5516         (do_resolve_class): Added extra argument in prototype.
5517         * parse.y (resolve_class): Added extra argument in prototype.
5518         (maybe_create_class_interface_decl): Likewise.
5519         (maybe_use_access_method, build_wfl_wrap): New functions.
5520         (java_complete_expand_classes, java_complete_expand_class):
5521         Likewise.
5522         (java_parser_context_push_initialized_field,
5523         java_parser_context_suspend, java_parser_context_resume):
5524         Likewise.
5525         (maybe_make_nested_class_name, make_nested_class_name,
5526         set_nested_class_simple_name_value,
5527         link_nested_class_to_enclosing, find_as_inner_class,
5528         find_as_inner_class_do, check_inner_class_redefinition,
5529         build_thisn_assign, build_current_thisn, build_access_to_thisn,
5530         maybe_build_thisn_access_method, build_outer_field_access,
5531         build_outer_field_access_methods, build_outer_field_access_expr,
5532         build_outer_method_access_method, build_new_access_id,
5533         build_outer_field_access_method, outer_field_access_p,
5534         outer_field_expanded_access_p, outer_field_access_fix,
5535         build_incomplete_class_ref, patch_incomplete_class_ref,
5536         create_anonymous_class): Likewise.
5537         (inst_id, wpv_id): New static global variables.
5538         (synchronized:): New rule, tagged <node>.
5539         (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
5540         rules.
5541         (anonymous_class_creation:): New rule, tagged <node>.
5542         (NEW_TK): Tagged <node>.
5543         (type_literals, array_type_literal): New rules, tagged <node>.
5544         (class_declaration:): Removed action when reducing by class_body:
5545         (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
5546         using GET_CPC in sub-rules.
5547         (class_member_declaration): Handle inner classes.
5548         (method_declaration): When reducing method_header:, reset
5549         current_function_decl when appropriate.
5550         (method_declarator:): Set the number of formal parameter to 0 for
5551         method declared without arguments.
5552         (constructor_declarator:): Likewise.
5553         (static_initializer:): List of elements kept in a list.
5554         (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
5555         use of the keyword `static' for type declarations.
5556         (block_statement:): Handle inner class declarations.
5557         (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
5558         type qualified `this'.
5559         (class_instance_creation_expression): Use anonymous_class_creation:
5560         to handle inner class instances creation. Handle qualified `new'.
5561         (something_dot_new): Added appropriate actions.
5562         (create_new_parser_context): New function.
5563         (java_push_parser_context, java_parser_context_save_global,
5564         java_parser_context_suspend): Use create_new_parser_context.
5565         (check_modifiers): Changed leading comment.
5566         (check_class_interface_creation): Handle interclasses.
5567         (add_superinterfaces): Fixed comment.
5568         (create_interface): Build qualified name from the raw_name instead
5569         of its matching WFL. Push the initialized fields list. raw_name added
5570         as an extra argument to maybe_create_class_interface_decl.
5571         (create_class): Build qualified name from the raw_name instead of
5572         its matching WFL. Removed assignment to current_parsed_class_un.
5573         Call PUSH_ERROR before returning an error. Suspend the current
5574         parser context when processing an inner class. Push the
5575         initialized fields list. raw_name added as an extra argument to
5576         maybe_create_class_interface_decl. Add the private this$<n>
5577         field.
5578         (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
5579         (register_fields): Get the class type from GET_CPC and handle
5580         previous errors.  Added code to handle the creation of static
5581         fields in inner classes. Initialized fields initialization
5582         statements kept in a list of lists.
5583         (maybe_generate_finit): Initialized fields initialization
5584         statements kept in a list of lists. Use GET_CPC.
5585         (maybe_generate_clinit): Likewise.
5586         (method_header): Use GET_CPC and GET_CPC_UN.
5587         (parser_qualified_classname): Handle inner classes.
5588         (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
5589         (java_fix_constructors): Hide pointer to enclosing context
5590         instance in constructor list when dealing with inner classes.
5591         (jdep_resolve_class): Call resolve_class with extra first argument
5592         JDEP_ENCLOSING.
5593         (resolve_class): Add enclosing context as a first extra argument
5594         to do_resolve_class.
5595         (do_resolve_class): Call find_as_inner_class. Handle WFLs
5596         properly.
5597         (resolve_no_layout): Extra argument added to resolve_class
5598         invocation.
5599         (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
5600         (java_get_real_method_name): Use GET_CPC_UN.
5601         (check_abstract_method_definitions): Use DECL_CLINIT_P.
5602         (java_check_abstract_methods): Handle static method declared in
5603         inner classes by an error.
5604         (java_check_regular_methods): Use DECL_CLINIT_P.
5605         (source_start_java_method): Also set DECL_MAX_LOCALS.
5606         (create_artificial_method): Call java_parser_context_save_global
5607         and java_parser_context_restore_global instead of saving/restoring
5608         the context by hand.
5609         (expand_start_java_method): Improved verbose mode message.
5610         (java_complete_expand_methods): Fixed leading comment. Use
5611         DECL_CLINIT_P.
5612         (fix_constructors): Added assignment to this$<n> if necessary.
5613         (java_expand_classes): Call java_complete_expand_classes instead
5614         of java_complete_expand_methods.
5615         (make_qualified_primary): Simplified.
5616         (merge_qualified_name): Optimized for missing left or right parts.
5617         (resolve_expression_name): Handle access to outer class fields from
5618         interclasses.
5619         (resolve_qualified_expression_name): New macro
5620         RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
5621         classes. Report error on non appropriate qualification of
5622         `new'. Handle qualified `this'.
5623         (not_accessible_p): Allow access to outer class private fields from
5624         inner classes.
5625         (patch_method_invocation): Handle method invocations through
5626         access methods and inner class constructor invocations.
5627         (find_applicable_accessible_methods_list): Search enclosing
5628         contexts of an inner class.
5629         (search_applicable_methods_list): Fixed typo.
5630         (argument_types_convertible): Handle inner class constructors'
5631         hidden outer context reference argument.
5632         (qualify_ambiguous_name): Handle qualified `this'.
5633         (java_complete_lhs): Handle use of field accessed through
5634         artificial access methods in various cases of assignments. Handle
5635         CLASS_LITERAL node.
5636         (check_final_assignment): Use DECL_CLINIT_P.
5637         (valid_ref_assignconv_cast_p): Handle the destination being an
5638         enclosing context of the source.
5639         (patch_unaryop): Handle use of field accessed through artificial
5640         access methods.
5641         (patch_return): Use DECL_CLINIT_P.
5642         (patch_throw_statement): Use DECL_CLINIT_P.
5643         (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
5644         * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
5645         ID_INIT_P.
5646
5647 2000-01-16  Anthony Green  <green@cygnus.com>
5648
5649         * parse.y (build_string_concatenation): Only use
5650         StringBuffer(String) shortcut if String arg is constant.
5651
5652 Wed Jan 12 20:20:11 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5653
5654         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
5655         the shift value to int. Fixed typo in comment.
5656
5657 2000-01-11  Mumit Khan  <khan@xraylith.wisc.edu>
5658
5659         * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
5660         * jcf-write.c: Likewise.
5661         * parse.y: Likewise.
5662         * parse.c: Regenerate.
5663
5664 2000-01-09  Anthony Green  <green@cygnus.com>
5665
5666         * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
5667         bytecodes in the correct order.
5668
5669 2000-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5670
5671         * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
5672
5673 Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>
5674
5675         * expr.c (java_lang_expand_expr): Switch to permanent obstack
5676         before building constant array decl.
5677
5678 Thu Jan  6 00:54:10 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5679
5680         * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
5681         method invocation and typo in conditional expression.
5682         (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
5683         the appropriate NOTE_POP.
5684         * parse.y (patch_binop): Shift value mask to feature the right
5685         type.
5686
5687 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5688
5689         * class.c (assume_compiled, assume_compiled_node): Add static
5690         prototype.
5691         (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
5692
5693         * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
5694
5695         * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
5696
5697         * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
5698         to `__modifier' to avoid stringifying it.
5699
5700         * parse.y (verify_constructor_circularity): Don't call a variadic
5701         function with a non-literal format string.
5702         (java_check_abstract_methods): Move unreachable code inside
5703         `continue' statement.
5704         (lookup_method_invoke): Call xstrdup, not strdup.
5705
5706         * expr.c (expand_java_field_op): Avoid the use of ANSI string
5707         concatenation.
5708
5709         * jcf-parse.c (yyparse): Likewise.
5710
5711         * jv-scan.c (main): Likewise.
5712
5713 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5714
5715         * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
5716         ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
5717         ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
5718         concatenation.
5719
5720         * parse.y (synchronized, variable_redefinition_error,
5721         check_class_interface_creation, create_interface, create_class,
5722         method_header, finish_method_declaration,
5723         check_modifiers_consistency, method_declarator,
5724         complete_class_report_errors, check_abstract_method_definitions,
5725         java_check_regular_methods, check_throws_clauses,
5726         java_check_abstract_methods, read_import_dir,
5727         check_pkg_class_access, declare_local_variables, fix_constructors,
5728         cut_identifier_in_qualified, resolve_expression_name,
5729         resolve_qualified_expression_name, patch_method_invocation,
5730         java_complete_lhs, patch_assignment, try_builtin_assignconv,
5731         patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
5732         patch_exit_expr, patch_exit_expr, patch_switch_statement,
5733         patch_try_statement, patch_synchronized_statement,
5734         patch_throw_statement, check_thrown_exceptions,
5735         patch_conditional_expr): Likewise.
5736
5737 Fri Dec 24 00:25:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5738
5739         * Makefile.in (LIBDEPS): Added gcc's errors.o
5740         (../jcf-dump$(exeext):): Link with gcc's errors.o
5741         (../gcjh$(exeext):): Likewise.
5742         * expr.c (expand_java_NEW): Layout the entire target type instead of
5743         laying out its methods only.
5744         (lookup_field): Layout the class after having loaded it.
5745         * java-tree.h (java_debug_context): Declared.
5746         * jcf-io.c (toplev.h): Included.
5747         (find_class): Removed assignment to jcf's outofsynch
5748         field. Force source file to be read if newer than its matching
5749         class file. Tweaked debug messages.
5750         * jcf-parse.c (jcf_out_of_synch): Deleted.
5751         (read_class): Call to jcf_out_of_synch removed.
5752         * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
5753         (jcf_out_of_synch): Prototype deleted.
5754         * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
5755         `deprecated' and `class_err': integer turned into bit fields.
5756         New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
5757         * parse.y (package_list): New global.
5758         (package_declaration:): Record newly parsed package name.
5759         (extra_ctxp_pushed_p): Static global deleted.
5760         (java_parser_context_save_global): Create buffer context for the
5761         purpose of saving globals, if necessary.
5762         (java_parser_context_restore_global): Pop context pushed for the
5763         purpose of saving globals, if necessary.
5764         (java_debug_context_do): New prototype and function.
5765         (java_debug_context): Likewise.
5766         (do_resolve_class): Use already parsed package names to qualify
5767         and lookup class candidate.
5768         (java_pre_expand_clinit): Removed unnecessary local variable.
5769
5770 1999-12-17  Tom Tromey  <tromey@cygnus.com>
5771
5772         * gjavah.c (decode_signature_piece): Print "::" in JArray<>.  This
5773         fixes PR gcj/119.
5774         (process_file): Use `\n\' at end of each line in string.
5775
5776 Thu Dec 16 00:09:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5777
5778         * expr.c (expand_invoke): Layout the loaded class before
5779         attempting to use it.
5780         (expand_java_field_op): Allow final field assignments to take
5781         place in $finit$.
5782         * typeck.c (convert): Return error_mark_node if expr is null.
5783
5784 1999-12-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5785
5786         * class.c (class_depth): Return -1 if the class doesn't load
5787         properly.
5788         * expr.c (can_widen_reference_to): Check for errors during depth
5789         computation and return 0 accordingly.
5790         * jcf-parse.c (parse_source_file): Call java_fix_constructors to
5791         create default constructors and add an other error check.
5792         * parse.h (java_fix_constructors): Prototyped.
5793         * parse.y (java_pre_expand_clinit): Likewise.
5794         (build_super_invocation): Re-prototyped to feature one argument.
5795         (java_check_circular_reference): Directly use `current'.
5796         (java_fix_constructors): New function.
5797         (java_check_regular_methods): Don't create default constructors
5798         here, but abort if none were found.
5799         (java_complete_expand_methods): Pre-process <clinit> calling
5800         java_pre_expand_clinit.
5801         (java_pre_expand_clinit): New function.
5802         (fix_constructors): build_super_invocation invoked with the
5803         current method declaration as an argument.
5804         (build_super_invocation): Use the context of the processed method
5805         decl argument instead of current_class.
5806         * typeck.c (lookup_java_method): Take WFLs in method names into
5807         account.
5808
5809 Tue Dec 14 14:20:16 1999  Per Bothner  <per@bothner.com>
5810
5811         * class.c (make_class_data): flag_keep_inline_functions to keep
5812         private methods in the method array.
5813
5814 1999-12-15  Anthony Green  <green@cygnus.com>
5815
5816         * check-init.c (check_init): Take into account both types of
5817         `throw's when checking for uninitialized variables.
5818
5819 Fri Dec 10 21:53:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5820
5821         * parse.y (java_complete_lhs): Force convertion of array
5822         dimensions to int_type_node, that's what runtime's ABI expects.
5823
5824 Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5825
5826         * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
5827         operand of a WFL, until the Java front-end gets fixed with regard
5828         to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
5829
5830 1999-12-10  Andrew Haley  <aph@cygnus.com>
5831
5832         * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
5833         decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
5834         expr.c (build_java_athrow): Add support for sjlj-exceptions.
5835         java-tree.h: Ditto.
5836         jcf-write.c: Ditto.
5837
5838 Wed Dec  8 15:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5839
5840         * expr.c (java_lang_expand_expr): Switch to permanent obstack
5841         before calling expand_eh_region_start and expand_start_all_catch.
5842         * except.c (expand_start_java_handler): Switch to permanent
5843         obstack before calling expand_eh_region_start.
5844         (expand_end_java_handler): Switch to permanent obstack before
5845         calling expand_start_all_catch.
5846
5847 1999-12-5  Anthony Green  <green@cygnus.com>
5848
5849         * decl.c (init_decl_processing): Mark throw_node as a noreturn
5850         function with side effects.
5851         (init_decl_processing): Mark all memory allocating DECLs with
5852         DECL_IS_MALLOC.
5853
5854 Wed Dec  1 04:25:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5855
5856         * except.c (expand_end_java_handler): Call
5857         expand_resume_after_catch and end_catch_handler.
5858
5859 Tue Nov 30 12:36:15 1999  Anthony Green  <green@cygnus.com>
5860
5861         * verify.c (verify_jvm_instructions): Create new return label
5862         chain if non existent (don't rely on the verified state of the jsr
5863         target.)
5864
5865 Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5866
5867         * jcf-write.c (generate_bytecode_insns): Fixed indentation for
5868         COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
5869
5870         * parse.y (patch_assignment): Removed bogus final class test on
5871         lhs when checking on whether to emit an ArrayStoreException runtime
5872         check.
5873         * expr.c (expand_java_arraystore): Likewise.
5874
5875 1999-11-28 Anthony Green <green@cygnus.com>
5876
5877         * decl.c (find_local_variable): Reuse single slot decls when
5878           appropriate.
5879
5880 Wed Nov 24 17:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5881
5882         * jcf-parse.c (saw_java_source): Global variable removed.
5883         (read_class): Don't use `saw_java_source'. Added extra braces.
5884         (yyparse): Code setting `saw_java_source' removed.
5885
5886 1999-11-24  Mark Mitchell  <mark@codesourcery.com>
5887
5888         * except.c (emit_handlers): Zero catch_clauses after emitting them.
5889
5890 Tue Nov 23 17:29:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5891
5892         * verify.c (merge_type_state): Non verified subroutines being
5893         considered more than once to trigger passive type merge.
5894
5895 Tue Nov 23 10:55:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5896
5897         * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
5898         in case of error. Error message tuned.
5899
5900 1999-11-21  Anthony Green  <green@cygnus.com>
5901
5902         * constants.c (find_methodref_index): Unwrap method names before
5903         inserting them in the constant pool.
5904
5905         * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
5906
5907         * class.c (assume_compiled_node): New typedef.
5908         (assume_compiled_tree): New static data.
5909         (find_assume_compiled_node): New function.
5910         (add_assume_compiled): New function.
5911         (assume_compiled): New function.
5912         * class.c (make_class_data): Use assume_compiled.
5913         (is_compiled_class): Use assume_compiled.
5914
5915         * java-tree.h (add_assume_compiled): Declare.
5916
5917         * lang.c (lang_decode_option): Parse new options.
5918
5919 Wed Nov 17 21:09:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5920
5921         * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
5922         int_type_node: that's what `_Jv_AllocObject' expects.
5923
5924 Thu Nov 11 01:57:14 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5925
5926         * parse.y (lookup_method_invoke): Use lang_printable_name to
5927         reliably build the type name during error report. Fixes PR gcj/97.
5928
5929 1999-11-09  Tom Tromey  <tromey@cygnus.com>
5930
5931         * jcf-path.c: Include <sys/stat.h>.
5932         (jcf_path_init): Search for libjava.zip.  Fixes PR gcj/84.
5933         (DIR_UP): New macro.
5934
5935 Tue Nov  9 12:12:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5936
5937         * parse.y (source_end_java_method): Resume permanent allocation,
5938         reversing Apr 27 1998 patch.
5939         (patch_string_cst): Pop obstacks after having pushed the permanent
5940         ones.
5941
5942 1999-11-05  Tom Tromey  <tromey@cygnus.com>
5943
5944         * class.c (finish_class): Emit inlined methods if any native
5945         methods exist in the class.  Fixes PR gcj/85.
5946
5947 Thu Nov  4 16:27:01 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5948
5949         * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
5950         (qualify_ambiguous_name): Likewise.
5951
5952 Wed Nov  3 15:20:02 MST 1999  Godmar Back <gback@cs.utah.edu>
5953
5954         * typeck.c: (lookup_java_method):  search all inherited
5955         interfaces when looking up interface method.
5956
5957 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5958
5959         * parse.y (method_header:): Issue error message for rule `type
5960         error'.
5961         (synchronized:): Error report when not using synchronized.
5962
5963 Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5964
5965         * parse.y (resolve_qualified_expression_name): Prevent `this' from
5966         being used before the superclass constructor has been called.
5967         (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
5968         instead of `CALL_THIS_CONSTRUCTOR_P'.
5969
5970 Sat Oct 30 21:35:13 1999  Todd T. Fries <todd@lighthouse.fries.net>
5971
5972         * check-init.c: Fix typo in comment.
5973
5974 Fri Oct 29 14:35:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5975
5976         * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
5977         and final method.
5978
5979 Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5980
5981         * parse.y (expression_statement:): Call function to report
5982         improper invocation of a constructor.
5983         (parse_ctor_invocation_error): New function.
5984
5985 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
5986
5987         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
5988         remember_end_note.
5989
5990 1999-10-21  Tom Tromey  <tromey@cygnus.com>
5991
5992         * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
5993         in generated `main'.
5994
5995 Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5996
5997         * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
5998         (qualify_ambiguous_name): Likewise.
5999
6000 Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6001
6002         * parse.y (java_complete_tree): fold_constant_for_init to work on
6003         permanent_obstack.
6004         (java_complete_lhs): Likewise.
6005         (array_constructor_check_entry): Complete an initializer element
6006         on permanent_obstack.
6007
6008 1999-10-19  Tom Tromey  <tromey@cygnus.com>
6009
6010         * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
6011         From Mike Moreton <mike@pillim.demon.co.uk>.
6012
6013 1999-10-15  Greg McGary  <gkm@gnu.org>
6014
6015         * java-tree.h (flag_bounds_check): Remove extern decl.
6016         * lang.c (flag_bounds_check): Remove global variable.
6017         (lang_f_options): Remove "bounds-check" entry.
6018         (lang_init_options): Default flag_bounds_check to "on".
6019
6020 1999-10-14  Tom Tromey  <tromey@cygnus.com>
6021
6022         * jvgenmain.c (usage): New function.
6023         (main): Use it.  Also, handle `-D' options.
6024         * jvspec.c (lang_specific_driver): Recognize -D.
6025         (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
6026
6027         * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
6028
6029 1999-10-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6030
6031         * jcf-dump.c (print_constant, disassemble_method): Don't call a
6032         variadic function with a non-literal format string.
6033
6034         * parse-scan.y (report_main_declaration): Likewise.
6035
6036         * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
6037
6038         * parse.y (read_import_dir, patch_assignment, patch_binop,
6039         patch_array_ref): Likewise.
6040
6041         * typeck.c (build_java_array_type): Likewise.
6042
6043         * verify.c (verify_jvm_instructions): Likewise.
6044
6045 Tue Oct 12 22:28:10 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6046
6047         * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
6048
6049 1999-10-07  Anthony Green  <green@cygnus.com>
6050
6051         * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
6052         where CHECK_PUT may fail for valid reasons.
6053
6054         * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
6055         UNSAFE_PUTN): New macros.
6056
6057 1999-10-04  Tom Tromey  <tromey@cygnus.com>
6058
6059         * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
6060         well.  Fixes Java PR gcj/59.
6061         * parse-scan.y (yyerror): Report errors.
6062
6063 Fri Sep 24 12:23:05 1999  Glenn Chambers  <GChambers@provsol.com>
6064
6065         * decl.c (insert_block): Remove unconditional `abort'.
6066
6067 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
6068
6069         * decl.c (builtin_function): No longer static.  New arg CLASS.  Arg
6070         FUNCTION_CODE now of type int.  All callers changed.
6071         Set the builtin's DECL_BUILT_IN_CLASS.
6072
6073 1999-09-23  Tom Tromey  <tromey@cygnus.com>
6074
6075         * jvspec.c (lang_specific_driver): Don't read spec file if
6076         -fsyntax-only given.
6077
6078 1999-09-22  Tom Tromey  <tromey@cygnus.com>
6079
6080         * lang-specs.h: Added `%(jc1)' to the jc1 spec.
6081
6082         * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
6083         (WORDS_TO_LONG): Likewise.
6084         (WORDS_TO_DOUBLE): Likewise.
6085
6086 Tue Sep 14 16:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6087
6088         * jcf-write.c (RELOCATION_VALUE_0): New macro.
6089         (RELOCATION_VALUE_1): Likewise.
6090         (emit_iinc, emit_reloc, push_constant1, push_constant2,
6091         push_in_const, push_long_const): Prototyped.
6092         (push_constant1): Argument `index' is of type HOST_WIDE_INT.
6093         (push_constant2): Likewise.
6094         (push_int_const): Cast find_constant1's integer arguments to `jword'.
6095         (find_constant_wide): Cast find_constant2's integer arguments to
6096         `jword'.
6097         (find_constant_index): Cast find_constant2's and find_constant2's
6098         integer arguments to `jword'.
6099         (emit_pop): Argument `value' is of type HOST_WIDE_INT.
6100         (emit_switch_reloc): Use RELOCATION_VALUE_0.
6101         (emit_if): Use RELOCATION_VALUE_1.
6102         (emit_goto): Likewise.
6103         (emit_jsr): Likewise.
6104         (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
6105         argument to push_long_const to HOST_WIDE_INT.
6106
6107 1999-09-15  Andreas Schwab  <schwab@suse.de>
6108
6109         * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
6110
6111 1999-09-20  Nick Clifton  <nickc@cygnus.com>
6112
6113         * lang.c (lang_decode_option): Extend comment.
6114
6115 Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6116
6117         * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
6118         instead of fndecl.
6119
6120 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6121
6122         * gjavah.c (get_field_name, print_method_info, print_include,
6123         add_namelet): Use xmalloc, not malloc.
6124
6125         * jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
6126         (munge): Use xrealloc, not realloc, trust xrealloc to handle a
6127         NULL pointer.
6128
6129         * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
6130
6131         * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
6132
6133         * jcf-path.c (add_entry): Likewise.
6134
6135         * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
6136
6137         * jv-scan.c (xmalloc): Remove definition.
6138
6139         * jvgenmain.c (xmalloc): Likewise.
6140
6141         * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
6142
6143         * lex.c (java_store_unicode): Use xrealloc, not realloc.
6144
6145         * parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
6146         concat, not xmalloc/sprintf.
6147         (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
6148         (xstrdup): Remove definition.
6149
6150         * parse.y (duplicate_declaration_error_p,
6151         constructor_circularity_msg, verify_constructor_circularity,
6152         check_abstract_method_definitions, java_check_regular_methods,
6153         java_check_abstract_methods, patch_method_invocation,
6154         check_for_static_method_reference, patch_assignment, patch_binop,
6155         patch_cast, array_constructor_check_entry, patch_return,
6156         patch_conditional_expr): Use xstrdup, not strdup.
6157
6158         * zextract.c (ALLOC): Use xmalloc, not malloc.
6159
6160 Sun Sep 12 23:30:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6161
6162         * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
6163
6164         * jvspec.c: Include gcc.h.  Don't include gansidecl.h.
6165         (do_spec, lang_specific_pre_link, lang_specific_driver,
6166         input_filename, input_filename_length): Don't declare.
6167         (main_class_name, jvgenmain_spec, lang_specific_driver):
6168         Constify a char*.
6169         (lang_specific_driver): All calls to the function pointer
6170         parameter now explicitly call `fatal'.
6171
6172 Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6173
6174         * parse.y (find_applicable_accessible_methods_list): Search
6175         abstract classes as interfaces.
6176
6177 Thu Sep  9 17:33:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6178
6179         * class.c (finish_class): We're now outside a valid method
6180         declaration. Tell the rest of gcc so.
6181
6182 1999-09-08  Bruce Korb  autogen@linuxbox.com
6183
6184         * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
6185
6186 1999-09-07  Tom Tromey  <tromey@cygnus.com>
6187
6188         * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
6189         java-array.h.
6190         (decode_signature_piece): Don't emit "::" in JArray<>.
6191         (print_namelet): Only print trailing `;' when printing a class.
6192
6193 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
6194
6195         * java-tree.h: Delete declarations for all tree nodes now moved to
6196         global_trees.
6197         * decl.c: Delete their definitions.
6198
6199 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
6200
6201         * Make-lang.in (jc1): Depend on ggc-callbacks.o.
6202         * Makefile.in (OBJS): Add ggc-callbacks.o.
6203         (OBJDEPS): Likewise.
6204
6205 1999-09-03  Tom Tromey  <tromey@cygnus.com>
6206
6207         * parse.y (strip_out_static_field_access_decl): Return operand if
6208         it satisfies JDECL_P.
6209
6210 1999-09-02  Tom Tromey  <tromey@cygnus.com>
6211
6212         * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
6213         Handle nested arrays, like `[[I'.
6214
6215 1999-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6216
6217         * class.c (finish_class): Remove unused parameter, all callers
6218         changed.
6219
6220         * expr.c (build_java_athrow): Change return type to void.
6221         (java_lang_expand_expr): Make sure each case in switch returns a
6222         value.
6223
6224         * java-tree.h (finish_class): Fix prototype to take void args.
6225
6226         * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
6227         (main): Issue return from main, not exit.
6228
6229         * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
6230
6231         * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
6232
6233         * jv-scan.c (main): Issue return from main, not exit.
6234
6235         * parse.y (check_abstract_method_definitions,
6236         java_check_abstract_method_definitions): Add static prototypes.
6237         (java_complete_expand_methods): Fix call to `finish_class'.
6238
6239         * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
6240         and `prevpc'.
6241
6242 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6243
6244         * lang.c (language_string): Constify.
6245
6246 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6247
6248         * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
6249         Remove hacks for stuff which comes from libiberty.
6250
6251         * Make-lang.in: Likewise.
6252
6253 Mon Aug 30 16:41:41 1999  Hans-Peter Nilsson  <hp@axis.se>
6254
6255         * Makefile.in (xref.o): Depend on xref.c explicitly.
6256
6257 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6258
6259         * java-tree.h (lang_printable_name): Constify a char*.
6260
6261         * lang.c (lang_printable_name): Likewise.
6262
6263 Fri Aug 27 23:31:57 1999  Jeffrey A Law  (law@cygnus.com)
6264
6265         * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
6266         comments in C code.
6267
6268 1999-08-26  Tom Tromey  <tromey@cygnus.com>
6269
6270         * gjavah.c (print_cxx_classname): Print "::" before qualified
6271         name.
6272
6273 Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6274
6275         * parse.y (lookup_cl): Changed leading comment. Now does its best
6276         to set the column number.
6277         (qualify_ambiguous_name): Take WFL wrappers into account.
6278
6279 Wed Aug 25 15:37:15 1999  Gregg Townsend  <gmt@cs.arizona.edu>
6280
6281         * verify.c (verify_jvm_instructions): Don't check instruction
6282         validity beyond end of method.
6283
6284 1999-08-25  Tom Tromey  <tromey@cygnus.com>
6285
6286         * jvspec.c (lang_specific_driver): Correctly handle --help again.
6287
6288 1999-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6289
6290         * gjavah.c (print_name, print_base_classname, utf8_cmp,
6291         cxx_keyword_subst, generate_access, name_is_method_p,
6292         get_field_name, print_field_name, super_class_name, print_include,
6293         decode_signature_piece, print_class_decls, usage, help,
6294         java_no_argument, version, add_namelet, print_namelet): Add static
6295         prototype.
6296         (print_base_classname, utf8_cmp, cxx_keyword_subst,
6297         name_is_method_p): Constify a char*.
6298         (get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
6299         Provide a final else clause in an if-else-if.
6300         (print_field_info): Add missing final arg in function call to
6301         `print_field_name'.
6302         (print_method_info, decompile_method, decode_signature_piece,
6303         print_c_decl, print_full_cxx_name, print_stub,
6304         print_mangled_classname, super_class_name, print_include,
6305         add_namelet, add_class_decl, print_class_decls, process_file,
6306         help): Constify a char*.
6307
6308         * jcf-write.c (jcf_handler, push_constant1, push_constant2,
6309         push_int_const, find_constant_wide, find_constant_index,
6310         push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
6311         emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
6312         emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
6313         emit_if, emit_goto, emit_jsr, call_cleanups,
6314         make_class_file_name): Add static prototypes.
6315         (generate_bytecode_return, generate_bytecode_insns): Pass a
6316         NULL_PTR, not a NULL_TREE.
6317
6318         * jv-scan.c: Include "jcf.h".
6319         (main): Declare using DEFUN macro.
6320
6321         * jvspec.c (find_spec_file, lang_specific_pre_link,
6322         lang_specific_driver): Add prototypes.
6323         (find_spec_file): Constify a char*.
6324
6325         * keyword.gperf (hash, java_keyword): Add prototypes.
6326
6327         * lang.c (lang_print_error): Add static prototype.
6328         (lang_init): Prefer memcpy over bcopy to avoid casts.
6329
6330         * lex.c (yylex): Add static prototype.
6331
6332         * parse-scan.y: Include "lex.c" earlier.
6333
6334         * parse.h: Remove redundant declaration for `yylex'.
6335
6336         * parse.y (java_decl_equiv, binop_compound_p, search_loop,
6337         labeled_block_contains_loop_p): Add static prototypes.
6338         (not_accessible_p): Make static to match prototype.
6339
6340         * verify.c (start_pc_cmp): Don't needlessly cast away const.
6341
6342 Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6343
6344         * parse.y (check_method_redefinition): Changed leading comment.
6345         (check_abstract_method_definitions): New function.
6346         (java_check_abstract_method_definitions): New function.
6347         (java_check_regular_methods): Call it.
6348         (verify_constructor_super): Fixed indentation.
6349         (lookup_method_invoke): Likewise.
6350
6351 Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6352
6353         * parse.y (method_header): Return a null pointer if the current
6354         class node is null.
6355         (finish_method_declaration): Return if the current function decl
6356         is null.
6357         (source_start_java_method): Likewise.
6358         (java_method_add_stmt): Likewise.
6359
6360 Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6361
6362         * class.c (emit_register_class): Removed unnecessary call to
6363         start_sequence.
6364         * parse.y (labeled_block_contains_loop_p): Removed unused local
6365         variable.
6366
6367 Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6368
6369         * parse.y (java_refold): Added prototype.
6370
6371 Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6372
6373         * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
6374         (java_stabilize_reference): Removed unnecessary `else'.
6375         (java_complete_lhs): Set flag to remember boolean. Call
6376         java_refold. Added comments.
6377         (java_decl_equiv): New function.
6378         (binop_compound_p): Likewise.
6379         (java_refold): Likewise.
6380         (patch_unaryop): Striped static field access assigned to decl and
6381         op. Changed promotion scheme for ++/-- operators.
6382         (search_loop): New function.
6383         (labeled_block_contains_loop_p): Likewise.
6384         (patch_loop_statement): Call labeled_block_contains_loop_p. Added
6385         comment.
6386         (patch_bc_statement): Call search_loop. Fixed comment.
6387
6388 1999-08-14  Anthony Green  <green@cygnus.com>
6389
6390         * expr.c (java_lang_expand_expr): Mark static array data as
6391         referenced.
6392
6393 Tue Aug 10 00:28:31 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
6394
6395         * jvgenmain.c (main): NUL-terminate name_obstack.
6396
6397 1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6398
6399         * check-init.c (check_bool2_init, done_alternative): Add static
6400         prototypes.
6401
6402         * class.c (add_interface_do, maybe_layout_super_class): Likewise.
6403         (add_method, build_utf8_ref, build_class_ref,
6404         append_gpp_mangled_type, layout_class_method): Constify a char*.
6405
6406         * decl.c (push_promoted_type, make_binding_level): Add static
6407         prototypes.
6408         (push_promoted_type, pushdecl): Constify a char*.
6409
6410         * except.c (find_handler_in_range, link_handler,
6411         check_start_handlers): Add static prototypes.
6412
6413         * expr.c (process_jvm_instruction): Constify a char*.
6414
6415         * gjavah.c (main): Constify a char*.
6416
6417         * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
6418         Constify a char*.
6419
6420         * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
6421         static prototypes.
6422         (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
6423         munge, print_ents): Constify a char*.
6424
6425         * jcf-dump.c (disassemble_method): Constify a char*.
6426         (print_constant_pool, print_exception_table): Add static prototypes.
6427         (print_constant, print_exception_table, main, disassemble_method):
6428         Constify a char*.
6429
6430         * jcf-io.c (find_classfile, find_class): Likewise.
6431
6432         * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
6433         (set_source_filename, predefined_filename_p): Add static prototypes.
6434         (set_source_filename, get_constant, get_class_constant,
6435         find_in_current_zip): Constify a char*.
6436
6437         * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
6438         static prototypes.
6439         (add_entry, add_path, jcf_path_classpath_arg,
6440         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
6441
6442         * jcf-reader.c (get_attribute, jcf_parse_preamble,
6443         jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
6444         jcf_parse_one_method, jcf_parse_methods,
6445         jcf_parse_final_attributes): Add static prototypes.
6446         (get_attribute): Constify a char*.
6447
6448         * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
6449         jcf_dependency_add_target, jcf_path_classpath_arg,
6450         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
6451
6452         * jv-scan.c (main): Constify a char*.
6453         (gcc_obstack_init): Add prototype arguments.
6454
6455         * jvgenmain.c (gcc_obstack_init): Likewise.
6456         (main): Constify a char*.
6457
6458         * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
6459         static prototypes.
6460         (put_decl_string, lang_print_error): Constify a char*.
6461         (lang_init): Remove redundant extern prototype.
6462
6463         * mangle.c (emit_unicode_mangled_name): Constify a char*.
6464
6465         * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
6466         Add static prototypes.
6467         (get_type_from_signature): Constify a char*.
6468
6469         * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
6470         Add static prototypes.
6471         (start_pc_cmp): Prefer PTR over GENERIC_PTR.
6472         (verify_jvm_instructions): Constify a char*.
6473
6474         * xref.c (xref_flag_value): Likewise.
6475
6476         * xref.h (xref_flag_value): Likewise.
6477
6478         * zextract.c (makeword, makelong): Add static prototypes.
6479         (makeword, makelong): Constify a uch*.
6480
6481 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6482
6483         * lang.c (java_dummy_print): Constify a char*.
6484         (lang_print_error): Likewise.
6485         (lang_init): Remove redundant prototype for `print_error_function'.
6486         (lang_init_source): Likewise.
6487         (lang_identify): Constify a char*.
6488
6489 1999-08-09  Tom Tromey  <tromey@cygnus.com>
6490
6491         * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
6492         (WORDS_TO_LONG): Likewise.
6493         (WORDS_TO_DOUBLE): Likewise.
6494
6495 1999-08-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6496
6497         * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
6498
6499         * expr.c (java_stack_pop, java_array_data_offset,
6500         build_java_throw_out_of_bounds_exception, case_identity,
6501         build_java_check_indexed_type): Add static prototypes.
6502         (linenumber_table, expand_invoke, expand_java_field_op,
6503         build_primtype_type_ref, expand_byte_code): Constify a char*.
6504
6505         * java-tree.h (build_primtype_type_ref, linenumber_table):
6506         Constify a char*.
6507         (java_lang_expand_expr): Add prototype.
6508
6509         * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
6510         `java_lang_expand_expr'.
6511
6512         * lex.c (java_lex_error): Constify a char*.
6513         (java_get_unicode, java_read_char, java_allocate_new_line,
6514         java_unget_unicode, java_sneak_unicode): Prototype.
6515
6516         * parse-scan.y (current_class, package_name, method_declarator,
6517         report_class_declaration, yyerror): Constify a char*.
6518
6519         * parse.h (java_report_errors): Prototype.
6520         (yyerror): Constify a char*.
6521
6522         * parse.y (classitf_redefinition_error, check_modifiers,
6523         parse_jdk1_1_error, lookup_package_type,
6524         lookup_package_type_and_set_next, get_printable_method_name,
6525         purify_type_name): Constify a char*.
6526         (build_super_invocation, maybe_generate_finit,
6527         verify_constructor_super, parser_add_interface,
6528         add_superinterfaces, jdep_resolve_class, note_possible_classname,
6529         java_complete_expand_methods, java_expand_finals,
6530         cut_identifier_in_qualified, java_stabilize_reference,
6531         do_unary_numeric_promotion, operator_string, do_merge_string_cste,
6532         merge_string_cste): Prototype.
6533         (single_type_import_declaration, yyerror,
6534         variable_redefinition_error, build_array_from_name,
6535         build_unresolved_array_type, check_class_interface_creation,
6536         resolve_class, complete_class_report_errors,
6537         note_possible_classname, read_import_dir,
6538         find_in_imports_on_demand, resolve_package, fix_constructors,
6539         check_deprecation, lookup_method_invoke,
6540         maybe_build_primttype_type_ref, array_constructor_check_entry):
6541         Constify a char*.
6542         (java_complete_expand_methods, java_expand_finals): Make static.
6543         (convert_narrow): Remove static prototype.
6544
6545 Tue Aug  3 20:21:20 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
6546
6547         * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
6548
6549 1999-08-02  Richard Henderson  <rth@cygnus.com>
6550
6551         * decl.c: Include defaults.h instead of expr.h.
6552         * parse.y: Likewise.
6553
6554 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
6555
6556         * java/decl.c (start_java_method): Change all uses of
6557         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
6558         Ensure expr.h is included.
6559         * java/expr.c (pop_arguments): Ditto.
6560         * java/parse.y (expand_start_java_method): Ditto.
6561
6562 1999-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6563
6564         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
6565
6566 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
6567
6568         * decl.c: Include "function.h".
6569         * except.c: Likewise.
6570         * parse.y: Likewise.
6571         * Makefile.in: Update dependencies.
6572
6573 1999-07-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6574
6575         * expr.c (build_java_soft_divmod): Provide a default case in switch.
6576         (java_lang_expand_expr): Mark parameters `target', `tmode' and
6577         `modifier' with ATTRIBUTE_UNUSED.
6578
6579         * gjavah.c (process_file): Add braces around ambiguous `else'.
6580
6581         * jcf-dump.c (print_access_flags, localvar_free): Change return
6582         type to void.
6583
6584         * parse.y (java_complete_expand_method): Initialize variable
6585         `exception_copy'.
6586         (resolve_qualified_expression_name): Likewise for `field_decl'.
6587         (patch_method_invocation): Likewise for `class_to_search'.
6588         (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
6589         (patch_assignment): Likewise for `lhs_type'.
6590
6591         * verify.c (verify_jvm_instructions): Remove unused variable
6592         `caller'.
6593
6594 1999-07-25  Richard Henderson  <rth@cygnus.com>
6595
6596         * decl.c (va_list_type_node): New.
6597
6598 1999-07-25  Anthony Green  <green@cygnus.com>
6599
6600         * gjavah.c (print_stub): New function.
6601         (METHOD_IS_NATIVE): New macro.
6602         (print_mangled_classname): Make static.
6603         (HANDLE_END_FIELD): Don't emit fields during stub generation.
6604         (process_file): Perform stub generation.
6605         (HANDLE_METHOD): Don't emit class decls during stub
6606         generation.
6607         (HANDLE_END_METHOD): Take into account stub generation.
6608         (print_method_info): Handle stub generation.
6609         (print_stub): New function.
6610         (print_cxx_classname): Make signature consistant with others.
6611         (help): Describe -stubs option.
6612         (main): Create stub file.
6613         (version): Use version.c.
6614         (print_full_cxx_name): New function.
6615         (print_c_decl): Use print_full_cxx_name.
6616
6617 Thu Jul 22 12:41:12 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6618
6619         * check-init.c (check_init): Handle MAX_EXPR.
6620
6621 1999-07-15  Andrew Haley  <aph@cygnus.com>
6622
6623         * lang.c (flag_use_divide_subroutine): New variable.
6624         * typeck.c: (convert_ieee_real_to_integer): Bounds check
6625         fp-to-integer conversion.
6626         (convert): Call convert_ieee_real_to_integer when flag_fast_math
6627         is not set.
6628
6629         * expr.c (build_java_soft_divmod): New function.
6630         (build_java_binop): Call build_java_soft_divmod if
6631         flag_use_divide_subroutine is set.
6632         * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
6633         soft_lrem_node: new builtin functions.
6634         (init_decl_processing) Initialize the new builtins.
6635         * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
6636         soft_lrem_node: new builtin functions.
6637         (build_java_soft_divmod): New function.
6638         * parse.y: Call build_java_soft_divmod if
6639         flag_use_divide_subroutine is set.
6640         * parse.c: Rebuilt.
6641
6642         * jvspec.c (lang_specific_driver): Always allow an extra arg (for
6643         a --specs= arg) even if not linking.
6644         * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
6645         -fuse-divide-subroutine
6646
6647 Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6648
6649         * parse.y (resolve_and_layout): Check methods only once.
6650         (resolve_qualified_expression_name): Verify thrown exceptions
6651         compatibility.
6652         (check_thrown_exceptions): Reject exceptions thrown in
6653         initializer. Error message tuned.
6654
6655 1999-07-14  Andrew Haley  <aph@cygnus.com>
6656
6657         * expr.c (expand_expr): Do not return the last statement in a
6658         block as the block's value.
6659
6660 Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6661
6662         * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
6663         CALL_EXPR, to avoid order of evaluation changes.
6664
6665 Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6666
6667         * parse.y (qualify_ambiguous_name): Do not use
6668         IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
6669
6670 Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6671
6672         * check-init.c (check_init): Handle MAX_EXPR.
6673         * expr.c (force_evaluation_order): Force method call arguments to
6674         be evaluated in left-to-right order.
6675         * parse.y (qualify_ambiguous_name): Loop again to qualify
6676         NEW_ARRAY_EXPR properly.
6677
6678 Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6679
6680         * parse.y (patch_invoke): Resolve unresolved invoked method
6681         returned type.
6682         (qualify_ambiguous_name): STRING_CST to qualify expression for
6683         type name resolution.
6684
6685 1999-06-24  Andrew Haley  <aph@cygnus.com>
6686
6687         * class.c (finish_class): Whenever a deferred method is
6688         output, rescan the list of methods to see if a new candidate for
6689         output can be found.
6690
6691 1999-06-28  Tom Tromey  <tromey@cygnus.com>
6692
6693         * jvspec.c (lang_specific_driver): Recognize --help.
6694
6695 Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6696
6697         * parse.y (resolve_package): Fixed bogus return statement.
6698         (patch_method_invocation): Resolve method invocation beginning with
6699         a package name qualifier.
6700
6701 1999-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6702
6703         * Make-lang.in (java.stage1): Depend on stage1-start.
6704         (java.stage2): Likewise for stage2-start.
6705         (java.stage3): Likewise for stage3-start.
6706         (java.stage4): Likewise for stage4-start.
6707
6708 Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6709
6710         * parse.y (java_complete_lhs): When doing cross referencing, don't
6711         try to keep file location on a WFL expanded as a CALL_EXPR.
6712
6713 Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6714
6715         * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
6716         compiling to class file a void method with an empty method body.
6717         As a side effect, the bytecode backend will generate the
6718         appropriate `return' instruction.
6719
6720 Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6721
6722         * parse.y (lookup_package_type_and_set_next): New function prototype.
6723         (resolve_package): Search current and imported packages.
6724         (lookup_package_type_and_set_next): New function.
6725
6726 1999-06-22  Andrew Haley  <aph@cygnus.com>
6727
6728         * verify.c (verify_jvm_instructions): Check for pending blocks
6729         before invalid PC test and opcode switch, not after.
6730
6731 1999-06-21  Andrew Haley  <aph@cygnus.com>
6732
6733         * except.c (find_handler_in_range): The upper limit for exception
6734         ranges is exclusive, not inclusive: (start <= pc < end).
6735         (link_handler): find child pointer which points to outer by
6736         searching sibling list: previous code incorrectly assumed that
6737         outer->outer->first_child must point to outer.
6738         * verify.c (verify_jvm_instructions): FIXME added to code for
6739         `athrow'.
6740         (verify_jvm_instructions): Do not assume that the last block
6741         processed in a subroutine is a block which ends with a `ret'
6742         instruction.  With some control flows it is possible that the last
6743         block ends with an `athrow'.
6744
6745 Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6746
6747         * parse.y (qualify_ambiguous_name): Reorganized the post
6748         evaluation of non WFL leading expression nodes.
6749
6750 Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6751
6752         * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
6753         CONVERT_EXPR.
6754
6755 Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6756
6757         * parse.y (qualify_ambiguous_name): Handle qualified expression
6758         beginning with a STRING_CST.
6759
6760 Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6761
6762         * parse.y (register_fields): Set DECL_INITIAL on both
6763         pre-initialized static and public fields.
6764         (resolve_field_access): Static field access expressions to always
6765         use pointer types.
6766         (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
6767         qualification. CONVERT_EXPR to be resolved as an expression name.
6768         (java_complete_lhs): Identify and access qualified final
6769         initialized field in switch statement case expression.
6770         (fold_constant_for_init): Pre-initialized field decl constant to
6771         be folded.
6772
6773 Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6774
6775         * parse.y (note_possible_classname): Mark returned node with
6776         QUALIFIED_P only if the original class name contained a '/'.
6777
6778 Sat Jun  5 11:46:59 1999  Anthony Green  <green@cygnus.com>
6779
6780         * Make-lang.in (gcjh): More parallel build fixes.
6781
6782 1999-06-03  Mike Stump  <mrs@wrs.com>
6783
6784         * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
6785
6786 Wed Jun  2 10:44:38 1999  Anthony Green  <green@cygnus.com>
6787
6788         * except.c (link_handler): Chain exception handlers in order.
6789
6790 Wed Jun  2 10:41:24 1999  Anthony Green  <green@cygnus.com>
6791
6792         * expr.c (expand_byte_code): Fill unreachable bytecode regions
6793         with nops and process as usual in order to always set correct EH
6794         ranges.  Emit detailed warnings about unreachable bytecodes.
6795
6796 Wed Jun  2 10:35:13 1999  Anthony Green  <green@cygnus.com>
6797
6798         * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
6799         constant.
6800
6801 Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6802
6803         * parse.y (lookup_field_wrapper): Unified returned value to NULL
6804           or the searched field decl.
6805
6806 Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6807
6808         * parse.y (fold_constant_for_init): Convert numerical constant
6809         values to the type of the assigned field.
6810
6811 Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6812
6813         * expr.c (lookup_field): Relaxed the test on class loading error
6814         detection.
6815         * parse.y (fold_constant_for_init): Enabeled old code.
6816
6817 Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6818
6819         * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
6820         decide the validity of the cast of a java.lang.Cloneable reference
6821         to an array.
6822         (patch_conditional_expr): Fixed first argument passed to
6823         binary_numeric_promotion.
6824
6825 Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6826
6827         * parse.y (qualify_ambiguous_name): Take into account that a
6828         CONVERT_EXPR might specify a type as a WFL.
6829
6830 Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6831
6832         * parse.y (patch_assignment): Save the rhs before using it as an
6833         argument to _Jv_CheckArrayStore.
6834
6835 Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6836
6837         * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
6838
6839 Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6840
6841         * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
6842         floating point litteral only when the exponent indicator has been
6843         parsed.
6844
6845 Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6846
6847         * parse.y (formal_parameter:): Construct argument tree list
6848         element even if a yet unsupported final parameter was encountered.
6849
6850 Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6851
6852         * parse.y (finish_method_declaration): Issue errors for native or
6853         abstract methods declared with a method body, as well as for non
6854         native or non abstract methods with no method body.
6855
6856 1999-05-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6857
6858         * class.c (build_utf8_ref): Initialize variable `field'.
6859
6860         * decl.c (init_decl_processing): Initialize variable `field'.
6861
6862         * expr.c (build_known_method_ref): Mark parameters `method_type',
6863         `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
6864         (process_jvm_instruction): Likewise for parameter `length'.
6865
6866         * jvspec.c (lang_specific_driver): Mark variables `saw_math',
6867         `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
6868         ATTRIBUTE_UNUSED.
6869
6870         * parse.y (maybe_generate_clinit): Remove unused variable
6871         `has_non_primitive_fields'.
6872         (find_in_imports_on_demand): Initialize variables `node_to_use'
6873         and `cl'.
6874         (patch_binop): Likewise for variable `prom_type'.
6875         (patch_unaryop): Likewise for variable `prom_type'.
6876
6877         * verify.c (verify_jvm_instructions): Likewise for variable `last'.
6878
6879         * xref.c (xref_table): Add missing initializer.
6880
6881 1999-05-14  Tom Tromey  <tromey@cygnus.com>
6882
6883         * java-except.h (struct eh_range): Removed unused `next' member.
6884         * verify.c (verify_jvm_instructions): Call check_nested_ranges
6885         after adding all exception handlers.  Sort exception ranges in
6886         order of start PC.
6887         (struct pc_index): New structure.
6888         (start_pc_cmp): New function.
6889         * except.c (add_handler): Return `void'.  Don't call link_handler;
6890         instead construct an ordinary linked list and do range
6891         coalescing.
6892         (check_nested_ranges): New function.
6893         (link_handler): Changed interface to allow merging of eh_ranges.
6894         Split overlapping ranges.  Return `void'.
6895
6896 Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6897
6898         * parse.y (constructor_block_end:): New rule, tagged <node>.
6899         (constructor_body:): Use `constructor_block_end' instead of
6900         `block_end'.
6901
6902 Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6903
6904         * parse.y (statement_nsi:): Pop `for' statement block.
6905         (java_complete_lhs): Labeled blocks containing no statement are
6906         marked as completing normally.
6907
6908 Fri May 14 12:31:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6909
6910         * xref.c (xref_set_current_fp): New function, defined.
6911         * xref.h (xref_set_current_fp): New function, prototyped.
6912
6913 Fri May 14 11:57:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6914
6915         * check-init.c (check_init): Take into account that
6916         LABELED_BLOCK_STMT can be empty.
6917
6918 Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6919
6920         * parse.y (java_check_regular_methods): Warning check on not
6921         overriding methods with default access in other packages does not
6922         apply to `<clinit>'.
6923         (java_complete_lhs): If block body is an empty_stmt_node, replace
6924         it by NULL_TREE. This prevents gcc from generating an irrelevant
6925         warning.
6926
6927 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6928
6929         * check-init.c (check_init): Removed code accepting to see things
6930         falling through default:, when doing xrefs.
6931         * java-tree.h (do_not_fold): New global variable, declared.
6932         * parse.y (do_not_fold): New global variable, defined.
6933         (java_complete_expand_method): Set `do_not_fold' to the value of
6934         `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
6935         and reinstall them after them have been purged; do not check for
6936         initializations; do not issue missing return errors.
6937         (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
6938         when doing xrefs.
6939         (patch_binop): Skip the fold part when doing xrefs.
6940         (build_string_concatenation): Skip the concatenation part when
6941         doing xrefs.
6942         (patch_synchronized_statement): Do not generate a try-finally when
6943         doing xrefs.
6944         (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
6945         and keep the location where the throw was seen.
6946         * typeck.c (convert): When `do_not_fold' is set, do not attempt
6947         any treatment on the converted node an simply return a NOP_EXPR of
6948         the targeted type.
6949         * xref.c (xref_get_data): New function, defined.
6950         * xref.h (xref_get_data): New function, declared.
6951         (XREF_GET_DATA): Use xref_get_data.
6952
6953 1999-05-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6954
6955         * gjavah.c (print_include): Cast the result of `strlen' to int
6956         when comparing against a signed value.
6957         (add_namelet): Likewise.
6958
6959 1999-05-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6960
6961         * expr.c (expand_invoke): Mark parameter `nargs' with
6962         ATTRIBUTE_UNUSED.
6963         (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
6964
6965         * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
6966         ATTRIBUTE_UNUSED.
6967
6968         * jcf-reader.c (get_attribute): Cast a value to long
6969         when comparing against a signed expression.  Likewise.
6970
6971         * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
6972         HOST_BITS_PER_CHAR.
6973
6974 1999-05-11  Andrew Haley  <aph@cygnus.com>
6975
6976         * parse.y (source_end_java_method): If the current method contains
6977         any exception handlers, force asynchronous_exceptions: this is
6978         necessary because signal handlers in libjava may throw exceptions.
6979         * decl.c (end_java_method): Ditto.
6980
6981 1999-05-11  Tom Tromey  <tromey@cygnus.com>
6982
6983         * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
6984         flags.
6985         * jvspec.c (THREAD_NAME): Removed.
6986         (GC_NAME): Likewise.
6987         (MATHLIB): Likewise.
6988         (WITHLIBC): Likewise.
6989         (GCLIB): Likewise.
6990         (THREADLIB): Likewise.
6991         (MATH_LIBRARY): Likewise.
6992         (lang_specific_driver): Don't add `-l' options to command line.
6993         Instead, add a single --specs option.  Recognize `-L' options and
6994         use them to search for spec file.
6995         (find_spec_file): New function.
6996         (SPEC_FILE): New define.
6997
6998 Tue May 11 11:46:36 1999  Dave Brolley  <brolley@cygnus.com>
6999
7000         * lang-options.h: -MD, -MMD, -M and -MM not needed here for
7001         cpplib-enabled build.
7002
7003 1999-05-05  Per Bothner  <bothner@cygnus.com>
7004
7005         * class.c (make_field_value):  DECL_INITIAL may be a string literal;
7006         temporarily zero it while calling rest_of_decl_compilation.
7007
7008         * java-tree.h (string_ptr_type_node):  Add declaration.
7009         * decl.c:  Define and initialize string_ptr_type_node.
7010         * parse.y (patch_string_cst):  Use string_ptr_type_node.
7011
7012         * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
7013         * parse.y (for_statement):  Now unconditionally exit_block.
7014         (finish_labeled_statement):  No longer exit_block if for-loop.
7015         (patch_loop_statement):  Check harder if the loop is already labeled.
7016
7017         * parse.y (patch_initialized_static_field):  Removed function.
7018         (maybe_generate_clinit):  Removed special handling for interfaces.
7019         (java_complete_expand_methods):  Do a preliminary java_complete_tree
7020         on <clinit> to determine if it can be removed.
7021         (java_complete_expand_method):  Remove special handling for <clinit>.
7022         (java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
7023         optimize if we get back empty_stmt_node.
7024         For MODIFY_EXPR, re-do checking of static initializers.
7025         (fold_constant_for_init):  Don't return immediate if VAR_DECL.
7026         For VAR_DECL, pass correct context.
7027
7028         * verify.c (verify_jvm_instructions):  Better error messages.
7029
7030 1999-05-03  Tom Tromey  <tromey@cygnus.com>
7031
7032         * parse-scan.y (interface_declaration): Call
7033         report_class_declaration for interfaces.
7034
7035 1999-04-30 20:54 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
7036
7037         * Makefile.in: Remove -v from bison command lines.
7038
7039 Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7040
7041         * check-init.c (check_init): Exclude a case of error when doing
7042         xrefs.
7043         * class.c (layout_class_method): Don't generate the error message
7044         twice when compiling from source.
7045         * lang-options.h: Added `-Wredundant-modifers' and
7046         `-Wunusupported-jdk11' flags and help text.
7047         * lang.c (lang_decode_option): Added support for
7048         `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
7049         flag_static_local_jdk11 and flag_redundant set accordingly.
7050         * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
7051         * parse.h (EXPR_WFL_ADD_COL): New macro.
7052         (DECL_END_SOURCE_LINE): Likewise.
7053         (DECL_INHERITED_SOURCE_LINE): Likewise.
7054         * parse.y (static_ref_err): New function, prototyped.
7055         (CCB_TK): Now tagged <operator>.
7056         (class_body:): Remember the location of the closing '}' of a class
7057         definition when doing xrefs.
7058         (block:): Likewise.
7059         (block_end:): Likewise.
7060         (create_class): Remember the location of the inherited class
7061         identifier when doing xrefs.
7062         (register_fields): Added test on first operand of `init' before
7063         testing it TREE_CODE.
7064         (method_header): Store the location of the class identifier in the
7065         class decl when doing xrefs.
7066         (finish_method_declaration): Don't combine first/last method line
7067         when doing xref.
7068         (java_check_regular_methods): Warning check on not overriding
7069         methods with default access on other packages move before check on
7070         static methods. Initialization of `aflags' also moved up.
7071         (resolve_expression_name): Call static_ref_err to report the error.
7072         (static_ref_err): New function, implemented.
7073         (resolve_field_access): Returned simplified static field access
7074         when doing xrefs.
7075         (resolve_qualified_expression_name): Check for illegal use of
7076         static fields in a non static context. Call static_ref_err to
7077         report error in various places.
7078         (java_complete_tree): Do not fold initialized static fields when
7079         doing xrefs.
7080         (java_complete_lhs): Likewise.
7081
7082 1999-04-29  Anthony Green  <green@cygnus.com>
7083
7084         * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
7085         create internal labels.
7086         (lookup_label): Ditto.
7087
7088 Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7089
7090         * class.c (layout_class_method): Generate <clinit>'s rtl for
7091         interfaces.
7092         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
7093         for interfaces' <clinit>.
7094         * expr.c (lookup_field): Search for fields in interfaces.
7095         (expand_invoke): Fixed indentation.
7096         (expand_java_field_op): Likewise. Use IS_CLINIT.
7097         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
7098         (IS_CLINIT): New macro.
7099         * parse.y (type_declaration:): Call maybe_generate_clinit after an
7100         interface was parsed.
7101         (maybe_generate_clinit): Don't generate if the current class is an
7102         interface with only fields of primitive types.
7103         (reset_method_name): Use IS_CLINIT.
7104         (java_complete_expand_method): Expand <clinit> when it exists for
7105         interfaces. Use IS_CLINIT.
7106         (resolve_expression_name): Use DECL_CONTEXT instead of
7107         current_class to build static field references.
7108         (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
7109         ARRAY_REF when doing xreferencing.
7110         (check_final_assignment): Fixed typo in leading comment. Use
7111         IS_CLINIT.
7112         (patch_array_ref): Don't fully expand array references when
7113         xreferencing.
7114         (patch_return): Use IS_CLINIT.
7115         (patch_throw_statement): Likewise.
7116
7117 1999-04-22  Tom Tromey  <tromey@cygnus.com>
7118
7119         * Make-lang.in (JAVA_SRCS): Added check-init.c.
7120
7121 Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7122
7123         * decl.c (predef_filenames, predef_filenames_size): New globals
7124         (init_decl_processing): predef_filenames and predef_filenames_size
7125         initialized.
7126         * java-tree.h (predef_filenames, predef_filenames_size): Declared
7127         extern.
7128         * jcf-parse.c (predefined_filename_p): New function.
7129         (yyparse): Check that files on the command line are specified only
7130         once and issue a warning otherwise.
7131         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
7132         * parse.y (source_end_java_method): Nullify NOP method bodies, to
7133         avoid a gcc warning with -W -Wall turned on.
7134         (java_expand_classes): Abort if errors were encountered.
7135         (java_complete_lhs): If the cross reference flag is set, wrap
7136         field DECL node around a WFL when resolving expression name.
7137
7138 Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7139
7140         * lang.c (lang_decode_option): Fixed returned value when parsing
7141         `-fxref=...' and `-Wall'.
7142         * parse.y (source_end_java_method): Do not generate code when
7143         flag_emit_xref is set.
7144         (resolve_expression_name): Do not build static field access when
7145         flag_emit_xref is set.
7146         (resolve_field_access): No special treatment on `length' when
7147         flag_emit_xref is set. Do not build qualified static field access
7148         when flag_emit_xref is set.
7149         (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
7150         when flag_emit_xref is set.
7151         (patch_assignment): Do not generate array store runtime check when
7152         flag_emit_xref is set.
7153         * xref.c (xref_flag_value): Fixed function declaration
7154         indentation.
7155         (xset_set_data): New function.
7156         * xref.h (xref_set_data): Added prototype for new function.
7157         (typedef struct xref_flag_table): New field data.
7158         (XREF_GET_DATA): New macro.
7159
7160 1999-04-19  Tom Tromey  <tromey@cygnus.com>
7161
7162         * xref.h (enum): Removed trailing comma.
7163
7164         * parse.y (resolve_qualified_expression_name): Added missing
7165         `break'.
7166
7167 Thu Apr 15 13:08:03 1999  Anthony Green  <green@cygnus.com>
7168
7169         * gjavah.c: New prototypes for java_float_finite and
7170         java_double_finite.
7171
7172 Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7173
7174         * parse.y (patch_unaryop): Fixed ++/-- operator check on array
7175         references.
7176
7177 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
7178
7179         * Makefile.in (TREE_H): Add tree-check.h.
7180         (RTL_H): Add genrtl.h.
7181
7182 Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7183
7184         * parse.y (patch_assignment): Added ArrayStoreException runtime
7185         check.
7186
7187 1999-04-06  Per Bothner  <bothner@cygnus.com>
7188
7189         * expr.c (pop_type_0):  New function.
7190         (pop_type):  Use pop_type_0.
7191         * java-tree.h (pop_type_0):  New declaration.
7192         * verify.c (verify_jvm_instructions):  Check return instructions.
7193
7194         * parse.y (patch_binop):  Don't fold if non-constant and emiting
7195         class files.
7196
7197 Mon Apr  5 16:06:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7198
7199         * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
7200
7201         * gjavah.c: Include math.h earlier.  Include tree.h/java-tree.h.
7202         (main_jcf): Don't define.
7203         (process_file): Don't set `main_jcf'.
7204
7205         * java-tree.h (main_jcf): Don't declare.
7206
7207         * jcf-parse.c (main_jcf): Add static definition.
7208
7209         * lang.c (main_jcf): Don't define.
7210
7211 Mon Apr  5 15:43:51 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7212
7213         * class.c (add_method_1): Cast the argument of `bzero' to PTR.
7214
7215         * decl.c (copy_lang_decl): Likewise for `bcopy'.
7216
7217         * jcf-depend.c: Include "config.h", not <config.h>.
7218
7219         * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
7220         `bcopy' to PTR.
7221
7222         * jcf-path.c: Include "config.h", not <config.h>.
7223
7224         * lex.c: Don't include various system header files.
7225         (java_init_lex): Cast the argument of `bzero' to PTR
7226
7227         * parse-scan.y (java_push_parser_context): Likewise.
7228
7229         * parse.y (java_push_parser_context): Likewise.
7230         (patch_bc_statement): Match format specifier to variable argument.
7231
7232         * xref.c: Don't include <stdio.h>.
7233
7234 Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7235
7236         * parse.y (struct parser_ctxt *ctxp): Now global.
7237         (declare_local_variables): Use WFL compound value for the
7238         declaration source line value, when doing cross-referencing.
7239
7240 1999-03-31  Tom Tromey  <tromey@cygnus.com>
7241
7242         * gjavah.c (print_field_info): Allow constants of other types.
7243         (print_include): Generate include when new name is proper prefix
7244         of already printed name.
7245         (add_namelet): Likewise.
7246         (cxx_keyword_subst): New function.
7247         (print_method_info): Use it.
7248         (print_field_name): New function.
7249         (get_field_name): New function.
7250         (print_field_info): Use get_field_name and print_field_name.
7251
7252 Wed Mar 31 11:00:32 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7253
7254         * Makefile.in (keyword.h): Generate using gperf language 'C', not
7255         'KR-C', so gperf uses the `const' keyword on strings.
7256
7257         * keyword.gperf (java_keyword): Const-ify a char*.
7258
7259 Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7260
7261         * parse.y (patch_bc_statement): Fixed identation and a bogus
7262         `printf' format.
7263
7264 Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7265
7266         * parse.y (patch_assignment): Allow static variables in other
7267         classes to be assigned.
7268
7269 Sun Mar 28 22:12:10 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7270
7271         * class.c (maybe_add_interface): Remove unused variable
7272         `interface_binfo'.
7273         (make_class_data): Use = for assignment, not ==.  Likewise.
7274         (emit_register_classes): Remove unused variable `decl'.
7275
7276         * lex.c: Fix comment so as not to contain an embedded `/*'.
7277
7278         * verify.c (verify_jvm_instructions): Remove unused variable
7279         `self_type'.
7280
7281 Sat Mar 27 15:49:18 1999  Per Bothner  <bothner@cygnus.com>
7282
7283         * parse.y (complete_loop_body):  Rename to finish_loop_body.
7284         (complete_labeled_statement):  Rename to finish_labeled_statement.
7285         (complete_for_loop):  Rename to finish_for_loop.
7286         (complete_method_declaration):  Rename to finish_method_declaration.
7287
7288         * java-tree.h (continue_identifier_node):  New global node.
7289         * decl.c:  Define and initialize continue_identifier_node.
7290         * parse.y (generate_labeled_block):  Remove - no longer needed.
7291         (build_loop_body):  Use continue_identifier_node for continue block.
7292         (finish_labeled_statement):  Also do pop_labeled_block actions.
7293         (java_complete_lhs):  POP_LOOP even if error.
7294         (build_labeled_block):  Special handling for continue_identifier_node.
7295         (patch_loop_statement):  Re-organize.
7296         (patch_bc_statement):  Re-write.
7297
7298 Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7299
7300         * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
7301         using a WFL compound value.
7302         * parse.y (xref.h): Include.
7303         (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
7304         WFL compound value.
7305         (register_fields): Set WFL compound value to lineno if doing
7306         xrefs.
7307         (java_complete_expand_method): Call expand_xref if flag_emit_xref
7308         is set.
7309         * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
7310         * xref.h (expand_xref): Prototype renamed from xref_generate.
7311
7312 Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7313
7314         * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
7315         (GET_CURRENT_BLOCK): New macro.
7316         * parse.y (current_static_block): New global variable.
7317         (method_body:): Define action.
7318         (complete_method_declaration): Set current_function_decl to NULL
7319         when work on the current method is done.
7320         (declare_local_variables): Use GET_CURRENT_BLOCK.
7321         (java_method_add_stmt): Likewise.
7322         (java_complete_expand_method): Disable the use of `this' when
7323         expanding <clinit>.
7324         (enter_a_block): If no current method exist, use
7325         current_static_block to link static initializer blocks.
7326         (exit_block): Rewritten to use current_static_block when no current
7327         method decl exists.
7328         (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
7329         (patch_return): Forbid the use of `return' in static initializers.
7330         (patch_throw_statement): Fixed indentation. Issue specific error
7331         for uncaught thrown checked exception in static initializer
7332         blocks. Removed FIXME.
7333
7334 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
7335
7336         * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
7337         Link gcj from gcc.o.
7338
7339 Tue Mar 23 10:48:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7340
7341         * parse.y (find_applicable_accessible_methods_list): When dealing
7342         with interface: ensure that a given interface or java.lang.Object
7343         are searched only once.
7344
7345 Tue Mar 23 10:05:27 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7346
7347         * gjavah.c (print_c_decl): Remove unused argument `flags'.
7348
7349         * jcf-dump.c (print_access_flags): Add braces around if-else.
7350
7351         * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
7352         COMBINE_INPUTS.
7353
7354         * lex.c (build_wfl_node): Add static prototype.
7355
7356         * lex.h (build_wfl_node): Remove static prototype.
7357
7358         * parse.y: Include lex.c early enough to declare everything needed.
7359         Ensure calls to `build_wfl_node' pass the proper arguments.
7360         (create_class): Remove unused variable `super_decl'.
7361         (get_printable_method_name): Initialize variable `name'.
7362
7363 Mon Mar 22 20:14:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7364
7365         * Changelog: Fixed 1999-03-22 typos.
7366         * lang.c (lang_decode_option): Fixed typo in error string in the
7367         XARG section.
7368
7369 1999-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7370
7371         * Makefile.in (JAVA_OBJS): Added entry xref.o.
7372         (xref.o): New rule.
7373         * java-tree.h (flag_emit_xref): Declared extern.
7374         * lang.c (xref.h): Included.
7375         (flag_emit_xref): New global variable.
7376         (lang_decode_option): Added support for -fxref.
7377         * xref.c: Created.
7378         * xref.h: Likewise.
7379
7380 1999-03-21  Manfred Hollstein  <manfred@s-direktnet.de>
7381
7382         * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
7383         linked with.
7384
7385 Sun Mar 21 08:30:30 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7386
7387         * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
7388         $(srcdir)/../system.h and $(JAVA_TREE_H).
7389         (jcf-io.o): Depend on $(JAVA_TREE_H).
7390         (mangle.o): Likewise.
7391
7392         * check-init.c (check_cond_init): Add static prototype.
7393
7394         * class.c (build_java_method_type, hashUtf8String,
7395         make_field_value, get_dispatch_vector, get_dispatch_table,
7396         append_gpp_mangled_type, mangle_static_field): Likewise.
7397         (strLengthUtf8): Hide unused definition.
7398         (hashUtf8String): Const-ify.
7399         (make_field_value): Un-ANSI-fy.
7400
7401         * constants.c: Move inclusion of jcf.h above java-tree.h.
7402         (set_constant_entry, find_class_or_string_constant,
7403         find_name_and_type_constant, get_tag_node,
7404         build_constant_data_ref): Add static prototype.
7405
7406         * decl.c (push_jvm_slot, builtin_function,
7407         lookup_name_current_level): Likewise.
7408         (builtin_function): Const-ify.
7409
7410         * except.c (expand_start_java_handler, expand_end_java_handler):
7411         Add static prototype.
7412
7413         * expr.c (flush_quick_stack, push_value, pop_value,
7414         java_stack_swap, java_stack_dup, build_java_athrow,
7415         build_java_jsr, build_java_ret, expand_java_multianewarray,
7416         expand_java_arraystore, expand_java_arrayload,
7417         expand_java_array_length, build_java_monitor, expand_java_pushc,
7418         expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
7419         expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
7420         expand_compare, expand_test, expand_cond, expand_java_goto,
7421         expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
7422         expand_java_field_op, java_push_constant_from_pool): Likewise.
7423
7424         (decode_newarray_type, expand_iinc): Un-ANSI-fy.
7425         (build_java_arraynull_check): Mark parameters `node' and `type'
7426         with ATTRIBUTE_UNUSED.
7427         (note_label): Likewise for parameter `current_pc'.
7428         (expand_java_call, expand_java_ret): Hide unused definition.
7429
7430         * java-tree.h (make_class, build_constants_constructor,
7431         java_set_exception_lang_code, pop_labeled_block, emit_handlers,
7432         init_outgoing_cpool, register_class, emit_register_classes,
7433         java_layout_seen_class_methods): Prototype.
7434         (unicode_mangling_length): Const-ify.
7435         (append_gpp_mangled_name, append_gpp_mangled_classtype,
7436         emit_unicode_mangled_name, format_int, format_uint,
7437         jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
7438         jcf_print_utf8_replace, open_class): Prototype.
7439
7440         * jcf-dump.c: Include "config.h", not <config.h>.  Don't include
7441         <stdio.h>.  Include tree.h/java-tree.h.
7442         (utf8_equal_string usage, process_class): Add static prototype.
7443         (open_class): Don't prototype this here.
7444         (utf8_equal_string): Match arguments to format specifiers.
7445         (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
7446         TABLE_SWITCH, disassemble_method): Likewise.
7447
7448         * jcf-io.c: Include tree.h/java-tree.h.
7449         (open_class, find_classfile, jcf_print_utf8,
7450         jcf_print_utf8_replace): Const-ify.
7451
7452         * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
7453         parse_class_file): Add static prototype.
7454         (find_in_current_zip): Match definition to existing static
7455         prototype.
7456
7457         * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
7458         (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
7459         finish_jcf_block, define_jcf_label, get_jcf_label_here,
7460         put_linenumber, localvar_alloc, localvar_free, get_access_flags,
7461         write_chunks, adjust_typed_op, generate_bytecode_conditional,
7462         generate_bytecode_return, perform_relocations, init_jcf_state,
7463         init_jcf_method, release_jcf_state, generate_classfile):
7464         Add static prototype.
7465         (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
7466         (make_class_file_name): Const-ify.
7467
7468         * jcf.h (find_classfile): Const-ify.
7469
7470         * jv-scan.c (reset_report): Remove prototype.
7471
7472         * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
7473         (error): Rewrite to allow varargs.
7474
7475         * lang.c (lang_f_options): Const-ify.
7476
7477         * lex.c (java_parse_escape_sequence): Add static prototype.
7478         (java_allocate_new_line): Match definition to existing static
7479         prototype.
7480
7481         * mangle.c Include tree.h/java-tree.h.
7482         (unicode_mangling_length, emit_unicode_mangled_name,
7483         append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
7484
7485         * parse.h (jdep_code): Remove trailing comma in enumeration.
7486         (java_get_line_col): Move prototype outside of !JC1_LITE test.
7487         (reset_report): Add prototype.
7488
7489         * verify.c (push_pending_label, merge_types): Add static
7490         prototypes.
7491
7492         * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
7493
7494 1999-03-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7495
7496         * parse.y (find_applicable_accessible_methods_list): Extend the
7497         search to superinterfaces when relevant.
7498         (search_applicable_methods_list): New function.
7499
7500 1999-03-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7501
7502         * class.c (unmangle_classname): Implemented stricter testing
7503         before setting the QUALIFIED_P flag on an identifier.
7504
7505 Tue Mar 16 15:15:41 1999  Per Bothner  <bothner@cygnus.com>
7506
7507         * parse.y (java_complete_lhs):  Call force_evaluation_order
7508         after patch_newarray.
7509         (patch_binop):  Don't call fold if there are side effects.
7510
7511 1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7512
7513         * parse.y (java_stabilize_reference): Use save_expr instead of
7514         building a SAVE_EXPR node.
7515         (java_complete_lhs): Patch the resulting string of the `+='
7516         operator (if necessary) and complete the RHS after having built
7517         the cast.
7518
7519 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
7520
7521         * class.c (make_class):  Don't set CLASS_P here (because
7522         this function is also called by build_java_array_type).
7523         (push_class):  Set CLASS_P here instead.
7524         * parse.h (TYPE_CLASS_P):  Check for TYPE_ARRAY_P is redundant.
7525
7526         * jcf-dump.c (print_access_flags):  Take extra parameter to indicate
7527         context.  If the context is class, perfer "super" over "synchronized".
7528         * jcf-write.c (generate_classfile):  Don't add ACC_SUPER if interface.
7529
7530         * parse.y (create_class):  Don't call parser_check_super here;
7531         it is not robust.  Always wait until later.
7532
7533         * parse.y (method_header):  For interfaces, set ACC_ABSTRACT (to
7534         match what JDK 1.2 does), but don't set ACC_PUBLIC.
7535
7536 Sat Mar 13 18:16:34 1999  Per Bothner  <bothner@cygnus.com>
7537
7538         * lex.c (java_read_char):  UNGET invalid non-initial utf8 character.
7539         * lex.h (UNGETC):  Change misleading macro.
7540
7541 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7542
7543         * parse.y (java_stabilize_reference): Return NODE when patching a
7544         COMPOUND_EXPR.
7545         (java_complete_lhs): Put parenthesis around truth values.
7546
7547 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7548
7549         * class.c (layout_class_method): Don't make rtl for interface
7550         methods.
7551         * parse.h (GET_TYPE_NAME): New macro.
7552         * parse.y (if_then_statement:): Fixed indentation.
7553         (if_then_else_statement:): Likewise.
7554         (for_statement:): Fixed spacing.
7555         (try_statement:): Fixed indentation.
7556         (create_interface): Don't force interfaces to be abstract.
7557         (method_header): Abstract methods are OK in interfaces.
7558         (declare_local_variables): Fixed typo in comment.
7559         (java_complete_expand_method): Fixed indentation.
7560         (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
7561         non accessible fields.
7562         (java_stabilize_reference): New function.
7563         (java_complete_lhs): Fixed indentation. Use
7564         java_stabilize_reference in compound assignement. Insert the
7565         cast. If not processing `+' fix string constants before processing
7566         binop.
7567
7568 Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7569
7570         * constants.c (find_class_or_string_constant): Cast variable `j'
7571         to a `jword' when comparing against one.
7572
7573         * expr.c (java_lang_expand_expr): Remove unused variables
7574         `has_finally_p' and `op0'.
7575
7576         * gjavah.c (print_field_info): Cast a value to jint when comparing
7577         against one.  Likewise for a jlong.
7578         (add_namelet): Likewise cast a `sizeof' to an int when comparing
7579         against a signed quantity.
7580
7581         * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
7582         (print_signature): Don't needlessly dereference variable `str'
7583
7584         * jcf-reader.c (get_attribute): Mark variables `max_stack' and
7585         `max_locals' with ATTRIBUTE_UNUSED.
7586         (jcf_parse_class): Likewise for variable `index'.
7587
7588         * parse.h (reverse_jdep_list): Remove static prototype.
7589
7590         * parse.y (build_jump_to_finally): Remove prototype and definition.
7591         (reverse_jdep_list): Add static prototype.
7592
7593         * typeck.c (convert_ieee_real_to_integer): Remove unused variables
7594         `assignment' and `expr_decl'.
7595
7596         * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
7597
7598 1999-03-12  Andrew Haley  <aph@cygnus.com>
7599
7600         * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
7601         we'll need a directory separator and a null character.
7602
7603 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
7604
7605         * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
7606
7607   Tue Mar  9 11:52:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7608
7609         * parse.y (method_header): Don't set ACC_ABSTRACT flags on
7610         interfaces.
7611
7612 Fri Mar  5 15:17:29 1999  Per Bothner  <bothner@cygnus.com>
7613
7614         * lex.c (java_parse_end_comment):  Take extra parameter (next char).
7615
7616         * class.c (build_utf8_ref):  Fix possible name class/ambiguity.
7617
7618         * class.c (layout_class_method):  A static method in a base class
7619         is never overridden, so treat it like it doesn't exist.
7620         However, do complain about private non-static method overriding
7621         public static method.
7622
7623         * parse.y:  Don't set unused INITIALIZED_P flag.
7624         * java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
7625
7626         * parse.y (find_expr_with_wfl):  Optimize tail-calls.
7627         (build_array_from_name):  Re-order &index[string] to &string[index].
7628
7629         * parse.y (java_complete_lhs):  Don't call patch_assignment if rhs is
7630         error_mark (it might catch more errors, but it is more likely to lose).
7631
7632 Sat Mar  6 11:17:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7633
7634         * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
7635         (parse-scan.o): Depend on toplev.h.
7636
7637         * class.c (make_method_value): Add prototype.  Make it static.
7638         Remove unused second argument, caller changed.
7639
7640         * expr.c (java_lang_expand_expr): Remove unused variable
7641         `return_label'.
7642
7643         * java-tree.h: Don't prototype find_in_current_zip.
7644         Add prototypes for verify_constant_pool, start_java_method,
7645         end_java_method, give_name_to_locals, expand_byte_code,
7646         open_in_zip, set_constant_value, find_constant1, find_constant2,
7647         find_utf8_constant, find_string_constant, find_class_constant,
7648         find_fieldref_index, find_methodref_index, write_constant_pool,
7649         count_constant_pool_bytes and encode_newarray_type.
7650
7651         * jcf-dump.c: Remove unused variable `LONG_temp'.
7652
7653         * jcf-parse.c: Include parse.h.
7654         (jcf_parse_source): Remove unused parameter, all callers changed.
7655         (jcf_figure_file_type): Add static prototype.
7656         (find_in_current_zip): Likewise.  Also remove unused parameter,
7657         all callers changed.
7658         (read_class): Initialize variable `saved_pos'.
7659
7660         * jcf-reader.c (jcf_parse_preamble): Mark variables
7661         `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
7662
7663         * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
7664         (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
7665         (java_parse_doc_section): Initialize variable `seen_star'.
7666         (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
7667         (java_lex_error): Mark parameters `msg' and `forward' with
7668         ATTRIBUTE_UNUSED.
7669         (java_get_line_col): Mark parameters `filename' and `line' with
7670         ATTRIBUTE_UNUSED.
7671
7672         * parse-scan.y: Include toplev.h.
7673         (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
7674
7675         * parse.h: use `struct JCF', not plain `JCF'.
7676         (java_parser_context_save_global, java_expand_classes
7677         java_parser_context_restore_global, java_parse): Add prototypes.
7678
7679         * typeck.c (convert_ieee_real_to_integer): Remove unused variable
7680         `node'.
7681
7682 Wed Feb 24 16:13:59 1999  Per Bothner  <bothner@deneb.cygnus.com>
7683
7684         *  check-init.c (check_init):  COPYN takes word count, not bit count.
7685
7686 Fri Feb 26 14:06:21 1999  Per Bothner  <bothner@cygnus.com>
7687
7688         * typeck.c (convert_ieee_real_to_integer):  Use save_expr instead of
7689         explicit build_decl.  (Avoids crash in reload when optimizing.)
7690
7691 Thu Feb 25 21:05:04 1999  Per Bothner  <bothner@cygnus.com>
7692
7693         * decl.c (complete_start_java_method):  Handle synchronized method
7694         even when compiling from bytecode.
7695
7696 1999-02-26  Tom Tromey  <tromey@cygnus.com>
7697
7698         * gjavah.c (add_class_decl): Only generate `#include' if outer
7699         class is not the name of the class we are processing.  Correctly
7700         append `.h' in #include.
7701         (process_file): Clean up newlines around generated `#include's.
7702         (decode_signature_piece): Correctly handle inner classes.
7703         (struct include): New structure.
7704         (all_includes): New global.
7705         (print_include): New function.
7706         (add_class_decl): Use it.
7707         (process_file): Likewise.
7708         (add_class_decl): Generate include for java-array.h if array
7709         seen.
7710         (process_file): Don't generate java-array.h include.
7711
7712         * gjavah.c (add_namelet): Check for standard package names here.
7713         (add_class_decl): Don't check for standard package names here.
7714
7715 1999-02-25  Tom Tromey  <tromey@cygnus.com>
7716
7717         * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
7718         When reading a zip file, only use strncmp if both strings are
7719         bigger than the buffer length.  Initialize `k' when looping
7720         through zip file.
7721
7722 1999-02-24  Tom Tromey  <tromey@cygnus.com>
7723
7724         * gjavah.c (struct namelet): New structure.
7725         (add_namelet): New function.
7726         (print_namelet): New function.
7727         (print_class_decls): Use add_namelet and print_namelet to generate
7728         namespaces and not classes.
7729         (method_printed): New global.
7730         (HANDLE_END_METHOD): Examine method_printed.
7731         (print_method_info): Set method_printed when required.  Print
7732         error if function to be ignored is marked virtual.  Handle $finit$
7733         method.
7734         (METHOD_IS_FINAL): New macro.
7735         (print_field_info): Use it.
7736         (HANDLE_METHOD): Clear method_printed.
7737         (method_pass): New global.
7738         (HANDLE_END_FIELD): Call add_class_decl on the first pass.
7739         (process_file): Do two passes over both fields and methods.
7740         (HANDLE_METHOD): Examine method_pass.
7741         (root): New global.
7742         (add_class_decl): New function.
7743         (print_class_decls): Don't scan over entire constant pool.
7744
7745 1999-02-23  Tom Tromey  <tromey@cygnus.com>
7746
7747         * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
7748         disable linking in that case.
7749
7750 1999-02-20  Tom Tromey  <tromey@cygnus.com>
7751
7752         * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
7753         not 0x1f.
7754
7755 Sun Feb 21 14:56:11 1999  Per Bothner  <bothner@cygnus.com>
7756
7757         * decl.c (build_result_decl), java-tree.h:  New method.
7758         (complete_start_java_method):  Handle synchronized methods.
7759         Don't build DECL_RESULT here.  (Ordering dependency problem.)
7760         (start_java_method):  Call build_result_decl here instead  ...
7761         * parse.y (java_complete_expand_method):  ... and here.
7762         (expand_start_java_method): Don't call complete_start_java_method here.
7763         (java_complete_expand_method):  Call it here instead.
7764         * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
7765         * java-tree.h:  ... here.
7766
7767         * expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
7768         * parse.y (java_complete_lhs):  Don't call force_evaluation_order
7769         for ARRAY_REF - it doesn't work when array bounds are checked.
7770         (patch_array_ref):  Handle it here instead.
7771
7772         * jcf-write.c (generate_classfile):  Emit "Exceptions" attribute.
7773
7774 Fri Feb 19 15:35:01 1999  Per Bothner  <bothner@cygnus.com>
7775
7776         Force left-to-right evaluation of binary operations etc.
7777         * expr.c (force_evaluation_order), java-tree.h:  New function.
7778         * parse.y (java_complete_lhs):  Pass binary operations, procedure
7779         calls, and ARRAY_REFs to force_evaluation_order.
7780         (various):  Set TREE_SIDE_EFFECTS more carefully.
7781
7782         Tolerate random (non-UTF8) encoding in comments without complaining.
7783         * lex.c (java_read_char):  Return 0xFFFE if bad UTF8 encoding.
7784         (java_is_eol):  Handle '\r' followed by '\n' instead of vice versa.
7785
7786         * parse.y (resolve_qualified_expression_name):  Handle error_mark.
7787         (java_complete_node case EXPR_WITH_FILE_LOCATION):  Likewise.
7788
7789         * parse.y (java_complete_lhs):  Ignore an empty statement in a
7790         COMPOUND_EXPR.  Don't complain about empty statement after return.
7791
7792 Fri Feb 19 13:00:56 1999  Per Bothner  <bothner@cygnus.com>
7793
7794         * parse.y (obtain_incomplete_type):  Don't wrap unknown types
7795         in TREE_LIST - just chain the POINTER_TYPEs together.
7796         (resolve_class):  If type already resolved, return decl.
7797         After resolving, update TREE_TYPE(class_type), and name (if array).
7798         * parse.h (do_resolve_class), parse.y:  Make non-static.
7799         * class.c (maybe_layout_super_class):  Take this_class argument.
7800         Do do_resolve_class if necessary.
7801         (layout_class, layout_class_methods): Adjust calls appropriately.
7802         * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
7803         JDEP_RESOLVED_P):  Redefined for new TREE_LIST-less convention.
7804         * typeck.c (build_java_array_type):  Don't call layout_class.
7805
7806 Wed Feb 17 15:47:20 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7807
7808         * parse.y (check_pkg_class_access): Allow private class access
7809         within the same package.
7810         (strip_out_static_field_access_decl): New function.
7811         (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
7812         operator argument before testing its nature.
7813
7814 Wed Feb  3 12:38:43 1999  Per Bothner  <bothner@cygnus.com>
7815
7816         * java-tree.def (FINALLY_EXPR):  Removed.  (Now uses TRY_FINALLY_EXPR.)
7817         (TRY_EXPR):  Simplify - it no longer has a finally clause.
7818         * check-init.c (check_init):  Handle TRY_FINALLY_EXPR.
7819         Simpler handling of TRY_EXPR, which no longer has a finally clause.
7820         * expr.c (java_lang_expand_expr):  Likewise.
7821         * java-tree.h (CATCH_EXPR_GET_EXPR):  Removed - no longer needed.
7822         * parse.h (java_get_catch_block), parse.y:  Removed - no longer needed.
7823         * parse.y (java_complete_lhs):  Add support for TRY_FIANLLY_EXPR.
7824         (build_try_statement):  Remove finally parameter and handling.
7825         (build_try_finally_statement):  New function.
7826         (patch_try_statement):   No longer need to support finally clause.
7827         (try_statement):  Update grammar action rules.
7828         * jcf-write.c (generate_bytecode_insns):  Handle TRY_FINALLY_EXPR.
7829         Simpler handling of TRY_EXPR, which no longer has a finally clause.
7830
7831 1998-11-26  Andrew Haley  <aph@viagra.cygnus.co.uk>
7832
7833         * jcf-parse.c (get_constant): Add braces around computation of 'd'
7834         when REAL_ARITHMETIC is not defined.  [Oct 26 fix got overwritten -PB]
7835
7836 1999-02-17  Andrew Haley  <aph@cygnus.com>
7837
7838         * class.c (build_utf8_ref): Back out broken patch which was
7839         intended to to output signatures using '.' as a separator.
7840
7841         * class.c (make_class_data): Output signatures using '.' as a
7842         separator, rather than '/'.
7843         (mangled_classname): Likewise.
7844         (make_field_value): Likewise.
7845         (make_method_value): Likewise.
7846         * constants.c (alloc_class_constant): Likewise.
7847         * expr.c (build_invokeinterface): Likewise.
7848
7849 Thu Feb 11 21:25:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7850
7851         * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
7852         of an ancient workaround.
7853
7854 Wed Feb 10 23:27:33 1999  Jeffrey A Law  (law@cygnus.com)
7855
7856         * jvspec.c (xmalloc): Kill the prototype.  It does not belong
7857         here anymore.
7858
7859 1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7860
7861         * lex.c (yylex): Encode \0 as UTF8.
7862
7863 1999-02-10  Tom Tromey  <tromey@cygnus.com>
7864
7865         * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
7866         * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
7867         (libgcj_zip): Renamed.
7868         * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
7869         LIBJAVA_ZIP_FILE.
7870         (jcf_path_init): Use LIBGCJ_ZIP_FILE.
7871
7872         * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
7873         (GC_NAME): Renamed -lgc to -lgcjgc.
7874
7875 Tue Feb  9 19:31:09 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7876
7877         * lex.c (java_lang_cloneable): Initialize.
7878         * parse.y (java_lang_cloneable): New static variable.
7879         (qualify_ambiguous_name): Take CONVERT_EXPR into account when
7880         doing one more qualification round.
7881         (valid_ref_assignconv_cast_p): Reject null source or
7882         destination. Allow an array to be cast into java.lang.Cloneable.
7883         (patch_cast): Swapped two first arguments to first call to
7884         valid_ref_assignconv_cast_p.
7885
7886 Mon Feb  8 11:50:50 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7887
7888         * parse.h: DECL_P renamed JDECL_P.
7889         * parse.y: DECL_P replaced by JDECL_P.
7890         (build_array_from_name): Always use pointer's type.
7891         (patch_bc_statement): Extra code to search continue target in a
7892         for loop. Fixed comments. Continue target is current loop when
7893         unlabeled.
7894
7895 1999-02-05  Andrew Haley  <aph@cygnus.com>
7896
7897         * class.c (make_class_data): The superclass of an interface should
7898         be null, not class Object.
7899
7900         * lex.c (java_lex): Sign extend hex literals.
7901
7902 1999-02-04  Andrew Haley  <aph@cygnus.com>
7903
7904         * class.c (build_utf8_ref): Output signatures using '.' as a
7905         separator, rather than '/'.
7906         (make_class_data): Likewise.
7907
7908 Wed Feb  3 22:50:17 1999  Marc Espie <Marc.Espie@liafa.jussieu.fr>
7909
7910         * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
7911         mkstemp.o.  Get them from libiberty now.
7912
7913 Tue Feb  2 19:49:12 1999  Jeffrey A Law  (law@cygnus.com)
7914
7915         * jcf-io.c: Do not include sys/stat.h or sys/wait.h
7916
7917 Tue Feb  2 20:04:50 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7918
7919         * jvspec.c (xmalloc): Fix the prototype to match the one obtained
7920         from libiberty.h
7921
7922 Tue Feb  2 10:39:47 1999  Per Bothner  <bothner@cygnus.com>
7923
7924         Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
7925         * jcf-write.c (generate_bytecode_return):  New function.
7926         (generate_bytecode_insns):  Use it, for RETURN_EXPR.
7927
7928         * jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
7929         generate special [fd]const_[01] instructions.
7930
7931         * jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
7932
7933         * verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
7934         handling OPCODE_lookupswitch or OPCODE_tableswitch.
7935
7936 Mon Feb  1 20:44:47 1999  Per Bothner  <bothner@cygnus.com>
7937
7938         * parse.y (patch_method_invocation):  Handle calling static methods,
7939         even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
7940
7941         * parse.y (java_complete_lhs):  Don't complain about unreachable
7942         exit condition in a do-while statement.
7943
7944 Fri Jan 29 18:19:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7945
7946         * lex.c (java_read_char): Fixed utf8 decoding.
7947         (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
7948         range.
7949         * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
7950         comments. Local variable `all_primitive' is gone. Broadened
7951         acceptance of `0' to floating point targets. `long' can now be
7952         widened to `double' or `float'.
7953         (valid_method_invocation_conversion_p): Added leading
7954         comment. Fixed tabulation.
7955         (build_string_concatenation): Optimize out left or right empty
7956         string constants.
7957
7958 Thu Jan 28 18:51:26 1999  Per Bothner  <bothner@cygnus.com>
7959
7960         * jcf-write.c (localvar_alloc):  Only emit entry for
7961         LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
7962         (generate_bytecode_insns):  Only call put_linenumber if
7963         debug_info_level > DINFO_LEVEL_NONE.
7964         * jvspec.c (lang_specific_driver):  If no -O* or -g* option
7965         is specified, add -g1 (for compatibility wih javac).
7966
7967 Thu Jan 28 09:17:51 1999  Hans-Peter Nilsson  <hp@axis.se>
7968
7969         * java/Makefile.in: Add missing dependencies for jcf-dump.o,
7970         gjavah.o, check-init.o, jv-scan.o
7971
7972 Mon Feb  1 09:50:48 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7973
7974         * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
7975
7976         * gjavah.c: Include config.h and system.h.
7977
7978         * javaop.h (inline): Don't define, its handled by system.h.
7979         (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
7980         from `inline' to `static inline'.
7981
7982         * jcf.h (inline): Don't define, its handled by system.h.
7983
7984         * lex.c (inline): Likewise.
7985
7986 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
7987
7988         * lang-specs.h: Map -Qn to -fno-ident.
7989
7990 Fri Jan 29 16:51:56 1999  Richard Henderson  <rth@cygnus.com>
7991
7992         * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
7993
7994 1999-01-29  Tom Tromey  <tromey@cygnus.com>
7995
7996         * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
7997         then cast it to Object before calling `append' method.
7998
7999 Thu Jan 28 14:45:39 1999  Per Bothner  <bothner@cygnus.com>
8000
8001         * check-init.c (check_bool2_init, check_bool_init, check_init):
8002         Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
8003         * jcf-write.c (generate_bytecode_insns):  Likewise.
8004
8005 Thu Jan 28 11:50:11 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8006
8007         * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
8008         * parse.y (patch_cast): Allow a boolean to be cast into a
8009         boolean.
8010
8011 Wed Jan 27 10:19:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8012
8013         * parse.y: (class_declaration:): Fixed indentation.
8014         (class_member_declaration:): Extra `;' after field declaration now
8015         accepted.
8016         (interface_declaration:): Removed debug messages in error reports.
8017         (patch_binop): Nodes created and returned inherit the orignal
8018         node's COMPOUND_ASSIGN_P flag value.
8019         (patch_cast): Fix cast from char to floating point.
8020
8021 Mon Jan 25 17:39:19 1999  Andrew Haley  <aph@cygnus.com>
8022
8023         * except.c, java-except.h (expand_resume_after_catch): new
8024         function.
8025         * expr.c (java_lang_expand_expr): call expand_resume_after_catch
8026         to branch back to main flow of control after a catch block.
8027
8028 Sat Jan 23 23:02:43 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8029
8030         * Makefile.in (parse.o): Depend on $(CONFIG_H) and
8031         $(srcdir)/../system.h.
8032         (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
8033         (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
8034         (jcf-write.o): Likewise.
8035         (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8036         (mangle.o): Depend on $(srcdir)/../toplev.h.
8037         (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8038         (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8039
8040         * class.c: Include output.h and parse.h.
8041         (mangled_classname): Add the `const' keyword to a char*.
8042         (find_named_method): Hide unused function definition.
8043         (build_utf8_ref): Change type of variable `c' to unsigned char.
8044         Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
8045         (build_class_ref): Add the `const' keyword to a char*.
8046         (layout_class_method): Remove unused variable `buf'.
8047
8048         * decl.c (find_local_variable): Remove unused variable `rtl'.
8049         (pushdecl): Likewise for variables `different_binding_level' and
8050         `oldglobal'.
8051         (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
8052         (maybe_build_cleanup): Likewise for parameter `decl'.
8053
8054         * except.c (expand_start_java_handler): Mark parameter `range'
8055         with ATTRIBUTE_UNUSED.
8056
8057         * expr.c: Include except.h.
8058         (pop_type): Remove unused variable `i'.
8059         (pop_value): Likewise for variables `n_words' and `i'.
8060         (expand_java_arrayload): Likewise for variable `convert'.
8061         (java_lang_expand_expr): Likewise for variables `op0', `type',
8062         `mode', `unsignedp', `node' and `elements'.
8063         (expand_byte_code): Likewise for variables `prev_eh_ranges' and
8064         `eh_ranges'.
8065         (process_jvm_instruction): Add a `const' qualifier to a char*.
8066
8067         * gjavah.c (output_directory): Add the `const' keyword to a char*.
8068         (temp_directory): Likewise.
8069         (print_c_decl): Likewise.
8070         (print_method_info): Likewise.
8071         (decode_signature_piece): Likewise.
8072         (print_mangled_classname): Likewise.
8073
8074         * java-except.h: Provide prototypes for maybe_start_try,
8075         maybe_end_try and add_handler.
8076
8077         * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
8078         (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
8079         (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
8080         init_expr_processing, push_super_field, init_class_processing,
8081         can_widen_reference_to, class_depth, verify_jvm_instructions,
8082         maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
8083         set_local_type, merge_type_state, push_type, load_type_state,
8084         add_interface, find_in_current_zip, append_gpp_mangled_classtype,
8085         emit_unicode_mangled_name): Add prototypes.
8086
8087         * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
8088         (print_signature_type): Use ISDIGIT, not isdigit.
8089         (print_signature): Remove unused variable `j'.
8090
8091         * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
8092         int when comparing against one.
8093
8094         * jcf-parse.c: Include toplev.h.
8095
8096         * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
8097         (localvar_free): Remove unused variable `i'.
8098         (generate_bytecode_conditional): Likewise for variable `kind'.
8099
8100         * jv-scan.c: Include config.h and system.h.  Remove redundant
8101         OS header and gansidecl.h includes.
8102         (warning): Add the `const' keyword to a char*.  Also add
8103         ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
8104         __STDC__, when determining whether to use ANSI-isms.
8105         (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
8106         (xmalloc): Don't redundantly prototype here.
8107         (main): Remove unused parameter `envp'.  Also fix the arguments
8108         passed to function `fatal' to match the format specifier.
8109
8110         * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
8111
8112         * mangle.c: Include toplev.h.
8113         (emit_unicode_mangled_name): Declare parameter `len'.
8114
8115         * parse.y (parse_warning_context): Add the `const' keyword to a
8116         char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
8117         `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
8118         (issue_warning_error_from_context): Add the `const' keyword to
8119         a char*.
8120         (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
8121         not `__STDC__' for whether to use ANSI-isms.
8122
8123         * typeck.c (incomplete_type_error): Mark parameters `value' and
8124         `type' with ATTRIBUTE_UNUSED.
8125         (parse_signature_type): Use ISDIGIT, not isdigit.
8126
8127         * verify.c (check_pending_block): Add the `const' keyword to a char*.
8128         (verify_jvm_instructions): Likewise.  Remove unused variables
8129         `field_name' and `default_val'.
8130
8131         * zextract.c: Include config.h and system.h.  Remove redundant
8132         OS header includes.
8133
8134         * zipfile.h: Prototype `read_zip_archive'.
8135
8136 Thu Jan 21 16:00:06 1999  Andrew Haley  <aph@cygnus.com>
8137
8138         * typeck.c (convert): Allow conversions to void type: some
8139         optimizations in gcc do this.
8140
8141 Thu Jan 21 15:21:49 1999  Andrew Haley  <aph@cygnus.com>
8142
8143         * typeck.c (convert_ieee_real_to_integer): New function.
8144         (convert): When not using fast-math and using hardware fp, convert
8145         an IEEE NaN to zero.
8146
8147 1999-01-18  Andrew Haley  <aph@cygnus.com>
8148
8149         * parse.y (patch_binop): Do a type conversion from signed to
8150         unsigned and then back to signed when a ">>>" is found.
8151
8152 Sun Jan 17 22:34:22 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8153
8154         * java-tree.h: (check_for_initialization): Added prototype.
8155         * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
8156         * parse.y (do_resolve_class): Removed unused locals.
8157         (read_import_dir): Likewise.
8158         (resolve_qualified_expression_name): Array creation
8159         expressions are valid primary expressions.
8160         (qualify_ambiguous_name): Likewise.
8161         (patch_synchronized_statement): Removed unused local.
8162
8163 Sun Jan 17 21:55:42 1999  Jeffrey A Law  (law@cygnus.com)
8164
8165         * Makefile.in (zextract.o): Add dependencies.
8166
8167         * Makefile.in: Do not put ^Ls at the start of a line.
8168
8169 Fri Jan 15 20:16:20 1999  Per Bothner  <bothner@cygnus.com>
8170
8171         * expr.c (process_jvm_instruction):  Coerce to correct Throwable
8172         sub-type the result of the call that gets the exception value.
8173
8174         * parse.y (java_complete_expand_methods):  If flags_syntax_only,
8175         don't call finish_class.
8176
8177         * parse.y (java_check_regular_methods):  If METHOD_PRIVATE,
8178         clear found before continuing.
8179
8180         * verify.c (verify_jvm_instructions):  On an array load, allow
8181         and handle top of stack to be TYPE_NULL.
8182
8183         * gjavah.c (generate_access):  Translate Java package private or
8184         protected access to C++ public, but with a comment.
8185
8186 1999-01-13  Andrew Haley  <aph@cygnus.com>
8187
8188         * expr.c (generate_name): Name prefix changed to avoid clashes
8189         with assembler temp labels.
8190
8191         * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
8192         MODIFY_EXPR.  Without this, code for the assignement may not be
8193         generated at all and the synchronized statement will read an
8194         uninitialized variable.
8195
8196 Wed Jan 13 01:24:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8197
8198         * class.c (maybe_layout_super_class): Fixed returned value.
8199         * lex.c: Added 1999 to the copyright.
8200         (java_init_lex): Initialize java_lang_imported.
8201         * lex.h: Added 1999 to the copyright.
8202         * parse.h: Added 1999 to the copyright.
8203         (REGISTER_IMPORT): Fixed typo in trailing macro.
8204         (CURRENT_OSB): New macro.
8205         (struct parser_ctxt): New fields osb_depth, osb_limit.
8206         * parse.y (java_lang_id): New global variable.
8207         (type_import_on_demand_declaration): Don't import java.lang.* twice.
8208         (array_creation_expression:): Use CURRENT_OSB.
8209         (dims:): Uses a stack to keep track of array dimensions.
8210         (cast_expression:): Use CURRENT_OSB.
8211         (find_expr_with_wfl): Return NULL if node found doesn't meet the
8212         conditions.
8213         (register_fields): Fixed typos in comment.
8214         (check_method_redefinition): Fixed comment indentation.
8215         (java_check_regular_methods): Set saved found wfl to NULL after
8216         having reinstalled it in the previously found DECL_NAME.
8217
8218 Sun Jan 10 13:36:14 1999  Richard Henderson  <rth@cygnus.com>
8219
8220         * gjavah.c (java_float_finite): Use a union to do type punning.
8221         (java_double_finite): Likewise.
8222
8223 Sat Jan  9 11:25:00 1999  Per Bothner  <bothner@cygnus.com>
8224
8225         * parse.y (build_new_array_init):  Don't set EXPR_WFL_LINECOL
8226         on CONSTRUCTOR (since that trashes TREE_CST_RTL).
8227         (patch_new_array_init):  Clear TREE_CONSTANT also if INDIRECT_REF.
8228         (register_fields):  Set TREE_STATIC on NEW_ARRAY_INIT, not on
8229         CONSTRUCTOR (which causes expand_expr to call output_constant_def).
8230         * expr.c (java_lang_expand_expr):  Check TREE_STATIC of NEW_ARRAY_INIT.
8231
8232 Fri Jan  8 15:48:03 1999  Per Bothner  <bothner@cygnus.com>
8233
8234         * check-init.c (check_init):  If compiling to native, we don't
8235         see THROW_EXPR.  Instead, look for a call to throw_node (_Jv_Throw).
8236
8237 1999-01-08  Tom Tromey  <tromey@cygnus.com>
8238
8239         * parse-scan.y (variable_declarator_id): Set or increment
8240         bracket_count.
8241         (bracket_count): New global.
8242         (formal_parameter): Handle case where bracket pairs trail variable
8243         declarator id.
8244
8245 1999-01-07  Andrew Haley  <aph@viagra.cygnus.co.uk>
8246
8247         * jcf-parse.c (yyparse): variable len changed from a char to an
8248         int to prevent overflow.
8249
8250 Wed Jan  6 17:19:46 1999  Per Bothner  <bothner@cygnus.com>
8251
8252         * java-tree.h:  Declare read_class.
8253         * jcf-parse.c (read_class):  New function.
8254         (load_class):  Now just call read_class.
8255
8256         * java-tree.h (java_parse_abort_on_error):  Only return if new errors.
8257         * jcf-parse.c (parse_source_file):  Declare save_error_count,
8258         which is needed by java_parse_abort_on_error macro,
8259         * parse.y (java_layout_classes, java_expand_classes):  Likewise.
8260
8261         * parse.y (register_fields):  Set TREE_STATIC flag of NEW_ARRAY_INIT
8262         constructor, if initializing a static field.
8263         (patch_new_array_init):  Set TREE_CONSTANT if it is.
8264         * expr.c (java_lang_expand_expr):  For a static array constructor
8265         of primitive elements, allocate the array itself statically.
8266         Disabled until we can set the vtable field statically.
8267
8268         * check-init.c:  New file.  Checks for definite assignment.
8269         * Makefile.in (JAVA_OBJS):  Add check-init.o.
8270         * parse.y (java_complete_expand_method): Call check_for_initialization.
8271         * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY):  Moved to java-tree.h.
8272
8273 Wed Jan  6 14:53:10 1999  Graham <grahams@rcp.co.uk>
8274
8275         * parse.y : include system.h instead of including
8276         standard headers directly with the exception of <dirent.h>.
8277
8278 Wed Jan  6 16:20:06 1999  Per Bothner  <bothner@cygnus.com>
8279
8280         * lex.h:  Moved static function declarations to lex.c,
8281         to shut up some -Wall warnings.
8282         * lex.c:  Static function declarations moved here.
8283         * jcf-dump.c:  Small fixes to shut up -Wall warnings.
8284
8285 Tue Jan  5 22:15:40 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8286
8287         * Make-lang.in ($(GCJ).o): Depend on prefix.h.
8288
8289 Tue Dec 22 11:25:19 1998  Per Bothner  <bothner@cygnus.com>
8290
8291         * expr.c (process_jvm_instruction):  Do load_type_state after JSR.
8292         * verify.c (verify_jvm_instructions):  Fix off-by-one error.
8293
8294         * jcf-write.c (CHECK_PUT):  Add (void) cast to avoid -Wall warnings.
8295         (localvar_alloc):  Change return type to void,
8296         (emit_unop):  Remove unused variable size.
8297
8298         * jcf-write.c (struct jcf_block):  Add new union.
8299         (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC):  New macros.
8300         (call_cleanups):  New functions.
8301         (struct jcf_partial):  New fields num_finalizers and return_value_decl.
8302         (generate_bytecode_insns):  Support CLEANUP_POINT_EXPR and
8303         WITH_CLEANUP_EXPR.  Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
8304         * lang.c (lang_init):  Call using_eh_for_cleanups.
8305         * parse.y (java_complete_lhs):  For SYNCHRONIZED_EXPR, defer
8306         completing operands to patch_synchronized_statement.
8307         Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
8308         (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
8309         WITH_CLEANUP_EXPR instead of TRY_EXPR.
8310
8311 Sun Dec 20 16:15:44 1998  John F. Carr  <jfc@mit.edu>
8312
8313         * Make-lang.in: Comment out control-Ls; they upset some makes.
8314
8315 1998-12-18  Tom Tromey  <tromey@cygnus.com>
8316
8317         * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
8318         consistently.
8319
8320 1998-12-17  Tom Tromey  <tromey@cygnus.com>
8321
8322         * parse.y (DIR_SEPARATOR): New define.
8323         (check_class_interface_creation): Use it.
8324
8325         * parse-scan.y (report_main_declaration): Recognize
8326         `java.lang.String' in argument to main.
8327
8328 Wed Dec 16 16:18:59 1998  Per Bothner  <bothner@cygnus.com>
8329
8330         * parse.y (create_interface):  Remove bogus test.
8331
8332 Wed Dec 16 14:42:19 1998  Per Bothner  <bothner@cygnus.com>
8333
8334         * jcf-parse.c (get_constant):  Set TREE_TYPE for string constants.
8335         (HANDLE_CONSTANTVALUE):  If flag_emit_class_files, call get_constant.
8336
8337 1998-12-16  Tom Tromey  <tromey@cygnus.com>
8338
8339         * parse-scan.y (qualified_name): Use correct sprintf format.
8340
8341 1998-12-15  Tom Tromey  <tromey@cygnus.com>
8342
8343         * gjavah.c (print_field_info): Changed how most negative number is
8344         printed.
8345
8346 Mon Dec 14 18:49:29 1998  Per Bothner  <bothner@cygnus.com>
8347
8348         * parse.y (fold_constant_for_init):  New function.
8349         (resolve_expression_name):  Don't replace static final
8350         constant-initialized fields by its value.
8351         (java_complete_lhs):  New.  Same as java_complete_tree, except does
8352         not replace static final constant-initialized fields by their values.
8353         (register_fields):  If there is an initializer, set DECL_INITIAL and
8354         MODIFY_EXPR_FROM_INITIALIZATION_P.
8355         (java_complete_tree):  For MODIFY_EXPR, use java_complete_lhs for lhs.
8356         Only call patch_initialized_static_field if
8357         MODIFY_EXPR_FROM_INITIALIZATION_P.
8358         (patch_initialized_static_field):  If not valid constant, clear
8359         DECL_INITIAL.
8360
8361         * parse.y (lookup_field_wrapper):  Fix thinko.
8362
8363         * parse.y (java_complete_tree):  In EXPR_WITH_FILE_LOCATION,
8364         set and restore global lineno.
8365
8366 1998-12-14  Tom Tromey  <tromey@cygnus.com>
8367
8368         * gjavah.c (print_field_info): If value to print is the smallest
8369         value of its size, then print as hex to avoid later warnings from
8370         C++ compiler.
8371
8372 1998-12-14  Tom Tromey  <tromey@cygnus.com>
8373
8374         * gjavah.c (decompile_method): Decompile `return null'.
8375         (process_file): Generate `#pragma interface'.
8376         (method_declared): New global.
8377         (print_method_info): Set it.
8378         (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
8379         (print_method_info): Handle abstract methods.
8380
8381 Sun Dec 13 17:31:40 1998  Per Bothner  <bothner@cygnus.com>
8382
8383         * parse.y (patch_method_invocation):  If class_decl is null
8384         (e.g. an array type), use original type.
8385
8386         * parse.y (check_thrown_exceptions):  Temporary hack to suppress
8387         errors about uncaught exception from clone (of array, specifically).
8388
8389 1998-12-13  Tom Tromey  <tromey@cygnus.com>
8390
8391         * gjavah.c (decompile_method): Handle all types of `return'
8392         opcode.  Decompile `return this' and `return'.
8393         (method_access): New global.
8394         (print_method_info): Set it.
8395         (decompile_method): Don't decompile a synchronized method.
8396
8397 1998-12-13  Tom Tromey  <tromey@cygnus.com>
8398
8399         * jcf-reader.c (jcf_parse_one_method): Recognize
8400         HANDLE_END_METHOD.
8401         * gjavah.c (HANDLE_END_METHOD): New macro.
8402         (HANDLE_CODE_ATTRIBUTE): New macro.
8403         (decompile_method): New function.
8404         (print_method_info): Don't print `;\n' at end of function decl.
8405         Include java-opcodes.h.
8406         (decompiled): New global.
8407
8408 Sat Dec 12 20:13:19 1998  Per Bothner  <bothner@cygnus.com>
8409
8410         * class.c (build_class_ref):  Handle PRIMTYPE.class if
8411         flag_emit_class_files.
8412         * expr.c (expand_java_field_op):  Don't optimize java.lang.XXX.TYPE
8413         if flag_emit_class_files.
8414         * parse.y (java_complete_tree):  Pre-liminary support for
8415         COMPONENT_REF - only to handle PRIMCLASS.TYPE.
8416
8417         * parse.y (patch_synchronized_statement):   Don't call monitorexit
8418         unless block CAN_COMPLETE_NORMALLY.  Propagate that flag properly.
8419
8420         * java-tree.h (DECL_LOCAL_STATIC_VALUE):  Removed - no longer used.
8421
8422         * zipfile.h (opendir_in_zip):  New declaration.
8423         * jcf-io.c (saw_java_source):  Moved to jcf-parse.c.
8424         (opendir_in_zip):  New function, using code from open_in_zip.
8425         (open_in_zip):  Call opendir_in_zip.
8426         (find_class):  Remove no-longer-used do_class_file parameter,
8427         but add source_ok parameter.  Change logic so if we find a .java file,
8428         we don't look for .class in later classpath emtries.
8429         * jcf-parse.c (load_class):  Pass saw_java_source to find_class.
8430         (jcf_figure_file_type):  Only call open_in_zip if correct magic number.
8431         * gjavah.c: Update call to find_class.
8432         * jcf-dump.c:  Likewise.
8433
8434         * jcf-write.c (put_linenumber):  Handle duplicate line numbers.
8435         (generate_bytecode_insns):  For EXPR_WITH_FILE_LOCATION, do
8436         nothing if body is empty_stmt_node.
8437         Various little fixes so SP gets correctly adjusted.
8438         For NEW_ARRAY_INIT, handle IGNORE_TARGET.
8439         For CALL_EXPR, test if static first.
8440         (generate_classfile):  Ignore fields that are DECL_ARTIFICIAL,
8441         such as the ones we create for Object and Class.
8442         Set and restore current_function_decl.
8443         * parse.y:  Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
8444         (note_possible_classname):  New function.
8445         (read_import_entry):  Removed.  Merged with read_import_dir.
8446         (read_import_dir):  Don't call find_class - that only gives us
8447         the first classpath entry having the needed package.
8448         Use the struct buffer data structure from buffer.h.
8449         (read_import_dir, find_in_imports_on_demand):  The remembered
8450         class names now use '.' (not '/') as package separator.
8451
8452         * parse.y (java_complete_expand_methods):  Call write_classfile
8453         here, and not in java_expand_classes (which only gets first class).
8454
8455 Sat Dec 12 19:46:04 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8456
8457         * parse.y (<type_declaration>):  Do maybe_generate_clinit last.
8458         (register_fields):  If a static fields has an initializer, just
8459         chain it on ctxp->static_initialized, and handle later.
8460         (java_complete_expand_methods):  Force <clinit> first.
8461         (resolve_expression_name, resolve_field_access):  Just get DECL_INITIAL
8462         - it's already been completed.
8463         (patch_initialized_static_field):  New function.
8464         (java_complete_field):  Call it.
8465
8466 Sat Dec 12 19:21:11 1998  Per Bothner  <bothner@cygnus.com>
8467
8468         * expr.c (encode_newarray_type, build_new_array):  New functions.
8469         * java-tree.h:  Declare build_new_array.
8470         * jcf-write.c (patch_newarray):  Use build_new_array.
8471
8472         * expr.c (java_lang_expand_exp):  Support NEW_ARRAY_INIT.
8473         * jcf-write.c (generate_bytecode_insns):  Support NEW_ARRAY_INIT.
8474
8475         * parse.y (patch_new_array_init):  Re-organize.
8476         Now is passed the actual array (pointer) type of the value.
8477         Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
8478         (patch_array_constructor):  Removed - merged into patch_new_array_init.
8479         (java_complete_tree):  Update patch_new_array_init.
8480
8481         * jcf-write.c (find_constant_index):  New function.
8482         (generate_bytecode_insns):  Use find_constant_index.
8483         (generate_classfile):  Use find_constant_index for ConstantValue.
8484
8485 1998-12-11  Tom Tromey  <tromey@cygnus.com>
8486
8487         * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
8488         * decl.c (init_decl_processing): Renamed dtable -> vtable.
8489         * class.c (make_class_data): Renamed dtable -> vtable, and
8490         dtable_method_count -> vtable_method_count.
8491
8492 Thu Dec 10 20:00:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8493
8494         * decl.c (long_zero_node, float_zero_node, double_zero_node): New
8495         global variables, initialized.
8496         * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
8497         Declared new global variables.
8498         * lex.c (java_lex): Return long_zero_node, float_zero_node,
8499         double_zero_node, integer_zero_node upon direct matching.
8500         * parse.y (purify_type_name): Added function prototype.
8501         (duplicate_declaration_error_p): Consider new_type as potentially
8502         being a incomplete type. Use purify_type_name on type string.
8503         (method_header): saved_type: unused variable removed. Don't figure
8504         return type if method name is invalid.
8505         (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
8506         processed by patch_unaryop.
8507         (patch_unaryop): Fixed typo in comment. Re-convert pre/post
8508         increment/decrement node into its original type after binary
8509         numeric promotion on its operands.
8510
8511 Thu Dec 10 11:02:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8512
8513         * parse.y (array_initializer:): Array init operand is NULL_TREE
8514         instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
8515         now an error. Fixed indentation problems.
8516         (patch_string): Handle error_mark_node as an argument.
8517         (patch_new_array_init): Fixed indentation problems.
8518         (array_constructor_check_entry): Removed check on null wfl_value.
8519         Return an error if wfl_value's walk returns an error.
8520
8521 Wed Dec  9 15:37:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8522
8523         * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
8524         * lex.c (java_lex): Remember column position before advancing one
8525         token. Retain location information on OCB_TK.
8526         * lex.h (typedef struct java_lc): Added new field.
8527         * parse.h (GET_SKIP_TYPE): New macro.
8528         (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
8529         * parse.y (build_new_array_init, patch_new_array_init,
8530         patch_array_constructor, maybe_build_array_element_wfl,
8531         array_constructor_check_entry): New function prototypes.
8532         (switch_block:): Tagged <node>.
8533         (OCB_TK): Tagged <operator>.
8534         (array_initializer:): Installed actions.
8535         (variable_initializer): Build location information on element if
8536         necessary.
8537         (switch_statement:): Fixed indentation typo.
8538         (switch_block:): Redefined default action.
8539         (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
8540         (patch_assignment): Removed duplicate code.
8541         (maybe_build_array_element_wfl, build_new_array_init,
8542         patch_new_array_init, patch_array_constructor,
8543         array_constructor_check_entry): New functions.
8544
8545 Mon Dec  7 15:13:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8546
8547         * parse.y (array_initializer): Tagged <node>.
8548         (variable_initializer:): Use default rule.
8549         (array_initializer:): Defined actions.
8550         (variable_initializers:): Likewise.
8551         (resolve_qualified_expression_name): Use DECL_CONTEXT to build
8552         non-static field accesses.
8553         (patch_invoke): Fixed indentation typo.
8554         (java_complete_tree): Likewise.
8555         (build_labeled_block): Changed leading comment. Generate an error
8556         in case of duplicate loop labels.
8557         (patch_conditional_expr): Patch results of string concatenation
8558         operations.
8559
8560 Sun Dec  6 13:45:00 1998  Per Bothner  <bothner@cygnus.com>
8561
8562         * constants.c (find_methodref_index):  When the class is an interface,
8563         generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
8564
8565         * decl.c (finit_identifier_node):  Use "$finit$", rather than
8566         "<finit>" (which Sun's verifier rejects).
8567         * parse.y (maybe_generate_finit):  Leave out meaningless final flag.
8568         (generate_field_initialization_code):  Removed.
8569         (fix_constructors)  Don't add call to $finit$ here (wrong order).
8570         (patch_method_invocation):  Add $finit$ call here.
8571
8572         * java-tree.h (CALL_USING_SUPER):  New macro.
8573         * parse.y (patch_invoke):  Remove im local variable.
8574         (patch_method_invocation, patch_invoke):  Don't pass super parameter.
8575         (patch_invoke):  Use CALL_USING_SUPER instead of from_super parameter.
8576         (resolve_qualified_expression_name):  Maybe set CALL_USING_SUPER.
8577
8578         * jcf-write.c (get_access_flags):  Fix typo ACC_PUBLIC -> ACC_FINAL.
8579
8580         * parse.y (java_complete_tree):  Don't complain about unreachable
8581         statement if it is empty_stmt_node.
8582
8583         * jcf-write.c (find_constant_wide):  New function.
8584         (push_long_const):  Use find_constant_wide.
8585
8586         * jcf-write.c (generate_bytecode_insn):  Fix bug in switch handling.
8587         (generate_bytecode_insn):  Use correct dup variant for MODIFY_EXPR.
8588         Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
8589         Emit invokeinterface when calling an interface method.
8590         Emit invokespecial also when calling super or private methods.
8591
8592         * jcf-write.c (generate_classfile):  Emit ConstantValue attributes.
8593
8594 Sun Dec  6 13:21:18 1998  Per Bothner  <bothner@cygnus.com>
8595
8596         * jcf-dump.c (INVOKE):  If invokeinterface, print number of args.
8597
8598 Thu Dec  3 17:11:12 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8599
8600         * java-tree.h (java_layout_seen_class_methods): New function
8601         prototype.
8602         (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
8603         * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
8604         * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
8605         * parse.y (method_declarator:): Defined action.
8606         (issue_warning_error_from_context): input_filename saved, set to
8607         the appropriate value and restored after java_error is called.
8608         (build_unresolved_array_type): Fixed comment.
8609         (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
8610         (method_header): Deal with return type the same way type are
8611         handled for fields and method's parameters and local variables
8612         types are handled.
8613         (check_method_redefinition): Removed extra CR.
8614         (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
8615         (java_layout_seen_class_methods): New function.
8616         (java_layout_classes): Call java_layout_seen_class_methods.
8617
8618 Thu Dec  3 15:56:50 1998  Per Bothner  <bothner@cygnus.com>
8619
8620         * parse,y (patch_synchronized_statement):  Set CAN_COMPLETE_NORMALLY.
8621
8622 Thu Dec  3 15:08:30 1998  Per Bothner  <bothner@cygnus.com>
8623
8624         * jcf-dump.c (main):  Fix error message.
8625         * jcf-path.c (add_entry):  Style fix.
8626
8627 Wed Dec  2 15:52:25 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8628
8629         * class.c (layout_class_method): Call build_java_argument_signature
8630         on constructors too.
8631         * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
8632         (patch_method_invocation): Define a primary when resolving an
8633         expression name. Augmented comment on code checking illegal `this'
8634         usage. Loosened it test by accepting NEW_CLASS_EXPR.
8635
8636 Tue Dec  1 13:53:24 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8637
8638         * class.c (layout_class_method): Don't report error on non-static
8639         overriding static if the method is private.
8640         * java-tree.h (finish_class): Prototype added.
8641         * lex.c (java_get_line_col): Handle col argument -2 value.
8642         * parse.h: All static method declarations moved to parse.y.
8643         * parse.y: Now contains all static method declarations previously
8644         found in parse.h.
8645         (find_expr_with_wfl, missing_return_error,
8646         unreachable_stmt_error): New functions.
8647         (java_get_real_method_name): Identify constructors bearing class
8648         names in source code compiled classes only.
8649         (java_complete_expand_methods): Call missing_return_error.
8650         (invocation_mode): Private methods invoked as static methods.
8651         (java_complete_tree): Call unreachable_stmt_error.
8652
8653 1998-12-01  Tom Tromey  <tromey@cygnus.com>
8654
8655         * Makefile.in (+target): Removed.
8656         (+xmake_file): Likewise.
8657         (+tmake_file): Likewise.
8658         (.NOEXPORT): Removed duplicate.
8659
8660 Fri Nov 27 13:20:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8661
8662         * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
8663
8664         * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
8665
8666         * jvgenmain.c: Remove the xmalloc prototype, we get it from
8667         libiberty.h.  Provide an xmalloc definition.
8668
8669         * jvspec.c: Remove the xmalloc prototype.
8670
8671         * parse-scan.y: Include config.h and system.h.  Don't include
8672         OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
8673         Provide an xstrdup definition.
8674
8675 Thu Nov 26 22:03:58 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
8676
8677         * jcf-path.c (add_entry): Recognize ".jar" too.
8678         * lang-specs.h: Likewise.
8679
8680 Thu Nov 26 12:44:07 1998  Per Bothner  <bothner@cygnus.com>
8681
8682         * jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
8683         soft_monitorenter_node, soft_monitorexit_node, throw_node.
8684
8685         * jcf-write.c (generate_bytecode_insns):
8686         Handle pre/post-increment/decrement of long.
8687
8688         * jcf-write.c (generate_bytecode_insns):
8689         Handle missing exception handler (finally for synchronized).
8690
8691 Wed Nov 25 09:47:15 1998  Per Bothner  <bothner@cygnus.com>
8692
8693         * java-tree.h (end_params_node):  Declare global.
8694         * decl.c (end_params_node):  New global.
8695         (init_decl_processing, start_java_method):  Use end_params_node for
8696         end of list of parameter types.  Follows correct gcc conventions.
8697         * expr.c (pop_argument_types, pop_arguments):  Likewise.
8698         * lang.c (put_decl_node):  Likewise.
8699         * typeck.c (various places):  Likewise.
8700         * class.y (various places):  Likewise.
8701         * parse.y (various places):  Likewise.
8702
8703         * parse.y (java_complete_tree):  Move CAN_COMPLETE_NORMALLY.
8704         (build_jump_to_finally):  Add missing CAN_COMPLETE_NORMALLY.
8705
8706         * class.c:  Add #include flags.h, remove no-longer needed declaration.
8707
8708         * class.c (layout_class_method):  Remove commented-out code, re-format.
8709         Don't add vtable entry (or index) for private methods.
8710         * expr.c (expand_invoke):  A private method is implicitly final.
8711         * class.c (make_class_data):  If inlining or optimizing,
8712         skip private methods.
8713
8714         * class.c (finish_class):  New function.  Calls existing methods,
8715         but alls emits deferred inline functions.
8716         * jcf-parse.c (parse_class_file):  Call finish_class.
8717         * parse.y (java_complete_expand_methods):  Likewise.
8718
8719         * expr.c (build_java_binop):  Explicit default, to silence -Wall.
8720
8721         * expr.c (CHECK_PC_IN_RANGE):  Add void cast to kill warnings.
8722
8723 Wed Nov 25 00:50:58 1998  Marc Espie <espie@quatramaran.ens.fr>
8724
8725         * jcf-write.c (generate_bytecode_conditional): Fix typo.
8726
8727 Tue Nov 24 17:06:38 1998  Per Bothner  <bothner@cygnus.com>
8728
8729         * (generate_classfile): Always write class access flag with
8730         ACC_SUPER set.
8731
8732 Tue Nov 24 16:34:33 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8733
8734         * class.c (maybe_layout_super_class): New function.
8735         (layout_class): Reorganized. Loop on class methods dispatched into
8736         a new function. Call maybe_layout_super_class.
8737         (layout_class_methods, layout_class_method): New functions.
8738         * expr.c (expand_java_NEW): Call layout_class_methods on loaded
8739         class.
8740         (expand_invoke): Likewise.
8741         * java-tree.h (all_class_list): New global variable declared.
8742         (layout_class_methods, layout_class_method): New function
8743         prototypes.
8744         (LAYOUT_SEEN_CLASS_METHODS): New macro.
8745         * jcf-parse.c (all_class_list): New global variable.
8746         (load_class): Extended what class_or_name can be. Use parser
8747         context mechanism to save globals before calling jcf_parse.
8748         (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
8749         is set on the file name.
8750         (jcf_parse): Layout class methods when Object is loaded, otherwise
8751         record class in all_class_list for delayed method layout.
8752         (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
8753         * lang.c (put_decl_node): Decode <init> into the decl context
8754         class name.
8755         * lex.c (java_allocate_new_line): Use xmalloc.
8756         * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
8757         pointers, not TREE_LIST elements.
8758         (struct parser_ctxt): Fixed comment indentations, added comments
8759         and reordered some fields.
8760         (java_check_methods): Function prototype removed.
8761         * parse.y (java_push_parser_context): Use xmalloc.
8762         (java_parser_context_restore_global): Pop extra pushed ctxp only
8763         when there's nothing next.
8764         (maybe_create_class_interface_decl): Fixed comment, add new
8765         created class decl to all_class_list.
8766         (method_header): Use GET_REAL_TYPE on argument's types.
8767         (method_declarator): Use GET_REAL_TYPE, change type to the real
8768         type in TREE_LIST dependency node. Build argument list with the
8769         real type.
8770         (create_jdep_list): Use xmalloc. Removed allocation error message.
8771         (obtain_incomplete_type): Fixed leading comment. Broadened
8772         incoming argument meaning.
8773         (register_incomplete_type): Use xmalloc. Removed allocation error
8774         message.
8775         (safe_layout_class): Fixed leading comment.
8776         (jdep_resolve_class): Reversed if statement condition and switch
8777         if and else bodies.
8778         (resolve_and_layout): Fixed leading comment. Broadened incoming
8779         argument meaning.
8780         (complete_class_report_errors): New local variable name, for
8781         clarity. purify_type_name used for all error cases.
8782         (java_get_real_method_name): Stricter check on constructors.
8783         (java_check_regular_methods): Reverse methods list only if not
8784         already laid out. Layout artificial constructor.
8785         (java_check_methods): Deleted.
8786         (source_start_java_method): Obtain incomplete type for patchable
8787         method arguments.
8788         (java_layout_classes): Fixed leading comment. Use
8789         LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
8790         statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
8791         before returning. Fixed comments.
8792         (java_expand_classes): Check for errors up front.
8793         (patch_method_invocation): Class to search is resolved and laid
8794         out.
8795
8796 Tue Nov 24 12:57:13 1998  Per Bothner  <bothner@cygnus.com>
8797
8798         * expr.c (java_lang_expand_expr):  Add missing emit_queue.
8799
8800         * javaop.h (int8):  Removed - not used.
8801         (jbyte):  Redefine portably with correct signedness.
8802
8803         * jcf-write.c (generate_bytecode_insns):  Don't free sw_state.cases.
8804
8805         * jcf-write.c (generate_bytecode_insns):  Fix typo
8806         OPCODE_getstatic to OPCODE_getfield.
8807
8808         * java-tree.def (CASE_EXPR, DEFAULT_EXPR):  Kind is 'x', not '1'.
8809         * parse.y (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR,
8810         set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
8811
8812 Thu Nov 19 11:16:55 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8813
8814         * jcf-parse.c (jcf_parse_source): Function returned type is
8815         void. Added prototype.
8816         (jcf_parse): Function returned type is void.
8817         (yyparse): Remove call to fclose on the last parsed file.
8818
8819         * java-tree.h (jcf_parse): Changed jcf_parse prototype.
8820
8821 Wed Nov 18 23:54:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8822
8823         * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
8824         (layout_class): Cope with methods featuring WFL in decl names.
8825         * decl.c (unqualified_object_id_node): New global variable,
8826         initialized.
8827         (build_decl_no_layout): Removed.
8828         * expr.c (build_primtype_type_ref): Handle Double.
8829         (java_lang_expand_expr): Fixed indentations.
8830         * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
8831         (flag_wall, flag_redundant, flag_not_overriding,
8832         flag_static_local_jdk1_1, unqualified_object_id_node): Global
8833         variable declarations.
8834         (build_decl_no_layout): Removed prototype.
8835         (java_get_real_method_name): Added prototype.
8836         (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
8837         (java_parse_abort_on_error): Macro now just returns.
8838         * jcf-parse.c (jcf_parse_source): Check fclose returned
8839         value. Call emit_register_classes if java_report_errors returns
8840         zero.
8841         * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
8842         flag_static_local_jdk1_1): New integer flags.
8843         (lang_decode_option): New flags set here.
8844         * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
8845         (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
8846         the flag_redundant variable.
8847         (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
8848         when parsing java.lang.Object class.
8849         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
8850         NULL_TREE to build.
8851         (resolve_qualified_expression_name): Fixed indentation.
8852         (patch_array_ref): Changed prototype.
8853         (not_initialized_as_it_should_p): Prototype removed.
8854         (java_report_errors): Added function prototype.
8855         * parse.y (formal_parameter:): Changed error message for not yet
8856         supported final parameters.
8857         (class_type_list:): Set both PURPOSE and VALUE of created
8858         TREE_LIST to be class_type.
8859         (primary_no_new_array:): Handle class literals on primitive types.
8860         (parse_warning_context): Reinstalled correct force_error and
8861         do_warning flags setups.
8862         (java_report_errors): Changed prototype. Return java_error_count
8863         value.
8864         (variable_redefinition_error): Consider treating variable type as
8865         a fake pointer.
8866         (create_interface): Warn about redundant abstract modifier if
8867         flag_redundant is set. Changed error message.
8868         (lookup_field_wrapper): Save/restore globals before/after looking
8869         up field.
8870         (duplicate_declaration_error_p): Consider treating declaration
8871         type as a fake pointer.
8872         (register_fields): Extract real type from dependency node. Check
8873         for duplicate field declaration after type adjustment. Use
8874         DECL_INITIAL to store static final initialized values.
8875         (method_header): Extract real function type from dependency node.
8876         (check_abstract_method_header): Use GET_METHOD_NAME.
8877         (obtain_incomplete_type): Layout fake pointer type.
8878         (safe_layout_class): Don't try to check for methods before layout.
8879         (java_complete_class): Don't check for correct throws clause
8880         elements inheritance here.
8881         (resolve_and_layout): Broadened name parameter meaning.
8882         (reset_method_name): Use GET_METHOD_NAME.
8883         (java_get_real_method_name): New function.
8884         (java_check_regular_methods): Don't check methods in
8885         java.lang.Object.  Verify lineage of throws clause elements. Use
8886         flag_no_overriding in warning report.
8887         (check_throws_clauses): Don't check if class was from
8888         bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
8889         (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
8890         (declare_local_variables): Use flag_static_local_jdk1_1 to report
8891         warning on unsupported final local variables. Use build_decl
8892         instead of build_decl_no_layout. Get real local variable type from
8893         dependency node.
8894         (source_start_java_method): Get real parameter type from
8895         dependency node. Call build_decl instead of build_decl_no_layout.
8896         (java_layout_classes): Reverse tree and layout type and class as
8897         required. Mark class as loaded when done.
8898         (resolve_field_access): Fixed indentation. Restricted condition
8899         leading to static field access code generation. Set field_type
8900         decl's TREE_TYPE if QUAL_DECL_TYPE not available.
8901         (resolve_qualified_expression_name): Initialize type_found to
8902         null. Handle static field resolved during qualification. Fixed
8903         layout on non primitive field decl types.
8904         (not_accessible_p): Fixed typo in comment.
8905         (patch_method_invocation): Resolve and layout class to search from
8906         type.
8907         (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
8908         layout non primitive type, if necessary. Make method node only to
8909         report errors.
8910         (find_applicable_accessible_methods_list): Consider WFL'ed method
8911         decl names. Fixed indentation.
8912         (argument_types_convertible): Resolve and layout target type if
8913         necessary.
8914         (java_complete_tree): Fixed indentation problems. Rewrote
8915         CALL_EXPR thrown exceptions check. Re-installed further processing
8916         of the assignment in certain cases.
8917         (patch_assignment): Call maybe_build_primttype_type_ref to perform
8918         inlining on class literals.
8919         (valid_builtin_assignconv_identity_widening_p): Cope with constant
8920         0 literal.
8921         (valid_method_invocation_conversion_p): Likewise.
8922         (patch_string): Temporary disable forbidden use of `this' in
8923         explicit constructor invocations when doing string concatenation
8924         within their scope.
8925         (patch_unaryop): Added comment. Reinstalled code to disable
8926         further check on assignment operation with cast expression RHS.
8927         (patch_switch_statement): Fixed indentation.
8928         (build_try_statement): Call build_decl instead of
8929         build_decl_no_layout.
8930         (patch_synchronized_statement): Likewise.
8931         (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
8932         IS_UNCHECKED_EXPRESSION_P.
8933         (check_thrown_exceptions_do): Changed leading comment. Resolve and
8934         layout argument exception type.
8935         (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
8936         of IS_UNCHECKED_EXPRESSION_P.
8937
8938 Wed Nov 18 14:21:48 1998  Anthony Green  <green@cygnus.com>
8939
8940         * jcf-parse.c (yyparse): Open class file in binary mode.
8941
8942 Sun Nov 15 17:14:17 1998  Per Bothner  <bothner@cygnus.com>
8943
8944         * jvgenmain.c:  Need to #include "gansidecl.h" (to get PROTO).
8945
8946         * jcf-write.c (perform_relocations):  Move check out one loop.
8947
8948 Sun Nov 15 15:09:56 1998  Anthony Green  <green@hoser.cygnus.com>
8949
8950         * Make-lang.in: Fix reference to srcdir.
8951         * jv-scan.c: Add missing xmalloc prototype.
8952         * jvgenmain.c: Ditto.
8953
8954 Sun Nov 15 14:36:29 1998  Per Bothner  <bothner@cygnus.com>
8955
8956         * decl.c (error_mark_node), java-tree.h:  New global.
8957         * parse.y:  Use empty_stmt_node instead of size_zero_node.
8958         (build_if_else_statement):  If missing else, use empty_stmt_node.
8959
8960         * parse.y (not_initialized_as_it_should_p):  Removed, with its callers.
8961         (java_complete_expand_method):  Complain if return is missing.
8962         (java_check_regular_methods):  Comment out incorrect error check.
8963         (not_accessible_p):  Fix incorrect handling of protected methods.
8964         (patch_method_invocation):  Pass correct context to not_accessible_p.
8965         (find_applicable_accessible_methods_list):  Likewise.
8966         (qualify_ambiguous_name):  If ARRAY_REF, it's an expression name.
8967         (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR, set
8968         TREE_TYPE (to void_type_node);  otherwise expand_expr crashes.
8969         (patch_if_else_statement):  Fix setting of CAN_COMPLETE_NORMALLY.
8970
8971         * jcf-write.c (CHECK_OP, CHECK_PUT):  Add some error checking.
8972         (push_int_const):  Remove reundant NOTE_PUSH.
8973         (generate_bytecode_insns - case STRING_CST):  Do NOTE_PUSH.
8974         (- case SWITCH_EXPR):  Fix code generation bug.
8975         (- case PREDECREMENT_EXPR etc):  Remove redundant NOTE_PUSH.
8976         (generate_classfile):  More robust for abstract methods.
8977
8978 Sun Nov 15 13:52:39 1998  Anthony Green  <green@cygnus.com>
8979
8980         * Makefile.in: jv-scan and jvgenmain all require libiberty.
8981         * Make-lang.in: Ditto.
8982
8983         * jv-scan.c: Remove xmalloc and xstrdup definitions.
8984         * jvgenmain: Ditto.
8985
8986 Sun Nov 15 14:10:56 1998  Per Bothner  <bothner@cygnus.com>
8987
8988         * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
8989
8990         * jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.
8991
8992 Sat Nov 14 17:19:18 1998  Per Bothner  <bothner@cygnus.com>
8993
8994         Allow uses of interface types to verify.  This is not really
8995         type-safe, but it matches what Sun does, and is OK as long as
8996         there are appropriate run-time checks.
8997         * verify.c (merge_types):  If merging two interface types,
8998         just set the result to java.lang.Object.
8999         * expr.c (pop_type):  Any interface is matches by java.lang.Object.
9000
9001 1998-11-13  Tom Tromey  <tromey@cygnus.com>
9002
9003         * gjavah.c (main): Handle --output-class-directory argument.
9004         * jvspec.c (lang_specific_driver): Translate `-d' into
9005         -foutput-class-dir.
9006         * jcf.h (jcf_write_base_directory): Declare.
9007         * lang.c (lang_decode_option): Recognize -foutput-class-dir.
9008         * lang-options.h: Mention -foutput-class-dir.
9009         * jcf-write.c (jcf_write_base_directory): New global.
9010         (make_class_file_name): Put generated .class file into `-d'
9011         directory, or into source directory if -d not given.  Function now
9012         static.
9013         (write_classfile): Free class file name.  Handle case where class
9014         file name is NULL.
9015         (DIR_SEPARATOR): New macro.
9016         Include <sys/stat.h>
9017
9018         * Makefile.in (prefix): New macro.
9019
9020 Thu Nov 12 14:15:07 1998  Per Bothner  <bothner@cygnus.com>
9021
9022         * parse.y (patch_invoke):  Do less if flag_emit_class_files.
9023         * expr.c (build_known_method_ref):  Don't check flag_emit_class_files
9024         here (done in patch_invoke instead).
9025         (case_identity):  Moved here from parse.y.
9026
9027         * java-tree.h (CAN_COMPLETE_NORMALLY):  New macro.
9028         * parse.y (java_complete_tree etc):  Maybe set CAN_COMPLETE_NORMALLY.
9029         * parse.y (java_complete_tree):  Re-order COMPOUND_EXPR in BLOCK
9030         so they can be efficiently scanned without recursion.
9031         Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
9032         * expr.c (java_lang_expand_expr):  Expand statements of COMPOUND_EXPR
9033         in BLOCK iteratively, rather than recursively.
9034
9035         * parse.y (do_unary_numeric_promotion):  New function.
9036         (patch_unaryop, patch_binop, patch_array_ref):  Use it.
9037
9038         * parse.y (patch_newarray):  Various fixes.
9039
9040         Re-do handling of switch statements (for proper block scoping).
9041         * parse.y:  Add just a single block for the enture switch block,
9042         but don't create any "case blocks".
9043         (group_of_labels):  Rmeoved unneeded non-terminal.
9044         CASE_EXPR and DEFAULT_EXPR are added to current block.
9045         * expr.c (java_lang_expand_expr):  Inline SWITCH_EXPR here.
9046         Now also need to handle CASE_EXPR and DEFAULT_EXPR.
9047         * java-tree.h (SWITCH_HAS_DEFAULT):  New macro.
9048         * parse.y (wfl_operator, print_int_node): Make non-static.
9049         (java_complete_tree):  CASE_EXPR and DEFAULT_EXPR are now processed
9050         as part of recursive scan of block.
9051         (java_expand_switch ):  Removed - inlined into java_lang_expand_expr.
9052         (patch_switch_statement):  Most tests move dinto java_complete_tree.
9053
9054         * parse.y:  Make various production be non-typed (void).
9055         * parse.y (parse_error):  Merged into issue_warning_error_from_context.
9056         * parse.y (add_stmt_to_compound):  Don't create/change extra node.
9057         (patch_method_invocation_stmt):  Renamed to patch_method_invocation.
9058
9059         * jcf-write.c (struct jcf_handler):  New type.
9060         (struct jcf_switch_state):  New type.
9061         (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC):  New relocation kinds.
9062         (alloc_handler, emit_unop, emit_reloc):  New functions.
9063         (adjust_typed_op):  Add extra parameter ("max type" offset).
9064         (emit_switch_reloc, emit_case-reloc):  New function.
9065         (generate_bytecode_conditional):  Handle REAL_TYPE comparisons.
9066         (generate_bytecode_insns):  Support REAL_CST, switch statements,
9067         exception handling, method calls, object/array creation, and more.
9068
9069         * class.c:  Remove some unused variables.
9070         * constants.c (find_string_constant):  New function.
9071         (count_constant_pool_bytes):  Fix to correctly handle wide constants.
9072         * decl.c (complete_start_java_method):  Don't _Jv_InitClass
9073         if flag_emit_class_files.
9074
9075 1998-11-12  Tom Tromey  <tromey@cygnus.com>
9076
9077         * jcf-io.c (find_class): Added explanatory comment.
9078
9079         * jcf-path.c (add_entry): Look for `.zip' at end of filename.  Add
9080         trailing slash to `.zip' entries.
9081
9082         * jvspec.c (lang_specific_driver): Correctly handle case where
9083         GC_NAME not defined.
9084
9085 1998-11-11  Tom Tromey  <tromey@cygnus.com>
9086
9087         * jvspec.c (GC_NAME): New define.
9088         (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
9089         if required.
9090         * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
9091
9092 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
9093
9094         * jcf-dump.c (TABLE_SWITCH):  Fix typos.
9095
9096 1998-11-11  Tom Tromey  <tromey@cygnus.com>
9097
9098         * jcf-dump.c (main): Correctly recognize `--'-style long options.
9099
9100 Tue Nov 10 12:34:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9101
9102         * class.c (is_compiled_class): Call safe_layout_class for class
9103         compiled from source.
9104         * conver.h (convert_to_integer, convert_to_real,
9105         convert_to_pointer): Added prototypes.
9106         * decl.c (init_decl_processing): Non longer push the decls of
9107         `methodtable', `constants', `Class', `Field', `dispatchTable'
9108         `jexception' and `Method'.
9109         * expr.c (build_invokeinterface): New function.
9110         (expand_invoke): static variable CLASS_IDENT now in
9111         build_invokeinterface. Use build_invokeinterface.
9112         (expand_java_field_op): Moved code to inline
9113         java.lang.PRIMTYPE.TYPE into a function.
9114         (build_primtype_type_ref): New function.
9115         * java-tree.def (INSTANCEOF_EXPR): New tree code.
9116         * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
9117         FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
9118         (DECL_CONSTRUCTOR_P): Fixed typo in comment.
9119         (DECL_LOCAL_STATIC_VALUE): New macro.
9120         (build_invokeinterface, build_primtype_type_ref): New function
9121         prototypes.
9122         (java_parse_abort_on_error): Macro rewritten.
9123         * jcf-parse.c (current_method): Add comment to declaration.
9124         (parse_zip_file_entries, process_zip_dir, void parse_source_file):
9125         Function prototypes fixed.
9126         (jcf_parse_source): push/pop parser context. save/restore global.
9127         (parse_source_file): Fixed leading comment. Now take a
9128         IDENTIFIER_NODE as an argument. Doesn't check methods, layout
9129         classes and pop the parser context anymore.
9130         (yyparse): Push parser context, save globals, parse the source
9131         file, restore globals and pop the parser context when processing a
9132         source file.
9133         * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
9134         * lex.c (java_parse_doc_section): New function.
9135         (java_lex): Call java_parse_doc_section when appropriate. Build an
9136         operator around INSTANCEOF_TK.
9137         * lex.h (java_lineterminator, java_sprint_unicode,
9138         java_unicode_2_utf8, java_lex_error, java_store_unicode):
9139         Prototypes rewritten.
9140         (java_parse_escape_sequence, java_letter_or_digit_p,
9141         java_parse_doc_section, java_parse_end_comment, java_get_unicode,
9142         java_read_unicode, java_store_unicode, java_read_char,
9143         java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
9144         Added function prototypes.
9145         * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
9146         define.
9147         (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
9148         New macros
9149         (struct parser_ctxt): New fields: deprecated,
9150         current_parsed_class_un, gclass_list.
9151         (fix_method_argument_names, issue_warning_error_from_context,
9152         resolve_package, lookup_package_type): New function prototypes.
9153         (resolve_expression_name): Fixed function prototype.
9154         (find_applicable_accessible_methods_list): Fixed indentation, added
9155         extra argument in prototype.
9156         (check_final_assignment, build_null_of_type, check_deprecation,
9157         check_method_redefinition, reset_method_name,
9158         java_check_regular_methods, java_check_abstract_methods,
9159         maybe_build_primttype_type_ref): New function prototype.
9160         * parse.y (conver.h): Include.
9161         (INSTANCEOF_TK): Tagged <operator>.
9162         (single_type_import_declaration): Use REGISTER_IMPORT macro.
9163         (relational_expression:): Build binop for instanceof.
9164         (java_push_parser_context): Remember ctxp->gclass_list across
9165         contexts.
9166         (java_pop_parser_context): Simply return if no context
9167         exists. Remember gclass_list across contexts.
9168         (issue_warning_error_from_context): New function.
9169         (parse_error_context): Don't setup ctxp->elc here. Call
9170         issue_warning_error_from_context instead.
9171         (parse_warning_context): Likewise.
9172         (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
9173         setup. Link new class/interface to ctxp->gclass_list.
9174         (add_superinterfaces): Register interface as incomplete if not
9175         loaded.
9176         (create_class): Remember class unqualified name in
9177         ctxp->current_parsed_class_un. Check class deprecation.
9178         (register_fields): Check field deprecation. Remember static final
9179         field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
9180         processing INIT.
9181         (method_header): New local variable ORIG_ARG. Use unqualified
9182         current class name for check on constructor errors. Promote return
9183         type if of record type. Argument list fix moved in
9184         fix_method_argument_names, called here. Check method deprecation.
9185         (fix_method_argument_names): New function.
9186         (method_declarator): Promote record typed arguments.
9187         (safe_layout_class): Check class methods before layout.
9188         (java_complete_class): Compute field layout when patched.
9189         (do_resolve_class): Try to load class after having it renamed
9190         after the package name.
9191         (get_printable_method_name): Use DECL_CONTEXT.
9192         (reset_method_name): New function.
9193         (check_method_redefinition): Use reset_method_name.
9194         (java_check_regular_methods): New local variable
9195         SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
9196         names for error report. Check for compile-time error when method
9197         found has default (package) access.
9198         (java_check_abstract_methods): Now takes an interface DECL node as
9199         an argument. Also reinstall real name on unchecked
9200         overriding/hiding methods for error report.
9201         (java_check_methods): Fixed leading comment. Get classes to verify
9202         from ctxp->gclass_list. Use CHECK_METHODS macro and set
9203         CLASS_METHOD_CHECKED_P on class verification.
9204         (lookup_java_method2): Get real method name if necessary.
9205         (find_in_imports): Don't check package class access here.
9206         (resolve_package, lookup_package_type): New functions.
9207         (java_layout_classes): Fixed leading comment. Take classes to be
9208         laid out from ctxp->gclass_list.
9209         (java_complete_expand_methods): Don't expand native and abstract
9210         methods.
9211         (java_expand_classes): New function.
9212         (resolve_expression_name): Use additional argument ORIG.  Retrieve
9213         values of static final field of primitive types.
9214         (resolve_field_access): Handles static final field of promotive
9215         type.
9216         (resolve_qualified_expression_name): Handle STRING_CST as
9217         primaries and package name resolution. Check deprecation on found
9218         decls. Set where_found and type_found on non static field resolved
9219         during qualification. Layout non primitive field decl types.
9220         (check_deprecation): New function.
9221         (maybe_access_field): Simplified.
9222         (patch_method_invocation_stmt): Local variable CLASS_TYPE
9223         removed. Reverse method's argument when primary is a type. Don't
9224         use CLASS_TYPE to report problems, use IDENTIFIER_WFL
9225         instead. Include abstract class in the list of class searchable
9226         for constructors. Use DECL_CONTEXT of found method for access
9227         checks. Check method deprecation.
9228         (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
9229         converting arguments. Handle INVOKE_INTERFACE.
9230         (lookup_method_invoke): Search constructor using existing
9231         infrastructure (don't rely on lookup_java_constructor anymore).
9232         (find_applicable_accessible_methods_list): Extra argument flag
9233         LC. Now include constructor in the search.
9234         (qualify_ambiguous_name): Conditional expression are primaries.
9235         (not_initialized_as_it_should_p): static final are always
9236         initialized.
9237         (java_complete_tree): Pass extra NULL argument to
9238         resolve_expression_name. Stricter test to carry on patching
9239         assignments. New case for INSTANCEOF_EXPR.
9240         (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
9241         (check_final_assignment, maybe_build_primttype_type_ref): New
9242         functions.
9243         (patch_assignment): Detect resolved static finals and carry normal
9244         assignment error check on them. Inline PRIMTYPE.TYPE read access.
9245         (try_builtin_assignconv): Access constant 0 on all primitive
9246         types.
9247         (valid_builtin_assignconv_identity_widening_p): Accept identical
9248         types. Accept all promoted type on int type.
9249         (valid_ref_assignconv_cast_p): Accept a null pointer to be
9250         assigned to a reference.
9251         (valid_method_invocation_conversion_p): Accept to check null
9252         pointers.
9253         (build_binop): Merge declaration and initialization of local
9254         variable BINOP.
9255         (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
9256         numeric types. Improved validity test for qualify operators on
9257         references.
9258         (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
9259         and PREINCREMENT_EXPR. Also detect resolved static finals of a
9260         primitive type and issue the appropriate error message.
9261         (resolve_type_during_patch): Mark class loaded when resolved.
9262         (patch_cast): Allow null to be cased to reference types.
9263         (build_null_of_type): New function.
9264         (patch_array_ref): Handle array on references correctly.
9265         (patch_return): Removed unused local variable MODIFY. Force
9266         boolean to be returned as integers. Allows null to be returned by
9267         a function returning a reference.
9268         * typeck.c (convert_to_integer, convert_to_real,
9269         convert_to_pointer): Prototypes moved to convert.h
9270         (lookup_argument_method): Use method real name, if necessary.
9271
9272 1998-10-30  Tom Tromey  <tromey@cygnus.com>
9273
9274         * class.c (build_class_ref): Changed name of primitive classes to
9275         start with `_Jv_'.
9276
9277         * class.c (make_class_data): Renamed fields: nmethods to
9278         method_count, method_count to dtable_method_count.  Always set
9279         `state' field to 0.
9280         * decl.c (init_decl_processing): Likewise.
9281
9282 Wed Oct 28 08:03:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9283
9284         * class.c (layout_class): Don't mangle <finit>, produce
9285         __finit<class> instead. Don't verify artificial methods.
9286         * decl.c (finit_identifier_node): New declared global.
9287         (init_decl_processing): finit_identifier_node initialized.
9288         * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
9289         * java-tree.h (finit_identifier_node): Declared as extern.
9290         (struct lang_decl): New field called_constructor.
9291         (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
9292         (CLASS_HAS_FINIT_P): New macro.
9293         (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
9294         explicit constructor invocation.
9295         (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
9296         CALL_SUPER_CONSTRUCTOR_P): New macros.
9297         (write_classfile): Added prototype.
9298         * jcf-parse.c (jcf_parse_source): Parse and remember for
9299         generation if the file was seen on the command line.
9300         (parse_source_file): Don't write the class file here.
9301         (yyparse): Loop on files rewritten. Set current_jcf.
9302         (parse_zip_file_entries): Parse class file only if it was found.
9303         * lang.c (init_parse): Don't open command line provided filename
9304         here.
9305         (lang_parse): Don't set main_jcf anymore.
9306         * parse.h (ABSTRAC_CHECK): Capitalized arguments.
9307         (JCONSTRUCTOR_CHECK): New macro.
9308         (JBSC_TYPE_P): New macro.
9309         (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
9310         (COMPLETE_CHECK_OP_2): New macro.
9311         (struct parse_ctxt): New field explicit_constructor_p.
9312         (check_class_interface_creation): Fixed prototype indentation.
9313         (patch_method_invocation_stmt): Prototype reflects added argument.
9314         (patch_invoke): Likewise.
9315         (complete_method_declaration, build_super_invocation,
9316         verify_constructor_circularity,
9317         build_this_super_qualified_invocation, get_printable_method_name,
9318         patch_conditional_expr, maybe_generate_finit, fix_constructors,
9319         verify_constructor_super, create_artificial_method,
9320         start_artificial_method_body, end_artificial_method_body,
9321         generate_field_initialization_code): New function prototypes.
9322         * parse.y: Fixed leading comment
9323         (constructor_header:, constructor_body:, block_end:): Rules tagged
9324         <node>.
9325         (type_declaration:): Call maybe_generate_finit.
9326         (method_declaration:): Action for method_body: placed in new
9327         function complete_method_declaration, called here.
9328         (constructor_declaration:): Defined actions. Removed leading
9329         FIXME.
9330         (constructor_header:): New rule with action.
9331         (constructor_body:): Rule rewritten using block_begin: and
9332         block_end:. Defined actions.
9333         (constructor_declarator:, explicit_constructor_invocation:):
9334         Defined actions.
9335         (block:): Use new rules block_begin: block_end:.
9336         (block_begin:, block_end:): New rules and actions.
9337         (block_statements:): Fixed error message for explicit
9338         constructors.
9339         (method_invocation:): Call build_this_super_qualified_invocation
9340         if primary is `this' or `super' was seen.
9341         (conditional_expression:): Action defined.
9342         (extra_ctxp_pushed_p): New static global flag.
9343         (java_parser_context_save_global): Create parser context if
9344         necessary. Use extra_ctxp_pushed_p to remember it.
9345         (java_parser_context_restore_global): Pop extra parser context if
9346         one exists.
9347         (build_array_from_name): Array on primitive types are marked
9348         loaded.
9349         (register_fields): Restore new name in field initializer
9350         expression if type was altered. Non static fields initialized upon
9351         declaration marked initialized.
9352         (maybe_generate_finit): New function.
9353         (maybe_generate_clinit): Use create_artificial_method,
9354         start_artificial_method_body, end_artificial_method_body. Generate
9355         debug info for enclosed initialization statements.
9356         (method_header): Fixed leading comment. Check constructor
9357         flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
9358         accordingly.
9359         (complete_method_declaration, constructor_circularity_msg,
9360         verify_constructor_circularity): New functions.
9361         (get_printable_method_name): New function.
9362         (check_method_redefinition): Don't rename <finit> methods. Fix
9363         declared constructor names. Error message for
9364         constructors modified.
9365         (java_check_regular_methods): Local variable seen_constructor
9366         renamed saw_constructor. Skip verification on constructors. Create
9367         default constructor with create_artificial_method.
9368         (java_check_methods): Removed unnecessary empty line.
9369         (create_artificial_method, start_artificial_method_body,
9370         end_artificial_method_body): New functions.
9371         (java_layout_classes): Changed leading comment. Reverse fields
9372         list if necessary. Always layout java.lang.Object if being
9373         defined.
9374         (java_complete_expand_methods): Verify constructor circularity.
9375         (java_complete_expand_method): Call fix_constructor on
9376         constructors.  Local variable no_ac_found removed. Restore
9377         bindings if method body expansion failed.
9378         (fix_constructors, verify_constructor_super,
9379         generate_field_initialization_code): New function.
9380         (java_expand_classes): Fixed leading comment. Write class file
9381         here.
9382         (resolve_expression_name): Check for illegal instance variable
9383         usage within the argument scope of an explicit constructor
9384         invocation.
9385         (resolve_qualified_expression_name): Pass extra from_super flag
9386         when invoking patch_method_invocation_stmt. New case for
9387         conditional expression when used as a primary. Check for error
9388         when acquiring super.
9389         (patch_method_invocation_stmt): Added extra argument super. New
9390         local variable is_static_flag. Set class_to_search according to
9391         the nature of the constructor invocation. Don't add `this'
9392         argument when expanding NEW_CLASS_EXPR. Check for illegal method
9393         invocation within the argument scope of explicit constructor
9394         invocation. Set is_static according to is_static_flag. Provide
9395         extra `super' argument to patch_invoke invocation.
9396         (patch_invoke): New argument from_super. Loop on arguments
9397         indentation fixed. Pass from_super to invocation_mode. New switch
9398         case INVOKE_SUPER. Fixed error message in switch default case.
9399         Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
9400         value.
9401         (invocation_mode): Return INVOKE_SUPER mode when appropriate.
9402         (lookup_method_invoke): Fixed prototypes in candidates list. Error
9403         message takes constructors into account.
9404         (find_applicable_accessible_methods_list): Fixed indentation.
9405         (qualify_ambiguous_name): Take explicit constructor invocation
9406         into account. Deal with a conditional expression as a primary to
9407         a method call.
9408         (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
9409         case. Added extra argument to patch_method_invocation_stmt.
9410         Register calls made to explicit constructor `this'. Don't call
9411         save_expr in ARRAY_REF case when emitting class files. Check for
9412         illegal use of this when expanding explicit constructor invocation
9413         arguments.
9414         (complete_function_arguments): Set and reset parser context
9415         explicit_constructor_p field value when appropriate.
9416         (build_super_invocation, build_this_super_qualified_invocation):
9417         New functions.
9418         (patch_assignment): Fixed typo.
9419         (patch_unaryop): Check on final fields occurs only when a decl
9420         exits.
9421         (patch_return): Take constructors into account.
9422         (patch_conditional_expr): New function.
9423         * typeck.c (build_java_signature): Removed unnecessary empty line.
9424
9425 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
9426
9427         * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
9428
9429 1998-10-28  Tom Tromey  <tromey@cygnus.com>
9430
9431         * decl.c (init_decl_processing): Renamed fields.
9432         * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
9433         interface_len, msize fields.
9434
9435         * class.c (make_class_data): Removed subclass_head and
9436         subclass_next fields.
9437         * decl.c (init_decl_processing): Removed subclass_head and
9438         subclass_next fields.
9439
9440 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
9441
9442         * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
9443         * mangle.c (emit_unicode_mangled_name): Similarly.
9444
9445 Mon Oct 26 12:17:23 1998  Nick Clifton  <nickc@cygnus.com>
9446
9447         * jcf-parse.c (get_constant): Place braces around code to compute
9448         'd' when REAL_ARITHMETIC is not defined.
9449
9450 Sun Oct 25 14:58:05 1998  H.J. Lu  (hjl@gnu.org)
9451
9452         * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
9453         dependency.
9454
9455 1998-10-23  Tom Tromey  <tromey@cygnus.com>
9456
9457         * lang-specs.h: `.zip' files are input to jc1.
9458
9459 Thu Oct 22 23:01:54 1998  Per Bothner  <bothner@cygnus.com>
9460
9461         * jvspecs.c:  Add (but don't enable) support for combining multiple
9462         .class and .java input filenames to a single jc1 invocation.
9463         Add support for -C flag (copile to .class files).
9464         Translate -classpath and -CLASSPATH arguments.
9465         * lang-specs.h:  Don't set %2 spec.
9466
9467 1998-10-22  Tom Tromey  <tromey@cygnus.com>
9468
9469         * jcf-path.c (add_entry): Don't add trailing separator if entry is
9470         a .zip file.
9471         (add_path): Don't add trailing separator to non-empty path
9472         elements.
9473
9474         * lang.c (lang_decode_option): Check for -fclasspath and
9475         -fCLASSPATH before examining other `-f' options.
9476
9477         * java-tree.h (finalize_identifier_node): Don't declare.
9478         * class.c (make_class_data): Don't push "final" field.
9479         * decl.c (init_decl_processing): Don't push "final" field.
9480         (finalize_identifier_node): Removed.
9481         (init_decl_processing): Don't set finalize_identifier_node.
9482
9483         * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
9484
9485 Sun Oct 11 10:31:52 1998  Anthony Green  <green@cygnus.com>
9486
9487         * Make-lang.in (java): Depend on jcf-dump and jv-scan.
9488         (JV_SCAN_SOURCES): New macro.
9489         (JCF_DUMP_SOURCES): Likewise.
9490         (jcf-dump$(exeext)): New target.
9491         (jv-scan$(exeext)): New target.
9492
9493 1998-10-22  Tom Tromey  <tromey@cygnus.com>
9494
9495         * Makefile.in (LEX): Removed.
9496         (LEXFLAGS): Likewise.
9497         (SET_BISON): New macro.
9498         (BISON): Removed.
9499         ($(PARSE_C)): Use SET_BISON.  Run bison from srcdir to avoid
9500         spurious diffs in parse.c.
9501         ($(PARSE_SCAN_C)): Likewise.
9502         (PARSE_DIR): New macro.
9503         (PARSE_C): Use it.
9504         (PARSE_SCAN_C): Likewise.
9505         (PARSE_RELDIR): New macro.
9506
9507         * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
9508
9509         * jcf-io.c (find_class): Use saw_java_source to determine when to
9510         look for `.java' file.
9511         * jcf-parse.c (saw_java_source): New global.
9512         (yyparse): Set it if `.java' file seen.
9513
9514         * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
9515         (GCJH_SOURCES): Likewise.
9516         * Makefile.in (datadir): New macro.
9517         (libjava_zip): Likewise.
9518         (JAVA_OBJS): Added jcf-path.o.
9519         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
9520         (../gcjh$(exeext)): Likewise.
9521         (jcf-path.o): New target.
9522         * java-tree.h (fix_classpath): Removed decl.
9523         * jcf-parse.c (fix_classpath): Removed.
9524         (load_class): Don't call fix_classpath.
9525         * parse.y (read_import_dir): Don't call fix_classpath.
9526         * lex.h: Don't mention classpath.
9527         * lex.c (java_init_lex): Don't initialize classpath.
9528         * jcf-io.c (classpath): Removed global.
9529         (find_class): Use jcf_path iteration functions.  Correctly search
9530         class path for .java file.
9531         (open_in_zip): New argument `is_system'.
9532         * jcf-dump.c (main): Call jcf_path_init.  Recognize all new
9533         classpath-related options.
9534         * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
9535         and -I.
9536         (lang_init): Call jcf_path_init.
9537         * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
9538         * lang-specs.h: Handle -I.  Minor cleanup to -M options.
9539         Correctly put braces around second string in each entry.
9540         * gjavah.c (main): Call jcf_path_init.  Recognize all the new
9541         classpath-related options.
9542         (help): Updated for new options.
9543         * jcf.h: Declare functions from jcf-path.c.  Don't mention
9544         `classpath' global.
9545         * jcf-path.c: New file.
9546
9547         * jcf-depend.c: Include jcf.h.
9548
9549         * jcf-write.c (localvar_alloc): Returns `void'.
9550         (localvar_free): Removed unused variable.
9551
9552         * lang.c (OBJECT_SUFFIX): Define if not already defined.
9553         (init_parse): Use OBJECT_SUFFIX, not ".o".
9554
9555 Wed Oct 21 07:54:11 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9556
9557         * class.c (emit_register_classes): Renamed from
9558         emit_register_class.
9559         * java-tree.h (emit_register_classes): Prototype renamed from
9560         emit_register_class.
9561         * jcf-parse.c (yyparse): Call emit_register_classes once before
9562         returning.
9563         * parse.y (java_expand_classes): No longer register classes.
9564
9565 Tue Oct 20 09:15:38 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9566
9567         * class.c (is_compiled_class): New local variable
9568         seen_in_zip. Identify classes found in currently compiled source
9569         file(s).
9570         * decl.c (complete_start_java_method): Fixed typo.
9571         * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
9572         HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
9573         (CLASS_P): Moved around.
9574         (java_parse_abort_on_error): Macro moved from jcf-parse.c
9575         * jcf-parse.c (java_parse_abort_on_error): Macro moved to
9576         java-parse.h
9577         (jcf_parse_source): Changed leading comment. Removed unnecessary
9578         fclose and CLASS_FROM_SOURCE_P marking.
9579         (parse_source_file): New local variables remember_for_generation
9580         and filename. Mark parsed file name identifier node. Removed block
9581         executed when parse_only was null. Set remember_for_generation.
9582         Use it as an argument to java_pop_parser_context.
9583         (yyparse): New local variables several_files, list, next node and
9584         current_file_list. Split ampersand separated file names into
9585         current_file_list. Iterate through the list and parse accordingly.
9586         * parse.h (java_pop_parser_context): New function prototype.
9587         * parse.y (ctxp_for_generation): New static global variable.
9588         (java_pop_parser_context): New argument generate. Link popped ctxp
9589         to ctxp_for_generation list accordingly.
9590         (java_complete_expand_methods): Fixed indentation.
9591         (java_expand_classes): New function.
9592
9593 Sat Oct 17 11:25:21 1998  Per Bothner  <bothner@cygnus.com>
9594
9595         * Makefile.in:  Link with libiberty.a instead of memmove.o.
9596
9597 Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9598
9599         * lex.c (setjmp.h): No longer included.
9600         * lex.h (setjmp.h): Included.
9601         * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
9602         (duplicate_declaration_error_p): Renamed from
9603         duplicate_declaration_error.
9604         (build_array_from_name): New function prototype.
9605         * parse.y (setjmp.h): No longer included.
9606         (variable_declarator_id): Define action.
9607         (build_array_from_name): New function.
9608         (duplicate_declaration_error_p): Renamed from
9609         duplicate_declaration_error.  Fixed leading comment.
9610         (register_fields): Main `for' loop reorganized. Uses
9611         SET_TYPE_FOR_RESOLUTION and build_array_from_name.
9612         (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
9613         build_array_from_name.
9614         (resolve_class): Set CLASS_LOADED_P on newly build array dimension
9615         types.
9616         (read_import_dir): Don't try to skip `.' and `..'.
9617         (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
9618         build_array_from_name. Main `for' loop reorganized.
9619         (resolve_qualified_expression_name): When building access to a
9620         field, use the type where the field was found, not its own type.
9621         (maybe_access_field): Use field DECL_CONTEXT if the type where the
9622         field was found is null.
9623         (qualify_ambiguous_name): Sweep through all successive array
9624         dimensions.
9625
9626 Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9627
9628         * java-tree.h (pop_labeled_block, lang_printable_name,
9629         maybe_add_interface, set_super_info, get_access_flags_from_decl,
9630         interface_of_p, inherits_from_p, fix_classpath,
9631         complete_start_java_method, emit_handlers, init_outgoing_cpool,
9632         make_class_data, register_class, alloc_name_constant): New
9633         function prototypes.
9634         * lang.c (lang_decode_option): Set argc argument unused. Fixed
9635         indentation. Added cast to remove warning.
9636         (lang_printable_name): Set v argument unused.
9637         (lang_print_error): Added argument to lang_printable_name call.
9638         (java_dummy_print, print_lang_decl, print_lang_type,
9639         print_lang_identifier, lang_print_xnode): All argument marked
9640         unused.
9641         * lex.c (java_unget_unicode): Removed unnecessary argument.
9642         (java_allocate_new_line): Unused local variable is gone.
9643         (java_read_char): Added parenthesis in expressions to remove
9644         warnings.  Added final return statement.
9645         (java_read_unicode): Added parenthesis in expression to remove
9646         warning.
9647         (java_parse_end_comment): Fixed java_unget_unicode invocation.
9648         (java_parse_escape_sequence): Likewise.
9649         (java_lex): Unused local variables are gone. Fixed
9650         java_unget_unicode invocation.
9651         * lex.h (set_float_handler): Prototype added when JC1_LITE not
9652         defined.
9653         * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
9654         lang_printable_name invocation in macro.
9655         (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
9656         Likewise.
9657         (duplicate_declaration_error): Suppressed unused argument in
9658         prototype.
9659         (identical_subpath_p): Function declaration is gone.
9660         (patch_invoke): Suppressed unused argument in prototype.
9661         (patch_cast, build_labeled_block, check_thrown_exceptions):
9662         Likewise.
9663         * parse.y (setjmp.h): Included
9664         (toplev.h): Likewise.
9665         (field_declaration:): Suppressed unused local
9666         (label_decl:): Fixed build_labeled_block invocation.
9667         (java_pop_parser_context): Put extra parenthesis around assignment
9668         in if.
9669         (yyerror): Suppressed unused local variables.
9670         (variable_redefinition_error): Fixed lang_printable_name
9671         invocation.
9672         (create_interface): Suppressed unused local variables.
9673         (create_class): Likewise.
9674         (duplicate_declaration_error): Suppressed unused argument. Fixed
9675         lang_printable_name invocation.
9676         (register_fields): Suppressed unused local variable. Fixed
9677         duplicate_declaration_error invocation.
9678         (method_header): Suppressed unused local variable.
9679         (method_declarator, parser_check_super): Likewise.
9680         (java_complete_class): Suppressed unused local variable. Fixed
9681         fatal error message.
9682         (complete_class_report_errors): Added default: in switch.
9683         (java_check_regular_methods): Fixed lang_printable_name
9684         invocations.
9685         (check_throws_clauses): Likewise.
9686         (java_check_abstract_methods): Suppressed unused local
9687         variable. Fixed lang_printable_name invocation.
9688         (read_import_entry): Added supplemental return statement.
9689         (read_import_dir): Suppressed unused local variables.
9690         (check_pkg_class_access, declare_local_variables): Likewise.
9691         (source_start_java_method): Suppressed unused extern variable
9692         declarations
9693         (expand_start_java_method): Suppressed unused extern and local
9694         variable declarations.
9695         (java_complete_expand_methods): Likewise.
9696         (java_complete_expand_method): Suppressed unused local variables.
9697         (make_qualified_name): Likewise.
9698         (resolve_qualified_expression_name): Added default: in
9699         switch. Fixed lang_printable_name invocation.
9700         (class_instance_creation_expression): Added parenthesis around
9701         expressions.
9702         (patch_method_invocation_stmt): Fixed lang_printable_name and
9703         patch_invoke invocations.
9704         (check_for_static_method_reference): Fixed lang_printable_name
9705         invocation.
9706         (patch_invoke): Suppressed unused arguments and local variables.
9707         (lookup_method_invoke): Suppressed unused local variables.
9708         (qualify_ambiguous_name): Added default: in switch.
9709         (identical_subpath_p): Function removed.
9710         (patch_assignment): Suppressed unused local variables. Suppressed
9711         unnecessary if statement. Fixed lang_printable_name invocations.
9712         (try_builtin_assignconv): Fixed lang_printable_name invocations.
9713         (valid_ref_assignconv_cast_p): Parenthesis around
9714         expression. Suppressed unused local variables.
9715         (build_binop): Suppressed unused local variables. fixed
9716         lang_printable_name invocations.
9717         (string_constant_concatenation): Suppressed unused local
9718         variables.
9719         (patch_unaryop): Fixed lang_printable_name invocation.
9720         (patch_cast): Suppressed unnecessary argument. Fixed
9721         lang_printable_name invocation.
9722         (patch_array_ref): Fixed lang_printable_name invocation.
9723         (patch_newarray, patch_return, patch_if_else_statement): Likewise.
9724         (build_labeled_block): Suppressed unused argument.
9725         (generate_labeled_block): Fixed build_labeled_block invocation.
9726         (build_loop_body): Suppressed unused local variables.
9727         (patch_loop_statement): Likewise.
9728         (patch_exit): Fixed lang_printable_name invocation.
9729         (patch_switch_statement): Likewise.
9730         (case_identity): First argument marked unused.
9731         (patch_try_statement): Fixed lang_printable_name invocations.
9732         (patch_synchronized_statement, patch_throw_statement): Likewise.
9733         (check_thrown_exceptions): Fixed check_thrown_exceptions and
9734         lang_printable_name invocations.
9735         (check_thrown_exceptions_do): Suppressed unused argument.
9736
9737 1998-10-14  Tom Tromey  <tromey@cygnus.com>
9738
9739         * jcf-write.c (write_classfile): Add output class file as target.
9740         * lang-options.h: Added -MD, -MMD, -M, and -MM.
9741         * jcf.h: Added declarations for dependency-tracking functions.
9742         * lang-specs.h: Handle -M, -MM, MD, and -MMD.
9743         * lang.c (lang_decode_option): Recognize -MD and -MMD.
9744         (finish_parse): Call jcf_dependency_write.
9745         (dependency_tracking): New global.
9746         (DEPEND_SET_FILE): New define.
9747         (DEPEND_ENABLE): New define.
9748         (init_parse): Enable dependency tracking if required.
9749         Include "flags.h".
9750         * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
9751         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
9752         (../gcjh$(exeext)): Likewise.
9753         (jcf-depend.o): New target.
9754         * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
9755         (GCJH_SOURCES): Likewise.
9756         * jcf-io.c (open_class): Call jcf_dependency_add_file.  Added
9757         dep_name argument.
9758         (find_classfile): Added dep_name argument.
9759         (find_class): Compute name of dependency.
9760         (open_in_zip): Call jcf_dependency_add_file.
9761         * gjavah.c (output_file): No longer global.
9762         (usage): Don't mention "gjavah".
9763         (help): Likewise.
9764         (java_no_argument): Likewise.
9765         (version): Likewise.
9766         (main): Recognize and handle -M family of options.
9767         (print_mangled_classname): Return is void.
9768         (process_file): Handle case where output is suppressed.
9769         (HANDLE_END_FIELD): Likewise.
9770         (HANDLE_METHOD): Likewise.
9771         * jcf-depend.c: New file.
9772
9773 Tue Oct 13 23:34:12 1998  Jeffrey A Law  (law@cygnus.com)
9774
9775         * java-tree.def: Add missing newline at EOF.
9776
9777 1998-10-13  Tom Tromey  <tromey@cygnus.com>
9778
9779         * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
9780         (main): Likewise.  Exit with SUCCESS_EXIT_CODE at end of
9781         function.
9782         Include <config.h> and "system.h".
9783         (disassemble_method): Undefine RET to avoid clash with
9784         config/i386/i386.h.
9785
9786 Tue Oct 13 03:50:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9787
9788         * decl.c (runtime_exception_type_node, error_exception_type_node):
9789         New global variables.
9790         (init_decl_processing): Initialized.
9791         * expr.c (java_lang_expand_expr): Set caught exception type to
9792         null if catch handler argument doesn't exit.
9793         * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
9794         tree codes.
9795         * java-tree.h (runtime_exception_type_node,
9796         error_exception_type_node): Global variables declared.
9797         (DECL_FUNCTION_THROWS): New macro.
9798         (DECL_FUNCTION_BODY): Modified comment.
9799         (DECL_SPECIFIC_COUNT): Likewise.
9800         (struct lang_decl): New field throws_list.
9801         (IS_UNCHECKED_EXPRESSION_P): New macro.
9802         * lex.c (java_lex): Generate location information for THROW_TK.
9803         * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
9804         EXCEPTIONS_P): New macros.
9805         (enum jdep_code): New value JDEP_EXCEPTION.
9806         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
9807         BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
9808         PATCH_METHOD_RETURN_ERROR): New macros.
9809         (patch_method_invocation_stmt): Added new argument to prototype.
9810         (patch_synchronized_statement, patch_throw_statement,
9811         check_thrown_exceptions, check_thrown_exceptions_do,
9812         purge_unchecked_exceptions, check_throws_clauses): New function
9813         prototypes.
9814         * parse.y Fixed typo in keyword section.
9815         (throw:): Rule tagged <node>.
9816         (THROW_TK): Keyword tagged <operator>.
9817         (method_header:): Last argument to call to method_header passed
9818         from throws: rule.
9819         (throws:, class_type_list:, throw_statement:,
9820         synchronized_statement:, synchronized:): Defined actions.
9821         (method_header): New local variable current. Register exceptions
9822         from throws clause.
9823         (java_complete_tree): Complete and verify exceptions from throws
9824         clause.
9825         (complete_class_report_errors): Error message on exceptions not
9826         found
9827         (java_check_regular_methods): Fixed typo. Shortcut on private
9828         overriding methods. Changed error message on method
9829         redefinition. Check for throws clause compatibility.
9830         (check_throws_clauses): New function.
9831         (java_check_abstract_methods): Use DECL_NAME for wfl or current
9832         method. Changed error message on method redefinition.
9833         (currently_caught_type_list): New static variable.
9834         (java_complete_expand_methods): Purge unchecked exceptions from
9835         throws clause list. Call PUSH_EXCEPTIONS before walk and
9836         POP_EXCEPTIONS after.
9837         (resolve_qualified_expression_name): Pass new argument as NULL to
9838         patch_method_invocation_stmt.
9839         (patch_method_invocation_stmt): New argument ref_decl. Invoke
9840         PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
9841         argument list when appropriate. Use new argument if non null to
9842         store selected method decl.
9843         (patch_invoke): Convert if necessary args of builtin types before
9844         forming CALL_EXPR. Argument list no longer reversed here.
9845         (invocation_mode): Treat final methods as static methods.
9846         (java_complete_tree): New cases for THROW_EXPR: and
9847         SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
9848         function call.
9849         (complete_function_arguments): No more RECORD_TYPE
9850         conversion. Function parameter nodes no longer saved.
9851         (valid_ref_assignconv_cast_p): Avoid handling null type.
9852         (patch_binop): Fixed null constant reference handling.
9853         (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
9854         BUILD_THROW macros.
9855         (patch_try_statement): Fixed comments. Record caught types in
9856         list, push the list, expand try block and pop the list.
9857         (patch_synchronized_statement, patch_throw_statement,
9858         check_thrown_exceptions, check_thrown_exceptions_do,
9859         purge_unchecked_exceptions): New functions.
9860         * typeck.c (lookup_argument_method): Allow WFL in place of method
9861         DECL_NAME during method definition check
9862
9863 1998-10-09  Tom Tromey  <tromey@cygnus.com>
9864
9865         * gjavah.c (decode_signature_piece): New function.
9866         (print_c_decl): Use it.  Added `name_override' argument.
9867         (print_method_info): Use name_override argument to print_c_decl.
9868         (seen_fields): Removed.
9869         (print_field_info): Don't update seen_fields.
9870         (struct method_name): New structure.
9871         (method_name_list): New global.
9872         (print_method_info): Add new method to list of methods.
9873         (name_is_method_p): New function.
9874         (print_field_info): If field name has same name as method, then
9875         change field name.
9876         (process_file): Parse methods before fields.
9877         (field_pass): New global.
9878         (HANDLE_END_FIELD): Take field_pass into account.
9879
9880 Wed Oct  7 12:10:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9881
9882         * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
9883         (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
9884
9885 Sat Oct  3 13:29:46 1998  Anthony Green  <green@cygnus.com>
9886
9887         * jvspec.c: Fix bug in jvgenmain_spec patch.
9888
9889 Fri Oct  2 17:22:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9890
9891         * Makefile.in (lang.o:): Install dependency on java-tree.def.
9892         * decl.c (soft_exceptioninfo_call_node): New global variable.
9893         (init_decl_processing): Fixed indentation. soft_badarrayindex_node
9894         takes extra integer argument. soft_exceptioninfo_call_node
9895         initialized.
9896         * except.c (java_set_exception_lang_code): New function
9897         (method_init_exceptions): Called here.
9898         (prepare_eh_table_type): New function.
9899         (expand_end_java_handler): Called here.
9900         * expr.c (build_java_throw_out_of_bounds_exception): Now features
9901         one argument. Modified generation of call to
9902         soft_badarrayindex_node to use new argument.
9903         (build_java_arrayaccess): Pass faulty index value to
9904         build_java_throw_out_of_bounds_exception.
9905         (generate_name): New function.
9906         (java_lang_expand_expr): New local variables node, current,
9907         has_finally_p. Expand TRY_EXPR node.
9908         (process_jvm_instruction): Replace top of the stack with thrown
9909         object reference when entering exception handler.
9910         * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
9911         specific tree codes.
9912         * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
9913         global.
9914         (DECL_SPECIFIC_COUNT): New macro.
9915         (prepare_eh_table_type, java_set_exception_lang_code,
9916         generate_name): New function declarations.
9917         (match_java_method): Declaration deleted.
9918         (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
9919         macros.
9920         * lex.c (TRY_TK, CATCH_TK): Generate location information.
9921         * parse.h (redefinition_error, refine_accessible_methods_list,
9922         can_cast_to_p): Function declaration removed.
9923         (classitf_redefinition_error, variable_redefinition_error,
9924         parse_jdk1_1_error, find_applicable_accessible_methods_list,
9925         find_most_specific_methods_list, argument_types_convertible,
9926         enter_a_block, valid_builtin_assignconv_identity_widening_p,
9927         valid_cast_to_p, valid_method_invocation_conversion_p,
9928         try_reference_assignconv, add_stmt_to_compound,
9929         build_jump_to_finally, build_tree_list, patch_try_statement,
9930         java_get_catch_block): New function declarations.
9931         * parse.y (string_buffer_type): Global variable deleted.
9932         (group_of_labels, catches, catch_clause, catch_clause_parameter,
9933         finally): Rules tagged <node>.
9934         (TRY_TK, CATCH_TK): Token tagged <operator>.
9935         (class_body_declaration:, class_member_declaration:,
9936         formal_parameter:, explicit_constructor_invocation:,
9937         interface_member_declaration:, constant_declaration:,
9938         primary_no_new_array:, class_instance_creation_expression:,
9939         array_creation_expression:): Issue error on unsuported JDK1.1
9940         features.
9941         (try_statement:, catches:, finally:): Define actions.
9942         (catch_clause_parameter): New rule.
9943         (catch_clause:): Use new rule catch_clause_parameter.
9944         (parse_jdk1_1_error): New function.
9945         (redefinition_error): Renamed classitf_redefinition_error.
9946         (variable_redefinition_error): New function.
9947         (check_class_interface_creation): Call
9948         classitf_redefinition_error.
9949         (java_complete_tree): Added error message on JDEP_TYPE: case.
9950         (complete_class_report_errors): Fixed indentation.
9951         (declare_local_variables): Call variable_redefinition_error.
9952         (source_end_java_method): Call java_set_exception_lang_code and
9953         emit_handlers where appropriate.
9954         (java_method_add_stmt): Call add_stmt_to_block.
9955         (add_stmt_to_block): New function.
9956         (lookup_method_invoke): Fixed outside comment. new local variable
9957         candicates.  Call find_applicable_accessible_methods_list and
9958         find_most_specific_methods_list when searching for a
9959         method. Modified error report to list possible candidates when
9960         applicable.
9961         (find_applicable_accessible_methods_list,
9962         find_most_specific_methods_list, argument_types_convertible): New
9963         function.
9964         (refine_accessible_methods_list): Function deleted.
9965         (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
9966         expr (if applicable) before calling patch_array_ref.
9967         (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
9968         (enter_block): Fixed comment.
9969         (enter_a_block): New function.
9970         (patch_assignment): Reorganized. Call try_reference_assignconv for
9971         references. Call valid_cast_to_p instead of can_cast_to_p.
9972         (try_reference_assignconv,
9973         valid_builtin_assignconv_identity_widening_p): New functions.
9974         (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
9975         (valid_cast_to_p, valid_method_invocation_conversion_p): New
9976         functions.
9977         (build_string_concatenation): Don't resolve StringBuffer.
9978         (patch_cast): Fixed inverted arguments.
9979         (patch_array_ref): Code to save array expr deleted. Call
9980         valid_cast_to_p instead of can_cast_to_p.
9981         (generate_labeled_block): Call generate_name.
9982         (build_jump_to_finally, build_try_statement, java_get_catch_block,
9983         patch_try_statement): New functions.
9984         * typeck.c (match_java_method): Function deleted.
9985
9986 Fri Oct  2 13:48:36 1998  Anthony Green  <green@cygnus.com>
9987
9988         * jvspec.c: jvgenmain_spec uses different temporary file names.
9989
9990 Fri Oct  2 12:50:19 1998  Anthony Green  <green@cygnus.com>
9991
9992         * jvspec.c (lang_specific_driver): Fail if user specifies
9993         --main= when not linking.
9994
9995 Mon Sep 28 13:48:33 1998  Tom Tromey  <tromey@cygnus.com>
9996
9997         * class.c (make_class_data): Push value for `thread' field.
9998         * decl.c (init_decl_processing): Added `thread' field to class.
9999
10000         * class.c (add_field): Always make static fields externally
10001         visible.
10002
10003 Sat Sep 26 08:22:47 1998  Anthony Green  <green@cygnus.com>
10004
10005         * expr.c (build_java_athrow,
10006         build_java_throw_out_of_bounds_exception, expand_invoke,
10007         build_newarray, expand_java_multianewarray, build_java_monitor):
10008         Update comments to reflect _Jv_* function names.
10009
10010 Fri Sep 25 16:03:02 1998  Per Bothner  <bothner@cygnus.com>
10011
10012         * decl.c (complete_start_java_method):  DECL_RESULT is always promoted.
10013         * decl.c (start_java_method):  Handle PROMOTE_PROTOTYPES target macro.
10014         * parse.y (expand_start_java_method):  Likewise.
10015
10016 Thu Sep 24 12:20:35 1998  Per Bothner  <bothner@cygnus.com>
10017
10018         * expr.c (pop_arguments):  Handle PROMOTE_PROTOTYPES target macro.
10019
10020         * class.c (push_class):  IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
10021         (add_field):  No longer need to convert from RECORD_TYPE to pointer,
10022         * expr.c:  Remove no-longer-needed calls to promote_type.
10023         * decl.c (give_name_to_locals):  Liekwise.
10024         * jcf-parse.c (get_class_constant):  Compensate for new signatures.
10025         * parse.y:  Add/remove promote_type calls as appropriate.
10026         * typeck.c (parse_signature_type):  Returns POINTER_TYPE for objects.
10027         (parse_signature_string):  Likewise.
10028         (build_java_array_type):  Fix for now signature convenions.
10029
10030         * lex.c (java_lex):  Fix (from Alex) for JC1_LITE problem.
10031
10032 Wed Sep 23 14:49:35 1998  Tom Tromey  <tromey@cygnus.com>
10033
10034         * class.c (init_class_processing): libjava function renamed to
10035         _Jv_RegisterClass.
10036
10037 Tue Sep 22 12:00:02 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10038
10039         * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
10040         * java-tree.def: Fixed DEFTREECODE third argument.
10041         (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
10042         CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
10043         * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
10044         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
10045         JAVA_THIS_EXPR): Now replaced by tree code definitions.
10046         (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
10047         * lang.c (java_tree_code_type, java_tree_code_length,
10048         java_tree_code_name): New arrays.
10049         (lang_init): Append Java tree node definitions to Gcc ones.
10050         * lex.c (expression_obstack): Declared as extern when JC1_LITE
10051         defined.
10052         (java_init_lex): Initialize wfl_append, wfl_string_buffer,
10053         wfl_to_string.
10054         (java_lex): Allow declaration of empty string constants. Retain
10055         location information on CASE_TK and DEFAULT_TK.
10056         * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
10057         JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
10058         Modified to be more robust.
10059         (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
10060         (build_new_invocation, try_builtin_assignconv,
10061         patch_switch_statement, string_constant_concatenation,
10062         build_string_concatenation, patch_string_cst, patch_string,
10063         java_expand_switch): New function declarations.
10064         * parse.y: Rules related to switch and EH tagged <node>.
10065         (label_id): Set to NULL_TREE
10066         (wfl_string_buffer, wfl_append, wfl_to_string): New static global
10067         tree nodes.
10068         (this_or_super:): Fixed indentation.
10069         (statement:, statement_nsi:, statement_without_trailing_substatement:,
10070         statement_expression:): Removed call to RULE on all sub-rules.
10071         (switch_expression:, switch_labels:): New rules.
10072         (switch_statement:, switch_block:, switch_block_statement_groups:,
10073         switch_block_statement_group:, switch_labels:, switch_label:):
10074         Defined actions.
10075         (throw_statement:, synchronized_statement:, try_statement:):
10076         Defined temporary actions.
10077         (class_instance_creation_expression:): Call
10078         build_new_invocation. Fixed indentation.
10079         (field_access): Fixed indentation.
10080         (method_invocation): Likewise.
10081         (make_qualified_primary): Use THIS_EXPR.
10082         (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
10083         resolving from SUPER, set *type_found.
10084         (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
10085         (java_complete_tree): Removed unused local variable `location'. Case
10086         for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
10087         NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
10088         on MODIFY_EXPR: and all binary operator tree code cases. Removed
10089         STRING_CST: case. default: checks for patchable strings.
10090         (complete_function_arguments): Transform string constant or
10091         crafted StringBuffer if necessary.
10092         (build_method_invocation): Fixed comments.
10093         (build_new_invocation): New function.
10094         (patch_assignment): Call try_builtin_assignconv to figure a valid
10095         assignment conversion between builtin types.
10096         (try_builtin_assignconv): New function.
10097         (build_binop): Use URSHIFT_EXPR directly to call build.
10098         (operator_string): Use UNARY_PLUS_EXPR.
10099         (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
10100         operator.
10101         (do_merge_string_cste, merge_string_cste,
10102         string_constant_concatenation, build_string_concatenation,
10103         patch_string, patch_string_cst): New function.
10104         (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
10105         (patch_unaryop): Likewise. New test of valid ++/-- operands.
10106         (build_newarray_node): Use NEW_ARRAY_EXPR.
10107         (build_this): Use THIS_EXPR.
10108         (build_return): Enable debug information on return statement.
10109         (build_if_else_statement): Likewise.
10110         (complete_labeled_statement): Fixed related comment.
10111         (build_loop_body): Fixed comment.
10112         (build_bc_statement): Enable debug information on break/continue
10113         statements.
10114         (patch_bc_statement): Fixed typos. Handle SWITCH statement
10115         context.
10116         (patch_switch_statement, case_identity, java_expand_switch): New
10117         functions.
10118
10119 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
10120
10121         * buffer.h (BUFFER_INIT):  New macro.
10122         * jcf-write.c (struct jcf_partial):  New type.  Put global stuff here.
10123         Pass (struct jcf_partial *state) to most functions.
10124         (jcf_block, jcf_relocation):  New types.
10125         Support labels, branches, conditionals, loops.
10126
10127 Mon Sep 21 15:08:48 1998  Tom Tromey  <tromey@cygnus.com>
10128
10129         * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
10130
10131 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
10132
10133         * decl.c (integer_type_node):  Make it have INT_TYPE_SIZE.
10134         * verify.c (verify_jvm_instructions):  Use int_type_not (32 bits),
10135         not integer_type_node (INT_TYPE_SIZ bits).
10136
10137         * parse.y (patch_if_else_statement):  Accept promoted_boolean_type_node.
10138
10139         * jcf-reader.c (get_attribute):  New HANDLE_EXCEPTION_TABLE hook.
10140         * jcf-dump.c (print_exception_table):  New function.
10141         (disassemble_method):  Better handling of wide instructions.
10142         Make more robust for bad input.
10143
10144 Wed Sep 30 20:53:51 1998  Jeffrey A Law  (law@cygnus.com)
10145
10146         * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
10147         FreeBSD.
10148
10149 Thu Sep 17 19:45:01 1998  Jeffrey A Law  (law@cygnus.com)
10150
10151         * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
10152
10153 Thu Sep 17 16:21:52 1998  Tom Tromey  <tromey@cygnus.com>
10154
10155         * Makefile.in ($(PARSE_H)): Removed target.
10156
10157 Thu Sep 17 01:57:07 1998  Jeffrey A Law  (law@cygnus.com)
10158
10159         * Makefile.in (JAVA_OBJS): Add memmove.o
10160         (memmove.o): New target & rules.
10161
10162 Tue Sep 15 23:21:55 1998  Tom Tromey  <tromey@cygnus.com>
10163
10164         * expr.c (expand_invoke): Don't generate a call to the class init
10165         code.
10166
10167 Mon Sep 14 10:14:47 1998  Jeffrey A Law  (law@cygnus.com)
10168
10169         * Makefile.in: Add many missing dependencies.
10170         * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
10171         as appropriate.
10172         * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
10173         * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
10174
10175 Fri Sep 11 14:05:21 1998  Per Bothner  <bothner@cygnus.com>
10176
10177         * decl.c (complete_start_java_method):  If method is static (and
10178         not private) call _Jv_InitClass.
10179         * expr.c (expand_invoke):  Don't call build_class_init.
10180
10181         * jvspec.c (jvgenmain_spec):  Fix spec for generated .o file.
10182
10183 Thu Sep 10 10:33:31 1998  Jeffrey A Law  (law@cygnus.com)
10184
10185         * Make-lang.in (GCJ): Define before using.
10186
10187 Wed Sep  9 21:23:10 1998  Jeffrey A Law  (law@cygnus.com)
10188
10189         * gjavah.c (java_no_argument): Renamed from no_argument to avoid
10190         losing due to namespace pollution in GNU getopt.h
10191
10192 Wed Sep  9 13:33:39 1998  Tom Tromey  <tromey@cygnus.com>
10193
10194         * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
10195         (java.all.cross): Likewise.
10196         (java.rest.encap): Likewise.
10197
10198 Tue Sep  8 10:34:05 1998  Jeffrey A Law  (law@cygnus.com)
10199
10200         * gjavah.c (print_class_decls): Fix thinko in arglist
10201         * jcv-io.c (find_classfile): Similarly.
10202
10203 Mon Sep  7 13:59:49 1998  Jeffrey A Law  (law@cygnus.com)
10204
10205         * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
10206
10207 Sat Sep  5 16:08:01 1998  Tom Tromey  <tromey@cygnus.com>
10208
10209         * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
10210         (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
10211         * Makefile.in (PARSE_C): New macro.
10212         (PARSE_H): Likewise.
10213         (PARSE_SCAN_C): Likewise.
10214         ($(PARSE_C)): Target renamed from parse.c.
10215         ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
10216         (clean): Remove parse-scan.c as well.
10217         (parse.o): Depend on $(PARSE_C).
10218
10219 Sat Sep  5 08:48:40 1998  Anthony Green  <green@cygnus.com>
10220
10221         * README, license.terms: Removed.
10222
10223         * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
10224         decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
10225         javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
10226         jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
10227         keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
10228         lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
10229         verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
10230         and Java trademark attribution.
10231
10232 Fri Sep  4 10:42:05 1998  Tom Tromey  <tromey@cygnus.com>
10233
10234         * Makefile.in: Use gcjh, not gjavah.
10235         * config-lang.in (stagestuff): Use gcjh, not gjavah.
10236         * Make-lang.in: Changed gjavah to gcjh everywhere.
10237
10238 Thu Sep  3 18:04:09 1998  Per Bothner  <bothner@cygnus.com>
10239
10240         * gjavah.c:  Support new -prepend -add -append flags.
10241         (print_method_info):  Method is not virtual if class is final.
10242
10243 Thu Sep  3 12:03:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10244
10245         * jv-scan.c: Fixed copyright assignment.
10246         * keyword.gperf: Likewise.
10247         * keyword.h: Likewise.
10248         * lex.c: Fixed copyright assignment.
10249         (java_lex): Push unicode back when parsing '<'.
10250         * lex.h: Fixed copyright assignment.
10251         * parse-scan.y: Likewise.
10252         * parse.h: Fixed copyright assignment.
10253         (build_debugable_stmt, complete_for_loop): New function prototypes.
10254         * parse.y: Fixed copyright assignment.
10255         (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
10256         size_zero_node when completing a loop with no exit condition.
10257         (for_statement_nsi:): Define action.
10258         (for_init:, for_update:): Return size_zero_node when empty.
10259         (declare_local_variables): Call build_debugable_stmt.
10260         (build_debugable_stmt): New function.
10261         (build_loop_body): Build debugable statement around loop
10262         condition part.
10263         (complete_loop_body): Take into account the debugable statement
10264         around the EXIT_EXPR.
10265         (complete_loop_body): New function.
10266         (patch_exit_expr): Fixed condition inversion.
10267
10268 Wed Sep  2 11:53:58 1998  Tom Tromey  <tromey@cygnus.com>
10269
10270         * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
10271         name of thread define.
10272         * jvspec.c (THREAD_NAME): New macro.
10273         (GCLIB): Likewise.
10274         (THREADLIB): Likewise.
10275         (lang_specific_driver): Recognize attempt to link with thread
10276         library or gc library.  Recognize -ljava on command line so it
10277         isn't linked against more than once.
10278
10279 Wed Sep  2 11:28:35 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10280
10281         * parse-scan.y (report_main_declaration): Name of the class
10282         containing `main' can be a qualified name.
10283
10284 Mon Aug 31 13:25:58 1998  Tom Tromey  <tromey@cygnus.com>
10285
10286         * config-lang.in: Changed gjavac to gjc everywhere.
10287         * Make-lang.in: Changed gjavac to gjc everywhere.
10288
10289 Thu Aug 27 02:28:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10290
10291         * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
10292         (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
10293         and install the files.
10294         * Makefile.in (JAVA_OBJS_LITE): New variable.
10295         (compiler:): Now include jv-scan as a dependency.
10296         (../jv-scan$(exeext), parse-scan.c): New targets.
10297         (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
10298         * config-lang.in (compilers): Removed gcj, gjavah from the list.
10299         * jcf-parse.c (parse_source_file): Call java_layout_classes and
10300         check for errors even if parse_only.
10301         * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
10302         defined.
10303         (yylex): New function. Uses java_lex body.
10304         (java_lex): Removed commented out statement. Remove local variable
10305         literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
10306         appropriate.  Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
10307         DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
10308         SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
10309         if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
10310         SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
10311         where appropriate.
10312         (java_lex_error): Empty if JC1_LITE is defined.
10313         (java_get_line_col): Return 0 if JC1_LITE is defined.
10314         * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
10315         SET_MODIFIER_CTX): Moved into the section containing the macros
10316         conditionally defined by JC1_LITE.
10317         (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
10318         argument if JC1_LITE is defined.
10319         (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
10320         REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
10321         is defined.
10322         (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
10323         FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
10324         SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
10325         to different values according to JC1_LITE.
10326         * parse.h (int_fits_type_p, stabilize_reference): Prototype not
10327         declared if JC1_LITE set.
10328         (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
10329         defined if JC1_LITE not set.
10330         (struct parser_ctx): Reorganized and skip the jc1 front end part
10331         if JC1_LITE set.
10332         (java_layout_classes): New function definition.
10333         (java_push_parser_context, java_init_lex, yyparse, yylex,
10334         yyerror): Prototype always declared. All other static function
10335         prototypes declared only if JC1_LITE is not set.
10336         * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
10337         declared in parse.h.
10338         (java_layout_classes): New function.
10339         (java_complete_expand_methods): No longer layout the class here.
10340         * parse-scan.y: New file.
10341         * jv-scan.c: New file.
10342
10343 Tue Aug 25 10:17:54 1998  Tom Tromey  <tromey@cygnus.com>
10344
10345         * gjavah.c (main): Handle -friend option.
10346         (friend_specs): New global.
10347         (generate_access): Handle friend_specs.
10348         (process_file): Likewise.
10349         (MAX_FRIENDS): New macro.
10350         (friend_count): New global.
10351         (print_cxx_classname): Added `prefix' argument.  Ignore arrays.
10352         Changed all callers.
10353
10354 Mon Aug 24 20:19:27 1998  Per Bothner  <bothner@cygnus.com>
10355
10356         * jcf-dump.c (process_class):  Move JCF_FINISH use to main,
10357         (main):  Handle processing all the entries of a named .zip archive.
10358         * jcf-io.c (jcf_trim_old_input):  New function.
10359         * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le):  New macros.
10360
10361 Mon Aug 24 07:35:13 1998  Per Bothner  <bothner@cygnus.com>
10362
10363         * lang.c (flag_assume_compiled):  Make default be on.
10364
10365 Fri Aug 21 17:29:04 1998  Per Bothner  <bothner@cygnus.com>
10366
10367         * jcf-dump.c:  Add bunches of flags to control output more.
10368         (process_class):  New function;  support printing more than one class.
10369         (main): Support new --print-main and --javap flags.
10370         * jcf-reader.c (IGNORE_ATTRIBUTE):  New hook.
10371         * jcf.h (CPOOL_INDEX_IN_RANGE):  New macro.
10372
10373 Thu Aug 20 14:24:47 1998  Per Bothner  <bothner@cygnus.com>
10374
10375         Change mangling of dispatch table to match C++ vtable (w/thunks).
10376         * class.c (build_dtable_decl), java-tree.h:  New function.
10377         (make_class_data):  Call it.
10378         * decl.c (init_decl_processing):  Likewise.
10379
10380 Wed Aug 19 17:57:07 1998  Warren Levy  <warrenl@cygnus.com>
10381
10382         * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
10383         soft_anewarray; adjust args passed.
10384         * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
10385         match _Jv_NewObjectArray.
10386
10387 Wed Aug 19 09:33:23 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10388
10389         * decl.c (push_labeled_block, pop_labeled_block): New functions.
10390         * expr.c (loopup_label): Call create_label_decl.
10391         (create_label_decl): New function.
10392         (java_lang_expand_expr): Call expand_start_bindings with argument
10393         set to zero.
10394         * java-tree.h Added space after PROTO in function declarations
10395         when necessary.
10396         (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
10397         (create_label_decl, push_labeled_block): New function
10398         declarations.
10399         * lex.c (label_id): Initialize.
10400         (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
10401         switch.
10402         * parse.h Added space after PROTO in function declarations when
10403         necessary.
10404         (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
10405         LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
10406         LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
10407         PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
10408         macros.
10409         (struct parser_ctxt): New fields current_loop,
10410         current_labeled_block.
10411         (build_if_else_statement, patch_if_else_statement,
10412         add_stmt_to_compound, patch_exit_expr, build_labeled_block,
10413         generate_labeled_block, complete_labeled_statement,
10414         build_bc_statement, patch_bc_statement, patch_loop_statement,
10415         build_new_loop, build_loop_body, complete_loop_body): New function
10416         declarations.
10417         * parse.y (java_warning_count): New global variable.
10418         (label_id): New static variable.
10419         (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
10420         (block:): Return size_zero_node when block is empty.
10421         (empty_statement:): Return size_zero_node.
10422         (statement:): Implement supplemental action when for_statement: is
10423         reduced.
10424         (label_decl:): New rule.
10425         (labeled_statement:): Rewritten using label_decl. Actions
10426         implemented.
10427         (labeled_statement_nsi:): Likewise.
10428         (if_then_statement): Actions implemented.
10429         (while_expression): New rule.
10430         (while_statement:): Rewritten using while_expression. Actions
10431         implemented.
10432         (while_statement_nsi:): Likewise.
10433         (do_statement_begin:): New rule.
10434         (do_statement:): Rewritten using do_statement_begin. Actions
10435         implemented.
10436         (for_statement:): Rewritten using for_begin. Actions implemented.
10437         (for_statement_nsi:): Likewise.
10438         (for_header:, for_begin:): New rules.
10439         (for_init:): Actions implemented.
10440         (statement_expression_list:, break_statement:,
10441         continue_statement:): Likewise.
10442         (yyerror): Count number of issued warning(s).
10443         (java_report_errors): Report error(s) and/or warning(s).
10444         (java_complete_class): Use build_java_argument_signature to
10445         recompute completed method signature.
10446         (java_check_regular_methods): New locals method_wfl and aflags.
10447         Use method_wfl instead of lookup_cl during error reports. Fixed
10448         indentation and modified some error messages. Use
10449         lang_printable_name in method instead of the DECL_NAME. New code
10450         to issue warnings on methods not overriding corresponding methods
10451         private to a different package.
10452         (java_method_add_stmt): Call add_stmt_to_compound.
10453         (add_stmt_to_compound): New function.
10454         (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
10455         LOOP_EXPR, EXIT_EXPR and COND_EXPR.
10456         (build_if_else_statement, patch_if_else_statement,
10457         build_labeled_block, generate_labeled_block,
10458         complete_labeled_statement, build_new_loop, build_loop_body,
10459         complete_loop_body, patch_loop_statement, build_bc_statement,
10460         patch_bc_statement, patch_exit_expr): New functions.
10461         * typeck.c (build_java_signature): Build argument signature before
10462         enclosing it in between parenthesis.
10463
10464 Mon Aug 17 17:44:24 1998  Warren Levy  <warrenl@cygnus.com>
10465
10466         * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
10467         (JAVA_OBJS): Added reminder comment
10468
10469 Thu Aug 13 10:01:45 1998  Nick Clifton  <nickc@cygnus.com>
10470
10471         * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
10472         be interpreted as a long long.
10473
10474 Thu Aug 13 14:34:07 1998  Warren Levy  <warrenl@cygnus.com>
10475
10476         * decl.c (init_decl_processing): Use _Jv_InitClass, not
10477         soft_initialise_class.  Use _Jv_NewMultiArray, not
10478         soft_multianewarray.  Use _Jv_ThrowBadArrayIndex, not
10479         soft_badarrayindex.  Use _Jv_CheckCast, not soft_checkcast.  Use
10480         _Jv_CheckArrayStore, not soft_checkarraystore.  Use
10481         _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
10482
10483 Wed Aug 12 14:23:13 1998  Per Bothner  <bothner@cygnus.com>
10484
10485         * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
10486         length_identifier_node):  New global tree node constants.
10487         * parse.y (kw_super, kw_this, kw_length):  Removed globals.
10488         Replace uses by super_identifier_node etc.
10489         * lex.c (kw_super, kw_this, kw_length):  Don't initialize.
10490
10491         * parse.y (resolve_field_access):  Don't special-case ".length" if
10492         flag_emit_class_files.
10493         (patch_array_ref):  Leave as ARRAY_REF if flag_emit_class_files.
10494         * jcf-write.c (generate_bytecode_insns):  Handle ARRAY_REF opcode
10495         and ARRAY.length.
10496
10497 Tue Aug 11 11:31:55 1998  Per Bothner  <bothner@cygnus.com>
10498
10499         * decl.c (init_decl_processing): Remove unused method_type_node fields.
10500         * class.c (make_method_value):  Remove init for removed fields.
10501
10502         * class.c (layout_class):  Use build_java_argument_signature.
10503         * java-tree.h (TYPE_ARGUMENT_SIGNATURE):  New macro.
10504
10505         * typeck.c (push_java_argument_signature):  Removed.  Merged into ...
10506         (build_java_argument_signature):  Use TYPE_ARGUMENT_SIGNATURE cache.
10507         (build_java_signature):  Don't use push_java_argument_signature.
10508
10509         * typeck.c (lookup_argument_method):  New function.
10510         * parse.y (java_check_regular_methods):  Use lookup_argument_method
10511         instead of lookup_java_method2 followed by lookup_java_method.
10512
10513         * parse.y (check_method_redefinition):  Minor optimization.
10514
10515         * jcf-write.c (generate_bytecode_insns):  Handle RETURN_EXPR,
10516         MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
10517
10518 Mon Aug 10 09:57:15 1998  Tom Tromey  <tromey@cygnus.com>
10519
10520         * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
10521         c-pragma.o.
10522
10523         * gjavah.c (java_float_finite): Use K&R-style definition.
10524         (java_double_finite): Likewise.
10525         (generate_access): Now returns void.  Changed all callers.
10526         (last_access_generated): Removed.
10527         (process_file): Only make a single pass over the .class file.
10528
10529 Wed Jul 29 17:50:23 1998  Per Bothner  <bothner@cygnus.com>
10530
10531         * class.c (get_dispatch_table):  Add extra dummy vtable entry,
10532         for compatibility for G++ (with -fvtable-thunks).
10533         * expr.c (build_invokevirtual):  Add one for extra dummy vtable entry.
10534
10535         * gjavah.c (process_file):  Use public inheritance for super-class.
10536
10537 Wed Jul 29 13:19:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10538
10539         * lex.c (java_init_lex): Initialize ctxp->package.
10540         * parse.h (struct parser_ctxt): package and package_len replaced
10541         by tree package, an identifier node. Field method_decl_list is
10542         gone. Fixed comments.
10543         (lookup_field_wrapper, merge_qualified_name, not_accessible,
10544         class_in_current_package): New function prototypes.
10545         * parse.y (array_type:): Set class loaded flag on primitive type
10546         arrays.
10547         (package_declaration:): Assign ctxp->package to the
10548         identifier node.
10549         (method_invocation:): Handle invocation of method qualified by
10550         `super'.
10551         (single_type_import_declaration:): Removed ambiguity check.
10552         (java_pop_parser_context): New local variable `next'. Reset and
10553         set IMPORT_CLASSFILE_NAME flags on current and previous import
10554         list.
10555         (java_accstring_lookup): Use new local macro COPY_RETURN.
10556         (lookup_field_wrapper): New function.
10557         (parser_qualified_classname): Use merge_qualified_name.
10558         (parser_check_super_interface): Broaden error message.
10559         (do_resolve_class): Check for qualified class name in the current
10560         compilation unit if appropriate.
10561         (process_imports): Check for already defined classes.
10562         (check_pkg_class_access): Got rid of call to
10563         get_access_flags_from_decl.
10564         (java_complete_expand_methods): Call safe_layout_class based on
10565         the current class size.
10566         (make_qualified_primary): Build a WFL qualification on primary if
10567         none exists.
10568         (merge_qualified_name): New function.
10569         (make_qualified_name): Use merge_qualified_name.
10570         (resolve_expression_name): Use safe_lookup_field.
10571         (resolve_field_access): Got rid of call to get_access_flags_from_decl.
10572         (resolve_qualified_expression_name): Likewise. Check on resolved
10573         element accessibility.
10574         (not_accessible_p, class_in_current_package): New functions.
10575         (maybe_access_field): Got rid of call to get_access_flags_from_decl.
10576         (patch_method_invocation_stmt): Merged common pieces. Check
10577         accessibility of invoked method.
10578         (check_for_static_method_reference): Add returned type in error
10579         message.
10580         (invocation_mode): Get rid of bogus check on PRIVATE methods.
10581         (refine_accessible_methods_list): Merged two conditions in test.
10582         (java_complete_class): Sanity check on stabilize_ref gone.
10583         * zextract.c (read_zip_archive): Cast lseek second argument to long.
10584
10585 Tue Jul 28 21:39:22 1998  Per Bothner  <bothner@cygnus.com>
10586
10587         * class.c (hashUtf8String):  Fix - use new JavaSoft specification.
10588
10589 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
10590
10591         * gjavah.c (F_NAN): Removed.
10592         (F_NAN_MASK): New macro.
10593         (F_POSITIVE_INFINITY): Removed.
10594         (F_NEGATIVE_INFINITY): Likewise.
10595         (java_float_finite): Rewrote.
10596         (D_NAN_MASK): Renamed.
10597         (java_double_finite): Rewrote.
10598         (D_POSITIVE_INFINITY): Removed.
10599         (D_NEGATIVE_INFINITY): Likewise.
10600
10601         * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
10602         If verbose, print underlying representation of value in hex.
10603
10604 Fri Jul 24 14:14:32 1998  Per Bothner  <bothner@cygnus.com>
10605
10606         * buffer.h, buffer.c:  New files.
10607         * Makefile.in (JAVA_OBJS):  Add buffer.o.
10608
10609         Support locals variables and writing their debug entries to .class.
10610         * jcf-write.c:  Simplify some by user new buffer type.
10611         (vode_buffer_grow):  Removed.
10612         (struct localvar_info):  New type.
10613         (localsvars, localvartable):  New buffers.
10614         (localvar_alloc, localvar_free):  New functions.
10615         (generate_bytecode_insns):  Handle local variables.
10616         (generate_classfile):  Write LocalVariableTable attribute.
10617
10618 Fri Jul 24 13:46:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10619
10620         * jcf-io.c (open_in_zip): Check the zipfile magic number.
10621         * zipfile.h (ZIPMAGIC): New macro.
10622
10623 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
10624
10625         * Makefile.in (gjavah.o): Updated dependencies.
10626         (jcf-dump.o): Likewise.
10627         (all.indirect): Use ../gjavah.
10628         (../gjavah$(exeext)): Likewise.
10629         (clean): Don't remove gjavah.
10630         (clean): Remove parse.c, not java/parse.c.
10631         * Make-lang.in (java): Added gjavah.
10632         (gjavah$(exeext)): New target.
10633         (GJAVAH_SOURCES): New macro.
10634         (java.all.build): Added gjavah.
10635         (java.all.cross): Likewise.
10636         (java.rest.encap): Likewise.
10637         * config-lang.in (compilers, stagestuff): Added gjavah.
10638
10639 Thu Jul 23 18:33:56 1998  Tom Tromey  <tromey@cygnus.com>
10640
10641         * gjavah.c (java_float_finite): New function.
10642         (java_double_finite): Likewise.
10643         (F_POSITIVE_INFINITY): New macro.
10644         (F_NEGATIVE_INFINITY): Likewise.
10645         (F_NAN): Likewise.
10646         (D_POSITIVE_INFINITY): Likewise.
10647         (D_NEGATIVE_INFINITY): Likewise.
10648         (D_NAN): Likewise.
10649         (print_field_info): Use java_float_finite and java_double_finite.
10650
10651 Thu Jul 23 15:28:24 1998  Per Bothner  <bothner@cygnus.com>
10652
10653         * parse.y (method_header):  Name "this" implicit argument.
10654
10655 Wed Jul 22 15:47:30 1998  Per Bothner  <bothner@cygnus.com>
10656
10657         * jcf-write.c:  Write out LineNumberTable attribute in .class file.
10658         (linenumber_buffer, linenumber_ptr, linenumber_limit):  New statics.
10659         (put_linenumber):  New function.
10660         (generate_bytecode_insns, generate_classfile):  Write line numbers.
10661
10662 Wed Jul 22 14:39:00 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10663
10664         * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
10665         (lookup_name, build_known_method_ref, build_class_init,
10666         build_invokevirtual, invoke_build_dtable, match_java_method,
10667         build_field_ref, pushdecl_force_head, build_java_binop,
10668         binary_numeric_promotion, build_decl_no_layout,
10669         build_java_arrayaccess, build_newarray, build_anewarray,
10670         build_java_array_length_access, build_java_arraynull_check): New
10671         extern function prototypes.
10672         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
10673         JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
10674         java-tree.h.
10675         * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
10676         to NULL
10677         * jcf.h (jcf_out_of_synch): New extern function prototype.
10678         * parse.h: Static/global function implemented in parse.y
10679         prototyped and declarations moved at the end of the file.
10680         (DECL_P): Check that the argument isn't null.
10681         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
10682         JAVA_THIS_EXPR): No longer defined here. See java-tree.h
10683         (QUAL_DECL_TYPE): New macro.
10684         (PARAMS): Macro definition removed.
10685         * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
10686         (return_statement:): Call build_return.
10687         (field_access:): Call make_qualified_primary in sub rule.
10688         (method_invocation:): Build method invocation and call
10689         make_qualified_primary when processing primaries.
10690         (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
10691         get_type_from_signature.
10692         (java_check_regular_method): Extra integer 0 argument when calling
10693         lookup_java_method2.
10694         (lookup_java_interface_method2): Extra method DECL argument when
10695         calling lookup_java_interface_method2.
10696         (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
10697         COMPOUND_EXPR node.
10698         (java_complete_expand_method): Layout current class iff not
10699         already done. Don't process interface's methods.
10700         (java_complete_expand_method): Use super class only if it
10701         exists. Use current class otherwise.
10702         (make_qualified_primary): New function.
10703         (resolve_expression_name): Process qualified expression or
10704         expression from primary the same way.
10705         (resolve_expression_name): Two last arguments to
10706         resolve_field_access are now NULL_TREEs.
10707         (resolve_field_access): New variable is_static. Local field must
10708         be DECLs. is_static computed on field DECLs only. Append code in
10709         where_found to the field access if necessary. Use QUAL_DECL_TYPE
10710         to initialize field_type.
10711         (resolve_qualified_expression_name): New local variable,
10712         previous_call_static and is_static. Handle primaries with function
10713         calls, casts, array references and `this'. `super' now handled as
10714         `(super_class)this'. Use is_static to clarify boolean expressions.
10715         Added code to handle case where a proper handle is required to
10716         access a field. Use QUAL_DECL_TYPE where applicable.
10717         (maybe_access_field): New function.
10718         (patch_method_invocation_stmt): New arguments primary, where,
10719         is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
10720         deleted. Use `where' as a type to search from if specified. Check
10721         for static method reference where forbidden. Append primary or
10722         current_this to the argument list if not calling constructor nor
10723         static methods.
10724         (check_for_static_method_reference): New function.
10725         (patch_invoke): Layout the class on which new is done if
10726         necessary.
10727         (lookup_method_invoke): Changed format to report errors on
10728         methods.
10729         (qualify_ambiguous_name): New local variable this_found. Now
10730         handle things from primaries. Method call are considered
10731         expression names.
10732         (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
10733         changed into NULLs.
10734         (not_initialized_as_it_should_p): Comply with the new DECL_P.
10735         (java_complete_tree): New case fo RETURN_EXPR. Process function
10736         call arguments in separate function.
10737         (complete_function_arguments): New function.
10738         (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
10739         anymore.
10740         (patch_assignment): Take the return function slot into account as
10741         a RHS. Distinguish assignment from a return.
10742         (valid_ref_assignconv_cast_p): Use build_java_argument_signature
10743         when checking methods in interfaces.
10744         (resolve_type_during_patch): NULL argument to unresolve_type_p
10745         instead of NULL_TREE.
10746         (patch_newarray): Fixed typo in comment.
10747         (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
10748         (build_return, patch_return): New functions.
10749         * typeck.c (lookup_java_constructor): Fixed typo in comment.
10750
10751 Tue Jul 21 12:10:04 1998  Per Bothner  <bothner@cygnus.com>
10752
10753         * constants.c (find_name_and_type_constant, find_fieldref_index,
10754         find_methodref_index):  New methods.
10755         * expr.c (build_invoke_non_interface):  If flag_emit_class_files,
10756         just return given method.  Also, rename to build_known_method_ref.
10757         (expand_invoke):  Rename call to build_invoke_non_interface.
10758         * java-tree.h, parse.h:  Update prototype.
10759         * parse.y, decl.c, jcf-parse.c:  Suppress calls to back-end functions
10760         (such as expand_expr_stmt) if flag_emit_class_files.
10761         * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
10762         STACK_TARGET, IGNORE_TARGET):  New macros.
10763         (code_buffer, code_ptr, code_limit, code_S, code_SP_max):  New globals.
10764         (generate_bytecode_insn):  New function to generate method's bytecode.
10765         (generate_classfile):  Node generate Code attribute for a method.
10766         (code_buffer_grow, push_constant1, push_constant2, push_int_const,
10767         push_long_const, field_op, adjust_typed_op, maybe_wide):
10768         New functions used by generate_bytecode_insn.
10769
10770         * typeck.c (signature_include_return):  Remove variable.
10771         (push_java_argument_signature, build_java_argument_signature):  New.
10772         (build_java_signature):  Use push_java_argument_signature.
10773         * parse.y:  Use build_java_argument_signature instead of fiddling
10774         with signature_include_return.
10775
10776 Fri Jul 17 09:48:51 1998  Tom Tromey  <tromey@cygnus.com>
10777
10778         * gjavah.c (print_c_decl): Always generate JArray<>* for array
10779         types.
10780
10781         * Makefile.in (all.indirect): Added gjavah$(exeext).
10782         (gjavah$(exeext)): Added $(exeext).
10783         (clean): Likewise.
10784
10785 Thu Jul 16 15:29:20 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10786
10787         * class.c (layout_class): Call to java_layout_parsed_class replace
10788         by safe_layout_class.
10789         * expr.c (build_java_array_length_access): Removed static storage
10790         class in the function definition.
10791         (build_java_arraynull_check): Likewise.
10792         Also fixed typos in two comments.
10793         * lex.c (java_init_lex): Initialize static global kw_length.
10794         (java_lex): Use BUILD_OPERATOR on RETURN_TK.
10795         * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
10796         java_lex_error.
10797         (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
10798         * parse.h (resolve_no_layout): New static function declaration.
10799         (get_identifier_in_static): Declaration removed.
10800         (java_layout_parsed_class): Function name declaration changed to
10801         safe_layout_class.
10802         (build_newarray_node, patch_newarray, resolve_type_during_patch,
10803         not_initialized_as_it_should_p, build_this): New static function
10804         declarations.
10805         (pushdecl_force_head, build_java_binop, int_fits_type_p,
10806         binary_numeric_promotion, stabilize_reference,
10807         build_decl_no_layout, build_java_arrayaccess): Extern function
10808         declarations moved into their own section.
10809         (build_newarray, build_anewarray, build_java_array_length_access,
10810         build_java_arraynull_check): New extern function declarations.
10811         (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
10812         (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
10813         fake tree codes.
10814         (CALL_CONSTRUCTOR_P): New macro.
10815         * parse.y (kw_length): New static global tree node.
10816         (return_statement): Tagged <node>.
10817         (RETURN_TK): Tagged <operator>.
10818         (variable_declarator_id:): Build variable declaration with an
10819         empty initialization value if a syntax error was found in the
10820         initialization part of the variable declaration.
10821         (statement_without_trailing_substatement:): return_statement: now
10822         uses the default rule.
10823         (return_statement:): Temporarily fixed to return NULL_TREE.
10824         (primary_no_new_array:): Call build_this when THIS_TK was parsed.
10825         (class_instance_creation_expression:): Class creation rules now
10826         call build_method_invocation upon reduction.
10827         (array_creation_expression:): Rules call build_newarray_node upon
10828         reduction.
10829         (dim_exprs:): Build a list of dimension expressions.
10830         (dim_expr:): Store location of the OSB_TK in the dimension
10831         expression node.
10832         (method_invocation:): Added a new error rule.
10833         (build_unresolved_array_type): WFL argument may also be an array
10834         on a primitive type. Name of the argument changed to reflect this.
10835         (method_declarator): Insert argument type at the beginning of the
10836         argument type list and later reverse the list.
10837         (unresolved_type_p): Argument 'returned' may be optionally
10838         NULL_TREE.
10839         (java_layout_class_from_source): Function renamed
10840         safe_layout_class.
10841         (resolve_and_layout): Now call resolve_no_layout and
10842         safe_layout_class.
10843         (resolve_no_layout): New function.
10844         (purify_type_name): New function.
10845         (complete_class_report_errors): Call purify_type_name during error
10846         report on a type not found.
10847         (process_imports): error_found local variable doesn't need to be
10848         initialized to zero.
10849         (declare_local_variables): New local type_wfl. Fixed typo in error
10850         message. type_wfl assigned to unresolved type and used to register
10851         incomplete type. Build a WFL around the variable initialization
10852         statement so that debug info can be generated on it.
10853         (source_start_java_method): Reverse argument list after they've
10854         been processed.
10855         (current_this): New static global variable.
10856         (java_complete_expand_methods): Set current_this when appropriate.
10857         (resolve_expression_name): Build correct static and non static
10858         field access bearing a simple name.
10859         (resolve_field_access): Resolve the length field of arrays. Handle
10860         f.m() cases.
10861         (patch_method_invocation_stmt): Set the type of the method
10862         invocation to error_mark_node. This value is later overridden by a
10863         valid type, if any. Don't handle qualified constructor invocation
10864         as qualified method invocation. Call lookup_method_invoke with its
10865         new flag. It's no longer necessary to access the selected method
10866         as the value of a tree list. Handle constructor invocation.
10867         (patch_invoke): Reverse argument list when invoking non interface
10868         methods. Insert call to new as the first argument of the
10869         constructor.
10870         (invocation_mode): Return a INVOKE_STATIC is the invoked method is
10871         defined within a final class. Return INVOKE_STATIC if the invoked
10872         method is a constructor.
10873         (lookup_method_invoke): New lc argument is a flag to indicate a
10874         constructor lookup. Now handle constructor lookup. Choose the most
10875         specific method in case several were matching the invocation
10876         requirements. Return a method decl instead of a tree list featuring
10877         one single method decl element.
10878         (refine_accessible_methods_list): New lc flag argument to
10879         indicate that a constructor is being looked up.
10880         (not_initialized_as_it_should_p): New function.
10881         (java_complete_tree): Now process fake tree codes
10882         JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
10883         save_expr on resolved function call arguments. Case on
10884         UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
10885         (patch_assignment): LHS can be a field access expression. When
10886         dealing with reference, lhs_type is the promoted type of the
10887         rhs_type, not the RHS. Use not_initialized_as_it_should_p where
10888         applicable.
10889         (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
10890         (patch_binop): Use not_initialized_as_it_should_p where
10891         applicable.
10892         (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
10893         (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
10894         where applicable.
10895         (resolve_type_during_patch): New function.
10896         (patch_cast): Call resolve_type_during_patch to resolve type and
10897         report error accordingly.
10898         (patch_array_ref): Use not_initialized_as_it_should_p where
10899         applicable. Array base expression is saved before being
10900         used. Promote the type of an array elements if it contains non
10901         builtin types.
10902         (build_newarray_node, patch_newarray, build_this): New functions.
10903
10904 Thu Jul 16 10:46:47 1998  Tom Tromey  <tromey@cygnus.com>
10905
10906         * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
10907         increment it in `for' statement.
10908         (print_field_info): If number is inf or nan, don't print it.
10909         (print_method_info): If method name is `delete', just ignore it.
10910         (print_c_decl): Special-case jstringArray.
10911
10912         * gjavah.c (help): New function.
10913         (no_argument): New function.
10914         (usage): Changed text.
10915         (main): Rewrote argument handling.  Now handles -v, --help,
10916         --version.
10917         (version): New function.
10918         (found_error): New global.
10919         (main): Return found_error.
10920         (generate_access): Set found_error.
10921         (print_c_decl): Likewise.
10922
10923 Wed Jul 15 10:36:27 1998  Tom Tromey  <tromey@cygnus.com>
10924
10925         * gjavah.c (print_c_decl): Don't print "," when examining field.
10926         Skip type name when looking at "[L" types.
10927         (process_file): Now static.
10928         (generate_access): Now returns int.
10929         (last_access_generated): New global.
10930         (process_file): Clear last_access_generated; make multiple passes
10931         over the class.
10932         (print_field_info): Just return if generate_access returns true.
10933         (print_method_info): Likewise.  Also, allow <init> functions to
10934         pass through.
10935         (print_c_decl): Added is_init argument.  Print constructors
10936         properly.
10937         (print_cxx_classname): Use UTF8_GET to extract characters from
10938         string.
10939         (print_base_classname): New function.
10940         (print_class_decls): New function.
10941         (process_file): Use it.
10942         (utf8_cmp): New function.
10943
10944 Mon Jul 13 14:21:47 1998  Nick Clifton  <nickc@cygnus.com>
10945
10946         * lang-options.h: Format changed to match changes in gcc/toplev.c
10947         to implement a --help option.
10948
10949 1998-07-10  Brendan Kehoe  <brendan@cygnus.com>
10950
10951         * decl.c (init_decl_processing): Revert change to dtable_type.
10952
10953 Thu Jul  9 18:22:12 1998  Per Bothner  <bothner@cygnus.com>
10954
10955         * java-tree.h (CLASS_P):  Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
10956
10957 1998-07-08  Brendan Kehoe  <brendan@cygnus.com>
10958
10959         * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
10960
10961         * lang.c (lang_init): Default flag_exceptions to 1, without
10962         checking to see if it's 2 first.
10963
10964 Wed Jul  8 03:01:32 1998  Jeffrey A Law  (law@cygnus.com)
10965
10966         * constants.c: Include "system.h".
10967         * decl.c: Likewise.
10968         * lang.c (flag_new_exceptions): Get via extern now.
10969         (lang_init_options): New functions.  Turn on flag_new_exceptions.
10970
10971 Tue Jul  7 12:56:48 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10972
10973         * lex.c (java_lex): Return 0 when we see an invalid character in
10974         the input.
10975
10976         * lex.c (java_read_char): Specify extra argument when calling
10977         java_lex_error.
10978         (java_read_unicode, java_parse_end_comment,
10979         java_parse_escape_sequence): Likewise,
10980         (java_lex): Specify extra argument when calling
10981         java_lex_error. Test that IDs are beginning with a legal character
10982         for IDs. Handle invalid characters with an error message and a
10983         call to java_lex_error.
10984         (java_lex_error): Adjust column position by new argument
10985         `forward'. Issue an error even if in the middle of reporting an
10986         other error.
10987
10988 1998-07-07  Brendan Kehoe  <brendan@cygnus.com>
10989
10990         * jcf-io.c (find_class): Zero out BUFFER before we use it, since
10991         we don't explicitly put a null pointer when we're copying it.
10992
10993 Tue Jul  7 09:38:38 1998  Tom Tromey  <tromey@cygnus.com>
10994
10995         * gjavah.c (print_cxx_classname): New function.
10996         (super_class_name): Likewise.
10997         (print_super_fields): Removed.
10998         (in_super): Removed.
10999         (print_field_info): Never generate #defines.
11000         (print_c_decl): Changed generated types to match JNI.  No longer
11001         print class name before method name.
11002         (print_method_info): Print "static" before static methods.
11003         Print "virtual" before non-final methods.
11004         (usage): Use exit(1), not exit(-1).
11005         (main): Likewise.
11006         (print_field_info): Use %.17g to print a double.
11007         (last_access): New globals.
11008         (process_file): Initialize last_access.
11009         (usage): Now static.
11010         (ACC_VISIBILITY): New define.
11011         (generate_access): New function.
11012         (print_field_info): Call it.
11013         (print_method_info): Likewise.  Also, generate information for all
11014         methods, not just native methods.  Return void.
11015         (print_c_decl): Return void.
11016         (print_field_info): Return void.
11017
11018 Thu Jul  2 16:53:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11019
11020         * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
11021         processing the jc1 grammar file. Prefix bison functions and
11022         variables with java_.
11023         (parse.c): Dependencies on parse.h and lex.h
11024         * expr.c (build_java_arrayaccess): Function now global.
11025         * java-tree.h: Comment reorganized to carry on previous
11026         classification effort.
11027         (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
11028         RESOLVE_TYPE_NAME_P): New flags on WFLs.
11029         * jcf-parse.c (parse_source_file): java_parse_source_file renamed
11030         java_parse (new prefix java_ generated by bison).
11031         (java_layout_parsed_class, java_register_parsed_class): Function
11032         call removed.
11033         (yyparse): Removed unnecessary call to init_outgoing_cpool.
11034         * lex.c (static tree wfl_op): Variable deleted.
11035         (java_init_lex): Initialize kw_super and kw_this. Initialize more
11036         ctxp fields to NULL_TREE.
11037         (java_lex): No longer create WFL for operators. Filename caching
11038         mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
11039         created as STRING_CST and later expanded. Removed extra argument
11040         to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
11041         and SUPER.
11042         (build_wfl_node): Removed code in comments.
11043         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
11044         store token and location data in the current bison token.
11045         * parse.h: Removed pre-processor based symbol prefixes hack. Moved
11046         static/extern function declaration at the beginning of the file.
11047         (struct qualification): Data structure definition deleted.
11048         (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
11049         (qualify_ambiguous_name): Function declaration modified. Function
11050         now returns nothing.
11051         (build_array_ref, patch_array_ref, make_qualified_name,
11052         resolve_qualified_expression_name, maybe_generate_clinit,
11053         resolve_field_access): New static function declarations.
11054         (build_java_arrayaccess): New extern function declaration.
11055         (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
11056         (CALL_EXPR_PRIMARY): Macro deleted.
11057         (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
11058         (struct parser_ctxt): Field initialized_final
11059         removed. non_static_initialized, static_initialized: New fields.
11060         * parse.y (static tree kw_super, static tree kw_this): New global
11061         static.
11062         (%union): tree wfl field of operator member replaced by int
11063         location. WFLs are non longer created for operators.
11064         (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
11065         (qualified_name:): Now calls make_qualified_name to build the
11066         identifier.
11067         (type_declaration:): Consider generating <clinit> when class
11068         parsing completed.
11069         (variable_declarator:): Directly build an assignment node when the
11070         variable is initialized when declared.
11071         (this_or_super:): Build a WFL and set current location when THIS
11072         or SUPER are parsed.
11073         (expression_statement:): Wrap statement around a WFL.
11074         (primary_no_new_array:): Fixed typo. Changed value returned by
11075         THIS_TK because of its new type (temporary).
11076         (dim_exprs:): Temporary fix because of OSB_TK's new type.
11077         (field_access:): Build qualified name with SUPER.
11078         (method_invocation:): Fixed returned value because of SUPER's new
11079         type.
11080         (array_access:): Use OSB_TK location information.
11081         (post_increment_expression:, post_decrement_expression:,
11082         unary_expression:, pre_increment_expression:,
11083         pre_decrement_expression:, unary_expression_not_plus_minus:,
11084         cast_expression:, multiplicative_expression:,
11085         additive_expression:, shift_expression:, relational_expression:,
11086         equality_expression:, and_expression:, exclusive_or_expression:,
11087         inclusive_or_expression:, conditional_and_expression:,
11088         conditional_or_expression:, assignment:): Use new location/token
11089         information available on operators.
11090         (create_class): Set super_decl_type to NULL_TREE when processing
11091         java.lang.Object.
11092         (register_fields): Field initialization is now a MODIFY_EXPR
11093         node. Chain initialization code to the matching lists (according
11094         the the field declaration modifiers).
11095         (maybe_generate_clinit): New function.
11096         (method_header): Don't set method's DECL_NAME to a WFL when adding
11097         methods to java.lang.Object.
11098         (resolve_and_layout): Now can return NULL_TREE if the type
11099         resolution fails. Otherwise, return the class DECL instead of its
11100         TYPE.
11101         (check_method_redefinition): Don't patch method DECL_NAME if it
11102         belongs to java.lang.Object.
11103         (process_imports): Simply assign error_found to the value returned
11104         by check_pkg_class_access.
11105         (declare_local_variables): Don't use their init statements (if
11106         any) when parsing error were previously found. Reuse MODIFY_EXPR
11107         build during parsing as an init statement.
11108         (java_method_add_stmt): Now return the current method body.
11109         (java_layout_parsed_class, java_register_parsed_class): Functions
11110         removed.
11111         (java_complete_expand_methods): Initialize the constant pool on a
11112         per class basis. Layout the classes before expanding their method
11113         bodies. Don't try expand artificial constructor code if error were
11114         found. Make the classes data and register them if no error were
11115         found.
11116         (java_complete_expand_method): Retrieve an artificial constructor
11117         argument list before entering its body. Assign the top block to
11118         the artificial constructor function body and set types of declared
11119         blocks and compound statements to void. Walk method body if not an
11120         artificial constructor.
11121         (make_qualified_name, cut_identifier_in_qualified): New functions.
11122         (resolve_expression_name): Fixed comments. Save/restore the
11123         current class CLASS_LOADED_P flag value. Build non qualified
11124         static field access and handle qualified expression names.
11125         (resolve_field_access, resolve_qualified_expression_name): New
11126         functions.
11127         (patch_method_invocation_stmt): Use the new expression resolution
11128         scheme, calling resolve_field_access when the function call is
11129         resolved as an expression.
11130         (qualify_ambiguous_name): Function rewritten to work on qualified
11131         expression produced by make_qualified_name.
11132         (java_complete_tree): Promote type when function's argument are
11133         RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
11134         the assignment to discover further errors if RHS is a expression
11135         name that fails to evaluate. Declare LHS initialized even though
11136         the assignment failed. Don't use the location variable and removed
11137         extra argument in patch function calls. Now handle the ARRAY_REF
11138         case and build internal string representation when STRING_CSTs are
11139         walked.
11140         (build_method_invocation): Don't wrap function call around a WFL.
11141         (build_assignment): Likewise. Use the operator location
11142         information.
11143         (patch_assignment): Handle array access LHSs. Handle error
11144         provenance, resulting in a better error report.
11145         (build_binop): Use op_location from operator as binop location
11146         information.
11147         (build_unaryop, build_incdec, build_cast): Likewise.
11148         (patch_binop): Extract location information from the node. Fixed
11149         typo in error message.
11150         (patch_unary_op): Extract location information from the node.
11151         (build_array_ref, patch_array_ref): New functions.
11152
11153 Wed Jul  1 13:11:36 1998  Tom Tromey  <tromey@cygnus.com>
11154
11155         * expr.c (expand_java_INSTANCEOF): Changed calling convention to
11156         match _Jv_IsInstanceOf.
11157         * decl.c (init_decl_processing): Use _Jv_NewArray, not
11158         soft_newarray.  Use _Jv_IsInstanceOf, not soft_instanceof.
11159
11160 Tue Jun 30 14:12:54 1998  Tom Tromey  <tromey@cygnus.com>
11161
11162         * decl.c (init_decl_processing): Functions are now named
11163         _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
11164
11165 Mon Jun 29 14:47:10 1998  Per Bothner  <bothner@cygnus.com>
11166
11167         * java-tree.h (load_class):  Add prototype.
11168         * class.c (is_compiled_class):  Add missing arg to load_class.
11169         * expr.c (expand_java_NEW):  Call load_class.
11170         * parse.y (process_import):  Removed bogus use of void return value.
11171
11172 Thu Jun 25 11:50:48 1998  Per Bothner  <bothner@cygnus.com>
11173
11174         * decl.c, java-tree.h (soft_athrow_node):  Renamed to soft_node.
11175         Function name is "_Jv_Throw" instead of "soft_athrow".
11176         * decl.c, java-tree.h (soft_new_node):  Renamed to alloc_object_node.
11177         Function name is "_Jv_AllocObject" instead of "soft_new".
11178         Takes an extra parameter (object size).
11179         * expr.c:  Update calls.
11180
11181 Wed Jun 24 13:59:02 1998  Per Bothner  <bothner@cygnus.com>
11182
11183         * lex.c (java_get_line_col):  Handle end-of-file.
11184         * except.c (expand_end_java_handler):  Handle null type (i.e. finally).
11185
11186 Wed Jun 24 09:22:34 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
11187
11188         * lang.c (lang_init): Make -fexceptions the default.
11189         * except.c (maybe_start_try, maybe_end_try): Don't do anything if
11190         exception handling is not turned on.
11191
11192 Tue Jun 23 10:17:09 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
11193
11194         * lang.c (flag_new_exceptions): Make this this default.
11195         * decl.c (end_java_method): Call emit_handlers.
11196         * except.c (method_init_exceptions): Set language code and version.
11197         (expand_start_java_handler): Enable exception, and call
11198         expand_eh_region_start.
11199         (expand_end_java_handler): Enable exception, and set up catch blocks.
11200         (emit_handlers): New routine to generate the saved handlers.
11201         * java-except.h (emit_handlers): Add prototype.
11202
11203 Fri Jun 12 11:31:24 1998  Per Bothner  <bothner@cygnus.com>
11204
11205         We used to have three different representations of the constant pool:
11206         the CPool structure, the tree_constant_pool, and the constructures
11207         used to build the Class object (which may need class and string
11208         constants) in compiled code.  None were appropriate for compiling
11209         to .class files, so I did a major overhaul.
11210
11211         First, the tree_constant_pool array was removed.  Things were
11212         modified to the CPool structure in the JCF could be used.
11213         Second, a "capacity" field was added to the CPool, and functions
11214         written to search for a matching constant, adding one if not found.
11215         The code that generated the Class object was changed to use a CPool.
11216         The actual TREE_LISTs used to build the CONSTRUCTORs used for
11217         the static Class object are now only in build_constants_constructor.
11218         Finally, I wrote code which can generate a .class file (including its
11219         constant pool) from the RECORD_TYPE of a class.  This is a big step
11220         on the way to compiling Java source into .class files.
11221
11222         * jcf-write.c:  New file. Writes out a RECORD_TYPE as a .class file.
11223         * Makefile.in (JAVA_OBJS):  Added jcf-write.o.
11224
11225         * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
11226         CONSTANT_ResolvedString, CONSTANT_ResolvedClass):  New macros.
11227         (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
11228         COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
11229         (COMPONENT_REF_CLASS):  Replaced by COMPONENT_REF_CLASS_INDEX.
11230         (lang_type):  Removed constant_pool field.
11231         * jcf.h (CPool):  Renamed size to count.  Added field capacity.
11232         (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
11233         CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT):  New macros.
11234         Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
11235
11236         * constants.c (current_constant_pool_tags, current_constant_pool_data,
11237         current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
11238         * constants.c (build_constants_constructor):  Use new outgoing_cpool.
11239         (set_constant_entry, find_constant1, find_constant2,
11240         find_class_constant, count_constant_pool_bytes, write_constant_pool,
11241         find_utf8_constant, find_class_or_string_constant):  New functions.
11242
11243         * jcf-parse.c (load_class):  Don't save/restore tree-constant_pool.
11244         (get_constant):  Use current_jcf.cpool instead of tree_constant_pool.
11245         (give_name_to_class, get_class_constant):  Likewise.
11246         * jcf-parse.c, java-tree.h (tree_constant_pool):  Removed.
11247         (get_name_and_type_constant, get_ref_constant):  Removed.
11248         * parse.h (parser_ctxt):  Remove field tree_constant_pool.
11249         * parse.y:  Don't save/restore tree_constant_pool.
11250         * verify.c (verify_jvm_instructions):  Update for new approach.
11251         * expr.c (expand_invoke, expand_java_field_op): Likewise.
11252
11253         * lang-options.h:  Added -femit-class-file, -femit-class-files.
11254         * lang.c (flag_emit_class_files), java-tree.h:  New flag.
11255         (lang_f_options):  Added "emit-class-file(s)".
11256
11257         * expr.c (build_java_arrayaccess):  Generate more efficient array
11258         bounds checking, by using unsigned compare.
11259
11260         * expr.c (expand_invoke):  Re-arrange error checks to make more robust.
11261
11262 Wed Jun 10 17:34:42 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11263
11264         * parse.h: New comment on the handling of unresolved type
11265         identifiers. JDEPs are now part of the jdep_code enum.
11266         (typedef struct jdep): Now use enum jdep_code or int, depending on
11267         availability. Both are narrowed down to an 8 bits bitfield.
11268         (CALL_EXPR_PRIMARY): Fixed comment.
11269
11270 Wed Jun 10 10:54:39 1998  Tom Tromey  <tromey@cygnus.com>
11271
11272         * Make-lang.in (java): Added gjavac and jvgenmain.
11273         (java.start.encap): Depend on gjavac.
11274         (java.rest.encap): Depend on jvgenmain.
11275
11276         * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
11277         (JAVA_CROSS_NAME): Likewise.
11278         (java.all.build): Depend on jvgenmain and gjavac.
11279         (java.all.cross): Depend on jvgenmain and gjavac-cross.
11280         (jvgenmain$(exeext)): New target.
11281         (java.install-common): Wrote.
11282         * config-lang.in (compilers, stagestuff): Added gjavac and
11283         jvgenmain.
11284
11285 Wed Jun 10 12:19:04 1998  Dave Brolley  <brolley@cygnus.com>
11286
11287         * lang.c (lang_decode_option): New argc/argv interface.
11288
11289 Tue Jun  9 18:12:46 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11290
11291         * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
11292         * decl.c (build_decl_no_layout): New function.
11293         * expr.c (java_lang_expand_expr): Layout declarations found in
11294         blocks before they're pushed.
11295         * jcf-parse.c (load_class): Save current line when parsing class
11296         file.
11297         (parse_source_file): Register class before expanding their
11298         methods.
11299         * lang.c (put_decl_node): Produce `null' when `void *' is
11300         processed.
11301         * lex.c (static tree wfl_op): New static global, for error report
11302         on casts.
11303         (java_init_lex): wfl_operator and wfl_op initialized
11304         here. Filename caching added for wfl_op. Return wfl_op when `(' is
11305         parsed.
11306         * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
11307         patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
11308         build_unresolved_array_type): New static function definitions.
11309         (build_decl_no_layout): New extern function declared.
11310         (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
11311         faulty modifier exists.
11312         (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
11313         (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
11314         (UNARY_PLUS_EXPR): New fake operator.
11315         (struct parser_ctxt): New field osb_number.
11316         * parse.y (static tree wfl_operator): New static WFL for operator
11317         bound error messages.
11318         (DECR_TK, INCR_TK): Moved.
11319         (OP_TK): Tagged <operator>.
11320         (array_type:): Now call build_unresolved_array_type.
11321         (dim_expr:): Count the number of '[' seen.
11322         (post_increment_expression, post_decrement_expression,
11323         pre_increment_expression, pre_decrement_expression,
11324         unary_expression_not_plus_minus, unary_expression:): Actions are
11325         now building the corresponding unary expressions.
11326         (cast_expression:): Actions are now building cast expressions.
11327         (build_unresolved_array_type): New function.
11328         (create_interface): Reset the number of declared interfaces.
11329         (create_class): Likewise.
11330         (method_header): Methods declared within the scope of an interface
11331         are now implicitly set public and abstract.
11332         (java_complete_class): Variable's and parameter's type are patched
11333         with a promoted type.
11334         (declare_local_variables): Resolved non builtin types are promoted
11335         before being used to build a variable decl. Removed type patch
11336         posted on variable initialization statement.
11337         (source_start_java_method): Use build_decl_no_layout to build the
11338         decl of a parameter of incomplete type.
11339         (java_register_parsed_class): Process interfaces too. Call
11340         rest_of_decl_compilation on each processed class declarations.
11341         (java_complete_expand_methods): Don't attempt to expand things in
11342         interfaces.
11343         (java_complete_tree): Process CONVERT_EXPR, even though it always
11344         has a type. Propagate error_mark_node to node's type too. Promote
11345         method's call argument type and return error_mark_node if
11346         argument's completion didn't work. MODIFY_EXPR can have a WFL as a
11347         RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
11348         handle unary operator nodes.
11349         (build_assignment): Added comment.
11350         (print_int_node): New function.
11351         (patch_assignment): New second argument. New error handling. Use
11352         print_int_node. Handle references. Use can_cast_to_p to issue
11353         different error message according to the context and check upon
11354         the initialization of the RHS.
11355         (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
11356         (operator_string): Handle more operators.
11357         (patch_binop): No longer use a function static
11358         wfl_operator. Improved error message on shift distance.
11359         (build_unaryop, build_incdec, build_cast, patch_unaryop,
11360         patch_cast): New functions.
11361
11362 Fri Jun  5 18:03:07 1998  Per Bothner  <bothner@cygnus.com>
11363
11364         * jvspec.c:  New file.
11365         * Make-lang.in:  New rules to build gjavac from jvspec.c and ../gcc.c.
11366
11367         * java-tree.h (identifier_subst):  Add declaration.
11368
11369 Thu Jun  4 13:44:23 1998  Tom Tromey  <tromey@cygnus.com>
11370
11371         * jvgenmain.c (main): Generate call to JvRunMain.
11372
11373         * class.c (make_class_data): Push value for "sync_info" field.
11374         * decl.c (init_decl_processing): Push "sync_info" field.
11375
11376 Wed Jun  3 20:39:14 1998  Per Bothner  <bothner@cygnus.com>
11377
11378         * typeck.c (build_java_array_type):  Set TYPE_NAME to actual
11379         Java (source) name, not signature.
11380         Set TYPE_ALIGN to (at least) that of element_type.
11381
11382 Tue Jun  2 15:19:19 1998  Per Bothner  <bothner@cygnus.com>
11383
11384         * class.c:  Moved classname-mangling-rekated code to ...
11385         * mangle.c:  ... this new file.
11386         * jvgenmain.c:  New program (needs mangle.c) to generate main program.
11387         * Makefile.in:  Update for above changes.
11388
11389 Mon Jun  1 09:58:36 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11390
11391         * expr.c (truthvalue_conversion): Convert integer and floating
11392         point value to their truth value.
11393         * lex.c (java_lex): Handle the `null' literal.
11394         * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
11395         (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
11396         ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
11397         New macros.
11398
11399         * parse.y: Reorganization/documentation on token declaration.
11400         (binop_lookup[]): New added new tree codes.
11401         (relational_expression): Build corresponding binary operators.
11402         (equality_expression, conditional_and_expression,
11403         conditional_or_expression): Likewise.
11404         (java_complete_class): Fix crash in debug message.
11405         (java_complete_tree): Check initialization of method call
11406         arguments. Further bogus node evaluation to detect more error
11407         during assignments. Handles more binary operators.
11408         (patch_assignment): Use DECL_P.
11409         (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
11410         code.
11411         (operator_string): Handle more case. Compacted source.
11412         (patch_binop): Changed function comment. Checking for
11413         uninitialized first operand takes the compound assignment into
11414         account and uses DECL_P. Checking for uninitialized second operand
11415         delayed to routine's end. Use macros to issue type bound error
11416         messages and issue messages on both operands if their types are
11417         different. Force fixed type into node. Handle all binary
11418         operators.
11419
11420 Wed May 27 10:30:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11421
11422         * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
11423         * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
11424         build operator node and return tokens.
11425         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
11426         * parse.h (java_complete_tree): Changed returned type in prototype.
11427         (build_method_invocation, build_assignment, patch_assignment,
11428         patch_binop): New static function declarations.
11429         (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
11430         BUILD_EXPR_WFL): New macros.
11431         * parse.y (enum tree_code binop_lookup[]): New static for token to
11432         TREE_CODE lookup.
11433         (%union): Parser union has new sub-structure `operator'.
11434         (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
11435         PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
11436         ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
11437         ASSIGN_ANY_TK): Tokens tagged `operator'.
11438         (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
11439         AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
11440         MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
11441         REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
11442         (assignment_operator:): Rule tagged `operator'.
11443         (expression_statement:): Re-installed default rule.
11444         (method_invocation:): Sub rules call build_method_invocation.
11445         (postfix_expression:): Don't attempt to resolve name here. Just
11446         return an ID.
11447         (multiplicative_expression:): Sub-rules build corresponding binop
11448         expression node.
11449         (additive_expression:, shift_expression:, and_expression:,
11450         exclusive_or_expression:, inclusive_or_expression:): Likewise.
11451         (assignment:): Sub rule invoke build_assignment.
11452         (assignment_operator:): Default rules on sub rules.
11453         (force_error): Added documentation on this variable.
11454         (declare_local_variables): Build initialization calling
11455         build_assignment.
11456         (expand_start_java_method): Removed unused rtx declaration. Mark
11457         arguments as already initialized.
11458         (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
11459         (java_complete_expand_methods): Don't process next method if
11460         completion of the previous one triggered errors.
11461         (java_complete_expand_method): Call source_end_java_method if no
11462         error were found during completion.
11463         (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
11464         locals declaratilon. Handle names found within a class. Return
11465         error_mark_node when things aren't found.
11466         (patch_method_invocation_stmt): Return error_mark_node on failures.
11467         (patch_invoke): Removed unused local. Return the correct node.
11468         (java_complete_tree): Now returns a value. The BLOCK section binds
11469         local identifiers and the type of a BLOCK is now void. Assign the
11470         result of operand completion on COMPOUND_EXPR. Assign the
11471         encapsulated node of a WFL to the result of its completion, except
11472         when the node is an identifier. Now handle MODIFY_EXPR and several
11473         binary operators. Return error_mark_node on errors.
11474         (build_method_invocation, build_assignment, patch_assignment,
11475         build_binop, operator_string, patch_binop): New functions.
11476         * typeck.c (binary_numeric_promotion): New function.
11477
11478 Thu May 21 12:01:04 1998  Per Bothner  <bothner@cygnus.com>
11479
11480         * class.c (identifier_subst):  New convenience wrapper for ident_subst.
11481         Replace most uses of ident_subst by identifier_subst.
11482
11483         * class.c (push_class_static_dummy_field):  Removed function.
11484         (build_class_ref):  Find Class object decl by looking up "CNAME.class",
11485         instead of looking got "class" static field.  Create that decl here.
11486         (class_identifier_node):  Removed;  no longer needed.
11487         (init_class_processing):  Don't init class_identifier_node.
11488         * jcf-parse.c (jcf_parse):  Don't call push_class_static_dummy_field.
11489         Do nreverse 0 times (instead of twice) for Object and Class.
11490         * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
11491
11492 Wed May 20 16:35:04 1998  Per Bothner  <bothner@cygnus.com>
11493
11494         * jcf-parse.c (parse_class-file):  Set lino to smallest line number,
11495         while initializing linenumber_count and linenumber_table.
11496         Do it before init_function_start (which calls emit_line_note).
11497         * expr.c (expand_byte_code):  Don't need to clear lineno here.
11498
11499 Mon May 18 16:23:32 1998  Tom Tromey  <tromey@cygnus.com>
11500
11501         * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
11502         then mangle number as _N_.
11503
11504         * class.c (mangle_class_field): New function.
11505         (build_class_ref): Set assembler name of class reference using
11506         mangle_class_field.
11507         (push_class_static_dummy_field): Likewise.
11508
11509 Sun May 17 12:52:35 1998  Michael Tiemann <tiemann@cygnus.com>
11510
11511         * parse.y (source_start_java_method): Use TREE_SET_CODE instead
11512         of assigning to TREE_CODE.  The latter method exploits a feature
11513         of GCC that is not ANSI compliant.
11514
11515 Thu May 12 13:44:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11516
11517         * decl.c (pushdecl_force_head): New function.
11518         (pushlevel): Removed conditional printf.
11519         (complete_start_java_method): Don't enter local variable scope if
11520         function is compiled from source code.
11521         * expr.c: parse.h now included
11522         (java_lang_expand_expr): New function.
11523         * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
11524         printf. Terminate buffer when doing directories.
11525         * jcf-parse.c (parse_source_file): Call lang_init_source before
11526         parsing and before code generation.
11527         * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
11528         use printf if the macro is defined.
11529         * lang.c (lang_init): Install lang_expand_expr hook on
11530         java_lang_expand_expr.
11531         (java_dummy_print): New function.
11532         (lang_init_source): New function.
11533         * lex.c (java_lex): Remember location of an opening brace at the
11534         second nesting level.
11535         (java_is_eol): Unget character seen after a CR if it is EOF.
11536         * parse.h: Now includes lex.h
11537         (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
11538         printf if the macro is defined.
11539         (expand_start_java_method, build_expr_block, enter_block,
11540         exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
11541         New static function declarations.
11542         (pushdecl_force_head): New extern function declaration.
11543         (INCOMPLETE_TYPE_P): New macro.
11544         (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
11545         (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
11546         BLOCK_EXPR_ORIGIN): New macros.
11547         (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
11548         DECL_SOURCE_LINE_LAST): New macros.
11549         (struct parser_ctxt): Removed field current_method_decl, redundant
11550         with the field current_function_decl. Added fields
11551         first_ccb_indent1 and pending_block.
11552         * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
11553         BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
11554         tagged <node>
11555         (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
11556         (compilation_unit:): Cosmetic on sub rule.
11557         (type_declaration:): Cosmetic on sub rules. Added an error rule.
11558         (variable_initializer:): Installed default rule on expression:.
11559         (method_declaration:): method_header: starts a new
11560         method. method_body: installs the function body, absorbs blocks
11561         emitted for temporary variable scopings, pops function's body block
11562         and merges function's last statement lineno in DECL_SOURCE_LINE.
11563         (method_body:): Installed default rules.
11564         (block:): Call enter_block when an opening brace is seen.  Absorb
11565         scoping blocks and call exit_block when a closing brace is seen.
11566         (block_statement:): Cosmetic changes.
11567         (method_invocation:): Create WFL around CALL_EXPR node.
11568         (patch_stage): Added comment around definition.
11569         (method_header): Try to use first_ccb_indent1 as the first line of
11570         the method, so BP debug info are emitted at the first opening
11571         brace of the function. If the function has no body, use the
11572         location of the function's name. Override currently defined method
11573         name with the matching WFL so we can point redefinition errors
11574         using the location where the function's name was declared.
11575         (check_abstract_method_header): Interprets DECL_NAME as an
11576         identifier or as a WFL, accordingly.
11577         (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
11578         (check_method_redefinition): Use DECL_NAME as a WFL. Extract
11579         location and name information out of it and reinstall DECL_NAME to
11580         its original identifier node value.
11581         (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
11582         function's source code).
11583         (read_import_dir): Test the value returned by find_class and issue
11584         a fatal accordingly.
11585         (declare_local_variables): Push a new block for the scope of the
11586         new variable(s) if code has been already generated at that nesting
11587         level. Pinpoint redefinition errors using the variable id
11588         WFLs. Generate initialization code if necessary. If the variable
11589         type is incomplete, register a patch on its decl.
11590         (source_start_java_method): Rewritten. Define a new block for the
11591         function's parameters. Build parameter decl out of function's
11592         arguments and register them for a patch if their types are
11593         incomplete.
11594         (expand_start_java_method): Includes the part of
11595         source_start_java_method that was pushing the parameter decls and
11596         completing the method start code.
11597         (source_end_java_method): Removed call the expand_end_bindings and
11598         poplevel (already taken care of). Reinstall function's arguments
11599         and get function's last line of code before calling
11600         expand_function_end.
11601         (java_method_add_stmt): New comment before the function's
11602         code. Complement the second operand of the current COMPOUND_EXPR
11603         if necessary.
11604         (java_complete_expand_methods): Don't generate debug info on line
11605         zero when expanding a generated constructor.
11606         (java_complete_expand_method): Set start and end line numbers for
11607         a artificially generated constructor to one and manually call
11608         enter_block and exit_block when defining it. For all methods:
11609         expand function's start calling the new expand_start_java_method
11610         and invoke java_complete_tree on the effective method's body, if
11611         any.
11612         (resolve_expression_name): Now use lookup_name_in_blocks to search
11613         local variable decls and print out an error when variables are
11614         undefined.
11615         (patch_method_invocation_stmt): Inserted comment before the
11616         function's code.
11617         (lookup_method_invoke): Chain method's arguments using chainon
11618         with the current arg list as a second argument. Inserted missing
11619         IDENTIFIER_POINTER when reporting an error on methods not found.
11620         (refine_accessible_methods_list): Don't retain constructors.
11621         (patch_arguments): Function removed.
11622         (java_complete_tree): Inserted comment before the function's
11623         code. New case for BLOCKs. Moved the WFL case a bit
11624         further. Complete function's arguments.
11625         (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
11626         maybe_absorb_scoping_blocks): New functions.
11627
11628 Mon Apr 27 10:50:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11629
11630         * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
11631         previously set.
11632         * jcf-parse.c (parse_source_file, java_error_count): New forward
11633         and extern declarations.
11634         (java_parse_abort_on_error): Macro moved.
11635         (jcf_parse_source): fatal called if fopen fails. Now calls
11636         parse_source_file.
11637         (parse_source_file): New parse_only parameter. Reflects the
11638         elimination of the second pass.
11639         (yyparse): parse_source_file called with argument set to 0.
11640         * jcf.h (JCF_ZERO): Sets java_source to zero.
11641         * lex.c (java_init_lex): pass argument is gone. Function modified
11642         to be called once during the analysis of a file.
11643         (java_unget_unicode): Fixed typo in fatal message.
11644         (java_get_line_col): Likewise.
11645         (java_lval): Likewise. String literals no longer built during
11646         second pass.
11647         * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
11648         account.
11649         * parse.h (MODIFIER_WFL): New macro.
11650         (parse_check_super, parser_check_super_interface): Now return int.
11651         (parser_chain_incomplete_item, not_builtin_p,
11652         complete_method_decl): Declarations removed.
11653         (build_method_invocation_stmt, build_invoke): Renamed using the
11654         `patch' instead of `build'
11655         (register-incomplete_type, obtain_incomplete_type,
11656         java_complete_tree, java_complete_expand_method,
11657         unresolved_type_p, create_jdep_list): New function declarations.
11658         (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
11659         END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
11660         (jdep): New typedef on new struct _jdep.
11661         (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
11662         JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
11663         JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
11664         JDEP_RESOLVED_P): New macros.
11665         (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
11666         JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
11667         JDEP_VARIABLE): New enum values and jdep kinds.
11668         (jdeplist): New typedef on struct _jdeplist.
11669         (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
11670         macros.
11671         (CALL_EXPR_PRIMARY): New macro.
11672         (struct parser_ctxt): Fields java_pass, current_method_decl,
11673         method_decl_list deleted. New field jdeplist.
11674         (INCOMPLETE_P): Macro deleted.
11675         * parse.y (single_type_import_declaration:): Removed pass switch.
11676         (type_import_on_demand_declaration): Likewise.
11677         (field_declaration:): Removed pass switch on all sub rules.
11678         (class_declaration:): Call the complete_class_decl removed on
11679         class_body rules.
11680         (method_declaration:): Removed second pass switch. No longer chain
11681         methods decl when method_header reduced.
11682         (method_header:): Sub rules no longer depend on pass switch.
11683         (method_declarator:): Likewise.
11684         (method_body:): Likewise.
11685         (abstract_method_declaration:): Likewise.
11686         (block_statement:): Likewise.
11687         (local_variable_declaration:): Likewise.
11688         (argument_list:): Likewise.
11689         (method_invocation:): Likewise. Call to build_method_invocation_stmt
11690         removed. Partial CLASS_EXPR tree node built instead.
11691         (postfix_expression:): Removed pass switch on all sub rules.
11692         (java_pop_parser_context): Free classd_list content.
11693         (yyerror): Call obstrack_grow0 to finalize error message.
11694         (check_class_interface_creation): Comment modified to reflect new
11695         returned value meaning. Removed second pass switch. Return 1 if an
11696         error was found, 0 otherwise. Adjust pointer on filename if a
11697         leading path separator was found.
11698         (maybe_create_class_interface_decl): Removed first pass switch
11699         when linking the class decl to the class_list. Install a new
11700         jdep_list for the class.
11701         (add_superinterfaces): List of unresolved interfaces is
11702         gone. Unresolved interfaces are directly added to the current
11703         dependencies list.
11704         (create_interface): Second pass shortcut removed.
11705         ctpx->modifier_ctx access through MODIFIER_WFL.
11706         (create_class): Second pass shortcut removed. Call to
11707         register_incomplete_type replaces the call to
11708         parser_chain_incomplete_item.
11709         (complete_class_decl): Function removed.
11710         (duplicate_declaration_error): New way of retrieving redeclared
11711         item type.
11712         (register_fields): Call to lookup_modifier_cl replaced by
11713         MODIFIER_WFL. New way of handling unresolved type, using
11714         unresolved_type_p and obtain_incomplete_type.
11715         register_incomplete_type replaces call to parser_chain_incomplete_item.
11716         (patch_stage): New static global variable.
11717         (method_header): New way of handling unresolved type, using
11718         unresolved_type_p and obtain_incomplete_type. patch_stage used to
11719         indicates that the method decl needs to be patched.
11720         (check_abstract_method_header): Call to lookup_modifier_cl
11721         replaced by MODIFIER_WFL.
11722         (method_declarator): Incomplete argument type are registered
11723         calling register_incomplete_type. Patch on the declared method is
11724         issued in that case.
11725         (unresolved_type_p): New function.
11726         (parser_check_super_interface): New comment to reflect function's
11727         modified returned type (int). Function and has a new argument
11728         this_wfl. Call to parse_error_context uses this_wfl instead of
11729         relying on lookup_cl.
11730         (parser_check_super): Comment reflects function's new returned
11731         type (int). Function returns non zero value on error.
11732         (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
11733         register_incomplete_type, jdep_resolve_class): New functions to
11734         handle incomplete types in declarations.
11735         (java_complete_class): Rewritten to work with the new incomplete
11736         type handling scheme.
11737         (complete_class_report_errors): Likewise.
11738         (complete_method_decl): Removed: it jobs is now handled by
11739         java_complete_class.
11740         (do_resolve_class): Class loaded in not already loaded and not
11741         found in Java source code.
11742         (java_check_regular_methods, java_check_abstract_methods): Don't
11743         call complete_method_decl anymore.
11744         (lookup_modifier_cl, not_builtin_p): Functions deleted.
11745         (read_import_dir): Got rid of the pass number dependency.
11746         (declare_local_variables): New handling of unresolved types (patch
11747         issued).
11748         (source_start_java_method): New parameter level. Function called
11749         with level set to 1 when argument types are potentially
11750         unresolved.  Called to complete the job with level set to 2 once
11751         types are complete.
11752         (source_end_java_method): Call to permanent_allocation
11753         removed. Waiting to be replaced by a more suitable obstack
11754         management.
11755         (java_complete_expand_methods, java_complete_expand_method,
11756         java_expand_finals): New functions.
11757         (build_method_invocation_stmt): Renamed
11758         patch_method_invocation_stmt. Extracts function call expression
11759         (wfl) and arguments (args) from CALL_EXPR tree operands.
11760         (build_invoke): Renamed patch_invoke. Fixed typo in fatal
11761         call. Patch the function and argument operand of the CALL_EXPR
11762         tree argument.
11763         (patch_argument, java_complete_tree): New functions.
11764
11765 Mon Apr 20 18:26:57 1998  Per Bothner  <bothner@cygnus.com>
11766
11767         Recover from missing fields and methods (i.e. error instead of fatal).
11768         * decl.c, java-tree.h (TYPE_identifier_node):  New global constant.
11769         * expr.c (expand_invoke):  Recover from missing method.
11770         (expand_java_field_op):  Recover from missing field.
11771         Inline references to java.lang.{Integer,Char,...}.TYPE.
11772         * typeck.c (get_type_from_signature), java-tree.h:  New function.
11773         * class.c (add_method):  Use get_type_from_signature.
11774         (build_class_ref):  Handle a class that was not found.
11775         * typeck.c (convert):  Handle conversion to pointers (for convenience).
11776         * verify.c (verify_jvm_instructions):  Use get_type_from_signature
11777         instead of lookup_field to handle missing fields.
11778
11779         * jcf-parse.c (process_zip_dir):  Set java_source.
11780
11781 1998-04-20  Brendan Kehoe  <brendan@cygnus.com>
11782
11783         * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
11784
11785 Tue Apr 14 15:59:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11786
11787         * jcf-parse.c (load_class): Don't change input_filename before
11788         calling jcf_parse_source (but still do it before calling
11789         jcf_parse).
11790         (jcf_parse_source): Assign input_filename after having saved the
11791         parser context.
11792         * lex.c (java_init_lex): Chain a WFL node to the import on demand
11793         list. ctxp->modifier_ctx zeroed according to its new
11794         definition. ctxp->filename initialized. Removed
11795         JAVA_MODIFIER_CTX_UNMARK.
11796         (java_unget_unicode): Update the character based column position.
11797         (java_allocate_new_line): ref_count not used anymore. Always free
11798         ctxp->p_line. Initialize c_line->char_col to 0.
11799         (java_get_unicode): Update the character based column position.
11800         (java_lex): Use ctxp->elc to store current position in source
11801         file, at the beginning of the parsed token. Set modifier_ctx entry
11802         corresponding to the parse modifier to a WFL node. Return a WFL
11803         node when an identifier is parsed.
11804         (java_lex_error): Now uses ctxp->elc to store current position in
11805         source.
11806         (build_wfl_node, java_is_eol, java_get_line_col): New functions.
11807         * lex.h (build_wfl_node): New function definitions.
11808         (struct java_line): ref_count and next fields are gone. New field
11809         char_col.
11810         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
11811         JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
11812         (JAVA_COLUMN_DELTA): New macro.
11813         (java_lc): New typedef on new struct _java_lc.
11814         * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
11815         (parse_error_context, parse_warning_context): Changed prototypes.
11816         (java_get_line_col): Added as an available global function.
11817         (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
11818         (IC_DECL): Replaced by macro IC_TYPE
11819         (DEPEND_WFL): New macro.
11820         (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
11821         wrong modifier.
11822         (exit_java_complete_class): Removed a commented out statement.
11823         (struct parser_ctxt): Added comments on fields. modifier_ctx is
11824         now an array of tree nodes. Deleted fields line_list and
11825         e_line. New field elc, to replace e_line.
11826         * parse.y (array_type:): Build WFL node.
11827         (qualified_name:): Build a single WFL node out of two. Retain
11828         the location information of the first node in the resulting node.
11829         (package_declaration:): Use package name as a WFL node
11830         (single_type_import_declaration:): Use imported name as a WFL node.
11831         (type_import_on_demand_declaration:): Use root of the imported
11832         packages as a WFL node.
11833         (field_declaration:): Removed unused local variable cl.
11834         (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
11835         (yyerror): New static elc. Removed static error_line, error_pos.
11836         New local code_from_source. Save ctxp->elc into elc at the first
11837         pass. Call java_get_line_col to get a string of the line where
11838         the error occurred.
11839         (debug_line): Removed static function.
11840         (parse_error_context, parse_warning_context): Parameter cl is now
11841         a WFL node. Use its value to initialize ctxp->elc.
11842         (redefinition_error): Parameter cl is now a WFL node.
11843         (parse_add_interface): New parameter wfl. No longer call
11844         lookup_cl, use wfl instead.
11845         (check_class_interface_creation): Parameter cl is now a WFL node.
11846         (maybe_create_class_interface_decl): Likewise.
11847         (add_superinterfaces): New function.
11848         (create_interface): Removed local cl, node, super_decl,
11849         super_decl_type.  Function now uses id as a WFL node. Better
11850         warning/error report on obsolete or forbidden mix of
11851         modifiers. Now calls add_superinterfaces to register interfaces.
11852         (create_class): Removed local cl, node. Local variable id is used
11853         as a WFL node. Better error report on forbidden modifier
11854         mix. Uses add_superinterfaces to register interfaces.
11855         (find_field): Argument cl is now a WFL node. Now store the WFL
11856         node of a fields that needs to be checked for their
11857         initialization.
11858         (method_header): Local variable node non longer used. Local
11859         variable id replaces cl.
11860         (check_modifiers_consistency): Local variable cl is now a WFL
11861         node.
11862         (method_declarator): Local variable cl replaced by parameter id.
11863         (parser_qualified_name): Now uses parameter name as a WFL node.
11864         (parser_check_super_interface): New parameter wfl, for achieve
11865         greater accuracy during error reports.
11866         (parser_chain_incomplete_item): New parameter named location. Used,
11867         along the decl, to construct the incomplete item node.
11868         (java_complete_class): resolve_class now uses WFL node extracted
11869         from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
11870         where appropriate.
11871         (complete_method_decl): Unresolved function's argument types are WFL.
11872         (resolve_class): Parameter cl is now a WFL node.
11873         (resolve_and_layout): Likewise.
11874         (do_resolve_class): Likewise. Try first to use cl and then do the
11875         lookup on the decl when calling check_pkg_class_access.
11876         (complete_class_report_errors): Use IC_TYPE in place of
11877         TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
11878         instead of doing a lookup over the decl.
11879         (java_check_final): Use WFL info from field tree list.
11880         (lookup_cl): Rewritten and returns a statically defined WFL node.
11881         (lookup_modifier_cl): Now uses information from WFL nodes.
11882         (process_imports): Likewise.
11883         (read_import_dir): name and cl arguments replaced by a single WFL
11884         node. Function modified accordingly.
11885         (find_in_imports_on_demand): Now uses WFL node.
11886         (check_pkg_class_access): cl argument is now a WFL node.
11887         (declare_local_variables): Fixed to use WFL nodes.
11888         (resolve_expression_name): Likewise.
11889         (build_method_invocation_stmt): name_combo argument renamed
11890         wfl. Function modified to use WFL nodes.
11891         (build_invoke): cl used as a WFL node when calling build_expr_wfl.
11892         (lookup_method_invoke): cl is now a WFL node. Added missing
11893         IDENTIFIER_POINTER to class type decl name.
11894
11895 Tue Apr 14 15:23:29 1998  Dave Brolley  <brolley@cygnus.com>
11896
11897         * lang.c (init_parse): Now returns char* containing the filename.
11898
11899 Fri Apr 10 11:36:04 1998  Per Bothner  <bothner@cygnus.com>
11900
11901         * class.c (layout_class):  Mangle repeated arg types to match cc1plus.
11902
11903         * decl.c, java-tree.h (integer_four_node):  New INTEGER_CST node.
11904         * class.c (make_class_data):  If flag_assume_compiled, initial class
11905         state is CSTATE_PREPARED; make superclass and interfaces direct
11906         references, rather than constant pool indexes.
11907
11908 Thu Apr  9 16:10:56 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11909
11910         * parser.y: Include flags.h. Removed debug variable pl.
11911         (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
11912         (block:): Likewise.
11913         (labeled_statement_nsi:): Generate debug info when reducing
11914         expression_statement:.
11915         (check_pkg_class_access): get_access_flags_from_decl invokation
11916         fixed for new CLASS_* flags location.
11917         (source_end_java_method): Save/restore parser context when
11918         entering/leaving this routine. Restore lineno to its right value
11919         before calling expand_end_bindings.
11920         (build_method_invocation_stmt): build_invoke called with the
11921         current line information.
11922         (build_invoke): New argument cl. Wrap the function call around a
11923         wfl node.
11924         (refine_accessible_methods_list): Changed comment, removed
11925         unnecessary code.
11926         * parse.h: Fixed typo in comments.
11927         (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
11928         (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
11929         (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
11930         parser_ccb_indent.
11931         * lex.c (java_lex): Record the last closing curly bracket of a
11932         function.
11933         * jcf-parse.c (jcf_parse_source): Now calls
11934         java_check_methods. Clarified comment, fixed typo.
11935
11936 1998-04-09  Dave Brolley  <brolley@cygnus.com>
11937
11938         * lang.c (init_parse): Expose for non USE_CPPLIB builds.
11939         (finish_parse): Expose for non USE_CPPLIB builds.
11940
11941 Wed Apr  8 13:06:23 1998  Jeffrey A Law  (law@cygnus.com)
11942
11943         * lang.c (lang_print_xnode): New function.
11944
11945 Fri Apr  3 13:22:41 1998  Per Bothner  <bothner@cygnus.com>
11946
11947         * decl.c (class_dtable_decl), java-tree.h:  New tree node.
11948         * class.c (get_dispatch_vector, get_dispatch_table):  New functions
11949         used to build a class's dispatch table.
11950         (make_class_data):  Generate dispatch table if flag_assume_compiled.
11951         Set dtable of class object to address of class_dtable_decl.
11952
11953         * decl.c (int_decl_processing):  Make soft_badarrayindex_node
11954         be volatile and have side effects - generates better code.
11955
11956         * class.c, expr.c, parse.y:  CLASS_INTERFACE, CLASS_FINAL, etc:
11957         These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
11958
11959         * expr.c (expand_invoke):  If class is final, method is
11960         effectively final, so can call it directly.
11961
11962         * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE):  New macros.
11963
11964         * Makefile.in, Make-lang.in:  Add missing $(exeext)s.
11965
11966 Thu Mar 19 16:59:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11967
11968         * parse.y (build_method_invocation_stmt): Removed extra argument
11969         to build_invoke.
11970
11971 Mon Mar 16 17:25:19 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11972
11973         * expr.c (dtable_indent): Now static global.
11974         (expand_invoke): Now call invoke_build_dtable and
11975         build_invokevirtual.
11976         (invoke_build_dtable, build_invokevirtual): New functions.
11977         * jcf-io.c (find_class): Defer issuing a warning by setting
11978         jcf->outofsynch to 1.
11979         * jcf-parse.c (jcf_out_of_synch): New function.
11980         (load_class): Test this_jcf.outofsynch flag and call
11981         jcf_out_of_synch accordingly.
11982         * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
11983         comment indentation.
11984         * lex.c (java_get_unicode): Fixed code indentation.
11985         (java_lex): Create string literal. Fixed typo. Removed several
11986         premature obstack_free.
11987         * parse.h: New enums for name resolution and invocation mode.
11988         (struct qualification): New data structure.
11989         (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
11990         (do_resolve_class, build_method_invocation_stmt,
11991         breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
11992         debug_line, identical_subpath_p, invocation_mode,
11993         refine_accessible_methods_list, build_invoke,
11994         lookup_method_invoke): New functions declared.
11995         (build_invokevirtual, invoke_build_dtable, match_java_method,
11996         build_field_ref, jcf_out_of_synch): New references to external
11997         functions.
11998         (struct parse_ctxt): Removed artificial_constructor field.
11999         * parse.y: (array_type:): Type defined for this rule.
12000         (class_type:): Installed default rule for interface_type:.
12001         (array_type:): Now build Java array type.
12002         (qualified_name:): Now use obstack_grow0.
12003         (method_declaration:): Skip the artificial constructor added to
12004         the list, if any.
12005         (abstract_method_declaration:): Execute the code only during pass 1.
12006         (block:): Installed default rule in block_statements:.
12007         (block_statement:): Add the statement to the method during pass 2.
12008         (statement_expression): Installed default rule for
12009         method_invocation:.
12010         (argument_list:): Added code to build the argument list.
12011         (method_invocation:): Added call to create the method invocation
12012         node.
12013         (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
12014         (debug_line): New function for debug.
12015         (complete_class_decl): No longer do something during pass 1.
12016         (method_header): Use BUILD_PTR_FROM_NAME.
12017         (parser_qualified_classname): Use obstack_grow0. Removed bogus
12018         obstack_free.
12019         (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
12020         function's main comment.
12021         (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
12022         classes.
12023         (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
12024         (resolve_class): Now works with arrays.
12025         (do_resolve_class, resolve_and_layout): New functions.
12026         (java_check_regular_methods): Reverse method list before and after
12027         having processed it. No longer set ctxp->artificial_constructor.
12028         (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
12029         accordingly. Fixed typo in issued error message. Now use
12030         obstack_grow0.
12031         (find_in_imports_on_demand): Now use obstack_grow0.
12032         (declare_local_variables): Use BUILD_PTR_FROM_NAME.
12033         (source_end_java_method): Call expand_expr_stmt instead of
12034         expand_expr. Calls it before calling expand_function_end.
12035         (java_method_add_stmt): Do nothing if errors were found during
12036         parsing.
12037         (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
12038         (build_method_invocation_stmt, build_invoke, invocation_mode,
12039         lookup_method_invoke, refine_accessible_methods_list,
12040         qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
12041         New functions.
12042         * typeck.c (build_java_signature): Properly end method signature
12043         if return type skipped.
12044         (match_java_method): New function.
12045
12046 Mon Mar 16 10:40:47 1998  Per Bothner  <bothner@cygnus.com>
12047
12048         * jcf-io.c (find_classfile):  If USE_JCF_STDIO, fopen in binary mode.
12049
12050 Wed Feb 25 08:55:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12051
12052         * expr.c (build_invoke_non_interface): New function.
12053         (methods_ident, ncode_ident): Now static globals.
12054         (expand_invoke): Use build_invoke_non_interface.
12055         * java-tree.h (struct lang_decl): New field function_decl_body.
12056         (DECL_FUNCTION_BODY): New macro.
12057         * jcf-parse.c (jcf_parse_source): Deeper check before setting
12058         CLASS_FROM_SOURCE_P.
12059         (parse_source_file): Fixed typos. Call java_layout_parsed_class
12060         before starting pass 2. Call to java_generate_parsed_class replaced
12061         by java_register_parsed_class.
12062         * lex.c: Fixed typo in header. Some line width related formating.
12063         * lex.h: Some line width related formating.
12064         * parse.h (source_end_java_method, resolve_expression_name,
12065         complete_class_decl, maybe_create_class_interface_decl,
12066         check_class_interface_creation): New static function declarations.
12067         (java_layout_parsed_class, java_method_add_stmt): New function
12068         declarations.
12069         (struct parser_ctxt): Field mark_class_generate removed. New
12070         fields class_list and artificial_constructor.
12071         * parse.y: Fixed typo in header.
12072         (class_declaration:): Call complete_class_decl when class body
12073         parsed.
12074         (method_declaration:): Call source_end_java_method in pass 2 when
12075         the method body is defined.
12076         (postfix_expression:): Do expression name resolution on sub-rule
12077         name during pass 2.
12078         (create_class, create_interface): Merged common pieces.
12079         (check_class_interface_creation, maybe_create_class_interface_decl):
12080         New functions.
12081         (complete_class_decl): New function.
12082         (register_fields): Fixed line width related typo.
12083         (method_header): Correctly skip first argument when fixing
12084         argument line. Changed the loop.
12085         (java_check_circular_reference): Now use ctxp->class_list.
12086         (java_complete_class): Removed start/stop marking.
12087         (java_check_regular_methods): Now takes a class decl as an
12088         argument.  Add default constructor if none were encountered.
12089         (java_check_methods): Now use ctxp->class_list. Changed call to
12090         java_check_regular_methods.
12091         (source_start_java_method): Set DECL_ARG_TYPE for each function
12092         arguments.
12093         (source_end_java_method, java_method_add_stmt): New functions.
12094         (java_generate_parsed_class): No longer exists.
12095         (java_layout_parsed_class, java_register_parsed_class): New functions.
12096         (resolve_expression_name): New function.
12097
12098 Thu Feb 12 11:54:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12099
12100         * jcf-parse.c: (parse_source_file): Check on errors after init lex.
12101         * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
12102         until pass initializations are done. Call read_import_dir with
12103         pass set to 0.
12104         * parse.h: (lookup_modifier_cl): New function declared.
12105         (INTERFACE_FIELD_MODIFIERS): New macro.
12106         (OBSOLETE_MODIFIER_WARNING): New macro.
12107         * parse.y: (register_fields): Class type and current field name in
12108         local variables. Check modifier(s) if adding field(s) to an interface.
12109         (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
12110         and report errors using the faulty modifier line context.
12111         (lookup_modifier_cl): New function.
12112         (read_import_dir): Detect and report default import processing
12113         failure.
12114
12115 1998-02-11  Brendan Kehoe  <brendan@cygnus.com>
12116
12117         Add a pair of -fassume-compiled/-fno-assume-compiled options.
12118         * class.c (is_compiled_class): Return 1 after making sure it
12119         qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
12120         * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
12121         * java-tree.h (flag_assume_compiled): Add decl.
12122         * lang.c (lang_f_options): Add the flag.
12123         (flag_assume_compiled): Add decl, default to 0.
12124
12125 Wed Feb 11 11:27:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12126
12127         * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
12128         (is_compiled_class): Likewise.
12129         (layout_class): Likewise.
12130         (layout_class): Detect and lay out classes defined in source code.
12131         (interface_of_p, add_interface_do, may_add_interface): New
12132         function.
12133         (add_interface): Now use add_interface_do.
12134         (add_method_1): New function.
12135         (add_method): Now use add_method_1.
12136         (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
12137         (complete_start_java_method): New function.
12138         (start_java_mehod): Now call complete_start_java_method.
12139         * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
12140         (expand_invoke): Likewise and fixed typo.
12141         *gjava.c: (print_super_field): Use new argument to find_class
12142         DO_CLASS_FILE.
12143         (main): Likewise.
12144         *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
12145         (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
12146         QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
12147         IDENTIFIER_NODE.
12148         (CLASS_COMPLETE_P): New flag on TYPE_DECL.
12149         (add_method_1, push_class): New prototypes.
12150         *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
12151         *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
12152         directory where the class was found.
12153         (find_class): New argument DO_CLASS_FILE. Function find_class
12154         modified accordingly.
12155         *jcf-parse.c: (fix_class_path): New function.
12156         (load_class): Use new VERBOSE argument. load_class now finds and
12157         loads/parses .class/.java files. Save read_state of current_jcf
12158         if necessary.
12159         (java_parser_abort_on_error): New macro.
12160         (jcf_parse_source, parse_source_file): New function.
12161         (jcf_parse): Fixed typo.
12162         (yyparse): Call parse_source_file () only.
12163         (process_zip_dir): Fixed typo, fix zdir->filename_length when
12164         writing the real class name back in the zip directory entry.
12165         (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
12166         (jcf_figure_file_type): Fixed bogus alloc and bcopy.
12167         *jcf.h: (typedef struct JCF): New fields java_source and zipd.
12168         (find_class): Prototype fixed.
12169         *lex.c: Added 1998 time stamp.
12170         Removed all static global variables, moved into the parser
12171         context data structure.. Now include unistd.h if SEEK_SET not
12172         defined.
12173         (java_init_lex): Rewritten.
12174         (java_sneak_unicode): Modified current unicode access in current line.
12175         (java_unget_unicode): Likewise.
12176         (java_allocate_new_line): New allocation management.
12177         (java_read_char): Modified access and storage of unget_utf8_value.
12178         New way of processing current unicode.
12179         (java_store_unicode, java_read_unicode): Fixed typo in declaration.
12180         (java_get_unicode): Now use the parser context.
12181         (java_lineterminator): Likewise.
12182         (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
12183         of the reentrant parser implementation. Function now use the
12184         parser context data structure and java_lval. Fixed production of
12185         the float and double constant "out of range" error message. Fixed
12186         obstack use. Return integer value when hitting a modifier. Now
12187         return type for TRUE, FALSE and other predefined types. Return
12188         identifier as a TREE_LIST list containing the current line context
12189         as the TREE_VALUE sub-node.
12190         (java_unicode_2_utf8): Fixed typo in declaration.
12191         (java_lex_error): Now use the parser context data structure.
12192         *lex.h: Added 1998 time stamp.
12193         (struct java_line): New fields ref_count and next.
12194         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
12195         JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
12196         (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
12197         *parse.h: Added 1998 time stamp.
12198         (java_parse_source_file): Renamed from parse_source_file.
12199         (YYERROR_NOW, YYNOT_TWICE): Fixed.
12200         (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
12201         INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
12202         JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
12203         THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
12204         END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
12205         CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
12206         (struct parser_ctxt): New data structure to keep the parser context.
12207         *parse.y: Added 1998 time stamp, got rid of static global variables.
12208         (java_error_count, ctxp): New global variables.
12209         (%union): New value field.
12210         (numeric_type, integral_type): Rules removed.
12211         (primitive_type): Rule defined to handle integral, float, double and
12212         boolean types.
12213         (qualified_name, package_declaration,
12214         single_type_import_declaration, type_import_on_demand_declaration,
12215         modifiers, class_declaration, super, interfaces,
12216         interface_type_list, class_body, field_declaration,
12217         field_declaration, variable_declarators, variable_declarator,
12218         variable_declarator_id, method_declaration, method_header,
12219         formal_parameter_list, formal_parameter, method_body, block,
12220         static, interface_declaration, extends_interfaces,
12221         abstract_method_declaration, local_variable_declarators): Rules now
12222         define actions.
12223         (force_error, do_warning): New global statics.
12224         (push_parser_context, parser_context_save_global,
12225         parser_context_restore_global, pop_parser_context): New functions.
12226         (yyerror): Now uses the global parser context. Fixed use of obstack.
12227         (parse_error, parse_error_context, parse_warning_context,
12228         java_accstring_lookup, redefinition_error, check_modifiers,
12229         parser_add_interface, create_interface, create_class, find_field,
12230         duplicate_declaration_error, register_fields, method_header,
12231         check_modifiers_consistency, check_abstract_method_header,
12232         method_declarator, parser_qualified_classname,
12233         parser_check_super_interface, parser_check_super,
12234         parser_chain_incomplete_item, java_check_circular_reference,
12235         layout_class_from_source, java_complete_class,
12236         complete_method_decl, resolve_class, complete_class_report_errors,
12237         java_check_final, check_method_redefinition,
12238         java_check_regular_methods, java_check_abstract_methods,
12239         java_check_methods, lookup_java_interface_method2,
12240         lookup_java_method2, lookup_cl, find_name_in_single_imports,
12241         process_imports, find_in_imports, read_import_entry,
12242         read_import_dir, find_in_imports_on_demand,
12243         check_pkg_class_access, not_builtin_p, declare_local_variables,
12244         source_start_java_method, java_generate_parsed_class): New
12245         functions.
12246         *typeck.c: (signature_include_return): New global variable.
12247         (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
12248         to add the function returned type in the signature.
12249
12250 1998-02-09  Brendan Kehoe  <brendan@cygnus.com>
12251
12252         * jcf-io.c (open_in_zip): Use strncmp and LEN.
12253
12254 Thu Jan 29 16:12:13 1998  Dave Brolley  <brolley@cygnus.com>
12255
12256         * Make-lang.in (java.info): Added.
12257         (java.install-info): Added
12258
12259 1998-01-27  Brendan Kehoe  <brendan@cygnus.com>
12260
12261         * Makefile.in (clean): Also remove java/parse.c.
12262
12263 1998-01-26  Brendan Kehoe  <brendan@cygnus.com>
12264
12265         Add a pair of -fbounds-check/-fno-bounds-check options.
12266         * lang.c (lang_decode_option): Add code to grok arguments.
12267         (flag_bounds_check): Add decl.
12268         (lang_f_options): New array w/ the option in it.
12269         * java-tree.h (flag_bounds_check): Add decl.
12270         * lang-options.h: New file.
12271         * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
12272         of a static macro value.
12273         (JAVA_ARRAY_EXCEPTION): Delete macro.
12274
12275 Fri Jan 23 14:19:47 1998  Per Bothner  <bothner@cygnus.com>
12276
12277         * typeck.c (build_java_array_type):  Fix two bugs in previous change.
12278         * expr.c (build_anewarray):  Add missing promote_type.
12279
12280 Thu Jan 22 17:43:45 1998  Per Bothner  <bothner@cygnus.com>
12281
12282         Add array types with known length to optimize bounds checking.
12283         * typeck.c (build_java_array_type):  Take length parameter.
12284         (java_array_type_length, build_prim_array_type):  New functions.
12285         * java-tree.h:  Update for new functions.
12286         * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
12287         * class.c:  Use build_prim_array_type.
12288         * expr.c (can_widen_reference_to):  Handle known-length array types.
12289         (verify_jvm_instructions):  Keep track of integer push instructions
12290         followed by newarray/anewarray, so we can build known-length arrays.
12291         (JAVA_ARRAY_DATA_OFFSET):  Replace by ...
12292         (java_array_data_offset):  New function.
12293         (build_java_array_length_access):  New function.  Optimize if constant.
12294         (build_java_arrayaccess):  Constant fold bounds check.
12295         (expand_java_newarray, expand_java_anewarray):  Replaced by ...
12296         (build_newarray, build_anewarray):  New functions.
12297         (ARRAY_NEW_NUM, ARRAY_NEW_PTR):  Use build_{a,}newarray.
12298         * verify.c (merge_types):  Handle known-lengh array types.
12299
12300 Mon Jan 19 13:09:25 1998  Per Bothner  <bothner@cygnus.com>
12301
12302         * expr.c (expand_byte_code):  Fix performace bug, which caused
12303         searching linenumber_table to be linear rather than constant.
12304
12305 Fri Dec 12 19:18:42 1997  Per Bothner  <bothner@cygnus.com>
12306
12307         * Makefile.in (BISON, BISONFLAGS):  Add missing macros.
12308
12309         * decl.c, java-tree.h (soft_fmod_node):  New global.
12310         * decl.c (init_decl_processing):  Define __builtin_fmod.
12311         * expr.c (build_java_binop):  Implement TRUNC_MOD_EXPR for REAL_TYPE
12312         using __builtin_fmod.
12313
12314 Thu Dec  4 13:22:59 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12315
12316         * keyword.h: New file, output of keyword.gperf as processed by
12317         gperf.
12318         * lex.c (java_lex_init): Initialize java_error_flag.
12319         * parse.c (YYERROR_NOW): Uses java_error_flag.
12320         * parse.y: New static java_error_flag. Useless definition of
12321         buffer_error gone.
12322         * parse.y (java_error): Portable error recovery using
12323         java_error_flag (not yet completely tuned).
12324
12325 1997-12-04  Brendan Kehoe  <brendan@lisa.cygnus.com>
12326
12327         * Makefile.in (parse.c): Use $(srcdir) for parse.y.
12328
12329 Wed Dec  3 18:37:42 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12330
12331         * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
12332         (parse.c, lex.c, keyword.h): New rules for Java source code
12333         front-end.
12334         * parse.c: Renamed into jcf-parse.c.
12335         * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
12336         * keyword.gperf: New file, Java keywords.
12337         * parse.y: New file, Java language grammar.
12338         * parse.h: New file, Java language grammar definitions.
12339         * lex.c: New file, Java language lexer.
12340         * lex.h: New file, Java language lexer definitions.
12341
12342 Wed Dec  3 17:00:17 1997  Per Bothner  <bothner@cygnus.com>
12343
12344         * decl.c (clinit_identifier_node), java-tree.h:  New global.
12345         * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P):  Removed.
12346         * verify.c (verify_jvm_instructions):  Inline use of removed macros.
12347         * expr.c (expand_java_field_op):  Check for invalid assignment
12348         to final field.
12349
12350         * jcf-reader.c (get_attribute):  Test for wrong attribute length.
12351
12352 Mon Oct 27 17:46:36 1997  Per Bothner  <bothner@cygnus.com>
12353
12354         * verify.c (verify_jvm_instructions):  When processing a handler,
12355         attempt to set the current_subr to the right value.
12356         (More complicated code combines Sep 17 and Oct 22 versions.)
12357
12358 Fri Oct 24 11:36:54 1997  Per Bothner  <bothner@cygnus.com>
12359
12360         * class.c (push_class):  Figure out (guess) name of source file.
12361         * parse.c  (set_source_filename):  Set DECL_SOURCE_FILE of class decl.
12362         (give_name_to_class):  Don't guess source name;  use DECL_SOURCE_FILE.
12363         (parse_class_file):  Change return type from int to void.
12364         Call debug_start_source_file/debug_end_source_file.
12365
12366         * expr.c (build_java_binop):  Fix masking 2nd operand.
12367         * decl.c (init_decl_processing):  Set sizetype first.
12368
12369 Wed Oct 22 19:39:05 1997  Per Bothner  <bothner@cygnus.com>
12370
12371         * verify.c (verify_jvm_instructions):  Don't set current_subr to NULL.
12372         (Revert Sep 17 change.)
12373
12374 Tue Oct 21 15:09:02 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12375
12376         * parse.c (process_zip_dir): Skip ZIP entries not bearing the
12377         .class extension in their name and fix thing so we don't process
12378         them parse_zip_file_entries().
12379         (parse_zip_file_entries): Cleaned unused local variables.
12380
12381 Mon Oct 20 14:52:42 1997  Per Bothner  <bothner@cygnus.com>
12382
12383         * expr.c (can_widen_reference_to):  Allows equal array element types.
12384         (expand_byte_code):  PRE_RET must expand OPERAND_VALUE (to get index).
12385         * jcf-dump.c (RET):  Get (and print) index.
12386
12387         * verify.c (verify_jvm_instructions case OPCODE_anewarray):
12388         Promote element type to POINTER_TYPE.
12389
12390 Mon Oct 20 13:40:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12391
12392         * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
12393         find_in_current_zip, jcf_figure_file_type): Moved from
12394         jcf-reader.c to parse.c.
12395         * zextract.c: (read_zip_archive): takes file_comment_length possible
12396         field into account.
12397
12398 Mon Oct 20 11:45:06 1997  Per Bothner  <bothner@cygnus.com>
12399
12400         * verify.c (verify_jvm_instructions):  Var can also be promoted to int.
12401
12402         * verify.c (merge_types):  Handle array types even better ...
12403
12404 Fri Oct 17 15:56:37 1997  Per Bothner  <bothner@cygnus.com>
12405
12406         * expr.c (java_stack_pop):  Fix use of NULL_TREE for TYPE_SECOND.
12407
12408         * java-tree.h (PUSH_FIELD):  Set DECL_ARTIFICIAL.
12409         * class.c (make_class_data):  Don't build fields_decl if no fields.
12410         When building fields_decl, skip if DECL_ARTIFICIAL.
12411
12412         * expr.c (java_stack_swap):  Update stack_type_map.
12413         * verify.c (merge_types):  Handle array types better.
12414
12415 Wed Oct 15 18:09:45 1997  Per Bothner  <bothner@cygnus.com>
12416
12417         * class.c (add_field):  Don't promote short integral fields to
12418         int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
12419         * expr.c (push_value):  Promote and convert short integral values.
12420
12421         * decl.c, java-tree.h (integer_two_node):  New constant node.
12422         * verify.c (merge_types):  Check for TYPE_RETURN_ADDR.
12423
12424 Wed Oct 15 17:04:50 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12425
12426         * class.c (append_gpp_mangled_type): Use function argument
12427         unpromoted type to generate mangled name.
12428
12429 Mon Oct 13 16:52:55 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12430
12431         * constants.c (build_constant_data_ref): Now uses current_class
12432         instead of main_class.
12433         (build_constants_constructor): Now uses current_class instead of
12434         main_class.
12435         * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
12436         of the global variable SeepZipFiles done here.
12437         * zextract.c (read_zip_archive): extra_field optional field taken
12438         into account while computing the position of the class file in the
12439         archive.
12440         * verify.c (verify_jvm_instructions): Use current_jcf to search
12441         the constant pool.
12442         * parse.c (load_class): First search for the class to load in the
12443         current zip file. Saves current_jcf (restored before returning
12444         from that function). Don't call JCF_FINISH in the class was found
12445         in the current ZIP file.
12446         (jcf_parse): If the class was found in the current ZIP file, save
12447         its tree_constant_pool (for later reuse).
12448         (parse_class_file): New function. Process each method defined in
12449         the current class and record the class as to be later registered.
12450         (yyparse): Rewritten. Figure the type of the current file and switch
12451         accordingly.
12452         * lang.c: New global variable current_jcf.
12453         (lang_init): Removed compiling_from_source test (done later, in
12454         yyparse). Removed call the jcf_parse ().
12455         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
12456         (typedef struct JCF): New fields seen_in_zip (to mark a class found
12457         in the current ZIP file) and zip_offset (offset to the class data in
12458         the current zip file).
12459         * jcf-reader.c: zipfile.h included.
12460         localToFile: New ZipFileCache static global variable
12461         (parse_zip_file_entries): New function. Browse the current ZIP
12462         file directory and process each class found.
12463         (process_zip_dir): New function. Register each class found in the
12464         ZIP file directory. The class aren't parsed but a valid JCF is
12465         link to each of them.
12466         (find_in_current_zip): New function. Search for a class in the
12467         current ZIP file directory. If found, prepare the class so that it
12468         can be loaded.
12469         (jcf_figure_file_type): New function. Examine the file structure
12470         to figure a class file, a ZIP file. If none of these categories are
12471         matched, a source file is assumed.
12472         * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
12473         SeenZipFile: New global variable.
12474         (open_in_zip): Use zipmember's length to accelerate the search for
12475         a member. If zipmember was NULL and zip file successfully read,
12476         return 0.
12477         * java-tree.h: New global variable current_jcf declared.  Added
12478         declaration for current_constant_pool_tags, current_constant_pool_data,
12479         current_constant_pool_length, current_constant_pool_data_ref.
12480         (struct lang_type): Augmented with two fields. struct JCF *jcf (to
12481         store the JCF of classes seen in a zip file) and tree *constant_pool
12482         (to save a loaded class constant pool). current_class declared here.
12483         * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
12484         retrieve method_ref_constant.
12485         (PUSHC): java_push_constant_from_pool now uses current_jcf.
12486         (OBJECT): get_class_constant now uses current_jcf.
12487         (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
12488         (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
12489         (expand_invoke): Now uses current_class instead of main_class
12490         (build_class_init): Now uses current_class instead of main_class
12491         * class.c: New static global variable registered_class.
12492         (register_class): New function.
12493         (emit_register_class): Modified to use registered_class instead of
12494         main_class
12495         (is_compiled_class): Now take into account class seen in the archive.
12496
12497 Mon Oct  6 12:03:23 1997  Per Bothner  <bothner@cygnus.com>
12498
12499         * except.h:  Renamed to: java-except.h.
12500         * parse.c, except.c, expr.c, verify.c:  Update #include accordingly.
12501         * except.c:  Add semi-working (commented out) implementation.
12502
12503         * expr.c (expand_iinc):  Add needed flush_quick_stack.
12504         * parse.c (set_source_filename):  New function.
12505         (give_name_to_class):  Set input_filename from package.classname.java.
12506
12507         * jcf-io.c (find_class):  Don't look first in ".".
12508
12509 Wed Oct  1 11:26:10 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12510
12511         * zextract.c (read_zip_archive): Now takes into account the
12512         extra_field field.
12513         * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
12514
12515 Sat Sep 20 12:44:28 1997  Per Bothner  <bothner@cygnus.com>
12516
12517         * constants.c, java-tree.h (build_internal_class_name):  New function.
12518         (alloc_class_constant):  Re-implement using build_internal_class_name.
12519         * class.c (make_class_data):  Likewise.
12520         * class.c (hashUtf8String):  Make hash algorithm match String.hashCode.
12521
12522 Wed Sep 17 13:15:23 1997  Per Bothner  <bothner@cygnus.com>
12523
12524         * verify.c (verify_jvm_instructions):  Temporarily set current_subr
12525         to NULL before pushing an exception handler target.
12526
12527         * expr.c (flush_quick_stack):  Save from low stack indexes to high.
12528         (java_stack_swap, java_stack_dup):  Re-write to be safe from
12529         clobbering registers.
12530         (build_class_init):  New function.
12531
12532 Wed Sep 17 11:02:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12533
12534         * typeck.c (build_java_array_type): Temporary use
12535         permanent_obstack to create the array 'length' field.
12536         * expr.c (lookup_label): Temporay use permanent_obstack to create
12537         label if not found.
12538         * class.c (push_super_field): Tempory use permanent_obstack.
12539
12540 Mon Sep 15 11:33:31 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12541
12542         * typeck.c (type_for_mode): Now handles double_type_node and
12543         float_type_node.
12544         * verify.c (verify_jvm_instructions): The instruction following
12545         the wide bytecode is checked. OPCODE_ret added to the list of
12546         wide.
12547
12548 Thu Sep 11 19:45:18 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12549
12550         * class.c (make_class): Temporary use permanent_obstack. Set the
12551         class CLASS_P field to 1.
12552         (push_class): Temporary use permanent_obstack.
12553         (set_super_info): Temporary use permanent_obstack.
12554         (add_method): Temporary use permanent_obstack, set
12555         METHOD_TRANSIENT().
12556         (add_field): Temporary use permanent_obstack. Sets
12557         FIELD_VOLATILE() and FIELD_TRANSIENT().
12558         (build_class_ref): Temporary use permanent_obstack if the class
12559         isn't compiled.
12560         (build_static_field_ref): Temporary use permanent_obstack when
12561         creating field's rtl.
12562         (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
12563         ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
12564         and fields. Function finalized, as far as flag handling.
12565         (push_class_static_dummy_field): Temporary use permanent_obstack.
12566         (emit_register_class): Force generation of class registration at
12567         -O3 or deeper.
12568         * decl.c (end_java_method): Call permanent_allocation() before
12569         returning.
12570         * expr.c (can_widen_reference_to): Added comment to interface
12571         handling, fixed typo.
12572         (lookup_field): Now uses CLASS_P() to correct FIXME
12573         (expand_invoke): Verification on public && !static &&
12574         !abstract moved into soft_lookupinterfacemethod (kaffe).
12575         Use Object class dtable if objectref is an array when expanding
12576         invokeinterface.
12577         (java_push_constant_from_pool): Temporary use permanent_obstack
12578         for CONSTANT_string
12579         * parse.c (get_ref_constant): Temporary use permanent_obstack to
12580         create constant references.
12581         (get_constant): Temporary use permanent_obstack to create constant.
12582         (load_class): Temporary use permanent_obstack to load class.
12583         (jcf_parse): Temporary use permanent_obstack to perform class
12584         layout.
12585         * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
12586         (build_java_signature): Temporary use permanent_obstack.
12587         * verify.c: (verify_jvm_instruction): removed unnecessary verification
12588         on ACC_SUPER flag.
12589         * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
12590         (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
12591         (CLASS_P): Defined
12592
12593 Thu Sep 11 11:57:32 1997  Per Bothner  <bothner@cygnus.com>
12594
12595         * class.c (append_gpp_mangled_type):  Fix typo.
12596         (emit_register_class):  Use main_class to get class object, rather
12597         than looking for no-longer-existing static decl starting with _CL.
12598         * typeck.c (parse_signature_type):  Promote array element type
12599         if it is a RECORD_TYPE.
12600
12601 Wed Sep 10 16:09:23 1997  Per Bothner  <bothner@cygnus.com>
12602
12603         * class.c (push_class_static_dummy_field):  New function.
12604         (mangle_static_field):  New. Do G++-style mangling of static fields.
12605         (layout_class):  Mandle static fields here, not in add_field.
12606         (build_class_ref):  The class object is now a dummy static field.
12607         * decl.c (find_local_variable):  Look for best, instead of first match.
12608         * expr.c (push_type):  Always promote_type, not just for RECORD_TYPE.
12609         (build_java_athrow):  Don't check here if exception is Throwable.
12610         * java-tree.h (TYPE_UNSET):  Renamed to TYPE_UNKNOWN.
12611         (TYPE_USED):  Removed.  No longer used ...
12612         * parse.c (jcf_parse):  Call push_class_static_dummy_field.
12613         * verify.c (push_pending_label):  New function.
12614         (push_pending_block):  Renamed to check_pending_block.
12615         (merge_types):  Remove unneeded suuport for TYPE_UNUSED.
12616         (verify_jvm_instructions):  Only reset prev_eh_ranges (to force
12617         re-checking possible handlers) after a store (less wasted work).
12618         Check for null handler (finally) before calling add_handler.
12619         Various changes to (finally?) correctly handle try/finally.
12620
12621 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
12622
12623         * class.c: Include stdio.h.
12624
12625 Thu Sep  4 21:30:55 1997  Per Bothner  <bothner@cygnus.com>
12626
12627         * expr.c (expand_invoke):  Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
12628         to make sure class is initialized before static/special invoke.
12629
12630         * verify.c (verify_jvm_instructions):  On a store instruction,
12631         call find_local_variable to force pre-allocation of decl and rtx.
12632         * decl.c (push_jvm_slot):  Set DECL_REGISTER on stack slots.
12633
12634 Wed Sep  3 16:13:23 1997  Per Bothner  <bothner@cygnus.com>
12635
12636         * class.c (build_class_ref):   Strip off "promoted_" if need be.
12637         (make_field_value): Call build_java_signature when needed.
12638         (layout_class):  Don't make_function_rtl if METHOD_ABSTRACT.
12639         * expr.c (build_java_athrow):  Don't push_value of exception.
12640         (build_java_binop):  Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
12641         match specification of [fd]cmp[lg] for NaNs.
12642         (expand_byte_code):  Add support for exception handler ranges.
12643         * except.c:  Add skeleton for EH code-generation.
12644         * verify.c (merge_types):  Treat all promoted integral types as equal.
12645         * constants.c (build_constants_constructor):  To force creation of
12646         current_constant_pool_data_ref, call build_constant_data_ref.
12647
12648         * javaop.def (lload):  Fix typo.
12649         * jcf-dump.c (main):  Clear filename to prevent possibly-bad free.
12650
12651 Tue Sep  2 17:37:25 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
12652
12653         * parse.c: Don't include function.h.
12654
12655 Wed Aug 27 18:33:04 1997  Per Bothner  <bothner@cygnus.com>
12656
12657         * except.[ch]:  New files.
12658         * Makefile.in (JAVA_OBJS):  Add except.o
12659         * expr.c:  Temporary warning about unimplemented exceptions.
12660         * verify.c:  Verify exception handlers.
12661
12662         * jcf-dump.c (disassemble_method):  Print exception table.
12663
12664 Wed Aug 27 13:26:58 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12665
12666         * expr.c (verify_jvm_instructions): Started a thorough
12667         verification of invoke* bytecodes.
12668         (expand_byte_code): flush quick stack if PC is the target of a
12669         branch.  and undef RET (conflicting with config/i386/i386.h).
12670         (expand_java_arrayload): Fixed bogus cast, when Boolean type is
12671         used.
12672         (expand_invoke): Now handles invokeinterface and do more
12673         verification according to the bytecode.
12674         (lookup_field): Don't try to load the class if processing
12675         dtable_type.
12676         (can_widen_reference_to): Now handles interfaces.
12677         * decl.c (init_decl_processing): New global variable
12678         soft_lookupinterfacemethod_node, declared in java-tree.h.
12679         Call set_super_info on string_type_node.
12680         * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
12681         defined.
12682         * class.c (set_super_info): Fills the CLASS_* flags according to
12683         access_flags.
12684         (get_access_flags_from_decl): Handles all class flags.
12685
12686 Tue Aug 26 18:54:34 1997  Per Bothner  <bothner@cygnus.com>
12687
12688         * class.c (add_method):  Zero out newly-allocated DECL_LANG_SPECIFIC.
12689         * parse.c (yyparse):  Check for abstract method, and missing code.
12690         * expr.c (expand_byte_code):  Change interface.
12691         * lang.c (put_decl_node):  Print promoted types prettier.
12692         * verify.c (verify_jvm_instruction):  Change interface.
12693         Partial support for scanning exception table.
12694         For load instructions, handle promoted integral types.
12695
12696 Thu Aug 21 13:48:01 1997  Per Bothner  <bothner@cygnus.com>
12697
12698         * verify.c:  New file, with contents moved from expr.c.
12699         * expr.c:  Bunch of stuff (mostly verification) moved to verify.c.
12700         * typeck.c (is_array_type_p):  Moved here from expr.c.
12701         * java-tree.h:  Add some now-needed function declarations.
12702         * Makefile.in (JAVA_OBJS): Added verify.o.
12703
12704 Wed Aug 20 14:34:34 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12705
12706         * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
12707         METHOD_ABSTRACT flag.
12708
12709         * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
12710         (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
12711         (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
12712
12713         * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
12714         variables.
12715         (start_java_method): Hook for SYNCHRONIZED methods.
12716
12717         * expr.c (build_java_jsr, build_java_ret): New functions
12718         (JSR,PRE): New macros
12719         (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
12720         (verify_jvm_instructions): tableswitch, lookupswitch,
12721         monitorenter, monitorexit, goto_w: verified.
12722         (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
12723         (build_java_monitor): New function.
12724         (MONITOR_OPERATION): Modified to call build_java_monitor()
12725         (verify_jvm_instructions): Started a thorough verification of
12726         invoke* bytecodes.
12727
12728 Tue Aug 19 13:35:49 1997  Per Bothner  <bothner@cygnus.com>
12729
12730         Support verification of jsr/ret subroutines (used for try/finally).
12731         * decl.c (return_address_type_node):  New type node.
12732         * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
12733         RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
12734         LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED):  New macros.
12735         (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
12736         TYPE_USED):  New macros for special types in type_map.
12737
12738         * java-tree.h (BCODE_JUMP_TARGET):  Renamed to BCODE_TARGET.
12739         (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET):  Replaced by
12740         BCODE_JUMP_TARGET.
12741         * expr.c (expand_byte_code):  Fix logic to warn of unused instructions.
12742
12743         * expr.c (can_widen_reference_to):  New function.
12744         (pop_type):  Use it.
12745         (merge_type_state):  Support handling start of subroutine.
12746         (push_pending_block):  Return char* error message, instead of calling
12747         fatal on an error.  Also handle subroutines.
12748         (verify_jvm_instructions):  Handle errors from push_poending_block.
12749         Support jsr and ret instructions.
12750
12751 Tue Aug 19 13:33:36 1997  Per Bothner  <bothner@cygnus.com>
12752
12753         * jcf-io.c (find_classfile):  Fix thinko.
12754         * jcf-dump.c:  Add CONVERT2 (to match changed javaop.def).
12755
12756 Tue Aug 12 20:14:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
12757
12758         * Makefile.in (BISON): Remove.
12759
12760 Thu Aug  7 23:08:24 1997  Per Bothner  <bothner@cygnus.com>
12761
12762         * Makefile.in:  Convert to autoconf.
12763         * config-lang.in (outputs):  Added java/Makefile.
12764
12765         * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
12766         Rename cc1java to jc1.
12767
12768         * lang.c (init_parse, finihs_parse):  New functions #ifdef USE_CPPLIB.
12769         * Makefile.in (INTERNAL_CFLAGS):  Add @extra_c_flags.
12770
12771         * class.c (class_depth):  Do load_class if needed.
12772
12773         Mostly better verification.
12774         * decl.c (pushdecl):  Set TYPE_STUB_DECL for a type.
12775         (init_decl_processing):  Change return type of soft_checkcast.
12776         * expr.c (expand_java_CHECKCAST):  Do push_value of the "casted" value.
12777         * lang.c (put_decl_string, put_decl_node, lang_printable_name,
12778         lang_print_error):  New functions.
12779         (lang_init):  Set global hook print_error_function to lang_print_error.
12780         * expr.c:  In the type_map ptr_type_node is only used for null now.
12781         (pop_type, merge_types):  Hence ptr_type_node matches any reference.
12782         (merge_types):  Dererence pointer to record types before comparing.
12783         (decode_newarray_type, merge_types):  On error just return NULL.
12784         (build_java_binop):  Add preliminary implementation (with warning)
12785         for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
12786         (lookup_label):  Set DECL_IGNORED_P (for dwarf2out).
12787         (expand_compare, expand_java_goto, expand_java_call):  Don't
12788         push_pending_block, since that only makes sense when verifying.
12789         (merge_type_state):  Different return codes.
12790         (push_pending_block):  A block may need to be verified more than once.
12791         (expand_byte_code):  Warn about unused code at code generation time.
12792         (verify_jvm_instruction):  Changed logic, since code may need to be
12793         re-verified if type-state has changed.  Also, better error handling.
12794         Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
12795         Improve newarray, anewarray, ?aload, athrow,
12796         * java-tree.h (LABEL_CHANGED):  New macro.
12797
12798 Tue Aug  5 12:21:27 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12799
12800         * decl.c (soft_athrow_node): New global variable initialized.
12801         * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
12802         * typeck.c (convert): Added support for REAL_TYPE.
12803         (convert_to_char): New function.
12804         (convert): Handle CHAR_TYPE.
12805         * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
12806         SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
12807         (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
12808         promoted type.
12809         (verify_jvm_instructions): Added break a the end of bogus unop: label.
12810         (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
12811         (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
12812         (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
12813         (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
12814         to Use The Right Things.
12815         (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
12816         compatible with INT. BOOLEAN is made equivalent to BYTE.
12817         (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
12818         OPCODE_ifnonnull): Now supported.
12819         (build_java_athrow): New function.
12820
12821 Mon Aug  4 15:46:45 1997  Per Bothner  <bothner@cygnus.com>
12822
12823         Rename method name <init> to match G++ (and fix mangling).
12824         * class.c (layout_class):  Replace method name of <init> by class name.
12825         (make_method_value):  Do inverse renaming of constructor from <init>.
12826         * java-tree.h (DECL_CONSTRUCTOR_P):  New macro.
12827         * typeck.c (lookup_java_constructor):  New function.
12828         * expr.c (expand_invoke):  If method_name is <init>, call
12829         lookup_java_constructor to find constructor.
12830
12831         * parse.c (get_constant):  Handle CONSTANT_Float and CONSTANT_Double.
12832
12833 Fri Aug  1 11:37:09 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12834
12835         * parse.c (get_class_constant): Modified to handle array "classes"
12836         * typeck.c (set_local_type): Bug fixed when filling type_map[] with
12837         wide type.
12838         (convert): Modified to handle real type.
12839         * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
12840         soft_multianewarray, soft_newarray_node, soft_throw_node): New global
12841         variables declared.
12842         * decl.c (soft_badarrayindex_node, soft_anewarray_node,
12843         soft_multianewarray, soft_newarray_node, soft_throw_node): New
12844         global variables initialized.
12845         (find_local_variable): Handles the case of a pointer
12846         (end_java_method): Restore the use of one more scope
12847         * expr.c (build_java_arraynull_check, build_java_arrayaccess,
12848         build_java_array_length_access, expand_java_arrayload,
12849         expand_java_arraystore, expand_java_array_length,
12850         expand_java_multianewarray, expand_java_anewarray,
12851         build_java_check_indexed_type, is_array_type_p,
12852         build_java_throw_out_of_bound_exception): New functions.
12853         (STORE_INTERNAL): Now forces type of the decl to be type of the value.
12854         (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
12855         OPCODE_<t>aload): Implemented code for verification.
12856         (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
12857         ARRAY_NEW_MULTI): Macro defined.
12858         (CONVERT): Modified to invoke convert().
12859         (case OPCODE_aload2): Fixed index typo from 2 to 1.
12860
12861 Thu Jul 31 12:48:18 1997  Per Bothner  <bothner@cygnus.com>
12862
12863         * class.c (push_class):  Set DECL_ARTIFICIAL (for dbxout.c).
12864         (build_class_ref, is_compiled_class):  Handle pointer-to-record types.
12865         (make_class_data):  Field name needs '/' as package prefix.
12866         * expr.c (type_stack_dup, java_stack_dup):  Fix fencepost errors.
12867
12868 Fri Jul 25 11:44:21 1997  Per Bothner  <bothner@cygnus.com>
12869
12870         Implement debug information for local variables.
12871         * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
12872         DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
12873         DECL_LOCAL_SLOT_CHAIN):  New macros.
12874         (struct lang_decl_var):  New type.
12875         * parse.c (give_name_to_locals):  Move to decl.c.
12876         * decl.c (give_name_to_locals):  Re-written to Do The Right Thing.
12877         (start_java_method):  Re-write parameter handling.
12878         (pending_local_decls):  New global variable.
12879         (push_jvm_slot, maybe_pushlevels, maybe_poplevels):  New functions.
12880         (find_local_variable):  Accept pc so we can skips decls not in range.
12881         (struct binding_level):  Add end_pc field.
12882         * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
12883         (various):  Change so current pc gets passed to find_local_variable.
12884
12885         * decl.c (init_decl_processing):  Re-arrange fields in
12886         class_type_node and and method_type_node to match kaffe 0.9.1.
12887         * class.c (make_method_value, make_class_data):  Update
12888         initializations to match.
12889
12890 Wed Jul 16 17:17:50 1997  Per Bothner  <bothner@cygnus.com>
12891
12892         * class.c (unicode_mangling_length, emit_unicode_mangled_name,
12893         append_gpp_mangled_name, append_gpp_mangled_type):  New functions.
12894         (push_super_field):  New function.
12895         (make_class_data):  Handle inheritance of class static initializer.
12896         (layout_class):  New name mangling.
12897         * constants.c (build_constant_data_ref):  Init type of data array
12898         to a one-element array.
12899         (build_constants_constructor):  Set DECL_SIZE from complete array type.
12900         * decl.c:  Rename class_type, object_type etc to class_type_node,
12901         object_type_node etc.  Make former inherit from latter.
12902         * expr.c (expand_invoke):  Add cast of function address.
12903         * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE):  New.
12904         * parse.c (yyparse):  Don't call layout_class here.
12905         * typeck.c (build_java_array_type):  Set TYPE_ARRAY_ELEMENT.
12906
12907 Sat Jun 14 12:06:57 1997  Per Bothner  <bothner@cygnus.com>
12908
12909         * decl.c, class.c:  Update method type to match latest Kaffe snapshot.
12910         * constants.c (lookup_name_constant):  Renamed to alloc_name_constant.
12911         (alloc_class_constant):  New.
12912         * expr.c (expand_invoke):  Make sure method's class is initialized.
12913         * class.c (interits_from_p, emit_register_class):  New functions.
12914         * parse.c (yyparse):  Call emit_register_class.
12915
12916 Mon Jun  9 18:08:06 1997  Per Bothner  <bothner@cygnus.com>
12917
12918         * constants.c:  New file, to handle constant pool.
12919         * Makefile.in (JAVA_OBJS):  Add constants.o.
12920         * decl.c (init_decl_processing):  Update, fix, finish various structs.
12921         (pushdecl_top_level):  New.
12922         * parse.c (layout_class):  Moved to class.c.
12923         * expr.c (java_push_constant_from_pool):  New function.
12924         * class.c (build_class_ref):  Make work fully
12925         (make_class_data):  Emit super-class, constant pool, interface vector.
12926
12927 Tue Jun  3 10:14:31 1997  Per Bothner  <bothner@cygnus.com>
12928
12929         java-tree.h (DECL_SIGNATURE, BCODE_EMITTED):  Remove.
12930         (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P):  New.
12931         * class.c (class_depth):  New function.
12932         (lookup_named_class):  Replaced by new function lookup_class.
12933         * decl.c (object_type_node, string_type_node):  New.
12934         Remove various types that we no longer need.
12935         * expr.c (verify_jvm_instructions):  New separate verifier pass.
12936         (push_type, pop_type):  New functions for verifier.
12937         (type_stack_dup, pop_argument_types, merge_types):  Likewise.
12938         (expand_byte_code):  Simplify, since we assume already verified.
12939         (expand_invoke):  Now mostly works.
12940         * javaop.def:  Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
12941         * lang.c (main_class):  Move to parse.c.  Don't make_class yet.
12942         * parse.c:  Wait to allocate class object until we know its name.
12943         (layout_class):  Calculate DECL_VINDEX for each virtual method.
12944         * typeck.c (get_array_type):  Rename to ...
12945         (build_java_array_type):  ... and provide working implementation.
12946         (build_java_signature):  New function - build Java signature of type.
12947         (set_java_signature):  New function - cache signature with type.
12948         (lookup_java_method):  New function.
12949
12950 Tue May  6 22:08:24 1997  Per Bothner  <bothner@deneb.cygnus.com>
12951
12952         * class.c (ident_subst):  Take extra SUFFIX parameter.
12953         (add_field):  Set DECL_ASSEMBLER_NAME of static fields;  more.
12954         (set_constant_value, build_static_field_ref, is_compiled_class):  New.
12955         (build_class_ref):  Actually implement.
12956         * decl.c, java-tree.h:  Renamed some xx_type to xx_type_node.
12957         * decl.c (builtin_function):  New.
12958         (init_decl_processing):  Update for current Kaffe.  Declare some
12959         builtin Kaffe functions.
12960         * expr.c (build_address_of):  New.
12961         (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
12962         Renamed (from expand_java_new etc), and added working implementations.
12963         (build_field_ref):  Now also handle static fields.
12964         (expand_invoke):  Implement invokestatic, and start implement rest.
12965         * java-opcodes.h:  Use javaop.def to avoid duplicated list.
12966         * javaop.def:  Rename invokevirt -> invokevirtual.
12967         * lang.c (use_handles):  Removed.
12968         * parse.c:  Add support for ConstantValue attribute.
12969         Handle nested loading of a class.  (JPOOL_UTF):  New.
12970
12971 Tue Mar 11 20:11:05 1997  Per Bothner  <bothner@deneb.cygnus.com>
12972
12973         * expr.c (expand_java_pushc):  Support #ifndef REAL_ARITHMETIC case.
12974
12975 Thu Feb 27 14:24:29 1997  Per Bothner  <bothner@deneb.cygnus.com>
12976
12977         * Make-lang.in (java.install-man):  New empty rule.
12978         * typeck.c (set_local_type):  New function.
12979         * expr.c (STORE_INTERNAL):  Call find_local_variable,
12980         not find_stack_slot.  Call set_local_type.
12981
12982 Wed Feb 12 16:11:05 1997  Per Bothner  <bothner@kalessin.cygnus.com>
12983
12984         * java-tree.h:  Various new macros for constructing RECORD_TYPEs,
12985         and building RECORD_TYPE CONSTRUCTORs.
12986         Also support for creating Utf8Const objects from an INDETIFIER_NODE.
12987
12988         * lang.c (use_handles):  Change the default to 0.
12989         * decl.c:  Define and build class_type, field_type, utf8const_type.
12990         * class.c (make_class_data, make_field_value,
12991         get_access_flags_from_decl, build_class_ref, build_utf8_ref,
12992         hashUtf8String, strLengthUtf8, mangled_classname:
12993         Functions to build reflective data structures.
12994         * parse.c (yyparse):  Call make_class_data.
12995
12996         * jcf-io.c (open_class, find_classfile):  New functions.
12997         * jcf-dump.c:  Support reading classfile from explicitly-named
12998         class file (without CLASSPATH searching).
12999
13000 Thu Oct 24 14:10:16 1996  Per Bothner  <bothner@deneb.cygnus.com>
13001
13002         * jcf-reader.c:  Add parameter list to HANDLE_CONSTANT_Utf8.
13003         * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
13004         Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
13005         (get_constant):  Now trivial for CONSTANT_Utf8.
13006
13007         * jcf.h:  Make NEW_CPOOL the default.
13008         * jcf.h, jcf-reader.c, parse.c:  Remove support for !NEW_CPOOL.
13009
13010 Thu Oct 24 13:52:45 1996  Per Bothner  <bothner@deneb.cygnus.com>
13011
13012         New directory.