OSDN Git Service

10a4746a8d095c6468afd8d5ad6993ccc6af516d
[pf3gnuchains/gcc-fork.git] / gcc / java / ChangeLog
1 2002-06-04  Tom Tromey  <tromey@redhat.com>
2
3         * jcf-write.c (perform_relocations): Optmize a goto to a goto.
4
5 2002-06-04  Michael Koch  <konqueror@gmx.de>
6
7         * gcj.texi (Input Options): Fixed typo.
8
9 2002-06-04  Zack Weinberg  <zack@codesourcery.com>
10
11         * java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
12         typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
13         all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
14         and all now-pointless local variables.  Rename other local
15         variables to reflect their not being handles.
16
17         * java-tree.h, jcf-dump.c, jcf-io.c: Remove all
18         #if JCF_USE_STDIO blocks.
19
20         * parse.y: Add missing semicolon at end of rule.
21
22 2002-06-03  Geoffrey Keating  <geoffk@redhat.com>
23
24         * check-init.c (attach_initialized_static_class): Delete, unused.
25         * parse.y: Use htab_t instead of struct hashtable, update
26         all uses.
27         * java-tree.h: Include hashtab.h instead of hash.h.
28         (struct lang_decl_func): Use htab_t, set up for gengtype.
29         (struct init_test_hash_entry): Delete.
30         (struct treetreehash_entry): New.
31         (java_treetreehash_find): New
32         (java_treetreehash_new): New prototype.
33         (java_treetreehash_create): New prototype.
34         (java_mark_tree): Delete prototype.
35         (java_hash_hash_tree_node): Delete prototype.
36         (java_hash_compare_tree_node): Delete prototype.
37         (attach_initialized_static_class): Delete prototype.
38         * expr.c (build_class_init): Update to use java_treetreehash
39         functions.
40         (java_expand_expr): Update to use htab_t.
41         (emit_init_test_initialization): Likewise.
42         * decl.c (java_mark_tree): Delete.
43         * class.c (init_test_hash_newfunc): Delete.
44         (java_hash_hash_tree_node): Delete.
45         (java_hash_compare_tree_node): Delete.
46         (add_method_1): Update to use java_treetreehash functions.
47         (JAVA_TREEHASHHASH_H): New macro.
48         (java_treetreehash_hash): New function.
49         (java_treetreehash_compare): New function.
50         (java_treetreehash_find): New function.
51         (java_treetreehash_new): New function.
52         (java_treetreehash_create): New function.
53         * Make-lang.in (JAVA_TREE_H): Replace hash.h by HASHTAB_H.
54
55         * Make-lang.in (java/parse.o): Depend on debug.h.
56         * java-tree.h (struct lang_identifier): Use gengtype.
57         (union lang_tree_node): New.
58         (struct lang_decl_func): Use gengtype.
59         (struct lang_decl_var): Likewise.
60         (struct lang_decl): Likewise.
61         * parse.y: Include debug.h.
62         * lang.c (LANG_HOOKS_MARK_TREE): Delete.
63
64         * lang.c (struct language_function): New dummy structure.
65
66         * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Set
67         descriminator for DECL_LANG_SPECIFIC.
68         (struct lang_decl_func): Rename from struct lang_decl.
69         (enum lang_decl_desc): New.
70         (struct lang_decl): Make it a union.  Update all the accessor macros.
71         (struct lang_type): Use gengtype.
72         * class.c (add_method_1): Set descriminator for DECL_LANG_SPECIFIC.
73         * decl.c (java_dup_lang_specific_decl): All lang_decl structures
74         are now the same size.
75         (lang_mark_tree): Use gengtype to mark TYPE_LANG_SPECIFIC;
76         use discriminator to mark DECL_LANG_SPECIFIC.
77
78         * Make-lang.in (gt-java-builtins.h): New rule.
79         (java/builtins.o): Add dependency on gt-<filename>.h.
80         * builtins.c: Use gengtype for roots.
81         (union string_or_tree): Use gengtype.
82         (struct builtin_record): Use gengtype.
83         * config-lang.in (gtfiles): Add builtins.c.
84
85         * Make-lang.in (gt-java-class.h, gt-java-constants.h,
86         gt-java-decl.h, gt-java-expr.h, gt-java-jcf-parse.h,
87         gt-java-jcf-write.h, gt-java-lang.h, gt-java-mangle.h,
88         gt-java-parse.h, gtype-java.h): Add rules to generate.
89         (parse.o): Add dependency on gt-java-parse.h, gt-java.h.
90         (class.o): Add dependency on gt-*.h.
91         (constants.o): Likewise.
92         (decl.o): Likewise.
93         (expr.o): Likewise.
94         (jcf-parse.o): Likewise.
95         (jcf-write.o): Likewise.
96         (lang.o): Likewise.
97         * config-lang.in (gtfiles): New.
98         * class.c: Replace uses of ggc_add_* with GTY markers.  Include gt-*.h.
99         * constants.c: Replace uses of ggc_add_* with GTY markers.
100         Include gt-*.h.
101         * decl.c: Replace uses of ggc_add_* with GTY markers.  Include gt-*.h.
102         * expr.c: Replace uses of ggc_add_* with GTY markers.  Include gt-*.h.
103         * java-tree.h: Replace uses of ggc_add_* with GTY markers.
104         * jcf-parse.c: Replace uses of ggc_add_* with GTY markers.
105         Include gt-*.h.
106         * jcf-write.c: Replace uses of ggc_add_* with GTY markers.
107         Include gt-*.h.
108         * lang.c: Replace uses of ggc_add_* with GTY markers.  Include gt-*.h.
109         * mangle.c: Replace uses of ggc_add_* with GTY markers.  Include
110         gt-*.h.
111         * parse.y: Replace uses of ggc_add_* with GTY markers.  Include gt-*.h.
112         Include gtype-java.h.
113
114 2002-06-02  Tom Tromey  <tromey@redhat.com>
115
116         Fix for PR java/5913:
117         * parse.y (patch_binop): Call patch_string on op1.
118
119 2002-06-02  Tom Tromey  <tromey@redhat.com>
120
121         Fix for PR java/1343, PR java/6336:
122         * parse.y (make_nested_class_name): Remove extraneous `else'; fix
123         formatting.  Changed return type.
124         (anonymous_class_counter): Moved to top of file.
125         (maybe_make_nested_class_name): Append number to class name for
126         function-local classes.
127
128 2002-05-28  Zack Weinberg  <zack@codesourcery.com>
129
130         * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h.
131         * Make-lang.in: Update dependency lists.
132
133 2002-05-18  Mark Mitchell  <mark@codesourcery.com>
134
135         * gjavah.c (throwable_p): Do not free the name of the class after
136         passing it to find_class.
137         * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition.
138         * jcf-io.c (dirent.h): Include it.
139         (fnmatch.h): Likewise.
140         (compare_path): New function.
141         (java_or_class_file): Likewise.
142         (memoized_dirlist_entry): New type.
143         (memoized_dirlist_lookup_eq): New function.
144         (memoized_dirlists): New variable.
145         (caching_stat): New function.
146         (memoized_class_lookup_eq): New function.
147         (memoized_class_lookups): Likewise.
148         (find_class): Use memoized_class_lookups and caching_stat.
149         * jcf.h (JCF_USE_SCANDIR): Define.
150         * parse.y (java_expand_classes): Write the class files in reverse
151         order.
152
153 2002-05-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
154
155         * Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
156
157 2002-05-13  Mark Mitchell  <mark@codesourcery.com>
158
159         * jcf-write.c (write_classfile): Unlink the temporary file if it
160         cannot be renamed.  Use concat to build up the name of the
161         temporary file.
162
163 2002-05-08  Mark Mitchell  <mark@codesourcery.com>
164
165         * jcf-write.c (write_classfile): Write the file to a
166         temporary file and then rename it.
167
168 2002-05-07  Tom Tromey  <tromey@redhat.com>
169
170         * gjavah.c (throwable_p): Use xstrdup, not strdup.
171
172         Fix for PR java/1200:
173         * gjavah.c (throwable_p): New function.
174         (decode_signature_piece): Use it.  A `WeakReference' isn't the
175         same as a `jweak'.
176         Include hashtab.h.
177         (gcjh_streq): New function.
178
179 2002-05-07  Andreas Jaeger  <aj@suse.de>
180
181         * parse.y (finish_for_loop): Fix if statement.
182
183 2002-05-06  Tom Tromey  <tromey@redhat.com>
184
185         Fix for PR java/5941:
186         * parse.y (finish_for_loop): Set SUPPRESS_UNREACHABLE_ERROR for
187         loop update expression.
188         (java_complete_lhs): Use SUPPRESS_UNREACHABLE_ERROR.
189         * java-tree.h (SUPPRESS_UNREACHABLE_ERROR): New macro.
190
191 2002-05-04  Mark Wielaard  <mark@klomp.org>
192
193         For PR java/6519:
194         * parse.y (build_string_concatenation): Return just op1 only when op2
195         is null and op1 is a STRING_CST, otherwise always construct a
196         StringBuffer.
197
198 2002-04-27  Tom Tromey  <tromey@redhat.com>
199
200         For PR java/6382:
201         * parse.y (string_convert_int_cst): New function.
202         (merge_string_cste): Use it.
203
204 2002-04-25  Neil Booth  <neil@daikokuya.demon.co.uk>
205
206         * java-tree.h (java_parse_file): Update.
207         (java_set_yydebug): Remove.
208         * jcf-parse.c (yydebug): Remove.
209         (java_set_yydebug): Die.
210         (java_parse_file): Update.
211         * lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
212
213 2002-04-24  Tom Tromey  <tromey@redhat.com>
214
215         For PR java/6425:
216         * parse.y (qualify_ambiguous_name) [case CALL_EXPR]: Always choose
217         EXPR_WFL_QUALIFICATION of qual_wfl.
218
219 2002-04-23  Per Bothner  <per@bothner.com>
220
221         * expr.c (PRE_JSR):  Call NOTE_LABEL for return address.
222         * java-tree.h (BCODE_RETURN_TARGET):  Removed - never set.
223         (BCODE_TARGET):  Remove BCODE_RETURN_TARGET.
224
225 2002-04-23  Tom Tromey  <tromey@redhat.com>
226
227         For PR java/6314:
228         * jvspec.c (lang_specific_driver): Use --resource, not -R.  Also
229         recognize `-fcompile-resource='.
230         * gcj.texi (Invoking gcj): Use --resource, not -R.  Expanded text
231         a bit.
232
233 2002-04-22  Alexandre Petit-Bianco  <apbianco@redhat.com>
234
235         * jcf-parse.c: (yyparse): Don't prepend "./" to relative
236         paths. Fixes PR java/2791.
237
238 2002-04-19  Andrew Haley  <aph@redhat.com>
239
240         * jcf-write.c (push_long_const): lo, hi: New variables.
241         Use rshift_double to extract the high part of a 64-bit long.
242         Use WORD_TO_INT to extract the low part.
243
244         * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
245         HOST_WIDE_INT for num.  Use JPOOL_UINT to get it.
246         CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
247
248 2002-04-18  Neil Booth  <neil@daikokuya.demon.co.uk>
249
250         * typeck.c (incomplete_type_error): Remove.
251
252 2002-04-18  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
253
254         * class.c (make_class_data): Set DECL_ALIGN on static class data,
255         for hash synchronization.
256         * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects.
257         * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for
258         class_type_node.
259
260 2002-04-16  Mark Wielaard  <mark@klomp.org>
261
262         * jcf-write.c (generate_bytecode_insns): Only write const_0 if not
263         negative zero.
264
265 2002-04-16  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
266
267         Fix for PR java/6294:
268         * parse.h (INNER_INTERFACE_MODIFIERS): Allow ACC_PRIVATE for inner
269         interfaces.
270
271 2002-04-15  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
272
273         Fix for PR java/6085:
274         * parse.y (patch_method_invocation): Always use build_access_to_thisn
275         to get enclosing "this" argument for inner-class constructor
276         invocation. Pass correct arguments to build_access_to_thisn.
277
278 2002-04-10  Andreas Jaeger  <aj@suse.de>
279
280         * gcj.texi (Input Options): Fix extdirs patch.
281
282 2002-04-10  Anthony Green  <green@redhat.com>
283
284         * jcf-path.c (jcf_path_init) : Clean up local extdirs declaration.
285
286 2002-04-09  Anthony Green  <green@redhat.com>
287
288         * gcj.texi (Input Options): Add --extdirs documentation.
289         * jcf-dump.c (OPT_extdirs): New macro.
290         (options): Add extdirs option.
291         (help): Describe --extdirs.
292         (main): Handle OPT_extdirs.
293         * gjavah.c (OPT_extdirs): New macro.
294         (options): Add extdirs option.
295         (help): Describe --extdirs.
296         (main): Handle OPT_extdirs.
297         * jcf-path.c (jcf_path_init): Add extdirs support.
298         (jcf_path_extdirs_arg): New function.
299         (extensions): New variable to hold extensions path entries.
300         * jvspec.c: Remove -fextdirs= when compiling main().
301         * lang.c (java_decode_option): Handle -fextdirs=.
302         * jcf.h (jcf_path_extdirs_arg): Declare new function.
303         * Make-lang.in: Compile jcf-path with version info for use in
304         identifying the appropriate libgcj.jar.
305
306 2002-04-08  Tom Tromey  <tromey@redhat.com>
307
308         For PR libgcj/5303:
309         * .cvsignore: Added rmic.1 and rmiregistry.1.
310         * gcj.texi (Top): Link to new nodes.
311         (Invoking rmic): New node.
312         (Invoking rmiregistry): Likewise.
313         * Make-lang.in (java.generated-manpages): Added rmic.1 and
314         rmiregistry.1.
315         (java.maintainer-clean): Likewise.
316         ($(srcdir)/java/rmic.1): New target.
317         ($(srcdir)/java/rmiregistry.1): Likewise.
318         (java.install-man): Handle rmic.1 and rmiregistry.1.
319
320 2002-04-08  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
321
322         * gcj.texi (Invocation): Update JvAttachCurrentThread documentation.
323         Add note about handling uncaught exceptions. Add an exception handler
324         to example.
325
326 2002-04-08  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
327
328         * parse.y (resolve_qualified_expression_name): Clear "from_super" flag
329         after using it to patch CALL_EXPR.
330
331 2002-04-08  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
332
333         * gcj.texi (Invocation): Document CNI invocation API.
334
335 2002-04-04  Neil Booth  <neil@daikokuya.demon.co.uk>
336
337         * expr.c (truthvalue_conversion): Rename.  Update.
338         (expand_compare): Update.
339         * java-tree.h (java_truthvalue_conversion): New.
340         * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
341
342 2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
343
344         * java-tree.h (java_mark_addressable): New.
345         * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
346         * typeck.c (mark_addressable): Rename, update.
347
348 2002-04-01  Neil Booth  <neil@daikokuya.demon.co.uk>
349
350         * expr.c (build_java_binop): Update.
351         * java-tree.h (java_signed_type, java_unsigned_type,
352         java_signed_or_unsigned_type): Update.
353         * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
354         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
355         * parse.y (patch_binop): Update.
356         * typeck.c (signed_or_unsigned_type, unsigned_type,
357         signed_type): Update.
358
359 2002-03-31  Neil Booth  <neil@daikokuya.demon.co.uk>
360
361         * lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
362         (java_dummy_print): Remove.
363         (lang_print_error): Rename.  Exit early if inhibiting output.
364         (inhibit_error_printing_function): New.
365         (java_init): Don't set hook.
366         (lang_init_source): Use new boolean.
367
368 2002-03-29  Martin Kahlert  <martin.kahlert@infineon.com>
369
370         * parse.y (do_resolve_class): Fix infinite recursion.
371
372 2002-03-29  Tom Tromey  <tromey@redhat.com>
373
374         * parse.y (check_inner_circular_reference): Ignore incomplete
375         types.
376
377 2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
378
379         * Make-lang.in (builtins.o): Update.
380         * boehm.c (get_boehm_type_descriptor): Update.
381         * builtins.c: Include langhooks.h.
382         * decl.c (java_init_decl_processing): Update.
383         * java-tree.h (java_type_for_mode, java_type_for_size): New.
384         * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
385         Redefine.
386         * typeck.c (type_for_mode, type_for_size): Update.
387
388 2002-03-29  Martin Kahlert  <martin.kahlert@infineon.com>
389
390         * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
391
392 2002-03-28  Tom Tromey  <tromey@redhat.com>
393
394         * except.c (expand_end_java_handler): If the handler type is NULL,
395         use java.lang.Throwable.  Fixes PR java/5986.
396
397 2002-03-28  Alexandre Petit-Bianco  <apbianco@redhat.com>
398
399         Fix for PR java/4715:
400         * jcf-parse.c (parse_source_file_3): New function.
401         (read_class): Call it.
402         (java_parse_file): Likewise.
403
404 Thu Mar 28 13:22:22 CET 2002  Jan Hubicka  <jh@suse.cz>
405
406         * java/lang.c (java_init_options): Set flag_trapping_math to 0.
407
408 2002-03-28  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
409
410         * parse.y (resolve_package): Initialize "decl".
411         (lookup_package_type): Remove unused function.
412
413 2002-03-28  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
414
415         Fix for PR java/5993:
416         * parse.y (resolve_package): Return the decl if resolution was
417         successful. Don't special case "java.lang" and "java.lang.reflect"
418         packages. Set type_name to the merged identifier.
419         (resolved_qualified_expression_name): Print error using "name" if
420         resolve_package returns NULL_TREE.
421
422 2002-03-27  Tom Tromey  <tromey@redhat.com>
423
424         * expr.c (expand_invoke): Don't generate null pointer check if
425         we're calling <init>.
426
427 2002-03-27  Neil Booth  <neil@daikokuya.demon.co.uk>
428
429         * expr.c (java_lang_expand_expr): Rename java_expand_expr,
430         fix prototype.
431         * java-tree.h (java_lang_expand_expr): Similarly.
432         * lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
433         (java_init): Don't set hook.
434
435 2002-03-27  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
436
437         Fix for PR java/5850:
438         * parse.y (lookup_field_wrapper): Call itself recursively for enclosing
439         context if field was not found in the current scope.
440         * expr.c (lookup_field): Don't look in enclosing contexts.
441
442 2002-03-26  Tom Tromey  <tromey@redhat.com>
443
444         Fix for PR java/5942:
445         * parse.y (init_src_parse): Added sanity check.
446         * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
447         elements, not 11.
448
449 2002-03-26  Neil Booth  <neil@daikokuya.demon.co.uk>
450
451         * decl.c (lang_mark_tree): Rename java_mark_tree.
452         * java-tree.h (java_mark_tree): New.
453         * java-lang.c (LANG_HOOKS_MARK_TREE): Redefine.
454
455 2002-03-25  Zack Weinberg  <zack@codesourcery.com>
456
457         * lex.c: Change java_perform_atof to take normal parameters
458         instead of a pointer to a parameter block.  Call it directly
459         from java_lex.
460
461 2002-03-22  Mark Wielaard  <mark@klomp.org>
462
463         Fix for PR java/5368:
464         * parse.y (resolve_qualified_expression_name): Use decl not field_decl
465         when printing error message.
466
467 2002-03-25  Neil Booth  <neil@daikokuya.demon.co.uk>
468
469         * decl.c (maybe_build_cleanup): Remove.
470
471 2002-03-22  Tom Tromey  <tromey@redhat.com>
472
473         Andrew Haley  <aph@cambridge.redhat.com>
474
475         * expr.c (build_field_ref): Don't build a check if the field is a
476         member of `this'.
477
478 2002-03-21  Eric Blake  <ebb9@email.byu.edu>
479
480         Fix for PR java/6026:
481         * lex.c (java_lex): Fix parsing of consecutive floats.
482
483 2002-03-21  Tom Tromey  <tromey@redhat.com>
484
485         * parse.y (build_access_to_thisn): Stop when FROM is not an inner
486         class.
487
488 2002-03-21  Neil Booth  <neil@daikokuya.demon.co.uk>
489
490         * cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
491         insert_block, getdecls, kept_level_p, global_bindings_p): New.
492
493 2002-03-20  Nic Ferrier  <nferrier@tapsellferrier.co.uk>
494
495         * gcj.texi: @code{gcj} becomes @command{gcj}.
496         @code{gcc} becomes @command{gcc}.
497         GcjRaw changed to gnu.gcc.RawData.
498
499 2002-03-20  Neil Booth  <neil@daikokuya.demon.co.uk>
500
501         * decl.c (start_java_method): Use new hook.
502         * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
503         (java_init): Remove old hook.
504
505 2002-03-18  Alexandre Petit-Bianco  <apbianco@redhat.com>
506
507         * builtins.c (define_builtin): Do nothing if `type' is null.
508         Fixes PR java/5876.
509
510 2002-03-18  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
511
512         * parse.y (parser_check_super_interface): Fix error message
513         grammar/order.
514
515 2002-03-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
516
517         * jcf-parse.c (get_constant): Delete unused variables.
518
519 2002-03-17  Neil Booth  <neil@daikokuya.demon.co.uk>
520
521         * java-tree.h (java_parse_file): New.
522         * jcf-parse.c (yyparse): Rename java_parse_file.
523         * lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
524
525 2002-03-16  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
526
527         * parse.y (craft_constructor): Return the constructor decl.
528         (java_expand_classes): Update comments.
529         (lookup_method_invoke): Call fix_constructors immediately for
530         anonymous class. Fixes PR java/5935.
531
532 2002-03-15  Anthony Green  <green@redhat.com>
533
534         * jcf-parse.c (yyparse): Don't emit class registration
535         constructor when compiling resource files.
536
537 2002-03-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
538
539         * lang.c (java_tree_code_type, java_tree_code_length,
540         tree_code_name): Delete.
541         (tree_code_type, tree_code_length, tree_code_name): Define.
542         (java_init): Don't try to copy into the various tree_code
543         arrays.
544
545 2002-03-12  Tom Tromey  <tromey@redhat.com>
546
547         * jcf-parse.c (get_constant) [CONSTANT_String]: String values are
548         UTF-8, not UCS-2.  Fixes PR java/5923.
549
550         * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is
551         a call_expr wrapped in a convert.  Fixes PR java/5848.
552
553 2002-03-12  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
554
555         * jcf-write.c (write_classfile): Improve error strings.
556
557 2002-03-11  Eric Blake  <ebb9@email.byu.edu>
558
559         * lex.c: Adjust comments to GNU standards.
560
561 2002-03-11  Eric Blake  <ebb9@email.byu.edu>
562
563         Fix for PR java/5902:
564         * lex.c (java_lex): Fix parsing of literals.
565
566 2002-03-11  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
567
568         * parse.y (patch_assignment): Wrap the right-hand-side with a save_expr
569         to prevent it getting evaluated twice in the store checking case.
570         * expr.c (build_java_arraystore_check): Unwrap SAVE_EXPR's when
571         examining OBJECT.
572
573 2002-03-09  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
574
575         * decl.c (java_init_decl_processing): Make sure class_type_node
576         alignment is not less than 64 bits if hash synchronization is enabled.
577
578 2002-03-08  Per Bothner  <per@bothner.com>
579
580         * parse.y (java_complete_lhs):  Check if patch_assignment
581         returned an error-mark.
582
583         * parse.y (try_builtin_assignconv):  Don't special-case zero.
584
585 2002-03-08  Per Bothner  <per@bothner.com>
586
587         Fix for PR java/5812.
588         * expr.c (build_java_jsr):  Take pc arguments, and do lookup_label
589         here instead of in JSR macro.  Likewise with load_type_state call.
590         Do the latter on if the return_pc has been verified (the jsr returns).
591         (JSR):  Now just call build_java_jsr.
592
593 2002-03-07  Jeff Sturm  <jsturm@one-point.com>
594
595         * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define.
596         (java.install-common): Link native driver to
597         JAVA_TARGET_INSTALL_NAME.
598
599 2002-03-05  David Billinghurst <David.Billinghurst@riotinto.com>
600
601         * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED
602         * builtins.c(sin_builtin): Likewise
603         * builtins.c(sqrt_builtin): Likewise
604
605 2002-03-03  Zack Weinberg  <zack@codesourcery.com>
606
607         * java/expr.c, java/jcf-parse.c, java/lex.c:
608         Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
609         REAL_ARITHMETIC blocks unconditional.  Delete some further
610         #ifdef blocks predicated on REAL_ARITHMETIC.
611
612 2002-03-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
613
614         * class.c (init_class_processing): Use ARRAY_SIZE in lieu of
615         explicit sizeof/sizeof.
616         * decl.c (java_init_decl_processing): Likewise.
617         * jcf-parse.c (init_jcf_parse): Likewise.
618         * parse.y (init_src_parse): Likewise.
619
620 2002-03-02  Per Bothner  <per@bothner.com>
621
622         Make --CLASSPATH by a synonym for --classpath and -classpath.
623         Implement --bootclasspath.
624         * jcf-path.c (classpath_u):  Rename static variable to classpath_user.
625         (classpath_l):  Remove.
626         (jcf_path_CLASSPATH_arg):  Remove.
627         (jcf_path_bootclasspath_arg):  New function.
628         (jcf_path_seal):  Simplify accordingly.
629
630         * jcf.h (jcf_path_bootclasspath_arg):  New declarations.
631         (jcf_path_CLASSPATH):  Remove declaration.
632         * jvspec.c (jvgenmain_spec):  Also accept -fbootclasspath*.
633         (lang_specific_driver):  Translate -bootclasspath.
634         * lang-options.h:  Add --bootclasspath.  Update --CLASSPATH.
635         * lang.c (decode_lang_options):  Do jcf_path_init first.
636         Handle -fCLASSPATH same as -fclasspath.  Also process -fbootclasspath.
637         * gjavah.c:  Also handle --bootclasspath.
638         Handle --CLASSPATH as a synonum for --classpath.
639         * jcf-dump.c: Likewise.
640
641         "." is not part of system path, but is the default for --classpath.
642         * jcf-path.c (jcf_path_init):  Don't add "." to sys_dirs.
643         (jcf_path_seal):  Add "." if no CLASSPATH specified.
644
645         * gcj.texi:  Document changes.
646
647 2002-03-01  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
648
649         * expr.c (build_java_arraystore_check): Fix formatting.
650
651 2002-02-28  Alexandre Petit-Bianco  <apbianco@redhat.com>
652
653         Fix for PR java/5758, java/5632:
654         * jcf-parse.c (load_class): Renamed local variable, consider `.' an
655         inner-class separator too.
656         * parse.y (do_resolve_class): New local `decl_result.'
657         Progressively build a name for what can have been loaded.
658
659 2002-02-28  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
660
661         * expr.c (java_array_data_offset): Removed function.
662         (JAVA_ARRAY_LENGTH_OFFSET): Removed macro.
663         (build_java_array_length_access): Obtain "length" value using a
664         COMPONENT_REF, instead of INDIRECT_REF and arithmetic.
665         (build_java_arrayaccess): Correct comment. Access "data" using a
666         COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF.
667         (build_java_arraystore_check): New function.
668         (expand_java_arraystore): Use build_java_arraystore_check.
669         * parse.y (patch_assignment): Simplify code to insert a store check
670         when lvalue is an ARRAY_REF. Use build_java_arraystore_check.
671         * check-init.c (check_init): Update to reflect that an array length
672         access is now a COMPONENT_REF.
673         * gcj.texi (Code Generation): Improve documentation of
674         -fno-bounds-check. Add documentation for -fno-store-check.
675         * java-tree.h (flag_store_check): Declare.
676         (build_java_arraystore_check): Declare.
677         * lang.c (flag_store_check): Initialize to 1.
678         (lang_f_options): Add store-check option.
679         * jvspec.c: Don't pass store-check option to jvgenmain.
680         * lang-options.h: Add help string for -fno-store-check.
681
682 2002-02-28  Neil Booth  <neil@daikokuya.demon.co.uk>
683
684         * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
685         * java-tree.h (java_dup_lang_specific_decl): New.
686         * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
687
688 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
689
690         * builtins.c, decl.c: Delete traditional-mode-related code
691         copied from the C front end but not used, or used only to
692         permit the compiler to link.
693
694 2002-02-22  Tom Tromey  <tromey@redhat.com>
695
696         Fix for PR java/2369:
697         * jvspec.c (verify_class_name): New function.
698         (lang_specific_driver): Call it.
699         (JAVA_START_CHAR_P): New macro.
700         (JAVA_PART_CHAR_P): Likewise.
701
702 2002-02-22  Per Bothner  <per@bothner.com>
703
704         * class.c:  Change vtable to be more compatible with g++ v3 abi.
705         (get_dispatch_table):  Prepend offset-to-top (always 0) and
706         type_info pointer (currently unimplemented hence NULL) to vtable.
707         Specifically, prepend offset-to-top and typeinfo ptr (currently null).
708         (make_class_data):  Variable dtable_start_offset is sizeof 2 pointers.
709         Adjust vtable pointers by dtable_start_offse - i.e. skip new words.
710         (build_dtable_decl):  Add declarations for new fields.
711
712 2002-02-20  Per Bothner  <per@bothner.com>
713
714         * parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
715         to finit$ (otherwise generate_bytecode_insns drops it). However, we
716         don't need to set it on the COMPOUND_EXPR - the caller does that.
717
718 2002-02-20  Nic Ferrier  <nferrier@tapsellferrier.co.uk>
719
720         * gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option
721         `--CLASSPATH' becomes `--classpath.'
722         * gjavah.c: Likewise.
723         * jcf-dump.c: Likewise.
724         * lang-options.h: Likewise.
725         * lang.c: Likewise.
726         * jcf-path.c: Updated comment.
727         (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.'
728         (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.'
729         * jcf.h (jcf_path_CLASSPATH_arg): Ditto.
730         (jcf_path_CLASSPATH_arg): Ditto.
731         (classpath_u): Updated leading comment.
732
733 2002-02-20  Per Bothner  <per@bothner.com>
734
735         * builtins.c (check_for_builtin):  New function.
736         (build_call_or_builtin):  Remove.
737         * java-tree.h:  Update accordingly.
738         * expr.c (expand_invoke):  Use build + check_for_builtin instead
739         of build_call_or_builtin.
740         * parse.y (patch_invoke):  Likewise.  This avoids needlessly creating
741         a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER
742         flag (which had caused jcf-write to incorrectly emit invokevirtual).
743
744 2002-02-17  Tom Tromey  <tromey@redhat.com>
745
746         * java-tree.h (TYPE_STRICTFP): New macro.
747         (struct lang_type) [strictfp]: New field.
748         (CLASS_STRICTFP): New macro.
749         (METHOD_STRICTFP): New macro.
750         (struct lang_decl) [strictfp]: New field.
751         * parse.y (method_header): Disallow strictfp constructor or
752         abstract method.
753         (STRICT_TK): Move before MODIFIER_TK.
754         * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
755         (METHOD_MODIFIERS): Likewise.
756         (INTERFACE_MODIFIERS): Likewise.
757         * jcf-write.c (get_access_flags): Likewise.
758         * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
759         (add_method_1): Likewise.
760         (get_access_flags_from_decl): Likewise.
761         * jcf-dump.c (print_access_flags): Print in standard order.  Also,
762         recognize strictfp flag.
763         * jcf.h (ACC_STRICT): New define.
764
765 2002-02-12  David Billinghurst <Davod.Billinghurst@riotinto.com>
766
767         * class.c(build_utf8_ref): Move declaration of decl_size
768
769 2002-02-07  Tom Tromey  <tromey@redhat.com>
770
771         * gcj.texi (Input Options): --CLASSPATH does not suppress system
772         path.
773
774 2002-02-04  Anthony Green  <green@redhat.com>
775
776         * class.c (build_utf8_ref): Put UTF-8 constants into merged
777         sections if available.
778
779 2002-02-04  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
780
781         * parse.y (java_expand_classes): Fix typo in static field loop.
782
783 2002-02-02  Richard Henderson  <rth@redhat.com>
784
785         * class.c (add_field): Mark static fields external.
786         (build_class_ref): Remove redundant set.
787         * parse.y (java_expand_classes): Mark static fields of classes
788         to be compiled as local.
789         * jcf-parse.c (parse_class_file): Likewise.
790
791 2002-02-02  Nic Ferrier  <nferrier@tapsellferrier.co.uk>
792
793         * gcj.texi (About CNI): New node.
794
795 2002-02-01  Craig Rodrigues  <rodrigc@gcc.gnu.org>
796
797         PR java/5080
798         * jcf-parse.c : Check for HAVE_LOCALE_H before using
799         setlocale() with LC_CTYPE as a parameter.
800         * jv-scan.c: Same.
801
802 2002-01-31  Joseph S. Myers  <jsm28@cam.ac.uk>
803
804         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
805         Follow GNU Coding Standards for --version.
806
807 2002-01-28  Tom Tromey  <tromey@redhat.com>
808
809         * expr.c (build_jni_stub): Ensure storage for `meth' is
810         generated.
811         * parse.y (java_complete_expand_methods): Set
812         current_function_decl before building JNI stub.
813
814 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
815
816         * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not
817         BUILT_IN_SQRTF.
818
819 2002-01-22  Tom Tromey  <tromey@redhat.com>
820
821         * decl.c (java_init_decl_processing): Use add_predefined_file.
822         Predefine RawData.java.
823         (predef_filenames): Removed.
824         (java_init_decl_processing): Don't register predef_filenames.
825         * jcf-parse.c (add_predefined_file): New function.
826         (predefined_filename_p): Rewrote.
827         (predefined_filename_p): No longer static.
828         * decl.c (java_init_decl_processing): Call initialize_builtins.
829         * Make-lang.in (JAVA_OBJS): Added builtins.o.
830         (java/builtins.o): New target.
831         * builtins.c: New file.
832         * parse.y (patch_invoke): Use build_call_or_builtin.
833         * java-tree.h (build_call_or_builtin): Declare.
834         (initialize_builtins): Declare.
835         (java_set_exception_lang_code): Removed unused declaration.
836         (PREDEF_FILENAMES_SIZE): Removed.
837         (java_tree_index): Added JTI_PREDEF_FILENAMES.
838         (predef_filenames): New define.
839         (add_predefined_file): Declare.
840         (predefined_filename_p): Declare.
841         * expr.c (expand_invoke): Use build_call_or_builtin.
842
843 2002-01-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
844
845         * parse.y (patch_switch_statement): Fix format specifier.
846
847 2002-01-16  Tom Tromey  <tromey@redhat.com>
848
849         More for PR java/5365:
850         * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
851         default.
852         (process_file): Generate include for
853         java.lang.UnsupportedOperationExceptions.
854
855 2002-01-15  Andreas Jaeger  <aj@suse.de>
856
857         * .cvsignore: Add man pages.
858
859 2002-01-15  Tom Tromey  <tromey@redhat.com>
860
861         Fix for PR java/5365:
862         * gjavah.c (process_file): Turn class name into a file name.
863
864 2002-01-14  Matthias Klose  <doko@debian.org>
865
866         * gcj.texi: Fix whitespace and formatting errors in the
867         synopsis of the man pages. Update copyright.
868
869 2002-01-14  Tom Tromey  <tromey@redhat.com>
870
871         For PR libgcj/5303:
872         * Make-lang.in (java.install-man): Handle jv-convert man page.
873         (java.generated-manpages): Added jv-convert.1.
874         (java.uninstall): Remove jv-convert.1.
875         (java.maintainer-clean): Likewise.
876         ($(srcdir)/java/jv-convert.1): New target.
877         * gcj.texi (Top): Link to jv-convert node.
878         (Individual utilities): Likewise.
879         (Invoking jv-convert): New node.
880
881 2001-01-10  Jeff Sturm  <jsturm@one-point.com>
882             Martin Kahlert  <martin.kahlert@infineon.com>
883
884         * jcf-parse.c (get_constant): Don't swap lo/hi for big
885         endian targets when HOST_BITS_PER_WIDE_INT >= 64.
886
887 2002-01-03  Graham Stott  <grahams@redhat.com>
888
889         * class.c (compile_resource_file): Update copyright date.
890         Constify filename parameter.
891         (java-tree.h): Update copyright date.
892         (compile_resource_file): Constify filename parameter.
893
894 2002-01-03  Graham Stott  <grahams@redhat.com>
895
896         * gcc/jcf-parse.c: Update copyright date.
897         (yyparse): Constify resource_filename.
898
899 2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
900
901         * parse.y (src_parse_roots): Don't needlessly zero init.
902
903 2001-12-31  Tom Tromey  <tromey@redhat.com>
904
905         * parse.y (dump_java_tree): New function.
906         (source_end_java_method): Call it.
907         (end_class_declaration): Likewise.
908         * lang.c (java_decode_option): Call dump_switch_p.
909
910 2001-12-28  Tom Tromey  <tromey@redhat.com>
911
912         * gen-table.pl: Don't process characters after \uffff.  Added
913         comment pointing to input file.
914
915 2001-12-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
916
917         * gen-table.pl: Const-ify output.  Document the location of a
918         suitable unicode input file.
919
920         * chartables.h: Regenerate.
921
922 2001-12-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
923
924         * chartables.h: Const-ify.
925         * gjavah.c (options): Likewise.
926         * jcf-dump.c (options): Likewise.
927         * jv-scan.c (options): Likewise.
928         * lex.c (java_start_char_p, java_part_char_p): Likewise.
929         * parse.y (binop_lookup): Likewise.
930
931 2001-12-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
932
933         * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
934         the static arrays that are output.
935         * jvspec.c (jvgenmain_spec): Make static.
936         * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
937         * keyword.h: Regenerate.
938         * lang.c (string_option, process_option_with_no, lang_f_options,
939         lang_W_options): Const-ify.
940         * lex.c (java_lex): Likewise.
941
942 2001-12-21  Richard Henderson  <rth@redhat.com>
943
944         * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
945         (get_boehm_type_descriptor): ... here.  Arrange for the
946         TREE_TYPE to get set properly.
947
948 2001-12-21  Richard Henderson  <rth@redhat.com>
949
950         * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
951         only if the target requires collect2.
952
953         * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
954
955 2001-12-20  Tom Tromey  <tromey@redhat.com>
956
957         For PR java/4509:
958         * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
959         CAN_COMPLETE_NORMALLY for the node.
960         * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
961         generate code for second branch if first branch can't complete
962         normally.
963         (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
964         the loop head if the loop body can't complete normally.
965
966 2001-12-20  Tom Tromey  <tromey@redhat.com>
967
968         For PR java/4766:
969         * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
970         case where `finally' clause can't complete normally.
971
972 2001-12-20  Tom Tromey  <tromey@redhat.com>
973
974         Fixes PR java/5057:
975         * parse.y (analyze_clinit_body): Added this_class parameter.
976         Check for more cases where we must keep <clinit>.
977         (maybe_yank_clinit): Cleaned up flow control.
978
979 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
980
981         * decl.c (java_init_decl_processing): Don't initialize
982         finit_leg_identifier_node.
983         * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
984         (finit_leg_identifier_node): Remove.
985         (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
986
987 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
988
989         * mangle.c (mangle_member_name): Don't special-case for
990         NO_DOLLAR_IN_LABEL.
991         * mangle_name.c (unicode_mangling_length): Likewise.
992         (append_unicode_mangled_name): Likewise.
993         * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
994         code.
995
996 2001-12-20  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
997
998         * expr.c (build_java_array_length_access): Don't force null pointer
999         check unless flag_check_references is set.
1000
1001 2001-12-20  Tom Tromey  <tromey@redhat.com>
1002
1003         Fix for PR java/3417:
1004         * parse.y (patch_assignment): Added special processing for
1005         `return'.
1006         (patch_return): Don't convert booleans to integers, and don't
1007         special-case `null'.
1008
1009 2001-12-20  Joseph S. Myers  <jsm28@cam.ac.uk>
1010
1011         * config-lang.in (diff_excludes): Remove.
1012
1013 2001-12-17  Joseph S. Myers  <jsm28@cam.ac.uk>
1014
1015         * gcj.texi: Update link to GCC manual.
1016
1017 2001-12-17  Tom Tromey  <tromey@redhat.com>
1018
1019         * parse.y (link_nested_class_to_enclosing): Removed useless
1020         statement.
1021
1022 2001-12-16  Tom Tromey  <tromey@redhat.com>
1023
1024         * mangle.c (mangle_method_decl): Never emit `C2' constructor.
1025         Fixes PR java/5088.
1026
1027 2001-12-16  Joseph S. Myers  <jsm28@cam.ac.uk>
1028
1029         * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
1030         jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
1031         spelling errors.
1032
1033 2001-12-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1034
1035         * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
1036
1037 2001-12-16  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1038
1039         * decl.c (java_init_decl_processing): Build otable_type correctly.
1040         otable_decl is an otable_type.
1041
1042 2001-12-15  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1043
1044         * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
1045         otable_type, otable_ptr_type, method_symbol_type,
1046         method_symbols_array_type, method_symbols_array_ptr_type): New
1047         field/global tree definitions.
1048         (flag_indirect_dispatch): New flag.
1049         * decl.c (java_init_decl_processing): Initialize new otable and
1050         otable_syms type nodes and decls. Add new field "index" to
1051         method_type_node.
1052         * class.c (build_method_symbols_entry): New function.
1053         (make_method_value): Set "index" to to method's vtable index for
1054         virtual methods when indirect-dispatch is not used.
1055         (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
1056         and set vtable_method_count to -1. Set otable and otable_syms field
1057         if indirect-dispatch is used and there was something to put in them.
1058         (build_method_symbols_entry): New function.
1059         (emit_offset_symbol_table): New function.
1060         * expr.c (get_offset_table_index): New function.
1061         (build_invokevirtual): Build array reference to otable at the index
1062         returned by get_offset_table_index, and use the result as the vtable
1063         offset.
1064         (build_invokeinterface): Similar.
1065         * jcf-parse.c (yyparse): If indirect-dispatch, call
1066         emit_offset_symbol_table at the end of compilation, after all classes
1067         have been generated.
1068         * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
1069         * lang.c (flag_indirect_dispatch): Define.
1070         (lang_f_options): Add indirect-dispatch flag.
1071
1072 2001-12-14  Matthias Klose  <doko@debian.org>
1073
1074         * gcj.texi: Markup for man page generation. Document missing
1075         options printed by <tool> --help.
1076         Terminate description of gij's -ms option with a dot.
1077         * Make-lang.in ($(srcdir)/java/*.1): New targets.
1078         (java.generated-manpages java.install-man, java.uninstall,
1079         java-maintainer-clean) Updated.
1080
1081 2001-12-14  Hans Boehm  <Hans_Boehm@hp.com>
1082
1083         * class.c (get_dispatch_table): Fix java vtable layout
1084         for TARGET_VTABLE_USES_DESCRIPTORS.
1085         * decl.c (java_init_decl_processing): Initialize
1086         alloc_no_finalizer_node, finalize_identifier_node.
1087         * expr.c (class_has_finalize_method): New function.
1088         (expand_java_NEW): Generate calls for finalizer-free allocation.
1089         (build_invokevirtual): Fix java vtable layout for
1090         TARGET_VTABLE_USES_DESCRIPTORS.
1091         * java-tree.h (enum java_tree_index): New entries:
1092         JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
1093         (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
1094         (class_has_finalize_method): declare.
1095         (HAS_FINALIZER_P): New macro.
1096         * parse.y (patch_invoke): Generate calls for finalizer-free
1097         allocation.
1098
1099 2001-12-12  Matthias Klose  <doko@debian.org>
1100
1101         * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
1102         whitespace at end of line.
1103
1104 2001-12-11  Tom Tromey  <tromey@redhat.com>
1105
1106         * lex.c (java_init_lex): Define wfl_to_string as
1107         gnu.gcj.runtime.StringBuffer unless generating bytecode.
1108
1109 2001-12-11  Jeff Sturm  <jsturm@one-point.com>
1110
1111         * class.c (make_method_value): Use null_pointer_node to
1112         represent empty exception table.
1113
1114 2001-12-10  Tom Tromey  <tromey@redhat.com>
1115
1116         * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
1117
1118 Mon Dec 10 06:09:57 2001  Douglas B. Rupp  <rupp@gnat.com>
1119
1120         * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
1121
1122 2001-12-09  Per Bothner  <per@bothner.com>
1123
1124         * check-init.c (current_switch_has_default):  New static field.
1125         (check_init):  Case DEFAULT_EXPR: Set current_switch_has_default.
1126         Case SWITCH_EXPR:  Save/restore current_switch_has_default.  If no
1127         DEFAULT_EXPR seen, simulate a default alternative that copies state.
1128
1129 2001-12-09  Tom Tromey  <tromey@redhat.com>
1130
1131         * check-init.c (check_init): Don't allow pre- or post- increment
1132         or decrement of final variable.
1133         (final_assign_error): Minor error message rewording.
1134
1135 2001-12-08  Tom Tromey  <tromey@redhat.com>
1136
1137         * java-tree.h: Fixed typo.
1138
1139         * gjavah.c (decompile_method): Don't decompile to `return this'
1140         for static methods.
1141
1142         * gjavah.c (cxx_keywords): Re-sorted.
1143         * lex.c (cxx_keywords): Re-sorted.
1144
1145         * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
1146         else.
1147
1148         * gjavah.c (print_namelet): Clear subnamelets.
1149         (HANDLE_METHOD): Set `method_printed' earlier.
1150
1151 2001-12-07  Tom Tromey  <tromey@redhat.com>
1152
1153         * lang.c (lang_f_options): Added
1154         optimize-static-class-initialization.
1155         (java_decode_option): Removed special case.
1156
1157 2001-12-07  Per Bothner  <per@bothner.com>
1158
1159         * check-init.c (check_init):  Fix typo freeing memory twice.
1160
1161 2001-12-05  Per Bothner  <per@bothner.com>
1162
1163         Restore support for static class initialization optimization.
1164         * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
1165         * check-init.c (check_int):  At end of BLOCK handle initialization
1166         blocks, which used to be done in java_complete_expand_method but did
1167         not handle the case where check_for_initialization might allocate
1168         more than a word of bits.
1169         * decl.c (lang_make_tree):  The smic field is now a tree.
1170         * expr.c (build_class_init):  Set DECL_FUNCTION_INIT_TEST_CLASS field.
1171         * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE):  New macro.
1172
1173         * parse.y (emit_test_initialization):  Combine hash_lookup calls.
1174
1175         * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
1176         Change from a hash table to a list.
1177         (struct_lang_decl):  Change field 'smic' to match.
1178         * class.c (add_method_1):  Initialize
1179         DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
1180         * parse.y (adjust_init_test_initialization):  Removed - inlined into -
1181         (java_expand_method_bodies): -here, since 'smic' is now a list.
1182         (patch_invoke):  Add to 'smic' list, instead of hash_lookup.
1183
1184         * check-init.c (WORD_SIZE):  Use BITS_PER_UNIT.
1185
1186         * class.c (java_hash_compare_tree_node):  Fix casts.
1187
1188 2001-12-04  Per Bothner  <per@bothner.com>
1189
1190         * check-init.c:   Handle definite unassignment to finals in addition
1191         to definite assignment.
1192         (loop_current_locals):  New field.
1193         (num_current_locals, int start_current_locals, num_current_words):
1194         Make static.
1195         (SET_P, CLEAR_P, SET_BIT):  Add needed but missing parentheses.
1196         (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
1197         CLEAR_ASSIGNED, CLEAR_UNASSIGNED):  New macros.
1198         (get_variable_decl, check_final_reassigned):  New functions.
1199         (check_init, check_bool_init):  Modify as needed for checking finals.
1200         (check_for_initialization):  Take extra parameter and return void.
1201         Do extra start-up logic to check final fields for assignment.
1202         * parse.y (check_static_final_variable_assignment_flag,
1203         reset_static_final_variable_assignment_flag, check_final_assignment,
1204         check_final_variable_local_assignment_flag,
1205         reset_final_variable_indirect_assignment_flag,
1206         reset_final_variable_global_assignment_flag):  Remove functions.
1207         (java_complete_expand_methods, outer_field_access_fix,
1208         patch_assignment): Remove no-longer used logic.
1209         * java-tree.h (DECL_FIELD_FINAL_IUD):  Change usage and comments.
1210         * parse.y (register_fields, java_complete_tree):  Update accordingly.
1211
1212         * check-init.c (ALLOC_WORDS/FREE_WORDS):  Use xmalloc/free, not alloca.
1213         (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER):  New.
1214         (check_cond_init, check_bool2_init):  Use DECLARE_BUFFERS.
1215
1216         * java-tree.h (STATIC_CLASS_INIT_OPT_P):  Temporarily turn off.
1217
1218         * java-tree.h (DECL FINAL):  New bit-field.
1219         (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL):  Define as DECL_FINAL.
1220         (LOCAL_FINAL_P):  Use DECL_FINAL rather than old LOCAL_FINAL.
1221         (DECL_INIT_CALLS_THIS):  New macro.
1222         (struct lang_decl):  New bit-field init_calls_this.
1223         (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
1224         DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
1225         (DECL_BIT_INDEX):  Change to use pointer_alias_set since we now
1226         use it for both local variables and final fields.
1227         (struct lang_decl_var):  Remove bit-fields final_liic, final_ierr,
1228         and local_final.
1229         (struct lang_type):  Remove hfv bit-field.
1230         (check_for_initialization):  Change to return void.
1231
1232         * java-tree.h (IS_ARRAY_LENGTH_ACCESS):  New macros.
1233         * expr.c (build_java_array_length_access):  Set IS_ARRAY_LENGTH_ACCESS.
1234         * check-init.c (final_assign_error):  New helper function.
1235         (check_final_reassigned, check_init):  Use it.
1236         (check_init):  Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
1237
1238         * java-tree.h (struct lang_decl, struct lang_decl_var):  Change all
1239         bit-fields to unsigned.
1240
1241 2001-12-03  Per Bothner  <per@bothner.com>
1242
1243         * parse.y (patch_binop):  Minor constant folding.
1244
1245         * parse.y (build_current_thisn):  Shorter 'buffer'.
1246
1247 2001-12-03  Per Bothner  <per@bothner.com>
1248
1249         * decl.c (complete_start_java_method):  Now generate TRY_FINALLY_EXPR
1250         instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
1251         * jcf-write.c (generate_bytecode_insns):  Remove support for
1252         CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
1253         * check-init.c (check_init):  Likewise.
1254
1255 2001-12-03  Per Bothner  <per@bothner.com>
1256
1257         * verify.c (subroutine_nesting):  New function.
1258         (verify_jvm_instructions):  Use it to fix logic for checking that
1259         we're done with the current subroutine.
1260
1261         * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
1262         OPCODE_instanceof use POP_TYPE macro for better diagnostics.
1263
1264 2001-12-03  Per Bothner  <per@bothner.com>
1265
1266         * jcf.h:  Fix obvious typo in comment.
1267         * typeck.c (build_null_signature):  Add comment.
1268
1269 2001-12-03  Neil Booth  <neil@daikokuya.demon.co.uk>
1270
1271         * expr.c: Remove leading capital from diagnostic messages, as
1272         per GNU coding standards.
1273         * jcf-io.c: Similarly.
1274         * jcf-parse.c: Similarly.
1275         * jv-scan.c: Similarly.
1276         * jvspec.c: Similarly.
1277         * mangle.c: Similarly.
1278
1279 2001-12-02  Tang Ching-Hui  <nicholas@cs.nthu.edu.tw>
1280             Alexandre Petit-Bianco  <apbianco@redhat.com>
1281
1282         * expr.c (build_java_arrayaccess): Call save_expr on array for
1283         correct evaluation order, modified comment, fixed indentation.
1284         * parse.y: (patch_assignment): Correctly extract the array base
1285         from the tree generate by build_java_arrayaccess, added comments.
1286         (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
1287         Fixes PR java/3096, PR java/3803, PR java/3965.
1288
1289 2001-12-01  Neil Booth  <neil@daikokuya.demon.co.uk>
1290
1291         * expr.c (expand_byte_code): Remove trailing periods from messages.
1292         * jcf-parse.c (load_class, jcf_parse): Similarly.
1293         * jcf-write.c (generate_classfile): Similarly.
1294         * lex.c (java_lex): Similarly.
1295
1296 2001-11-30  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1297
1298         * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
1299
1300 2001-11-29  Joseph S. Myers  <jsm28@cam.ac.uk>
1301
1302         * Make-lang.in (java.generated-manpages): New dummy target.
1303
1304 2001-11-27  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1305
1306         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1307         ASM_FINAL_SPEC.
1308         (lang_specific_pre_link): Use set_input to set input_filename.
1309         Append `main' here.
1310         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1311         (main): Fix definition.
1312         Strip `main' from classname.
1313         Fixes PR java/227.
1314
1315 2001-11-18  Roger Sayle <roger@eyesopen.com>
1316
1317         * parse.h (java_expand_switch): Remove old prototype.
1318
1319 2001-11-18  Tom Tromey  <tromey@redhat.com>
1320
1321         Fix for PR java/1401:
1322         * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
1323         arg0 is null.
1324         (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
1325         correctly.
1326
1327 2001-11-18  Neil Booth  <neil@daikokuya.demon.co.uk>
1328
1329         * lang.c (finish_parse): Rename to java_finish.
1330         (LANG_HOOKS_FINISH, java_finish): New.
1331
1332 2001-11-15  Neil Booth  <neil@daikokuya.demon.co.uk>
1333
1334         * decl.c (init_decl_processing): Rename java_init_decl_processing.
1335         * java-tree.h: New prototype.
1336         * lang.c (java_init): Update prototype.  Combine with old init_parse.
1337
1338 2001-11-13  Tom Tromey  <tromey@redhat.com>
1339
1340         * gjavah.c (method_signature): New global.
1341         (HANDLE_METHOD): Set it.
1342         (decompile_return_statement): New function.
1343         (decompile_method): Use it.
1344         (print_method_info): Removed `synth' argument.
1345
1346 2001-11-09  Neil Booth  <neil@daikokuya.demon.co.uk>
1347
1348         * java-tree.h (java_set_yydebug): New.
1349         * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
1350         * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
1351         (print_lang_decl, print_lang_type, print_lang_identifier,
1352         print_lang_statistics, lang_print_xnode): Remove.
1353
1354 2001-11-09  Neil Booth  <neil@daikokuya.demon.co.uk>
1355
1356         * jcf-parse.c (init_lex): Remove.
1357         * lang.c (language_string, lang_identify): Remove.
1358         (struct lang_hooks): Constify.
1359         (LANG_HOOKS_NAME): Override.
1360         (init_parse): Update.
1361
1362 2001-11-08  Andreas Franck  <afranck@gmx.de>
1363
1364         * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
1365         program_transform_name the way suggested by autoconf.
1366         (java.install-common): Also transform auxiliary program names with
1367         program_transform_name.
1368
1369 2001-11-08  Tom Tromey  <tromey@cygnus.com>
1370
1371         * parse.y (trap_overflow_corner_case): New rule.
1372         (unary_expression): Use it.
1373         * lex.c (java_init_lex): Don't set minus_seen.
1374         (yylex): Don't use minus_seen.  Communicate overflow to parser for
1375         it to handle.
1376         (error_if_numeric_overflow): New function.
1377         * parse.h (minus_seen): Removed field.
1378         (JAVA_RADIX10_FLAG): New define.
1379
1380 2001-11-07  Tom Tromey  <tromey@redhat.com>
1381
1382         Patch for PR java/1414:
1383         * parse.y (case_label_list): New global.
1384         (goal): Register case_label_list with GC.
1385         (java_complete_lhs): Save new case on case_label_list.
1386         (patch_switch_statement): Check for duplicate case labels.
1387
1388 2001-11-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
1389
1390         * parse.y (patch_assignment): Removed unused third argument.
1391         (java_complete_lhs): Removed unused third argument to patch_assignment.
1392
1393 2001-11-06  Neil Booth  <neil@cat.daikokuya.demon.co.uk>
1394
1395         * lang.c: Include langhooks-def.h.
1396         * Make-lang.in: Update.
1397
1398 2001-10-31  Zack Weinberg  <zack@codesourcery.com>
1399
1400         * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
1401
1402 2001-10-29  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1403
1404         * mangle.c (find_compression_record_match): Don't match compression
1405         records for package name elements unless they occur at the start of
1406         the name. Fix for PR java/4717.
1407
1408 2001-10-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1409
1410         * expr.c (expand_java_field_op): Don't special-case references to
1411         java.lang.PRIMTYPE.TYPE.
1412         (build_primtype_type_ref): Removed.
1413         * java-tree.h (build_primtype_type_ref): Remove prototype.
1414         * parse.y (maybe_build_primttype_type_ref): Removed.
1415         (complete_function_arguments): Don't special-case references to
1416         java.lang.PRIMTYPE.TYPE.
1417         (patch_assignment): Likewise.
1418         (array_constructor_check_entry): Likewise.
1419
1420 2001-10-24  Alexandre Petit-Bianco  <apbianco@redhat.com>
1421
1422         * mangle.c (static tree compression_table): Fixed leading comment.
1423         * parse.h (struct parser_ctxt): Fixed field comment.
1424         * parse.y (check_pkg_class_access): New prototype, fixed leading
1425         comment, new parameter used to emit error only if passed as true.
1426         (parse_check_super): Pass extra argument to check_pkg_class_access.
1427         (do_resolve_class): Likewise.
1428         (process_imports): Likewise.
1429         (read_import_dir): Fixed indentation.
1430         (find_in_imports_on_demand): New local class_type_name. Local
1431         node_to_use deleted. while loop changed into for loop. Report
1432         multiple definition only for accessible classes. Improved error
1433         message.
1434         (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
1435         assigned to parameter list, fixed indentation. while loop changed
1436         into for loop, restore TREE_CHAIN on local `tem' before the next
1437         iteration.
1438
1439 Tue Oct 23 14:02:17 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1440
1441         * lang.c (lang_get_alias_set): Deleted.
1442
1443 2001-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1444
1445         * gjavah.c (jni_print_char): Fix thinko in last change.
1446
1447         * gjavah.c (jni_print_char, decode_signature_piece): Use
1448         safe-ctype macros and/or fold extra calls into fewer ones.
1449         * lex.c (java_read_unicode, java_lex): Likewise.
1450         * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
1451         JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
1452         * mangle_name.c (append_unicode_mangled_name,
1453         unicode_mangling_length): Likewise.
1454
1455 2001-10-17  Richard Henderson  <rth@redhat.com>
1456
1457         * Make-lang.in (java/lang.o): Depend on langhooks.h.
1458
1459 2001-10-15  Alexandre Petit-Bianco  <apbianco@redhat.com>
1460
1461         * lang.c (langhooks.h): Included.
1462         (LANG_HOOKS_INIT): Redefined.
1463         (LANG_HOOKS_INIT_OPTIONS): Likewise.
1464         (LANG_HOOKS_DECODE_OPTION): Likewise.
1465         (struct lang_hooks lang_hooks): New initialization.
1466
1467 2001-10-11  Per Bothner  <per@bothner.com>
1468
1469         * parse.y (patch_synchronized_statement):  Use a TRY_FINALLY_EXPR
1470         rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
1471         The former is simpler, and jcf-write.c handles it better.
1472         (java_complete_lhs):  No longer need to handle CLEANUP_POINT_EXPR
1473         or WITH_CLEANUP_EXPR.
1474         * jcf-write.c:  Revert Alex's change from 2000-10-18.  It is no
1475         longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
1476
1477         * parse.y (patch_if_else_statement):  If the condition is constant,
1478         optimize away the test.
1479
1480 2001-10-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
1481
1482         * parse.y (patch_cast): Call patch_string on the first operand of
1483         the incoming node, update it if necessary. Fixes PR java/4510.
1484
1485 2001-10-09  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
1486
1487         * parse.y (find_as_inner_class): Don't disregard the enclosing scope
1488         when name qualifier matches a package name.
1489
1490 2001-10-08  Tom Tromey  <tromey@redhat.com>
1491
1492         Fix for PR java/4489:
1493         * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
1494         force a new label when computing `body_block'.
1495
1496 2001-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1497
1498         * jcf-io.c (format_uint): Const-ify.
1499         * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
1500         * lex.c (java_get_line_col): Likewise.
1501         * parse.y (build_incdec): Likewise.
1502
1503 2001-10-05  Alexandre Petit-Bianco  <apbianco@redhat.com>
1504
1505         * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
1506         a NULL enclosing context if appropriate. Fixes PR java/4466.
1507
1508 2001-10-03  Alexandre Petit-Bianco  <apbianco@redhat.com>
1509
1510         * parse.y (patch_assignment): Use lvalue's original TYPE when
1511         building the final COMPOUND_EXPR.
1512         (try_reference_assignconv): Fixed leading comment.
1513
1514 2001-09-26  Alexandre Petit-Bianco  <apbianco@redhat.com>
1515
1516         * parse.y (check_final_variable_indirect_assignment): For
1517         COMPOUND_EXPR, return only if finals were found initialized
1518         properly, if not, keep on checking.
1519         (check_final_variable_global_assignment_flag): New local
1520         error_found, set when appropriate and used to decide whether to
1521         report uninitialized finals. Fixed typo in comment.
1522
1523 2001-09-22  Alexandre Petit-Bianco  <apbianco@redhat.com>
1524
1525         * decl.c (init_decl_processing): Fixed typo in predef_filenames
1526         last three initializations. Fixes PR java/4360.
1527
1528 2001-09-21  Richard Henderson  <rth@redhat.com>
1529
1530         * class.c (get_dispatch_table): Handle function descriptors.
1531         (build_dtable_decl): Likewise.
1532         * expr.c (build_invokevirtual): Likewise.
1533
1534 2001-09-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
1535
1536         * parse.y (patch_method_invocation): Build class initialization
1537         when static finals are used to qualify method invocation.
1538         Fixes PR java/4366.
1539
1540 2001-09-19  Alexandre Petit-Bianco  <apbianco@redhat.com>
1541
1542         * parse.h: (WFL_STRIP_BRACKET): Re-written using
1543         build_type_name_from_array_name.
1544         (STRING_STRIP_BRACKETS): New macro.
1545         * parse.y (build_type_name_from_array_name): New function.
1546         (array_creation_expression:): Accumulate []s instead of [s.
1547         (cast_expression:): Accumulate []s instead of [s after cast type
1548         name.
1549         (build_array_from_name): Local string deleted, use
1550         build_type_name_from_array_name.
1551         (build_unresolved_array_type): Accumulate []s instead of [s after
1552         type name.
1553         (register_fields): Fixed comment.
1554         (resolve_class): Local name, base deleted, new locals tname and
1555         array_dims. Use build_type_name_from_array_name. Use array_dims to
1556         build array type.
1557         (purify_type_name): Use STRING_STRIP_BRACKETS.
1558
1559 2001-09-18  Andreas Jaeger  <aj@suse.de>
1560
1561         * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
1562         * jv-scan.c: Likewise.
1563
1564 2001-09-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
1565
1566         * parse.y (patch_method_invocation): Inner class creation context
1567         check not enforced within constructors. Fixes PR java/1873.
1568
1569 2001-09-16  Tom Tromey  <tromey@redhat.com>
1570
1571         * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
1572         NOTE_PUSH for single-case push.  Fixes PR java/4189.
1573
1574 2001-09-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
1575
1576         * java-tree.h (TYPE_IMPORT_LIST): New macro.
1577         (TYPE_IMPORT_DEMAND_LIST): Likewise.
1578         (struct lang_type): New fields import_list and import_demand_list.
1579         * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
1580         TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
1581         (do_resolve_class): New local saved_enclosing_type, initialized,
1582         passed as parameter to find_in_imports and find_in_imports_on_demand.
1583         (find_in_imports): Added paramater enclosing_type, use its
1584         TYPE_IMPORT_LIST when applicable.
1585         (find_in_imports_on_demand): Added parameter enclosing_type, use
1586         its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
1587         declaration and initialization.
1588         (fold_constant_for_init): Switch/restore current_class to the
1589         appropriate context.
1590
1591 2001-09-13  Mark Mitchell  <mark@codesourcery.com>
1592
1593         * verify.c (verify_jvm_instructions): Fix typo.
1594
1595 2001-09-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1596
1597         * expr.c (expand_invoke): Const-ification.
1598         * parse.y (patch_method_invocation): Likewise.
1599
1600 2001-09-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1601
1602         * gjavah.c (cxx_keywords): Const-ification.
1603         * keyword.gperf (java_keyword): Likewise.
1604         * lang.c (java_tree_code_name): Likewise.
1605         * lex.c (cxx_keywords): Likewise.
1606         * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
1607
1608 2001-09-11  Richard Henderson  <rth@redhat.com>
1609
1610         * parse.h (ctxp_for_generation): Mark extern.
1611
1612 2001-09-10  Richard Henderson  <rth@redhat.com>
1613
1614         * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
1615
1616 2001-09-07  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
1617
1618         * typeck.c (java_array_type_length, build_prim_array_type):
1619         Represent empty arrays by NULL index.
1620
1621 2001-09-06  Alexandre Petit-Bianco  <apbianco@redhat.com>
1622
1623         * java-tree.h (compile_resource_file): Grouped with other prototypes.
1624         * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
1625
1626 2001-09-06  Anthony Green  <green@redhat.com>
1627
1628         * class.c (O_BINARY): Define if necessary.
1629         (registerResource_libfunc): Declare.
1630         (init_class_processing): Initilize registerResource_libfunc.
1631         (compile_resource_file): New function.
1632         * java-tree.h (resource_name): Declare.
1633         (compile_resource_file): Declare.
1634         * jcf-parse.c (yyparse): Handle compiling java resource files.
1635         * lang.c (java_decode_option): Handle -fcompile-resource option.
1636         * jvspec.c (lang_specific_driver): Handle -R flag for compiling
1637         resource files.
1638         * gcj.texi (Code Generation): Add documentation for -R flag.
1639
1640 2001-09-05 Alexandre Petit-Bianco  <apbianco@redhat.com>
1641
1642         * jcf-write.c (generate_classfile): Issue an error in case of
1643         field/initial value mismatch.
1644         * parse.y (analyze_clinit_body): Keep <clinit> if an array is
1645         being initialized and we're generating bytecode.
1646         (java_complete_lhs): In MODIFY_EXPR section: added comments,
1647         set DECL_INITIAL properly when appropriate.
1648         Fixes PR java/4230
1649         Fixes PR java/4204
1650
1651 2001-09-01  Per Bothner  <per@bothner.com>
1652
1653         * parse.y (maybe_yank_clinit):  A field without an initializer is not
1654         relevant.  All initializers except static final and constant require
1655         <clinit>, regardless of flag_emit_class_files.
1656
1657 2001-08-31  Per Bothner  <per@bothner.com>
1658
1659         * class.c (set_constant_value):  When not emiting class files, then a
1660         String ConstantValue is a utf8const_ptr_type.
1661
1662 2001-08-30  Per Bothner  <per@bothner.com>
1663
1664         * jcf-write.c (generate_classfile):  Check that field is primitive
1665         or string before emitting ConstantValue attribute.
1666
1667 2001-08-30  Per Bothner  <per@bothner.com>
1668
1669         * parse.y (resolve_qualified_expression_name):  If creating a
1670         COMPOUND_EXPR, set it's type correctly.
1671
1672 2001-08-30  Per Bothner  <per@bothner.com>
1673
1674         * jcf-io.c (open_class):  Set filename field.
1675
1676         * jcf-parse,c (parse_class_file):  Set current_function_decl
1677         for better error message when Code attribute is missing.
1678
1679         * lang.c (put_decl_node, lang_print_error):  Re-arrange for
1680         better diagnostics, especially for constructors.
1681
1682 2001-08-30  Per Bothner  <per@bothner.com>
1683
1684         * jcf-write.c (generate_classfile):  Don't write ConstantValue
1685         attribute if field is not final, for compatibility with jdk.
1686
1687         * jcf-write.c (generate_classfile):  Convert ConstantValue values
1688         to correct type.  Work-around for front-end bug.
1689         * class.c (set_constant_value):  Error if constant has wrong type.
1690
1691 2001-08-30  Per Bothner  <per@bothner.com>
1692
1693         * jcf-dump.c (print_constant):  Fix fencepost error so "Float" and
1694         "Double" are printed at verbosity 1.
1695
1696         * jcf-dump.c (main):  Disable flag_print_attributes if --javap.
1697
1698         * jcf-dump.c (SPECIAL_IINC):  Remove unneeded casts to long.
1699
1700 2001-08-30  Alexandre Petit-Bianco  <apbianco@redhat.com>
1701
1702         * parse.y (patch_assignment): Don't verify final re-assignment here.
1703         (java_complete_lhs): Verify assignments to finals calling
1704         patch_assignment. Verify re-assignments to finals before calling
1705         patch_assignment.
1706
1707 2001-08-29  Alexandre Petit-Bianco  <apbianco@redhat.com>
1708
1709         * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
1710         Fixes PR java/1413
1711
1712 2001-08-28  Alexandre Petit-Bianco  <apbianco@redhat.com>
1713
1714         * lex.c (java_lex): new local found_hex_digits. Set and then used
1715         in test to reject invalid hexadecimal numbers.
1716         * parse.y (java_complete_tree): Prevent unwanted cast with
1717         initialized floating point finals.
1718         (patch_binop): Emit a warning when detecting a division by zero,
1719         mark result not constant, don't simplify non integer division.
1720
1721 2001-08-28  Per Bothner  <per@bothner.com>
1722
1723         * jcf-write.c  (generate_bytecode_insns):  For increments and
1724         decrements just recurse to push constant.  Improvement on Mark's patch.
1725
1726 2001-08-28  Mark Mitchell  <mark@codesourcery.com>
1727
1728         * jcf-write.c (generate_bytecode_insns): Generate an integer to
1729         real conversion for increments and decrements of reals.
1730
1731 2001-08-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
1732
1733         * parse.y (resolve_qualified_expression_name): Handle unresolved
1734         qualified expressions, prevent numerical qualifiers, fixed typo.
1735         Fixes PR java/4141
1736
1737 2001-08-24  Alexandre Petit-Bianco  <apbianco@redhat.com>
1738
1739         * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
1740         don't report anything but deprecated class when marked so. Handle
1741         VAR_DECL.
1742         (patch_method_invocation): Check deprecation on methods and types.
1743         (patch_binop): code becomes an enum tree_code, added default: to
1744         switch to handle that. Detect division by zero, try to fold and
1745         return before using a subroutine.
1746
1747 2001-08-23  Alexandre Petit-Bianco  <apbianco@redhat.com>
1748
1749         * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
1750         file smaller than 4 bytes.
1751         * parse.y (check_inner_circular_reference): New function.
1752         (check_circular_reference): Likewise.
1753         (array_initializer:): Accept {,}.
1754         (java_check_circular_reference): Rewritten using
1755         check_circular_reference and check_inner_circular_reference.
1756         (java_complete_expand_method): Unconditionally save and restore
1757         the unpurged exception list.
1758         (build_dot_class_method_invocation): Unmangle signature parameter.
1759
1760 2001-08-21  Tom Tromey  <tromey@redhat.com>
1761
1762         * decl.c (init_decl_processing): Add `throws' field to method
1763         descriptor.
1764         * class.c (make_method_value): Compute `throws' field for method.
1765
1766 2001-08-22  Alexandre Petit-Bianco  <apbianco@redhat.com>
1767
1768         * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
1769         circularity is detected.
1770         (ctors_unchecked_throws_clause_p): Fixed leading comment.
1771
1772 2001-08-17  Richard Henderson  <rth@redhat.com>
1773
1774         * class.c (emit_register_classes): Add align parameter to
1775         call to assemble_integer.
1776
1777 2001-08-16  Alexandre Petit-Bianco  <apbianco@redhat.com>
1778
1779         * jcf-parse.c (load_class): New locals saved and class_loaded. If
1780         loading a class_or_name fails, try considering an innerclass name
1781         and load the enclosing context.
1782         * parse.y (resolve_inner_class): New function.
1783         (find_as_inner_class): Added leading comment.
1784         (register_incomplete_type): Keep the current context as enclosing
1785         context for JDEP_FIELD dependencies.
1786         (do_resolve_class): Locals new_class_decl and super initialized to
1787         NULL. Call resolve_inner_class, explore the enclosing context
1788         superclass if necessary.
1789         Fixes PR java/4007
1790
1791 2001-08-16  Tom Tromey  <tromey@redhat.com>
1792
1793         * jcf-dump.c (main): Updated for change to jcf_path_seal.
1794         * gjavah.c (main): Updated for change to jcf_path_seal.
1795         * lang.c (version_flag): New global.
1796         (java_decode_option): Recognize `-version'.
1797         (java_init): Update for change to jcf_path_seal.
1798         * jcf.h (jcf_path_seal): Added `print' argument.
1799         * jcf-path.c (jcf_path_seal): Added `print' argument.
1800
1801 2001-08-13  Zack Weinberg  <zackw@panix.com>
1802
1803         * Make-lang.in (java/decl.o): Update dependencies.
1804         * decl.c: Include libfuncs.h, don't include toplev.h.
1805
1806 2001-08-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
1807
1808         * decl.c (init_decl_processing): exception_type_node,
1809         class_not_found_type_node, and no_class_def_found_type_node
1810         initialized. predef_filenames augmented accordingly.
1811         instinit_identifier_node initialized.
1812         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
1813         * java-tree.h (enum java_tree_index): New entries
1814         JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
1815         JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
1816         (exception_type_node): New macro.
1817         (class_not_found_type_node): Likewise.
1818         (no_class_def_found_type_node): Likewise.
1819         (instinit_identifier_node): Likewise.
1820         (PREDEF_FILENAMES_SIZE): Adjusted.
1821         (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
1822         (struct lang_type): Fixed typo in bitfield name.
1823         (DECL_INSTINIT_P): New macro.
1824         (ID_INSTINIT_P): Likewise.
1825         * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
1826         attribute.
1827         * parse.y (encapsulate_with_try_catch): New function.
1828         (generate_instinit): Likewise.
1829         (build_instinit_invocation): Likewise.
1830         (ctors_unchecked_throws_clause_p): Likewise.
1831         (add_instance_initializer): Deleted.
1832         (build_instance_initializer): Likewise.
1833         (in_instance_initializer): Likewise.
1834         (check_method_redefinition): instinit$ not to be verified.
1835         (java_complete_expand_methods): Generate instinit$, simplified code.
1836         (build_dot_class_method): Eliminated unnecessary locals. Use
1837         encapsulate_with_try_catch, removed unnecessary code.
1838         (fix_constructors): New local iii. Use build_instinit_invocation.
1839         (patch_method_invocation): Added comment.
1840         (maybe_use_access_method): Don't consider instinit$.
1841         (find_applicable_accessible_methods_list): Shorten the search for
1842         instinit$ too.
1843         (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
1844         (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
1845         (patch_throw_statement): Likewise. Fixed typo.
1846
1847 2001-08-12  David Edelsohn  <edelsohn@gnu.org>
1848
1849         Revert:
1850         2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1851         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1852         ASM_FINAL_SPEC.
1853         (lang_specific_pre_link): Use set_input to set input_filename.
1854         Append `main' here.
1855         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1856         (main): Fix definition.
1857         Strip `main' from classname.
1858         Fixes PR java/227.
1859
1860 2001-08-11  Zack Weinberg  <zackw@panix.com>
1861
1862         * lex.h: Don't include setjmp.h.  Don't define
1863         SET_FLOAT_HANDLER or prototype set_float_handler.
1864
1865 2001-08-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
1866
1867         * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
1868         `poplevel' in the right order.
1869
1870 2001-08-09  Richard Henderson  <rth@redhat.com>
1871
1872         * Make-lang.in (class.o): Depend on TARGET_H.
1873         * class.c (emit_register_classes): Use target hooks instead of
1874         assemble_constructor and assemble_destructor.
1875
1876 2001-08-08  Alexandre Petit-Bianco  <apbianco@redhat.com>
1877
1878         * check-init.c (flags.h): Include
1879         (check_init): Don't report uninitialized static class
1880         initialization flags, don't free bit index when doing static class
1881         initialization optimization.
1882         (check_for_initialization): Return type changed to `unsigned int.'
1883         (attach_initialized_static_class): New function.
1884         * class.c (add_method_1): Create the initialized static class
1885         table if necessary.
1886         (finish_class): Always emit deferred inline methods.
1887         * decl.c (emit_init_test_initialization): Moved to expr.c
1888         (complete_start_java_method): Don't traverse
1889         DECL_FUNCTION_INIT_TEST_TABLE.
1890         (lang_mark_tree): Mark hash tables in function decls.
1891         * expr.c (emit_init_test_initialization): Moved from decl.c.
1892         (build_class_init): Create LAG_DECL_SPECIFIC for the static class
1893         initialization flag, set DECL_CONTEXT and
1894         LOCAL_CLASS_INITIALIZATION_FLAG.
1895         (java_lang_expand_expr): Emit initialization code for static class
1896         initialized flags when entering block, if necessary.
1897         * gcj.texi (-fno-optimize-static-class-initialization): Documented.
1898         * java-tree.h (flag_optimize_sci): New global variable declaration.
1899         (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
1900         (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
1901         (LOCAL_FINAL_P): Fixed typo in comment.
1902         (FINAL_VARIABLE_P): Likewise.
1903         (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
1904         (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
1905         (struct lang_decl): New fields `ict', `smic' and `cif.'
1906         (check_for_initialization): New returned value for global.
1907         (attach_initialized_static_class): New global function.
1908         (STATIC_CLASS_INIT_OPT_P): New macro.
1909         * lang-options.h (-fno-optimize-static-class-initialization): New flag.
1910         * lang.c (java_decode_option): Handle
1911         `-fno-optimize-static-class-initialization'
1912         * parse.y (start_complete_expand_method): New function.
1913         (java_expand_method_bodies): Likewise.
1914         (attach_init_test_initialization_flags): Likewise.
1915         (adjust_init_test_initialization): Likewise.
1916         (emit_test_initialization): Likewise.
1917         (java_complete_expand_methods): Nullify abstract and native method
1918         bodies.
1919         (java_complete_expand_method): New locals `fbody', `block_body'
1920         and `exception_copy.' Reorganized: directly return on empty method
1921         bodies, call `start_complete_expand_method', remember definitely
1922         initialized static class in function, don't expand method bodies.
1923         (java_expand_classes): Call `java_expand_method_bodies' before
1924         `finish_class' when compiling to native.
1925         (resolve_expression_name): Use `orig' after building outer class
1926         field access.
1927         (patch_invoke): Remember static method invokations.
1928
1929 2001-08-06  Richard Henderson  <rth@redhat.com>
1930
1931         * class.c (emit_register_classes): Pass a symbol_ref and priority
1932         to assemble_constructor.
1933
1934 2001-08-02  Alexandre Petit-Bianco  <apbianco@redhat.com>
1935
1936         * java-tree.h (all_class_filename): New macro.
1937         (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
1938         (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
1939         newly created IDENTIFIER_NODE to `all_class_filename.'
1940
1941 2001-08-01  Jeff Sturm  <jsturm@one-point.com>
1942
1943         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
1944         Use ggc_add_tree_root to register roots.
1945
1946 2001-07-31  Alexandre Petit-Bianco  <apbianco@redhat.com>
1947
1948         * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
1949         second operand calling check_init.
1950         * decl.c (complete_start_java_method): Swaped second and third
1951         arguments while creating WITH_CLEANUP_EXPR node.
1952         * jcf-write.c (generate_bytecode_insns): Use second operand
1953         instead of third when handling WITH_CLEANUP_EXPR.
1954         * parse.y (java_complete_lhs): Expand second operand of
1955         WITH_CLEANUP_EXPR nodes.
1956         (patch_synchronized_statement): Swaped second and third arguments
1957         while creating WITH_CLEANUP_EXPR node.
1958
1959 2001-07-18  Alexandre Petit-Bianco  <apbianco@redhat.com>
1960
1961         * parse.y (create_interface): Avoid cyclic inheritance report when
1962         syntax error encountered during class definition.
1963         Fixes PR java/2956
1964
1965 2001-08-02  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1966
1967         * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
1968         ASM_FINAL_SPEC.
1969         (lang_specific_pre_link): Use set_input to set input_filename.
1970         Append `main' here.
1971         * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
1972         (main): Fix definition.
1973         Strip `main' from classname.
1974         Fixes PR java/227.
1975
1976 2001-07-18  Tom Tromey  <tromey@redhat.com>
1977
1978         For PR java/2812:
1979         * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
1980         * lex.c (java_new_lexer): Use ICONV_CONST.
1981         (java_read_char): Likewise.
1982         * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
1983         (jv-scan$(exeext)): Likewise.
1984
1985 2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
1986
1987         * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
1988         * parse.y (check_class_interface_creation): Allow `private' if the
1989         enclosing is not an interface.
1990         (create_interface): Interface tagged public if the enclosing
1991         context is an interface.
1992         (create_class): Class tagged public if the enclosing context
1993         is an interface.
1994         Fixes PR java/2959
1995
1996 2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>
1997
1998         * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
1999         Fixes PR java/2665
2000
2001 2001-07-14  Tim Josling  <tej@melbpc.org.au>
2002
2003         * check-init.c (check_init): Remove references to EXPON_EXPR.
2004
2005 2001-07-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
2006
2007         * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
2008         TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
2009         Fixes PR java/3602
2010
2011 2001-07-13  Tom Tromey  <tromey@redhat.com>
2012
2013         * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
2014         invocation.
2015
2016 2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
2017
2018         * parse.y (patch_method_invocation): Don't override primary if one
2019         is already provided, but let this$<n> be built. Fixed comment.
2020
2021 2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>
2022
2023         * parse.y (empty_statement:): Report empty statement error only
2024         when found at class declaration level.
2025         Fixes PR java/3635
2026
2027 2001-07-12  Tom Tromey  <tromey@redhat.com>
2028
2029         * expr.c (expand_load_internal): New function.
2030         (LOAD_INTERNAL): Use it.
2031
2032 2001-07-11  Alexandre Petit-Bianco  <apbianco@redhat.com>
2033
2034         * parse.y (verify_constructor_super): Compare anonymous class ctor
2035         args with `valid_method_invocation_conversion_p.'
2036         Fixes PR java/3285
2037
2038 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
2039
2040         * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
2041         `-fsyntax-only.' Fixes PR java/3248
2042
2043 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
2044
2045         * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
2046
2047 2001-07-10  Alexandre Petit-Bianco  <apbianco@redhat.com>
2048
2049         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
2050         current function is static. Fixes PR java/1970
2051
2052 2001-07-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2053
2054         * parse.y (patch_method_invocation): Add enclosing context to ctor
2055         calls if necessary. Fixes PR java/2953
2056
2057 2001-07-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2058
2059         * parse.y (resolve_package): Abort if qualified expression member
2060         isn't right.
2061         (qualify_ambiguous_name): Don't qualify as type if `this' in use.
2062         Fixes PR java/1391
2063
2064 2001-07-07  Zack Weinberg  <zackw@stanford.edu>
2065
2066         * verify.c: Don't use // comments.
2067
2068 2001-07-05  Tom Tromey  <tromey@redhat.com>
2069
2070         * lang.c (flag_assume_compiled): Removed.
2071         * java-tree.h (flag_assume_compiled): Removed.
2072         * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
2073         -fhash-synchronization, -fuse-divide-subroutine,
2074         -fcheck-references, -femit-class-file, -femit-class-files,
2075         -fassume-compiled.  Updated --encoding information.  Changed
2076         -foutput-class-dir to `-d'.
2077
2078 2001-07-04  Daniel Berlin  <dan@cgsoftware.com>
2079
2080         * jcf-parse.c (parse_class_file): Add lineno parameter to
2081         debug_start_source_file call.
2082
2083 2001-07-04  Joseph S. Myers  <jsm28@cam.ac.uk>
2084
2085         * gcj.texi: Use gpl.texi.
2086         * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
2087         dependencies and use doc/include in search path.
2088
2089 2001-07-03  Jeff Sturm  <jsturm@one-point.com>
2090
2091         * parse.y (fix_constructors): Test if a CALL_EXPR invokes
2092         `this'.  If so, don't build instance initializers.
2093
2094 2001-07-03  Alexandre Petit-Bianco  <apbianco@redhat.com>
2095
2096         * parse.y (resolve_expression_name): Improved error message for
2097         inner class cases. Fixes PR java/1958
2098
2099 2001-06-28  Gabriel Dos Reis  <gdr@codesourcery.com>
2100
2101         * lang.c: #include diagnostic.h
2102         (lang_print_error): Add a `diagnostic_context *' parameter.
2103         (java_dummy_print): Likewise.
2104         * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
2105
2106 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
2107
2108         * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
2109         * jcf.h (typedef struct JCF): New bitfield `finished.'
2110         (JCF_FINISH): Set `finished.'
2111         (JCF_ZERO): Reset `finished.'
2112         Fixes PR java/2633
2113
2114 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
2115
2116         * parse.y (class_body_declaration:): Don't install empty instance
2117         initializers.
2118         Fixes PR java/1314
2119
2120 2001-06-27  Alexandre Petit-Bianco  <apbianco@redhat.com>
2121
2122         * class.c (set_super_info): Call `set_class_decl_access_flags.'
2123         (set_class_decl_access_flags): New function.
2124         * java-tree.h (set_class_decl_access_flags): New prototype.
2125         * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
2126         (parse_class_file): New local `decl_max_locals.' Take wide types
2127         into account to compute DECL_MAX_LOCALS.
2128         * parse.y (type_import_on_demand_declaration:): Ignore duplicate
2129         imports on demand.
2130
2131 2001-06-22  Jan van Male  <jan.vanmale@fenk.wau.nl>
2132
2133         * zipfile.h: Use GCC_JCF_H instead of JCF_H.
2134
2135 2001-06-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
2136
2137         * class.c (java_hash_tree_node): Fixed indentation in leading comment.
2138         * parse.y (do_resolve_class): Moved comments out to leading comment
2139         section. Removed local `start', New local `_ht' and
2140         `circularity_hash.'  Record `enclosing' in hash table and search
2141         it to detect circularity.  Use `enclosing' as an argument to
2142         `lookup_cl.' Free the hash table when done.
2143
2144 2001-06-19  Tom Tromey  <tromey@redhat.com>
2145
2146         * lex.c (java_read_char): Disallow invalid and overlong
2147         sequences.  Fixes PR java/2319.
2148
2149 2001-06-05  Jeff Sturm  <jsturm@one-point.com>
2150
2151         * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
2152
2153 2001-06-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
2154
2155         * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
2156         arguments accordingly.
2157
2158 2001-06-02  Joseph S. Myers  <jsm28@cam.ac.uk>
2159
2160         * gcj.texi: Move contents to just after title page.
2161
2162 2001-06-01  Alexandre Petit-Bianco  <apbianco@redhat.com>
2163
2164         * parse.y (type_literals:): Use `build_incomplete_class_ref' with
2165         builtin type.
2166         (patch_incomplete_class_ref): Build the class ref, build the class
2167         init if necessary, complete the tree.
2168         Fixes PR java/2605
2169
2170 2001-05-31  Alexandre Petit-Bianco  <apbianco@redhat.com>
2171
2172         * parse.y (lookup_field_wrapper): Test `name' code.
2173         (resolve_qualified_expression_name): Test `qual_wfl' code.
2174         (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
2175         handle `qual_wfl' by code.
2176         (maybe_build_primttype_type_ref): Test `wfl' code.
2177
2178 2001-05-23  Theodore Papadopoulo  <Theodore.Papadopoulo@sophia.inria.fr>
2179
2180         * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
2181         fdl.texi.
2182         (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls.  Create
2183         the dvi file in the java directory.
2184
2185 2001-05-25  Sam TH  <sam@uchicago.edu>
2186
2187         * gen-table.pl javaop.h jcf.h lex.h,
2188         parse.h: Fix header include guards.
2189
2190 2001-05-23  Joseph S. Myers  <jsm28@cam.ac.uk>
2191
2192         * jv-scan.c (version): Update copyright year.
2193
2194 2001-05-21  Per Bothner  <per@bothner.com>
2195
2196         * jcf-parse.c (read_class):  If class is from .class or .zip file
2197         and it's already been read, don't push/pop parser context.
2198
2199 2001-05-18  Per Bothner  <per@bothner.com>
2200
2201         * jvspec.c (lang_specific_pre_link):  Re-arrange the linker
2202         command line so the jvgenmain-generated main program comes first.
2203
2204 2001-05-15  Tom Tromey  <tromey@redhat.com>
2205
2206         * class.c (build_utf8_ref): Don't generate identifier based on
2207         utf8const contents.
2208
2209 2001-05-12  Richard Henderson  <rth@redhat.com>
2210
2211         * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
2212         * expr.c (java_lang_expand_expr): Expand it.
2213         (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
2214         calling build_exception_object_ref.
2215         * parse.y (catch_clause_parameter): Likewise.
2216         (build_dot_class_method): Likewise.
2217         (try_reference_assignconv): Likewise.
2218         * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
2219         * jcf-write.c (generate_bytecode_insns): Likewise.
2220
2221 2001-05-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
2222
2223         * parse.y (build_unresolved_array_type): Set
2224         EXPR_WFL_QUALIFICATION on the newly created wfl.
2225         Fixes PR java/2538. Fixes PR java/2535.
2226
2227 2001-05-07  Alexandre Petit-Bianco  <apbianco@redhat.com>
2228
2229         * parse.y (fix_constructors): Removed unnecessary assignment to
2230         local. Moved assignment to `this$<n>', fixed comments and
2231         indentation.
2232         (build_wfl_wrap): Fixed indentation.
2233         Fixes PR java/2598, java/2579 and java/2658.
2234
2235 2001-05-03  Mo DeJong  <mdejong@redhat.com>
2236
2237         * lex.c (java_new_lexer): Call iconv_close on temp handle used to
2238         check for byte swap.
2239
2240 2000-05-02  Jeff Sturm  <jsturm@one-point.com>
2241
2242         * expr.c (build_class_init): Move MODIFY_EXPR
2243         outside of COND_EXPR.  Remove variable `call'.
2244
2245 2001-05-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2246
2247         * decl.c: NULL_PTR -> NULL.
2248         * jcf-write.c: Likewise.
2249
2250 2001-05-01  Tom Tromey  <tromey@redhat.com>
2251
2252         * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
2253         (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
2254         * gcj.texi: Updated copyright text.  Include fdl.texi.
2255         (Top): Link to new node.
2256
2257 2001-05-01  Per Bothner  <per@bothner.com>
2258
2259         * parse.h (REGISTER_IMPORT):  Use tree_cons instead of chainon.
2260
2261 2001-05-01  Per Bothner  <per@bothner.com>
2262
2263         * parse.y (java_pop_parser_context):  The TREE_VALUE of a link in the
2264         import_list contains the name, not the TREE_PURPOSE.
2265
2266 2001-04-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2267
2268         * jcf-io.c (read_zip_member): Cast to long in comparison with
2269         signed value.
2270
2271         * jvspec.c (lang_specific_driver): Initialize variables.
2272
2273         * mangle.c (find_compression_record_match): Likewise.
2274
2275         * typeck.c (build_null_signature): Provide static prototype.  Mark
2276         parameter with ATTRIBUTE_UNUSED.
2277
2278         * verify.c (verify_jvm_instructions): Initialize variable.
2279
2280 2001-04-27  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
2281
2282         * parse.y (do_resolve_class): Check for cyclic inheritance during
2283         inner class resolution.
2284
2285 2001-04-27  Per Bothner  <per@bothner.com>
2286
2287         * parse.y (java_expand_classes):  Don't change ctxp_for_generation
2288         while iterating, since that could cause gc to lose stuff.
2289
2290 2001-04-26  Per Bothner  <per@bothner.com>
2291
2292         Fix method search wrt scope of inner classes to match JLS2.
2293         * typeck.c (build_null_signature):  New static function.
2294         (has_method):  New function.  Uses build_null_signature and lookup_do.
2295         * java-tree.h (has_method):  New declaration.
2296         * parse.y (find_applicable_accessible_methods_list):  Do not search
2297         context of inner classes here.
2298         (patch_method_invocation):  Search scope, ie. current and outer clases,
2299         for method matching simple name, to find class.
2300
2301 2001-04-26  Per Bothner  <per@bothner.com>
2302
2303         * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
2304         Fix thinko:  If a single case, use if_icmpeq, not ifeq.
2305
2306         * constants.c (find_methodref_with_class_index):  New function.
2307         (find_methodref_index):  Use find_methodref_with_class_index.
2308         * java-tree.h (find_methodref_with_class_index):  New declaration.
2309         * jcf-write.c (generate_bytecode_insns case CALL_EXPR):  Don't change
2310         DECL_CONTEXT, instead use new find_methodref_with_class_index function.
2311         If context changed from interface to class, don't use invokeinterface.
2312
2313 2001-04-25  Per Bothner  <per@bothner.com>
2314
2315         * verify.c (verify_jvm_instructions):  For field instructions,
2316         check that field index is valid.  For invoke instructions, check that
2317         method index is valid.
2318
2319 2001-04-25  Alexandre Oliva  <aoliva@redhat.com>
2320
2321         * config-lang.in (target_libs): Copy from $libgcj_saved.
2322
2323 2001-04-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
2324
2325         * decl.c (init_decl_processing): Add new class "protectionDomain"
2326         field.
2327         * class.c (make_class_data): Set initial value for "protectionDomain".
2328
2329 2001-04-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2330
2331         * jvspec.c (lang_specific_driver): Fix memory allocation
2332         deficit, by using concat in lieu of xmalloc/sprintf.
2333
2334 2001-04-20  Per Bothner  <per@bothner.com>
2335
2336         Fixes to compile multiple .class files at once.
2337         * decl.c (init_decl_processing):  Don't set CLASS_LOADED_P.
2338         * java-tree.h (CLASS_PARSED_P):  New macro.
2339         (CLASS_LOADED_P):  Re-define to use TYPE_SIZE and CLASS_PARSED_P.
2340         * jcf-parse.c (jcf_parse_source):  Inline into read_class.
2341         (read_class):  Avoid some code duplication.
2342         Don't call JCF_FINISH for a .class file - might be needed later.
2343         (jcf_parse):  Don't call layout_class here.  Check/set CLASS_PARSED_P
2344         rather than CLASS_LOADED_P, since latter implies class laid out.
2345         (yyparse):  Do layout_class and JCF_FINISh here instead, in pass 2.
2346         * parse.y:  Don't need to set CLASS_LOADED_P for array types.
2347
2348 2001-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2349
2350         * Make-lang.in (java/boehm.o): Depend on toplev.h.
2351
2352         * boehm.c: Include toplev.h.
2353
2354 2001-04-06  Tom Tromey  <tromey@redhat.com>
2355             Alexandre Petit-Bianco  <apbianco@redhat.com>
2356
2357         Fix for PR gcj/1404 and PR gcj/2332:
2358         * parse.y (build_array_from_name): If we use the type_wfl then
2359         accumulate dimensions from the original type as well.
2360         (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
2361
2362 2001-04-06  Tom Tromey  <tromey@redhat.com>
2363
2364         * parse.y (analyze_clinit_body): Return true if the second operand
2365         of a METHOD_EXPR is nonzero.
2366
2367 2001-04-06  Tom Tromey  <tromey@redhat.com>
2368
2369         * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
2370         directory.
2371         ($(srcdir)/java/parse.c): Likewise.
2372
2373 2001-04-05  Alexandre Petit-Bianco  <apbianco@redhat.com>
2374
2375         * gcj.texi: Use `which-gcj' instead of `which-g77.'
2376         (version-gcc): Initialized.
2377         (which-gcj): Likewise.
2378
2379 2001-04-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
2380
2381         * java-tree.h (struct lang_decl): New macro
2382         `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
2383         * parse.y (build_instance_initializer): New function.
2384         (add_instance_initializer): Use it.
2385         (java_fix_constructors): Set `current_class' before fix pass.
2386         (fix_constructors): Just return if already fixed. Move `super()'
2387         invokation ahead. Use `build_instance_initializer.'
2388         Fixes PR java/1315.
2389
2390 2001-04-04  Alexandre Petit-Bianco  <apbianco@redhat.com>
2391
2392         * parse.y (resolve_qualified_expression_name): Pass field's
2393         DECL_CONTEXT to `not_accessible_p.'
2394         (not_accessible_p): Changed parameters order in `inherits_from_p'
2395         invokation.
2396
2397 2001-03-27  Andrew Haley  <aph@cambridge.redhat.com>
2398
2399         * lang-options.h: Add flag_check_references.
2400
2401 2001-04-04  Per Bothner  <per@bothner.com>
2402
2403         * java-tree.h (CONSTANT_VALUE_P):  New macro.
2404         * jcf-write.c (generate_classfile):  Use CONSTANT_VALUE_P.
2405         * parse.y (maybe_build_class_init_for_field):  New static function.
2406         (resolve_expression_name, resolve_field_access):  Use
2407         maybe_build_class_init_for_field instead of build_class_init
2408         This does not do the init if the field is compile-time-constant.
2409         (resolve_field_access):  Simplify.
2410
2411         * parse.y (fold_constant_for_init):  Merge test into switch.
2412
2413 2001-04-03  Zack Weinberg  <zackw@stanford.edu>
2414
2415         * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
2416         on gansidecl.h.
2417         * buffer.c, jvgenmain.c: Don't include gansidecl.h.
2418
2419 2001-04-02  Zack Weinberg  <zackw@stanford.edu>
2420
2421         * expr.c (pop_type_0): Save the result of the first
2422         lang_printable_name call in a scratch buffer, so it
2423         won't be clobbered by the second call.
2424
2425 2001-03-30  Alexandre Petit-Bianco  <apbianco@redhat.com>
2426
2427         * parse-scan.y (array_type:): Rewritten.
2428         (type_declaration:): `empty_statement' replaces `SC_TK.'
2429         (class_member_declaration:): `empty statement' added.
2430         (method_body:): Simplified.
2431         (static_initializer:): Likewise.
2432         (primary_no_new_array:): Use `type_literals.'
2433         (type_literals:): New rule.
2434         (dims:): Set and update `bracket_count.'
2435         Fixes PR java/1074. Fixes PR java/2412.
2436
2437 2001-03-28  Hans Boehm  <boehm@acm.org>
2438
2439         * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
2440         (get_boehm_type_descriptor): Set type on returned value to be a
2441         pointer length integer.
2442
2443 2001-03-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2444
2445         * expr.c (pop_type_0): Call `concat' rather than building the
2446         string manually.
2447         (pop_type): Add format specifier in call to `error'.
2448
2449         * parse.y (patch_method_invocation): Avoid casting away
2450         const-ness.
2451
2452 2001-03-28  Jeffrey Oldham  <oldham@codesourcery.com>
2453
2454         * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
2455
2456 2001-03-28  Richard Henderson  <rth@redhat.com>
2457
2458         IA-64 ABI Exception Handling:
2459         * Make-lang.in (except.o): Don't depend on eh-common.h.
2460         * check-init.c (check_init): Handle EXC_PTR_EXPR.
2461         * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
2462         [soft_exceptioninfo_call_node]: Remove.
2463         [eh_personality_libfunc, lang_eh_runtime_type]: New.
2464         (end_java_method): No emit_handlers.
2465         * except.c (java_set_exception_lang_code): Remove.
2466         (method_init_exceptions): Don't call it.
2467         (prepare_eh_table_type): No CATCH_ALL_TYPE.
2468         (build_exception_object_ref): New.
2469         (expand_end_java_handler): Update for except.h name changes.
2470         (emit_handlers, expand_resume_after_catch): Remove.
2471         * expr.c (java_lang_expand_expr): Update for except.h name changes.
2472         (process_jvm_instruction): Use build_exception_object_ref.
2473         * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
2474         (soft_exceptioninfo_call_node): Remove.
2475         (build_exception_object_ref): Declare.
2476         * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
2477         soft_exceptioninfo_call_node.  Move processing ...
2478         [EXC_PTR_EXPR]: ... here.
2479         * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
2480         * parse.y (catch_clause_parameter): Use build_exception_object_ref.
2481         (source_end_java_method): No java_set_exception_lang_code or
2482         emit_handlers.
2483         (build_dot_class_method): Use build_exception_object_ref.
2484         (try_reference_assignconv): Check EXC_PTR_EXPR not
2485         soft_exceptioninfo_call_node.
2486
2487 2001-03-28  Richard Henderson  <rth@redhat.com>
2488
2489         * java-tree.h (throw_node): Define as a single member of
2490         java_global_trees instead of a separate array.
2491         (JTI_THROW_NODE): New.
2492         * decl.c (throw_node): Don't declare.
2493         (init_decl_processing): Init a scalar throw_node.
2494         Don't register it for gc.
2495         * check-init.c (check_init): Reference scalar throw_node.
2496         * expr.c (build_java_athrow): Likewise.
2497         * jcf-write.c (generate_bytecode_insns): Likewise.
2498         * parse.h (BUILD_THROW): Likewise.
2499
2500 2001-03-28  Richard Henderson  <rth@redhat.com>
2501
2502         * decl.c (end_java_method): Do not save and restore
2503         flag_non_call_exceptions.
2504         * parse.y (source_end_java_method): Likewise.
2505         * lang.c (flag_exceptions): Don't declare.
2506         (java_init_options): Set flag_non_call_exceptions.  Set
2507         flag_exceptions here ...
2508         (java_init): ... not here.
2509
2510 2001-03-27  Richard Henderson  <rth@redhat.com>
2511
2512         * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
2513         exceptions_via_longjmp.
2514
2515         * lang.c (flag_new_exceptions): Don't declare it.
2516         (java_init_options): Or set it.
2517
2518 2001-03-27  Richard Henderson  <rth@redhat.com>
2519
2520         * decl.c (end_java_method): Rename asynchronous_exceptions to
2521         flag_non_call_exceptions.
2522         * parse.y (source_end_java_method): Likewise.
2523
2524 2001-03-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2525
2526         * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
2527
2528 2001-03-26  Mark Mitchell  <mark@codesourcery.com>
2529
2530         * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
2531
2532 2001-03-26  Alexandre Petit-Bianco  <apbianco@redhat.com>
2533
2534         * parse.y (find_as_inner_class): Follow current package
2535         indications not to mistakingly load an unrelated class.
2536
2537 2001-03-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2538
2539         * constants.c (PUTN): Use memcpy, not bcopy.
2540
2541         * lex.c (java_read_char): Use memmove, not bcopy.
2542
2543         * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
2544
2545 2001-03-23  Per Bothner  <per@bothner.com>
2546
2547         * verify.c (verify_jvm_instructions):  Replace 3 pop_type by POP_TYPE
2548         macro for better error pin-pointing.
2549         * java-tree.h:  Fix typo in comment.
2550
2551         * jcf-write.c (generate_bytecode_insns):  Changes to TRY_FINALLY_EXPR.
2552         Don't include jsr/goto in exception range.
2553         Check if start and end of exception range are the same (also TRY_EXPR).
2554         Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
2555         However, do emit the following goto even if try_block is empty.
2556         Defer freeing exception_decl until after the finalizer, to make
2557         sure the local isn't reused in the finalizer.  Fixes PR java/1208.
2558
2559         * parse.y (java_complete_lhs):  If the try-clause is empty, just
2560         return the finally-clause and vice versa.
2561
2562 2001-03-23  Alexandre Petit-Bianco  <apbianco@redhat.com>
2563
2564         * gcj.texi (Input Options): documented the check for attribute
2565         `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
2566         * java-tree.h (flag_force_classes_archive_check): Declared extern.
2567         * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
2568         (jcf_parse): Check for the right classes archive if necessary.
2569         * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
2570         (jcf_parse_fields): Fixed indentation.
2571         * jcf-write.c (append_gcj_attribute): New function.
2572         (generate_classfile): Compute the attribute count, invoke
2573         `append_gcj_attribute'.
2574         * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
2575         turned into bit fields. New bit field `right_zip.'
2576         (JCF_ZERO): Set `right_zip' to zero.
2577         * lang-options.h (-fforce-classes-archive-check): Added flag.
2578         * lang.c (flag_force_classes_archive_check): New flag.
2579         (lang_f_options): New entry `force-classes-archive-check.'
2580         Fixes PR java/1213.
2581
2582 2001-02-07  Andrew Haley  <aph@redhat.com>
2583
2584         * gcj.texi (Configure-time Options): Add -fcheck-references.
2585         * expr.c (build_java_indirect_ref): New function.
2586         (java_check_reference): New function.
2587         (build_java_array_length_access): Use build_java_indirect_ref to
2588         check for null references.
2589         (build_java_arrayaccess): Likewise.
2590         (build_get_class): Likewise.
2591         (build_field_ref): Likewise.
2592         (invoke_build_dtable): Likewise.
2593         (build_invokeinterface): Likewise.
2594         * lang.c (lang_f_options): Add flag_check_references.
2595         * jvspec.c (jvgenmain_spec): Add flag_check_references.
2596         * java-tree.h (flag_check_references): New variable.
2597         * lang.c (flag_check_references): Likewise.
2598         * parse.y (patch_invoke): Use java_check_reference.
2599         (patch_assignment): Allow for extra nesting in
2600         _Jv_CheckArrayStore.
2601
2602 2001-03-23  Bryce McKinlay  <bryce@albatross.co.nz>
2603
2604         * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
2605         * lex.c (cxx_keywords): Likewise.
2606
2607 2001-03-21  Alexandre Petit-Bianco  <apbianco@redhat.com>
2608
2609         * parse.y (qualify_ambiguous_name): Broaden `length'
2610         recognition. Help MODIFY_EXPR be resolved as expression names.
2611         Fixes PR java/2066. Fixes PR java/2400.
2612
2613 2001-03-21  Bryce McKinlay  <bryce@albatross.co.nz>
2614
2615         * gjavah.c (process_file): Mark interface definitions with
2616         "__attribute__ ((java_interface))".
2617
2618 2001-03-21  Alexandre Petit-Bianco  <apbianco@redhat.com>
2619
2620         * class.c (layout_class): Fixed push_super_field's second
2621         argument. Fixes PR java/2333.
2622         (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
2623         too early to lay innerclasses out.
2624
2625 2001-03-20  Tom Tromey  <tromey@redhat.com>
2626             Alexandre Petit-Bianco <apbianco@redhat.com>
2627
2628         * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
2629         inside an array reference. Insertion of the array store check
2630         rewritten. Fixes PR java/2299.
2631
2632 2001-03-20  Tom Tromey  <tromey@redhat.com>
2633
2634         * lex.c (java_read_unicode): Only accept leading `u's.
2635
2636 2001-03-20  Tom Tromey  <tromey@redhat.com>
2637
2638         * jcf-parse.c (read_class): Initialize `class'.
2639
2640 2001-03-20  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
2641
2642         * jcf_parse.c (jcf_parse): Eliminate unused variable.
2643
2644 2001-03-19  Mark Mitchell  <mark@codesourcery.com>
2645
2646         * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
2647         (layout_class): Likewise.
2648         (layout_class_method): Likewise.
2649         (emit_register_classes): Likewise.
2650         * decl.c (builtin_function): Likewise.
2651         (give_name_to_locals): Likewise.
2652
2653 2001-03-19  Per Bothner  <per@bothner.com>
2654
2655         * jcf-parse.c (load_inner_classes):  Check CLASS_LOADED_P
2656         before trying to load an inner class.
2657
2658         Fixes to process to command-line .class files in two passes.
2659         * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P):  New flags.
2660         (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P):  Rename to ..
2661         (CLASS_FROM_CURRENTLY_COMPILED_P):  ... because it is more general now.
2662         * class.c (is_compiled_class):  Fix for renamed flag.
2663         * parse.y (maybe_create_class_interface_decl):  Likewise.
2664         * jcf-parse.c (yyparse):  Also set if compiling .class files.
2665         * jcf-parse.c (read_class);  Read current_class.
2666         (jcf_parse):  Make static.
2667         (load_inner_classes):  New function, with code moved from jcf_parse,
2668         because we need to inner classes after the command-line files are read.
2669         (yyparse):  Set finput to NULL when it doesn't need to be closed.
2670         Reduce use of main_jcf (basically only for archive) and
2671         use finput instead of main_jcf->read_state.
2672         Inline jcf_figure_file_type into yyparse.
2673         Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
2674         Defer load_inner_classes and parse_class_file to a second pass,
2675         after we've correctly mapped command-line .clas fiels to classes.
2676         (jcf_figure_file_type):  Removed.
2677         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE):  Removed flags.
2678         (JCF_ZERO):  Also clear zipd field.
2679         * zipfile.h:  Conditionalize on JCF_H insread of JCF_ZIP.
2680
2681 2001-03-18  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
2682
2683         * jcf-parse.c (yyparse): Change ch from char * to char.
2684
2685 2001-03-19  Per Bothner  <per@bothner.com>
2686
2687         * jvspec.c (lang_specific_driver):  Check for .zip and .jar files.
2688         Add constructed filelist-file at end, following -xjava.  Thus any .o
2689         and library files are not affected by the -xjava.  Also wrap
2690         explicit @FILE with -xjava and -xnone.
2691
2692 2001-03-19  Andrew Haley  <aph@cambridge.redhat.com>
2693
2694         * class.c (build_static_field_ref): Call make_decl_rtl() after
2695         setting the DECL_EXTERNAL flag.
2696
2697 2001-03-17  Per Bothner  <per@bothner.com>
2698
2699         * decl.c (clear_binding_level):  Fix initializer (broke 03-15).
2700
2701         * jcf-write.c (generate_bytecode_insns):  Handle emitting iinc
2702         when result is is needed (target is STACK_TARGET).
2703
2704         * parse.h (JDEP_SOLV):  Removed.
2705         * parse.y (register_incomplete_type):  Use JDEP_TO_RESOLVE instead.
2706
2707         * parse.y (incomplete_class_list): Removed.
2708         (obtain_incomplete_type): Don't use or set incomplete_class_list.
2709         It doesn't work if resolve_class changes the name of an array type
2710         that is on the list and then someone else looks for the modified name.
2711         Also, seems liable to break when compiling multiple source files at
2712         once.  So the simplest is to just remove incomplete_class_list -
2713         it is only a minor space win and it is not even clear it saves time.
2714
2715         * parse.y (resolve_class):  Remove unneeded promote_type.
2716
2717 2001-03-15  Per Bothner  <per@bothner.com>
2718
2719         * java-tree.h (BLOCK_IS_IMPLICIT):  New flag.
2720         * parse.h (BLOCK_EXPR_ORIGIN):  Removed macro.
2721         * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
2722         Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
2723
2724         * jcf-parse.c (yyparse):  Set/reset input_filename for source file.
2725         * parse.y (java_expand_classes):  Likewise.
2726
2727         * parse.y (expand_start_java_method):  Was only called once and had a
2728         misleading name, so inline in caller java_complete_expand_method.
2729         (enter_a_block):  Likewise inline in enter_block and remove.
2730
2731         Remove junk from when gcc/java was created (by copying from C/C++).
2732         * decl.c (keep_next_level_flag, keep_next_if_subblocks):  Remove.
2733         (struct binding_level):  Remove fields keep, keep_if_subblocks,
2734         more_cleanups_ok, have_cleanups (which have never been used).
2735         (pushlevel, poplevel):  Remove related useless code.
2736
2737         * class.c (make_class_data):  The class_dtable_decl (i.e. the
2738         vtable for Class) should be external, except when compiling Class.
2739
2740         * jvspec.c (lang_specific_driver):  Fix -C handling.
2741         Check -save-temps to see if temp @FILE should be deleted.
2742         Follow-up to/fix for February 16 patch.
2743
2744         * verify.c (verify_jvm_instructions):  Better error msgs for dup.
2745         (type_stack_dup):  Remove no-longer neded error check.
2746
2747 2001-03-15  Bryce McKinlay  <bryce@albatross.co.nz>
2748
2749         * mangle.c (mangle_record_type): Rename 'from_pointer' argument
2750         to 'for_pointer'. If this type is for a pointer (argument) mangling,
2751         don't surround the element with 'N..E' if the type name is
2752         unqualified.
2753
2754 2001-03-14  Mark Mitchell  <mark@codesourcery.com>
2755
2756         * class.c (build_static_field_ref): Use COPY_DECL_RTL,
2757         DECL_RTL_SET_P, etc.
2758         (make_method_value): Likewise.
2759         (get_dispatch_table): Likewise.
2760
2761         * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
2762
2763 2001-03-07  Tom Tromey  <tromey@redhat.com>
2764
2765         * config-lang.in (lang_requires): Define.
2766
2767 2001-03-07  Brad Lucier  <lucier@math.purdue.edu>
2768
2769         * typeck.c (convert): Check flag_unsafe_math_optimizations,
2770         not flag_fast_math.
2771
2772 2001-03-05  Per Bothner  <per@bothner.com>
2773
2774         Fix a problem where rest_of_decl_compilation applied to
2775         class_dtable_decl causes problems because it was done too early,
2776         before output file was opened.
2777         * decl.c (init_decl_processing):  Remove init of class_dtable_decl.
2778         * class.c (class_dtable_decl):  Add macro - element of class_roots.
2779         (make_class_data):  Define class_dtable_decl.
2780         * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl):  Removed.
2781
2782 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
2783
2784         * java/class.c, java/decl.c, java/java-tree.h: Replace all
2785         uses of 'boolean' with 'bool'.
2786
2787 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
2788
2789         * lang-specs.h: Add zero initializer for cpp_spec field to all
2790         array elements.
2791
2792 2001-02-16  Per Bothner  <per@bothner.com>
2793
2794         Handle compiling multiple input files at once, and @FILE syntax.
2795         * gcj.texi:  Updated documentation to match.
2796         * java-tree.h (flag_filelist_file, init_src_parse):  New declarations.
2797         * jcf-parse.c (parse_source_file):  Split into ...
2798         (parse_source_file_1):  New function - and:
2799         (parse_source_file_2):  New function.
2800         (yyparse):  On -ffilelist-file, open and scan named file.
2801         On first pass over files, only do parse_source_file_1.
2802         A new second pass calls parse_source_file_2 for each file to compile.
2803         (init_jcf_parse):  Call init_src_parse.
2804         * jvspec.c (INDIRECT_FILE_ARG):  New flag.
2805         (lang_specific_driver):  Support @FILELIST-FILE syntax, as well
2806         as multiple input file combined in one compilation.
2807         * lang-options.h:  Add -ffilelist-file
2808         * lang.c (flag_filelist_file):  New flag variable.
2809         (lang_f_options):  Handle -ffilelist-file.
2810         * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
2811         * parse.h (struct parse_ctxt):  Remove fields incomplete_class and
2812         gclass_list - use global fields of src_parse_roots instead.
2813         * parse.y (src_parse_roots):  New array.
2814         (incomplete_class_list, gclass_list):  New macros.
2815         (push_parser_context, java_pop_parser_context,
2816         java_parser_context_resume):  Don't fiddle with deleted fields.
2817         (various):  Use incomplete_class gclass_list and global macros
2818         instead of parse_ctxt fields - the lists are global.
2819         (init_src_parse):  New function.
2820
2821 Fri Feb 23 15:28:39 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2822
2823         * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
2824
2825 2001-02-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
2826
2827         * parse.y (check_inner_class_access): Moved declaration of local
2828         `enclosing_decl_type' to the right location.
2829
2830 2001-02-19  Bryce McKinlay  <bryce@albatross.co.nz>
2831
2832         * parse.y (parser_check_super_interface): Don't call
2833         check_pkg_class_access for an inner interface.
2834         (parser_check_super): Don't call check_pkg_class_access for inner
2835         class.
2836         (do_resolve_class): Simplify enclosing type loop. Don't call
2837         check_pkg_class_access if CL and DECL are not set.
2838         (find_in_imports_on_demand): Set DECL if class_type needed to be
2839         loaded. Don't call check_pkg_class_access for an inner class.
2840         (check_inner_class_access): Rewritten to implement member access
2841         rules as per spec 6.6.1.
2842         (check_pkg_class_access): Handle the empty package correctly.
2843         (in_same_package): New function. Determine if two classes are in the
2844         same package.
2845
2846 2001-02-18  Bryce McKinlay  <bryce@albatross.co.nz>
2847
2848         * typeck.c (build_java_array_type): Don't try to poke a public `clone'
2849         method into array types.
2850         * parse.y (patch_method_invocation): Bypass access check on clone call
2851         to array instance.
2852
2853 2001-02-15  Alexandre Petit-Bianco  <apbianco@redhat.com>
2854
2855         * expr.c (build_instanceof): Check for arrays when trying fold to
2856         false.
2857
2858 2001-02-15  Jim Meyering  <meyering@lucent.com>
2859
2860         * Make-lang.in (java.install-common): Depend on `installdirs'.
2861         (java.install-info): Likewise.
2862
2863 2001-02-15  Bryce McKinlay  <bryce@albatross.co.nz>
2864
2865         * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
2866
2867 2001-02-14  Tom Tromey  <tromey@redhat.com>
2868             Alexandre Petit-Bianco  <apbianco@cygnus.com>
2869
2870         Fix for PR java/1261.
2871         * typeck.c (build_java_array_type): Add public `clone' method to
2872         arrays.
2873         * parse.y (resolve_qualified_expression_name): Use current_class
2874         when checking for inaccessibility.
2875         (patch_method_invocation): Fixed error message when accessibility
2876         denied.  Added `from_super' argument.
2877
2878 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
2879
2880         * parse.y (resolve_class): Don't build a fake decl. Use the one
2881         already built.
2882         * typeck.c (build_java_array_type): Build and assign decl to array
2883         type.
2884
2885 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
2886
2887         * parse.y (not_accessible_p): Changed leading comment. Added extra
2888         `where' argument. Use it to enforce protected access rules.
2889         (resolve_qualified_expression_name): Added extra argument to
2890         not_accessible_p.
2891         (patch_method_invocation): Use argument `primary' to provide
2892         not_accessible_p with an extra argument.
2893         (lookup_method_invoke): Added extra argument to not_accessible_p.
2894         (search_applicable_method_list): Likewise.
2895
2896 2001-02-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
2897
2898         * parse.y (resolve_qualified_expression_name): Try to resolve as
2899         an inner class access only if `decl' is a TYPE_DECL.
2900
2901 2001-02-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2902
2903         * decl.c (classdollar_identifier_node): Initialize.
2904         * java-tree.h (enum java_tree_index): New entry
2905         `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
2906         (classdollar_identifier_node): New macro.
2907         (ID_CLASSDOLLAR_P): Likewise.
2908         * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
2909         (build_dot_class_method_invocation): Likewise.
2910         (find_applicable_accessible_methods_list): `class$' can't be
2911         inherited.
2912
2913 2001-02-09  Raja R Harinath  <harinath@cs.umn.edu>
2914
2915         * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
2916
2917 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2918
2919         * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
2920         * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
2921         gone.
2922
2923 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2924
2925         * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
2926         outside of the `__U' sequence too.
2927         (unicode_mangling_length): Count `_' or `U' outside of the `__U'
2928         sequence too.
2929
2930 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
2931
2932         * jvgenmain.c (error): Reversed 2001-02-01 deletion.
2933
2934 2001-02-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2935
2936         * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
2937         (JVGENMAIN_OBJS): Likewise.
2938         * java-tree.h (append_gpp_mangled_name): New prototype.
2939         * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
2940         Removed cast calling `gcc_add_root.'
2941         * jvgenmain.c (mangle_obstack): New global, initialized.
2942         (main): Use it.
2943         (do_mangle_class): Constify local `ptr.'
2944         Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
2945         append_gpp_mangle_name and update `count' if necessary.
2946         Use `mangle_obstack.'
2947         * mangle.c (append_unicode_mangled_name): Removed.
2948         (append_gpp_mangled_name): Likewise.
2949         (unicode_mangling_length): Likewise.
2950         (mangle_member_name): Return type set to `void.'
2951         (mangle_field_decl): Don't append `U' in escaped names.
2952         (mangle_method_decl): Likewise.
2953         (mangle_member_name): Just use `append_gpp_mangled_name.'
2954         * mangle_name.c: New file.
2955
2956 2001-02-07  Per Bothner  <per@bothner.com>
2957
2958         * check-init.c (check_init):  Fix TRY_FINALLY_EXPR logic.
2959
2960         * check-init.c (check_init):  Don't call done_alternative after
2961         processing loop code, as a LOOP_EXPR never terminates normally.
2962
2963 2001-02-08  Joseph S. Myers  <jsm28@cam.ac.uk>
2964
2965         * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
2966
2967 2001-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2968
2969         * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
2970         DECLs.
2971
2972 2001-02-06  Tom Tromey  <tromey@redhat.com>
2973
2974         * lex.c (java_new_lexer): Longer error message.
2975
2976 2001-02-05  Jeff Sturm  <jeff.sturm@commerceone.com>
2977             Alexandre Petit-Bianco  <apbianco@cygnus.com>
2978
2979         * typeck.c (build_prim_array_type): Added leading comment.
2980         (build_java_array_type): Moved locals out of
2981         block. Always create the `data' field, fixed alignment to match
2982         C++.
2983
2984 2001-02-04  Tom Tromey  <tromey@redhat.com>
2985
2986         * expr.c (java_lang_expand_expr): Don't bother recomputing
2987         `length'.  Use rest_of_decl_compilation, not make_decl_rtl.
2988         Fixes PR java/1866.
2989
2990 2001-02-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2991
2992         * parse.y (process_imports): Save the original name of the import
2993         for better error report.
2994
2995 2001-02-04  Bryce McKinlay  <bryce@albatross.co.nz>
2996
2997         * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
2998         of macros used when compiling jvspec.c.
2999         * jvspec.c (lang_specific_driver): Link with the shared
3000         libgcc by default.
3001
3002 Sun Feb  4 15:52:44 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3003
3004         * check-init.c (check_init): Call internal_error instead of fatal.
3005         * expr.c (java_lang_expand_expr): Likewise.
3006         * jcf-parse.c (get_constant): Likewise.
3007         * mangle.c (java_mangle_decl): Likewise.
3008         * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
3009         (operator_string): Likewise.
3010         * check-init.c (check_init): Call abort instead of fatal.
3011         * class.c (build_class_ref): Likewise.
3012         * constants.c (write_constant_pool): Likewise.
3013         * decl.c (start_java_method): Likewise.
3014         * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
3015         (java_stack_dup, encode_newarray_type): Likewise.
3016         (build_java_array_length_access): Likewise.
3017         (build_java_check_indexed_type, expand_java_pushc): Likewise.
3018         (build_java_soft_divmod, build_invokeinterface): Likewise.
3019         * java-tree.h (INNER_CLASS_P): Likewise.
3020         * jcf-parse.c (parse_signature, get_name_constant): Likewise.
3021         (give_name_to_class, get_class_constant): Likewise.
3022         * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
3023         (find_constant_index, generate_bytecode_conditional): Likewise.
3024         (generate_bytecode_insns, perform_relocations): Likewise.
3025         * lex.c (java_unget_unicode, java_lex): Likewise.
3026         * mangle.c (mangle_type, mangle_record_type): Likewise.
3027         (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
3028         (finish_mangling): Likewise.
3029         * parse.h (MARK_FINAL_PARMS): Likewise.
3030         * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
3031         (obtain_incomplete_type, java_complete_class): Likewise.
3032         (java_check_regular_methods, java_complete_expand_method): Likewise.
3033         (cut_identifier_in_qualified, check_deprecation): Likewise.
3034         (patch_invoke, find_applicable_accessible_methods_list): Likewise.
3035         (java_complete_lhs, lookup_name_in_blocks): Likewise.
3036         (check_final_variable_indirect_assignment, build_unaryop): Likewise.
3037         * typeck.c (set_local_type, parse_signature_type): Likewise.
3038         (parse_signature_string, build_java_signature): Likewise;
3039         (set_java_signature): Likewise.
3040         * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
3041         * class.c (add_method): Call fatal_error instead of fatal.
3042         (build_static_field_ref): Likewise.
3043         * expr.c (build_known_method_ref, expand_invoke): Likewise.
3044         * jcf-parse.c (get_constant, jcf_parse): Likewise.
3045         * lex.c (java_new_new_lexer): Likewise.
3046         * jv-scan.c (main): Likewise.
3047         (fatal_error): Renamed from fatal.
3048         * jcf-parse.c (yyparse): Call fatal_io_error instead of
3049         pfatal_with_name.
3050         * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
3051         (yyparse): Likewise.
3052         * jcf-write.c (make_class_file_name, write_classfile): Likewise.
3053         * lex.c (java_get_line_col): Likewise.
3054         * jcf-parse.c (load_class): Make errors non-fatal.
3055         * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
3056
3057 2001-02-01  Bryce McKinlay  <bryce@albatross.co.nz>
3058
3059         * jvgenmain.c (class_mangling_suffix): Remove unused string.
3060         (error): Remove unused function.
3061         (main): Don't use "__attribute__ alias" on generated class symbol.
3062
3063 2001-01-30  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3064
3065         * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
3066         argument.
3067         * parse.y (finish_method_declaration): Code accounting for WFLed
3068         method DECL_NAMEs deleted.
3069         (check_abstract_method_definitions): Likewise.
3070         (resolve_type_during_patch): Layout resolved type.
3071         * typeck.c (lookup_do): Removed unused local.
3072
3073 2001-01-30  Bryce McKinlay  <bryce@albatross.co.nz>
3074
3075         * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
3076         * decl.c (init_decl_processing): Use integer_minus_one_node, not
3077         integer_negative_one_node.
3078         * expr.c (build_java_binop): Likewise.
3079
3080 2001-01-24  Jeff Sturm  <jeff.sturm@commerceone.com>
3081
3082         * zextract.c (read_zip_archive): Read file_offset before writing
3083         zipd and consequently clobbering the header contents.
3084
3085 2001-01-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3086
3087         * Make-lang.in: Remove all dependencies on defaults.h.
3088         * decl.c: Don't include defaults.h.
3089         * expr.c: Likewise.
3090         * parse.y: Likewise.
3091
3092 2001-01-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3093
3094         * ChangeLog (2001-01-21): Fixed typo.
3095         * class.c (layout_class_method): Code accounting for WFLed
3096         method DECL_NAMEs deleted.
3097         * constant.c (find_methodref_index): Likewise.
3098         * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
3099         * java-tree.h (DECL_FUNCTION_WFL): New macro.
3100         (struct lang_decl): New field `wfl'.
3101         (java_get_real_method_name): Prototype deleted.
3102         * mangle.c (mangle_method_decl): Code accounting for WFLed
3103         method DECL_NAMEs deleted.
3104         * parse.h (GET_METHOD_NAME): Macro deleted.
3105         * parse.y (reset_method_name): Deleted.
3106         (method_header): Set DECL_FUNCTION_WFL.
3107         (check_abstract_method_header): Code accounting for WFLed method
3108         DECL_NAMEs deleted.
3109         (java_get_real_method_name): Deleted.
3110         (check_method_redefinition): Code accounting for WFLed method
3111         DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
3112         (java_check_regular_methods): Likewise.
3113         (java_check_abstract_methods): Likewise.
3114         (java_expand_classes): Don't call `reset_method_name.'
3115         (search_applicable_method_list): Use DECL_NAMEs instead of
3116         GET_METHOD_NAME.
3117         * typeck.c (lookup_do): Code accounting for WFLed method
3118         DECL_NAMEs deleted.
3119
3120 2001-01-25  Richard Earnshaw  <rearnsha@arm.com>
3121
3122         * lex.c (java_read_char): Check for EOF from getc first.
3123
3124 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3125
3126         * class.c (layout_class): Don't lay the superclass out if it's
3127         already being laid out.
3128         * jcf-parse.c (handle_innerclass_attribute): New function.
3129         (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
3130         handle_innerclasses_attribute.
3131         (jcf_parse): Don't load an innerclasses if it's already being
3132         laid out.
3133         * jcf-write.c (append_innerclass_attribute_entry): Static
3134         `anonymous_name' and its initialization deleted. `ocii' and `ini'
3135         to be zero for anonymous classes.
3136
3137 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3138
3139         * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
3140         necessary.
3141         * jcf-parse.c (set_source_filename): Use
3142         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
3143
3144 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3145
3146         * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
3147         gets a unique asm name.
3148
3149 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3150
3151         * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
3152         (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
3153         if necessary.
3154         (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
3155         * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
3156         * parse.y (lookup_package_type_and_set_next): Deleted.
3157         (resolve_package): Removed unnecessary code.
3158         (find_applicable_accessible_methods_list): `finit$' can't be
3159         inherited.
3160         * verify.c (pop_argument_types): Added missing prototype.
3161
3162 2001-01-23  Bryce McKinlay  <bryce@albatross.co.nz>
3163
3164         * config-lang.in: Disable java by default.
3165
3166 2001-01-23  Tom Tromey  <tromey@redhat.com>
3167
3168         * gcj.texi (Copying): New node.
3169         Added copyright information.
3170
3171 2001-01-21  Per Bothner  <per@bothner.com>
3172
3173         Various fixes to allow compiling a compressed .jar/.zip archive.
3174         * zipfile.h (struct ZipFileCache):  Replace by struct ZipFile.
3175         (struct ZipFile):  Add fields name and next (from  ZipFileCache).
3176         (struct ZipDirectory):  New field zipf points to owning ZipFile.
3177         * jcf.h (struct ZipDirectory):  Add forward declaration.
3178         (struct JCF):   Declare zipd field to have type struct ZipDirectory.
3179         Remove seen_in_zip and zip_offset fields.
3180         (JCF_SEEN_IN_ZIP):  New macro.
3181         * zextract.c (read_zip_archive):  Set ZipDirectory's zipf field.
3182         * jcf-io.c:  Change all ZipFileCache to ZipFile.
3183         (read_zip_member):  New function.
3184         (open_in_zip):  Call read_zip_member.
3185         * jcf-parse.c (find_in_current_zip):  Remove function.
3186         (read_class):  Merge in find_in_current_zip functionality.
3187         Call read_zip_member if needed.
3188         (parse_zip_file_entries):  Use read_zip_member.
3189         (process_zip_dir):  Update for removed and added JCF fields.
3190         (jcf_figure_file_type):  Re-use, don't copy initial ZipFile struct.
3191
3192 2001-01-21  Per Bothner  <per@bothner.com>
3193
3194         Minor optimization of static ggc roots.
3195         * jcf-parse.c (parse_roots):  New static field.
3196         (current_field, current_method, current_file_list):  Replace by macros
3197         naming fields of parse_roots.
3198         (init_jcf_parse):  Combine 3 ggc_add_tree_root calls to 1.
3199         * class.c (class_roots):  New static field.
3200         (registered_class, fields_ident, info_ident, class_list):
3201         New macros naming fields of parse_roots.
3202         (build_static_field_ref):  Don't register roots here.
3203         (layout_class):  Static field list replaced by macro class_list.
3204         (init_class_processing):  Call ggc_add_tree_root for 4 roots.
3205         Initialize fields_ident and info_ident here.
3206
3207 2001-01-21  Per Bothner  <per@bothner.com>
3208
3209         * jcf-parse.c (ggc_mark_jcf):  New function.
3210         (init_jcf_parse):  Register current_jcf as ggc root.
3211
3212 2001-01-21  Per Bothner  <per@bothner.com>
3213
3214         * lang.c (put_decl_node):  Print method's name.
3215
3216 2001-01-21  Per Bothner  <per@bothner.com>
3217
3218         * verify.c (VERIFICATION_ERROR_WITH_INDEX):  New macro.
3219         (verify_jvm_instructions):  Use it, for better error messages on loads.
3220
3221 2001-01-21  Per Bothner  <per@bothner.com>
3222
3223         * verify.c (merge_type_state):  Still may have to merge even if
3224         LABEL_VERIFIED (label).
3225
3226 2001-01-21  Per Bothner  <per@bothner.com>
3227
3228         * parse.y (method_header):  Don't set the DECL_NAME of a FUNCTION_DECL
3229         to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
3230
3231 2001-01-19  Per Bothner  <per@bothner.com>
3232
3233         * expr.c (pop_type_0):  Only return object_ptr_type_node on mismatch
3234         if expeting an interface type.  Refines Tom's change of 2000-09-12.
3235
3236 2001-01-18  Per Bothner  <per@bothner.com>
3237
3238         * gcj.texi (Input Options): Mention .java files.
3239
3240 2001-01-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3241
3242         * lang-options.h (-Wunsupported-jdk11): Removed.
3243         * lang.c (flag_not_overriding): Deleted.
3244         (flag_static_local_jdk1_1): Likewise.
3245         (lang_W_options): Removed "unsupported-jdk11" entry.
3246         * parse.y (java_check_methods): Removed dead code.
3247
3248 2001-01-17  Tom Tromey  <tromey@redhat.com>
3249
3250         Changes suggested by Per Bothner:
3251         * gcj.texi (Input Options): Don't mention input files.
3252         (Code Generation): Updated --main information.
3253         (Invoking jcf-dump): Mention that --javap is incomplete.
3254         From Alexandre Petit-Bianco:
3255         (Warnings): Don't mention -Wunsupported-jdk11.
3256         My stuff:
3257         (Compatibility): Mention JDK 1.2-ness of libraries.
3258         (Resources): Mention resources used when writing gcj.
3259
3260 2001-01-17  Tom Tromey  <tromey@redhat.com>
3261
3262         * gcj.texi: New file.
3263         * Make-lang.in ($(srcdir)/java/gcj.info): New target.
3264         (java.info): Depend on gcj.info.
3265         (java/gcj.dvi): New target.
3266         (java.dvi): Depend on gcj.dvi.
3267         (java.install-info): Wrote.
3268
3269 2001-01-16  Jeff Sturm  <jeff.sturm@appnet.com>
3270
3271         * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
3272         having called make_decl_rtl.
3273
3274 2001-01-14  Per Bothner  <per@bothner.com>
3275
3276         Various patches to emit better messages on verification errors.
3277         * expr.c (push_type_0):  Return error indication on stack overflow,
3278         instead of callinfg fatal.
3279         (push_type):  Now just call push_type_0 (nd fatal on overflow).
3280         (pop_type_0):  Return detailed error message (in a char** argument).
3281         (pop_type):  If pop_type_0 fails, print error message.
3282         (pop_argument_types):  Moved to verify.c.
3283         * verify.c (pop_argument_types):  Moved from expr.c.
3284         Return a (possible) error message, rather than void.
3285         (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING):  New macros.
3286         (verify_jvm_instruction):  Use new macros, improving error messages.
3287         For case OPCODE_astore use object_ptr_type_node.
3288         * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED):  New macros.
3289         (pop_type_0, push_type_0, pop_argument_types):  Update accordingly.
3290
3291         * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
3292         constant, return body without wrapper.  (Improves constant folding.)
3293         * lex.c (build_wfl_node):  Clear TREE_TYPE from returned node.
3294
3295 2001-01-13  Per Bothner  <per@bothner.com>
3296
3297         * expr.c (expand_java_field_op):  Assigning to a final field outside
3298         an initializer does not violate JVM spec, so should be warning, not
3299         error.  (Sun's verifier does not complain - though MicroSoft's does.)
3300
3301 2001-01-12  Joseph S. Myers  <jsm28@cam.ac.uk>
3302
3303         * gjavah.c (version), jcf-dump.c (version): Update copyright year
3304         to 2001.
3305
3306 2001-01-11  Bryce McKinlay  <bryce@albatross.co.nz>
3307
3308         * parse.y (resolve_expression_name): Permit instance variables from
3309         enclosing context in super constructor call.
3310         (resolve_qualified_expression_name): Permit enclosing class's qualified
3311         "this" in super constructor call.
3312
3313 2001-01-10  Mark Mitchell  <mark@codesourcery.com>
3314
3315         * class.c (build_utf8_ref): Remove last argument in call to
3316         make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
3317         (build_class_ref): Likewise.
3318         (build_static_field_ref): Likewise.
3319         (get_dispatch_table): Likewise.
3320         (layout_class_method): Likewise.
3321         (emit_register_classes): Likewise.
3322         * constants.c (build_constant_data_ref): Likewise.
3323         * decl.c (builtin_function): Likewise.
3324         (create_primitive_vtable): Likewise.
3325         * expr.c (build_known_method_def): Likewise.
3326         (build_jni_stub): Likewise.
3327         (java_lang_expand_expr): Likewise.
3328
3329 2001-01-10  Tom Tromey  <tromey@redhat.com>
3330
3331         * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
3332
3333 2001-01-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3334
3335         * java-tree.h (lang_printable_name_wls): New prototype.
3336         * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
3337         rather than `current_class' to print type name. Don't prepend type
3338         names when printing constructor names.
3339         (lang_printable_name_wls): New function.
3340         * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
3341         `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
3342         * parse.y (patch_method_invocation): Message tuned for constructors.
3343         (not_accessible_p): Grant `private' access from within
3344         enclosing contexts.
3345
3346 2001-01-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3347
3348         All files with updated copyright when applicable.
3349         * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
3350         * class.c (mangle_class_field): Function removed.
3351         (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
3352         (utf8_cmp, cxx_keyword_p): Moved to lex.c.
3353         (build_class_ref): Call `java_mangle_class_field' instead of
3354         `mangle_class_field.'
3355         (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
3356         (layout_class): Call `java_mangle_decl' instead of
3357         `mangle_static_field.'
3358         (cxx_keywords): Initialized static array moved to `lex.c.'
3359         (layout_class_method): Changed leading comment. Simplified to
3360         call `java_mangle_decl.' Local `ptr' moved in for loop body.
3361         * decl.c (lang_mark_tree): Mark field `package_list.'
3362         * java-tree.h (TYPE_PACKAGE_LIST): New macro.
3363         (struct lang_type): New field `package_list.'
3364         (unicode_mangling_length): Prototype removed.
3365         (append_gpp_mangled_name, append_gpp_mangled_classtype,
3366         emit_unicode_mangled_name): Likewise.
3367         (cxx_keyword_p): New prototype.
3368         (java_mangle_decl, java_mangle_class_field,
3369         java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
3370         * jcf-parse.c (jcf_parse_source): Constify `file' argument to
3371         `build_expr_wfl.'
3372         * jvgenmain.c (main_method_prefix): Global variable removed.
3373         (main_method_suffix): Likewise.
3374         (do_mangle_classname): New function.
3375         (main): Call it. Format changed to accommodate new mangling scheme.
3376         * lex.c: (utf8_cmp): Conditionally prototyped.
3377         (cxx_keywords): Moved from class.c, conditionally defined.
3378         (utf8_cmp, cxx_keyword_p): Likewise.
3379         * mangle.c (obstack.h, ggc.h): Included.
3380         (mangle_field_decl): New function.
3381         (mangle_method_decl, mangle_type, mangle_pointer_type,
3382         mangle_array_type, mangle_record_type,
3383         find_compression_pointer_match, find_compression_array_match,
3384         find_compression_record_match,
3385         find_compression_array_template_match, set_type_package_list,
3386         entry_match_pointer_p, emit_compression_string, init_mangling,
3387         finish_mangling, compression_table_add, mangle_member_name): Likewise.
3388         (mangle_obstack): New global.
3389         (MANGLE_RAW_STRING): New macro.
3390         (unicode_mangling_length): Turned static.
3391         (append_unicode_mangled_name): Renamed from
3392         `emit_unicode_mangled_name.'  Turned static. `mangle_obstack'
3393         replaces `obstack', removed from the parameter list.
3394         (append_gpp_mangled_name): Turned static. `mangle_obstack'
3395         replaces parameter `obstack', removed from the parameter list. Call
3396         `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
3397         (append_gpp_mangled_classtype): Removed.
3398         (compression_table, compression_next): New static variables.
3399         * parse.y (temporary_obstack): Extern declaration removed.
3400
3401 2001-01-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3402
3403         * parse.y (patch_binop): Compute missing type in error situations.
3404
3405 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
3406
3407         * class.c (make_class_data): Push initial value for "arrayclass".
3408         * decl.c (init_decl_processing): Add new class field "arrayclass".
3409
3410 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
3411
3412         From patha@softlab.ericsson.se:
3413         * parse.y (switch_label): Use build, not build1, to construct
3414         DEFAULT_EXPR.
3415
3416 2001-01-04  Neil Booth  <neil@daikokuya.demon.co.uk>
3417
3418         * lang.c (lang_decode_option): Change -MA to -MP.
3419         * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
3420         Update to new prototype; do quote targets.
3421         (jcf_dependency_write): Update.
3422
3423 2000-12-22  Bryce McKinlay  <bryce@albatross.co.nz>
3424
3425         Shorten primitive array allocation path:
3426         * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
3427         to create new primitive arrays.
3428         * expr.c (build_newarray): If generating native code, call
3429         soft_newarray_node with a reference to the primitive TYPE identifier
3430         instead of type_value.
3431
3432 2000-12-17  Bryce McKinlay  <bryce@albatross.co.nz>
3433
3434         Fix for PRs gcj/312 and gcj/253:
3435         * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
3436         dest if they arn't already.
3437         * class.c (layout_class): Call maybe_layout_super_class on
3438         superinterfaces also, but only if compiling from bytecode.
3439
3440         Fix for PR gcj/373:
3441         * parse.y (create_class): Set ACC_STATIC if class is declared in an
3442         interface.
3443
3444 2000-12-15  Tom Tromey  <tromey@redhat.com>
3445
3446         * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
3447         set.
3448
3449 2000-12-14  Andrew Haley  <aph@redhat.com>
3450
3451         * boehm.c (mark_reference_fields): Change test to correctly detect
3452         bitmap overflow.
3453
3454 2000-12-15  Andreas Jaeger  <aj@suse.de>
3455
3456         * config-lang.in (lang_dirs): Added.
3457
3458 2000-12-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3459
3460         * parse.y (end_artificial_method_body): Fixed undefined behavior.
3461         Credits go to rth for finding it.
3462
3463 2000-12-13  Mike Stump  <mrs@wrs.com>
3464
3465         * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
3466
3467 2000-11-07  Tom Tromey  <tromey@cygnus.com>
3468
3469         * Make-lang.in (JAVA_LEX_C): Added chartables.h.
3470         * lex.c (java_ignorable_control_p): Removed.
3471         (java_letter_or_digit_p): Removed.
3472         (java_start_char_p): New function.
3473         (java_read_char): Return `int', not `unicode_t'.  Changed
3474         callers.
3475         (java_read_unicode): Likewise.
3476         (java_read_unicode_collapsing_terminators): Likewise.
3477         (java_get_unicode): Likewise.
3478         (java_new_lexer): Initialize hit_eof.
3479         (java_parse_end_comment): Take `int' argument.
3480         (java_parse_doc_section): Likewise.
3481         (java_parse_escape_sequence): Don't allow backlash-newline.
3482         Return `int'.
3483         * lex.h (JAVA_DIGIT_P): Removed.
3484         (_JAVA_LETTER_OR_DIGIT_P): Removed.
3485         (_JAVA_IDENTIFIER_IGNORABLE): Removed.
3486         (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
3487         (JAVA_PART_CHAR_P): New macro.
3488         (UEOF): Now -1.
3489         (JAVA_CHAR_ERROR): Now -2.
3490         (java_lexer): New field `hit_eof'.
3491         * chartables.h: New file.
3492         * gen-table.pl: new file.
3493
3494 2000-11-20  Tom Tromey  <tromey@cygnus.com>
3495             Alexandre Petit-Bianco  <apbianco@cygnus.com>
3496
3497         * parse.y (java_complete_lhs): Only allow compound assignment of
3498         reference type if type is String.
3499
3500 2000-12-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3501
3502         * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
3503         jcf-path.c: Likewise.
3504
3505 2000-12-09  Anthony Green  <green@redhat.com>
3506
3507         * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
3508         filestart and filename_length as int values.
3509
3510 2000-12-07  Mo DeJong  <mdejong@redhat.com>
3511
3512         * jcf-io.c (find_class): Correct the logic that tests to see if a
3513         .java file is newer than its .class file. The compiler was
3514         incorrectly printing a warning when file mod times were equal.
3515
3516 2000-12-07  Zack Weinberg  <zack@wolery.stanford.edu>
3517
3518         * jvgenmain.c: Use ISPRINT not isascii.
3519
3520 2000-12-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3521
3522         * parse.y (end_artificial_method_body): Fixed typo.
3523
3524 2000-12-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3525
3526         * parse.y (patch_method_invocation): Pick the correct enclosing
3527         context when creating inner class instances.
3528         Fixes gcj/332.
3529
3530 2000-11-26  Joseph S. Myers  <jsm28@cam.ac.uk>
3531
3532         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
3533         Update copyright year to 2000.
3534
3535 2000-11-23  Anthony Green  <green@redhat.com>
3536
3537         * jcf-parse.c (init_jcf_parse): Register current_file_list root.
3538         Move current_file_list out of yyparse and make it static.
3539
3540         * expr.c: Declare quick_stack and tree_list_free_list as static
3541         (init_expr_processing): Register quick_stack and
3542         tree_list_free_list roots.
3543
3544 2000-11-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3545
3546         * parse.y (build_outer_field_access): New local `decl_ctx', use
3547         it. Check for field's context and current class immediate outer
3548         context inheritance.
3549         (outer_field_access_p): Consider fields inherited from the last
3550         enclosing context.
3551         (build_access_to_thisn): Stop at the last enclosing context if
3552         necessary.
3553         Fixes gcj/367.
3554
3555 Thu Nov 23 02:19:14 2000  J"orn Rennecke <amylaar@redhat.com>
3556
3557         * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
3558
3559 2000-11-22  Bryce McKinlay  <bryce@albatross.co.nz>
3560
3561         * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
3562         scratch buffer.
3563
3564 2000-11-20  Tom Tromey  <tromey@cygnus.com>
3565
3566         * jv-scan.c (help): Document --complexity.
3567         (options): Added --complexity.
3568         (flag_complexity): New global.
3569         (main): Call `report'.
3570         * parse-scan.y (complexity): New global.
3571         (if_then_statement, if_then_else_statement,
3572         if_then_else_statement_nsi, switch_block_statement_group,
3573         while_expression, do_statement, for_begin, continue_statement,
3574         throw_statement, catch_clause, finally, method_invocation,
3575         conditional_and_expression, conditional_or_expression,
3576         conditional_expression): Update complexity.
3577         (reset_report): Reset complexity.
3578         (report): New function.
3579
3580 2000-11-20  Tom Tromey  <tromey@cygnus.com>
3581
3582         * lex.c (yylex): Added STRICT_TK case.
3583         * parse.y (STRICT_TK): Added.
3584         * parse-scan.y (STRICT_TK): Added.
3585         * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
3586         `;'.  Use 4, not 3, with -k option.  Correctly rename resulting
3587         file.
3588         * keyword.h: Rebuilt.
3589         * keyword.gperf (strictfp): Added.
3590
3591 2000-11-20  Tom Tromey  <tromey@cygnus.com>
3592
3593         * lex.c (yylex): Recognize floating point constants with leading
3594         0.
3595
3596 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3597
3598         * java-tree.h (cyclic_inheritance_report): Constify.
3599         * parse.y (cyclic_inheritance_report): Likewise.
3600
3601 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
3602
3603         * parse.y (goal): Remove call to ggc_add_string_root.
3604
3605 2000-11-16  Zack Weinberg  <zack@wolery.stanford.edu>
3606
3607         * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
3608         Create string in scratch buffer, then pass to build_string.
3609
3610 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
3611
3612         * parse.y (issue_warning_error_from_context): Add
3613         ATTRIBUTE_PRINTF.
3614
3615 2000-11-11  Anthony Green  <green@redhat.com>
3616
3617         * jcf-parse.c (process_zip_dir): Add finput parameter.
3618         (jcf_figure_file_type): Call process_zip_dir with appropriate
3619         argument.
3620
3621 2000-11-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3622
3623         * decl.c (copy_lang_decl): Use memcpy, not bcopy.
3624         * jcf-parse.c (jcf_figure_file_type): Likewise.
3625
3626 2000-11-09  Joseph S. Myers  <jsm28@cam.ac.uk>
3627
3628         * parse.y (create_new_parser_context): Use memset () instead of
3629         bzero ().
3630
3631 2000-11-08  Tom Tromey  <tromey@cygnus.com>
3632
3633         * gjavah.c (process_file): Only include gcj/cni.h when generating
3634         CNI stubs.
3635
3636 2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>
3637
3638         * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
3639         (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
3640         instead of bzero ().
3641
3642 2000-11-05  Tom Tromey  <tromey@cygnus.com>
3643
3644         * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
3645         * lex.c (IS_ZERO): New define.
3646         (java_perform_atof): Error on floating point underflow.
3647
3648 2000-11-04  Tom Tromey  <tromey@cygnus.com>
3649
3650         * lex.c (java_parse_escape_sequence): Only read two octal
3651         characters if the first one is greater than 3.  Don't allow
3652         "octal" numbers to include the digits 8 or 9.
3653
3654 2000-11-05  Joseph S. Myers  <jsm28@cam.ac.uk>
3655
3656         * Make-lang.in (java.distdir): Remove.
3657
3658 2000-11-03  Tom Tromey  <tromey@cygnus.com>
3659
3660         * Make-lang.in (java.dvi): New target.
3661         Partial fix for PR other/567.
3662
3663         * lang-options.h: Mention -Wout-of-date.
3664         * jcf-dump.c (flag_newer): New global.
3665         * gjavah.c (flag_newer): New global.
3666         * jcf-io.c (find_class): Only warn when flag_newer set.
3667         * lang.c (flag_newer): New global.
3668         (struct string_option): New declaration.
3669         (lang_W_options): New global.
3670         (process_option_with_no): New function.
3671         (lang_decode_option): Use it.
3672
3673         * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
3674         * gjavah.c (cxx_keyword_subst): Handle any number of trailing
3675         `$'.
3676
3677         * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
3678         (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
3679         * lex.c (java_read_unicode): Removed `term_context' argument.
3680         Recognize any number of `u' in `\u'.
3681         (java_read_unicode_collapsing_terminators): New function.
3682         (java_get_unicode): Use it.
3683         (java_lineterminator): Removed.
3684         (yylex): Produce error if character literal is newline or single
3685         quote.  Return if eof found in middle of `//' comment.  EOF in
3686         `//' comment is only an error if pedantic.
3687         (java_ignorable_control_p): New function.
3688         (java_parse_end_comment): Return if eof found in middle of
3689         comment.
3690         Include flags.h.
3691         * jv-scan.c (pedantic): New global.
3692
3693 2000-10-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3694
3695         * parse.y (outer_field_access_p): Inherited fields aren't
3696         consider outer fields.
3697         (maybe_build_thisn_access_method): Use
3698         PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
3699         (resolve_expression_name): Trigger an error if a static field
3700         is being accessed as an outer field.
3701
3702 2000-10-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3703
3704         * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
3705         Fixes gcj/365.
3706
3707 2000-10-27  Zack Weinberg  <zack@wolery.stanford.edu>
3708
3709         * Make-lang.in: Move all build rules here from Makefile.in,
3710         adapt to new context.  Wrap all rules that change the current
3711         directory in parentheses.  Expunge all references to $(P).
3712         When one command depends on another and they're run all at
3713         once, use && to separate them, not ;.  Add OUTPUT_OPTION to
3714         all object-file generation rules.  Delete obsolete variables.
3715
3716         * Makefile.in: Delete.
3717         * config-lang.in: Delete outputs= line.
3718
3719 2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3720
3721         * parse.y (patch_method_invocation): NULLify this_arg when already
3722         inserted.
3723         (maybe_use_access_method): Handle call to methods unrelated to the
3724         current class. Fixed comment.
3725         Fixes gcj/361.
3726
3727 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3728
3729        * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
3730        scope.
3731
3732 2000-10-24  Tom Tromey  <tromey@cygnus.com>
3733
3734         * lex.c (java_new_lexer): Initialize new fields.  Work around
3735         broken iconv() implementations.
3736         (java_read_char): Swap bytes if required.  Use fallback decoder if
3737         required.
3738         (byteswap_init, need_byteswap): New globals.
3739         (java_destroy_lexer): Only close iconv handle if it is in use.
3740         * lex.h (java_lexer): New fields read_anything, byte_swap,
3741         use_fallback.
3742         Made out_buffer unsigned.
3743
3744 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3745
3746         * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
3747         where an enclosing context can be set on the jdep.
3748         (do_resolve_class): Fixed identation.
3749
3750 2000-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3751
3752         * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
3753
3754         * jcf-reader.c (peek_attribute, skip_attribute): Only define
3755         when requested.
3756
3757         * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
3758
3759         * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
3760
3761 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3762
3763         * jcf-write.c (OP1): Update `last_bc'.
3764         (struct jcf_block): Fixed indentation and typo in comments.  New
3765         field `last_bc'.
3766         (generate_bytecode_insns): Insert `nop' if `jsr' immediately
3767         follows `monitorenter'.
3768         * parse.y (patch_synchronized_statement): New local `tmp'. Call
3769         `patch_string'.
3770         Fixes gcj/232.
3771
3772 2000-10-16  Tom Tromey  <tromey@cygnus.com>
3773
3774         * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
3775         * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
3776         * lang-options.h: Added -MA, -MT, -MF..
3777         * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
3778         (DEPEND_TARGET_SET): New macro.
3779         (DEPEND_FILE_ALREADY_SET): Likewise.
3780         (init_parse): Handle new flags.
3781         * jcf.h (jcf_dependency_print_dummies): Declare.
3782         * Make-lang.in (s-java): Added mkdeps.o.
3783         * Makefile.in (BACKEND): Added mkdeps.o.
3784         (../gcjh$(exeext)): Added mkdeps.o.
3785         (../jcf-dump$(exeext)): Added mkdeps.o.
3786         * jcf-depend.c: Include mkdeps.h.
3787         (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
3788         add_entry): Removed.
3789         (jcf_dependency_reset): Rewrote.
3790         (dependencies): New global.
3791         (jcf_dependency_set_target): Rewrote.
3792         (jcf_dependency_add_target): Likewise.
3793         (jcf_dependency_add_file): Likewise.
3794         (munge): Removed.
3795         (print_ents): Removed.
3796         (jcf_dependency_write): Rewrote.
3797         (print_dummies): New global.
3798         (jcf_dependency_print_dummies): New function
3799         (jcf_dependency_write): Call deps_dummy_targets if required.
3800
3801 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3802
3803         * gjavah.c (add_class_decl): Removed unused variables `tname',
3804         `tlen' and `name_index'.
3805         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
3806         * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
3807         in `wfl_operator' with value.
3808         (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
3809         (jcf_figure_file_type): Fixed identation.
3810         * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
3811         * parse.y (analyze_clinit_body): New function.
3812         (static_initializer:): Reset `current_static_block'.
3813         (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
3814         `wfl_operator' with new value.
3815         (lookup_cl): Use EXPR_WFL_FILENAME.
3816         (maybe_yank_clinit): Handle bogus <clinit> bodies, call
3817         analyze_clinit_body.
3818         (build_outer_field_access): Access to this$<n> built from
3819         current_class, not its outer context.
3820         (build_access_to_thisn): Fixed leading comment. Tidied things up.
3821         (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
3822         (patch_method_invocation): Use `is_static_flag' when already
3823         initialized.
3824         (patch_newarray): Removed assignment in ternary operator.
3825
3826 2000-10-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3827
3828         * except.c (free_eh_ranges): Don't free `whole_range'.
3829
3830 2000-10-15  Anthony Green  <green@redhat.com>
3831
3832         * decl.c (init_decl_processing): Call init_class_processing before
3833         anything else.
3834
3835 2000-10-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3836
3837         * check-init.c (check_init): Fixed leading comment. Use
3838         LOCAL_FINAL_P.
3839         * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3840         (give_name_to_locals): Likewise.
3841         (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
3842         fields in lang_decl_var.
3843         * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
3844         DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
3845         (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
3846         (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
3847         DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
3848         (LOCAL_FINAL): Rewritten.
3849         (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
3850         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
3851         (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
3852         `init_final' fields.
3853         (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
3854         `final_uid', `final_liic', `final_ierr' and `local_final' fields.
3855         (TYPE_HAS_FINAL_VARIABLE): New macro.
3856         (struct lang_type): Added `afv' field.
3857         * parse.y (check_static_final_variable_assignment_flag): New function.
3858         (reset_static_final_variable_assignment_flag): Likewise.
3859         (check_final_variable_local_assignment_flag): Likewise.
3860         (reset_final_variable_local_assignment_flag): Likewise.
3861         (check_final_variable_indirect_assignment): Likewise.
3862         (check_final_variable_global_assignment_flag): Likewise.
3863         (add_inner_class_fields): Use LOCAL_FINAL_P.
3864         (register_fields): Handle local finals and final variables.
3865         (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
3866         (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3867         (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
3868         on local finals.
3869         (java_complete_expand_methods): Loop to set
3870         TYPE_HAS_FINAL_VARIABLE. Call
3871         `reset_final_variable_local_assignment_flag' and
3872         `check_final_variable_local_assignment_flag' accordingly before
3873         and after constructor expansion. Call
3874         `reset_static_final_variable_assignment_flag'
3875         before expanding <clinit> and after call
3876         `check_static_final_variable_assignment_flag' if the
3877         current_class isn't an interface. After all methods have been
3878         expanded, call `check_final_variable_global_assignment_flag' and
3879         `check_static_final_variable_assignment_flag' if the current class
3880         is an interface.
3881         (maybe_yank_clinit): Fixed typo in comment.
3882         (build_outer_field_access_methods): Removed old sanity check. Use
3883         FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
3884         Don't create access methods for finals.
3885         (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
3886         (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
3887         existing DECL_INIT has been processed.
3888         (java_complete_lhs): Likewise.
3889         (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
3890         Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
3891         logic.
3892         (patch_assignment): Use LOCAL_FINAL_P.
3893         (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
3894         DECL_INITIAL is nullified.
3895         Fixes gcj/163.
3896
3897 2000-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3898
3899         * Make-lang.in (parse.c, parse-scan.c): Create atomically.
3900
3901         * Makefile.in (parse.c, parse-scan.c): Likewise.
3902
3903 2000-10-12  Mark Mitchell  <mark@codesourcery.com>
3904
3905         * class.c (temporary_obstack): Remove.
3906         (make_class): Don't mess with obstascks.
3907         (push_class): Likewise.
3908         (set_super_info): Likewise.
3909         (add_method_1): Likewise.
3910         (add_method): Likewise.
3911         (add_field): Likewise.
3912         (build_utf8_ref): Likewise.
3913         (build_class_ref): Likewise.
3914         (build_static_field_ref): Likewise.
3915         (finish_class): Likewise.
3916         (push_super_field): Likewise.
3917         (layout_class): Likewise.
3918         (layout_class_methods): Likewise.
3919         (init_class_processing): Likewise.
3920         * constants.c (get_tag_node): Likewise.
3921         (build_constant_data_ref): Likewise.
3922         * decl.c (ggc_p): Remove.
3923         (copy_lang_decl): Use ggc_alloc.
3924         (complete_start_java_method): Don't mess with obstacks.
3925         (start_java_method): Likewise.
3926         (end_java_method): Likewise.
3927         * except.c (link_handler): Use xmalloc.
3928         (free_eh_ranges): New function.
3929         (method_init_exceptions): Use it.
3930         (add_handler): Use xmalloc.
3931         (expand_start_java_handler): Don't mess with obstacks.
3932         (prepare_eh_table_type): Likewise.
3933         (expand_end_java_handler): Likewise.
3934         * expr.c (push_value): Likewise.
3935         (create_label_decl): Likewise.
3936         (build_jni_stub): Likewise.
3937         (java_lang_expand_expr): Likewise.
3938         (note_instructions): Use xrealloc.
3939         (java_push_constant_from_pool): Don't mess with obstacks.
3940         (process_jvm_instruction): Likewise.
3941         * java-tree.h (cyclic_inheritance_report): Remove duplicate
3942         declaration.
3943         * jcf-parse.c (get_constant): Don't mess with obstacks.
3944         (read_class): Likewise.
3945         (jcf_parse): Likewise.
3946         * lex.c (expression_obstack): Remove.
3947         (java_lex): Don't use obstack_free.
3948         * parse.h (exit_java_complete_class): Don't mess with obstacks.
3949         (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
3950         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
3951         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
3952         * parse.y (gaol): Add more GC roots.
3953         (add_inner_class_fields): Adjust calls to MANGLE_* macros.
3954         (lookup_field_wrapper): Likewise.
3955         (obtain_incomplete_type): Don't mess with obstacks.
3956         (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
3957         macros.
3958         (craft_constructor): Don't mess with obstacks.
3959         (safe_layout_class): Likewise.
3960         (java_complete_class): Likewise.
3961         (source_end_java_method): Likewise.
3962         (build_outer_field_access_methods): Likewise.
3963         (build_outer_method_access_method): Likewise.
3964         (maybe_build_thisn_access_method): Likewise.
3965         (build_dot_class_method_invocation): Likewise.
3966         (java_complete_tree): Likewise.
3967         (java_complete_lhs): Likewise.
3968         (do_merge_string_cste): Likewise.
3969         (patch_string_cst): Likewise.
3970         (array_constructor_check_entry): Likewise.
3971         * typeck.c (build_java_array_type): Likewise.
3972         (parse_signature_string): Likewise.
3973         (build_java_signature): Likewise.
3974
3975 2000-10-12  Tom Tromey  <tromey@cygnus.com>
3976
3977         Fix for PR gcj/356:
3978         * gjavah.c (add_class_decl): Don't special-case inner classes.
3979         (add_namelet): Likewise.
3980
3981 2000-10-11  Rodney Brown  <RodneyBrown@mynd.com>
3982
3983         * java-tree.h: Constify current_encoding.
3984         * lang.c: Constify current_encoding.
3985
3986 2000-10-10  Jeff Sturm  <jeff.sturm@appnet.com>
3987
3988         * jvgenmain.c (class_mangling_suffix): Omit `.'.
3989         (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
3990
3991 2000-10-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3992
3993         * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
3994         patch. Fixes gcj/340.
3995
3996 2000-10-10  Tom Tromey  <tromey@cygnus.com>
3997
3998         * lex.c (java_new_lexer): Initialize out_first and out_last
3999         fields.
4000         * lex.h (java_lexer): Added out_buffer, out_first, out_last.
4001
4002 2000-10-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4003
4004         * parse.y (pop_current_osb): New function.
4005         (array_type:): Use `dims:', changed actions
4006         accordingly. Suggested by Anthony Green.
4007         (array_creation_expression:): Used pop_current_osb.
4008         (cast_expression:): Likewise.
4009         (search_applicable_method_list): Fixed indentation.
4010
4011 2000-10-08  Anthony Green  <green@redhat.com>
4012
4013         * parse.y (array_type_literal): Remove production.
4014         (type_literals): Refer to array_type, not array_type_literal.
4015
4016 2000-10-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4017
4018         Patch contributed by Corey Minyard.
4019         * decl.c (check_local_named_variable): New function.
4020         (tree check_local_unnamed_variable): Likewise.
4021         (find_local_variable): Splitted. Call check_local_{un}named_variable.
4022
4023 2000-10-07  Anthony Green  <green@redhat.com>
4024
4025         * class.c (layout_class): Handle case where superclass can't be
4026         layed out yet.
4027
4028 2000-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
4029
4030         * Makefile.in (keyword.h): Refer to GNU FTP site for updated
4031         gperf.
4032
4033 2000-10-05  Tom Tromey  <tromey@cygnus.com>
4034
4035         * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
4036         * jvgenmain.c (class_mangling_prefix): Removed.
4037         (class_mangling_suffix): New global.
4038         (main): Use it.
4039         * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
4040         `$'.
4041         (print_method_info): Handle overrides for static and final
4042         methods.
4043         (process_file): Generate declaration for class object field.
4044         * class.c (cxx_keywords): New array.
4045         (utf8_cmp): New function.
4046         (cxx_keyword_p): New function.
4047         (layout_class_method): Mangle C++ keywords by appending `$'.
4048         (mangle_field): New function.
4049         (mangle_class_field): Use mangle_field.  Mangle class name as
4050         `class$'.
4051         (mangle_static_field): Use mangle_field.
4052
4053 Tue Oct  3 13:44:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4054
4055         * decl.c (find_local_variable): Removed uncessary type check and
4056         fixed range check typo. From Corey Minyard.
4057
4058 Wed Sep 13 16:06:52 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4059
4060         * decl.c (give_name_to_locals): New local `code_offset'. Call
4061         `maybe_adjust_start_pc'.
4062         * expr.c (note_instructions): New function.
4063         (expand_byte_code): Don't collect insn starts here.
4064         (peek_opcode_at_pc): New function.
4065         (maybe_adjust_start_pc): Likewise.
4066         * java-tree.h (maybe_adjust_start_pc): Declare.
4067         (note_instructions): Likewise.
4068         * jcf-parse.c (parse_class_file): Call `note_instructions'.
4069
4070 Wed Sep 13 11:50:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4071
4072         * parse.y (field_access:): Fixed indentation.
4073         (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
4074
4075 2000-09-07  Tom Tromey  <tromey@cygnus.com>
4076
4077         Fix for PR gcj/307:
4078         * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
4079         JPRIMITIVE_TYPE_P, for arithmetic operators.
4080         (patch_method_invocation): Indentation fix.
4081         (try_builtin_assignconv): Handle boolean specially.  Fixed typo.
4082         (valid_builtin_assignconv_identity_widening_p): Handle boolean.
4083         (do_unary_numeric_promotion): Cleaned up code.
4084         (valid_cast_to_p): Handle boolean correctly.
4085
4086 2000-09-27  Tom Tromey  <tromey@cygnus.com>
4087
4088         * lex.c (java_read_unicode): Reset bs_count when finished with
4089         `\u' sequence.
4090
4091 2000-10-01  Mark Mitchell  <mark@codesourcery.com>
4092
4093         Convert to GC.
4094         * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
4095         * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
4096         (typeck.o): Depend on ggc.h.
4097         * class.c (add_method_1): Use GC functions for allocation.
4098         (init_class_processing): Register roots.
4099         * decl.c (ggc_p): Set to 1.
4100         (pending_local_decls): Make it static.
4101         (push_jvm_slot): Use GC functions for allocation.
4102         (init_decl_processing): Register roots.
4103         (give_name_to_locals): Use GC functions for allocation.
4104         (lang_mark_tree): New function.
4105         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
4106         functions for allocation.
4107         * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
4108         * lex.c (java_lex): Use build_string, rather than replicating it
4109         inline.
4110         * parse.y (goal): Add more roots.
4111         (mark_parser_ctxt): New function.
4112         * typeck.c: Include ggc.h.
4113
4114 2000-09-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4115
4116         * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
4117         contains something else than MODIFY_EXPR.
4118
4119 2000-09-23  Mark Mitchell  <mark@codesourcery.com>
4120
4121         * Make-lang.in (JAVA_SRCS): Include java-tree.h.
4122         * Makefile.in (parse.o): Depend on ggc.h.
4123         (class.o): Likewise.
4124         (constants.o): Likewise.
4125         (decl.o): Likewise.
4126         (expr.o): Likewise.
4127         (jcf-parse.o): Likewise.
4128         (jcf-write.o): Likewise.
4129         (mangle.o): Likewise.
4130         * class.c: Include ggc.h.
4131         (build_static_field_ref): Register GC roots.
4132         (layout_class): Likewise.
4133         (init_class_processing): Likewise.
4134         * constants.c: Include ggc.h.
4135         (current_constant_pool_data_ref): Remove.
4136         (tag_nodes): Move it to ...
4137         (get_tag_node): ... here.  Register GC roots.
4138         * decl.c: Include ggc.h.  Remove many global tree definitions.
4139         (throw_node): Define.
4140         (java_global_trees): Likewise.
4141         (predef_filenames): Make the size a constant.
4142         (init_decl_processing): Adjust accordingly.
4143         (init_decl_processing): Call init_jcf_parse.  Register GC roots.
4144         * expr.c: Include ggc.h.
4145         (init_expr_processing): Register GC roots.
4146         (build_invokeinterface): Likewise.
4147         * java-tree.h: Replace extern tree declarations with macros.
4148         (java_global_trees): New variable.
4149         (java_tree_index): New enumeration.
4150         (init_jcf_parse): Declare.
4151         * jcf-parse.c: Include ggc.h.
4152         (current_class): Remove declaration.
4153         (main_class): Likewise.
4154         (all_class_list): Likewise.
4155         (predefined_filename_p): Adjust for constant size of
4156         predef_filenames.
4157         (init_jcf_parse): New function.
4158         * jcf-write.c: Include ggc.h.
4159         (generate_classfile): Register GC roots.
4160         (append_synthetic_attribute): Likewise.
4161         (append_innerclass_attribute_entry): Likewise.
4162         * lang.c: Include ggc.h.
4163         (lang_print_error): Register GC roots.
4164         * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
4165         with macros.
4166         * parse.y: Include ggc.h.
4167         (wfl_operator): Remove.
4168         (goal): Register GC roots.
4169         (java_pop_parser_context): Adjust for new field names.
4170         (java_parser_context_save_global): Likewse.
4171         (java_parser_context_restore_global): Likewise.
4172         (java_parser_context_suspend): Likewise.
4173         (java_parser_context_resume): Likewise.
4174         (verify_constructor_circularity): Register GC roots.
4175         (lookup_cl): Likewise.
4176         (java_reorder_fields): Likewise.
4177         (build_current_this): Likewise.
4178         (class_in_current_package): Likewise.
4179         (argument_types_convertible): Likewise.
4180         (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
4181
4182 2000-09-14  Tom Tromey  <tromey@cygnus.com>
4183
4184         * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
4185
4186 2000-09-13  Tom Tromey  <tromey@cygnus.com>
4187
4188         * jcf-parse.c: Include <locale.h>.
4189         * jv-scan.c: Include <locale.h>.
4190
4191 2000-09-12  Tom Tromey  <tromey@cygnus.com>
4192
4193         * expr.c (pop_type_0): Return `Object' if trying to merge two
4194         interface types.
4195         * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
4196         interface types; `Object' is always a valid supertype.
4197
4198 2000-09-12  Tom Tromey  <tromey@cygnus.com>
4199
4200         Fix for PR gcj/33:
4201         * jv-scan.c (help): Document --encoding.
4202         (options): Added `encoding' entry.
4203         (OPT_ENCODING): New define.
4204         (main): Handle --encoding.
4205         Include <langinfo.h> if nl_langinfo exists.
4206         * lang-options.h: Document --classpath, --CLASSPATH, --main, and
4207         --encoding.
4208         * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
4209         (parse_source_file): Correctly call java_init_lex.  Added `finput'
4210         argument.  Use nl_langinfo to determine default encoding.
4211         * java-tree.h (current_encoding): Declare.
4212         * parse.y (java_parser_context_restore_global): Don't restore
4213         `finput'.
4214         (java_parser_context_save_global): Don't set `finput' field.
4215         (java_pop_parser_context): Don't restore `finput'.  Free old lexer
4216         if required.
4217         * lang.c (current_encoding): New global.
4218         (lang_decode_option): Recognize `-fencoding='.
4219         (finish_parse): Don't close finput.
4220         * parse.h (struct parser_ctxt): Removed `finput' and
4221         `unget_utf8_value' fields.  Added `lexer' field.
4222         (java_init_lex): Fixed declaration.
4223         * lex.c (java_new_lexer): New function.
4224         (java_destroy_lexer): Likewise.
4225         (java_read_char): Added `lex' argument.  Handle iconv case.
4226         (java_read_unicode): Added `lex' argument.  Count backslashes in
4227         lexer structure.
4228         (java_init_lex): Added `finput' and `encoding' arguments.  Set
4229         `lexer' field in ctxp.
4230         (BAD_UTF8_VALUE): Removed.
4231         (java_lex): Handle seeing UEOF in the middle of a string literal.
4232         * lex.h: Include <iconv.h> if HAVE_ICONV defined.
4233         (java_lexer): New structure.
4234         (UNGETC): Removed.
4235         (GETC): Removed.
4236         (DEFAULT_ENCODING): New define.
4237         (java_destroy_lexer): Declare.
4238
4239 2000-09-12  Tom Tromey  <tromey@cygnus.com>
4240
4241         Fix for PR gcj/343:
4242         * lex.c (java_init_lex): Initialize java_io_serializable.
4243         * parse.y (java_io_serializable): New global.
4244         (valid_ref_assignconv_cast_p): An array can be cast to
4245         serializable.
4246
4247 2000-09-10  Zack Weinberg  <zack@wolery.cumb.org>
4248
4249         * decl.c, expr.c: Include defaults.h if not already included.
4250         Don't define the *_TYPE_SIZE macros.
4251
4252 2000-09-09  Geoffrey Keating  <geoffk@cygnus.com>
4253
4254         * typeck.c (build_java_array_type): Correct first parameter
4255         in ADJUST_FIELD_ALIGN invocation.
4256
4257 2000-09-06  Tom Tromey  <tromey@cygnus.com>
4258
4259         * lang-specs.h: Also recognize `-femit-class-files'.
4260
4261 2000-09-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4262
4263         * verify.c (merge_types): Load the types to merge if necessary.
4264
4265 2000-09-02  Anthony Green  <green@redhat.com>
4266
4267         * jcf-io.c: Include zlib.h.
4268         (open_in_zip): Read compressed class file archives.
4269         * zipfile.h (ZipDirectory): Add uncompressed_size and
4270         compression_method fields.
4271         * zextract.c (read_zip_archive): Collect file compression info.
4272
4273 2000-08-15  Bryce McKinlay  <bryce@albatross.co.nz>
4274
4275         * parse.y (do_resolve_class): Also explore superclasses of
4276         intermediate enclosing contexts when searching for inner classes.
4277
4278 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4279
4280         * parse.y (variable_declarator_id:): Better error message.
4281         (expression_statement:): Use YYNOT_TWICE.
4282         (cast_expression:): Likewise.
4283         (assignment:): Likewise.
4284
4285 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4286
4287         * parse.y (do_merge_string_cste): New locals. Create new
4288         STRING_CSTs each time, use memcpy. Fixes gcj/311.
4289
4290 2000-08-07  Hans Boehm  <boehm@acm.org>
4291
4292         * boehm.c (mark_reference_fields): Set marking bits for all words in
4293         a multiple-word record.
4294         (get_boehm_type_descriptor): Use the procedure marking descriptor for
4295         java.lang.Class.
4296
4297 2000-08-31  Mike Stump  <mrs@wrs.com>
4298
4299         * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
4300         jcf-dump$(exeext)): Make parallel safe.
4301
4302 2000-08-29  Zack Weinberg  <zack@wolery.cumb.org>
4303
4304         * jcf-parse.c (set_source_filename): Constify a char *.
4305         * jcf-write.c (append_innerclasses_attribute,
4306         make_class_file_name): Constify a char *.  Don't recycle a
4307         variable for an unrelated purpose.
4308         * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
4309         (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
4310
4311 2000-08-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4312
4313         * expr.c (can_widen_reference_to): Fixed indentation.
4314         * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
4315         * parse.y: `finit$' replaces `$finit$' in comments.
4316         (try_builtin_assignconv): Fixed leading comment.
4317
4318 2000-08-25  Greg McGary  <greg@mcgary.org>
4319
4320         * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
4321
4322 2000-08-24  Greg McGary  <greg@mcgary.org>
4323
4324         * lang.c (lang_decode_option): Use ARRAY_SIZE.
4325         * parse.y (BINOP_LOOKUP): Likewise.
4326
4327 2000-08-22  Andrew Haley  <aph@cygnus.com>
4328
4329         * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
4330         sign extending. Fixes gcj/321.
4331         * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
4332         combining to make a jlong. Fixes gcj/321.
4333
4334 2000-08-21  Nix  <nix@esperi.demon.co.uk>
4335
4336         * lang-specs.h: Do not process -o or run the assembler if
4337         -fsyntax-only.
4338
4339 2000-08-16  Andrew Haley  <aph@cygnus.com>
4340
4341         * typeck.c (build_java_array_type): Rewrite code to do array
4342         alignment.  Take into account back-end macros when aligning array
4343         data.  Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
4344         user to set alignment. Fixes gcj/252 and 160.
4345
4346 2000-08-09  Tom Tromey  <tromey@cygnus.com>
4347
4348         * parse.y (check_abstract_method_definitions): Now return `int'.
4349         Check implemented interfaces.  Fixes PR gcj/305.
4350
4351         * parse.y (patch_switch_statement): Disallow `long' in switch
4352         expressions.  Fixes PR gcj/310.
4353
4354 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4355
4356         * decl.c (finit_leg_identifier_node): New global.
4357         (init_decl_processing): Use `finit$' to initialize
4358         finit_identifier_node. Use `$finit$' to initialize
4359         finit_leg_identifier_node.
4360         * expr.c (expand_java_field_op): Use ID_FINIT_P.
4361         * java-tree.h (finit_identifier_node): Changed attached comment.
4362         (finit_leg_identifier_node): New declaration.
4363         (ID_FINIT_P): Take finit_identifier_node and
4364         finit_leg_identifier_node into account. This is a backward
4365         compatibility hack.
4366
4367 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4368
4369         * jcf-write.c (generate_bytecode_conditional): Re-installed lost
4370         Jan 6 2000 patch.
4371         (generate_bytecode_insns): Check `nargs' before emitting it.
4372         * verify.c (merge_type_state): Fixed typo.
4373         * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
4374         generate_bytecode_{conditional,insns}.
4375
4376 Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
4377
4378         * check-init.c (check_init): Add case for BIT_FIELD_REF (required
4379         for -pg builds).
4380
4381 2000-08-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4382
4383         * class.c (maybe_layout_super_class): Fixed indentation.
4384         * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
4385         (java_check_methods): New function declaration.
4386         * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
4387         instead of `str_ptr'.
4388         * jcf-write.c (generate_bytecode_insns): Emit number the of args
4389         of a `invokeinterface' at the right time.
4390         * parse.h (WFL_STRIP_BRACKET): New macro.
4391         (SET_TYPE_FOR_RESOLUTION): Use it.
4392         * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
4393         (check_class_interface_creation): Don't check for cross package
4394         innerclass name clashes.
4395         (method_header): Behave properly if MDECL is `error_mark_node'.
4396         (method_declarator): Return `error_mark_node' if bogus current
4397         class.
4398         (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
4399         (resolve_and_layout): New local `decl_type', set and used. Call
4400         java_check_methods.
4401         (java_check_methods): New method.
4402         (java_layout_classes): Use it.
4403         (resolve_qualified_expression_name): No EH check necessary in
4404         access$<n>.
4405         (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
4406         `case' statement.
4407         (patch_assignment): Set DECL_INITIAL on integral final local.
4408
4409 2000-08-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4410
4411         * java-tree.h (flag_extraneous_semicolon): New extern.
4412         * lang-options.h: (-Wextraneous-semicolon): New option.
4413         * lang.c (flag_redundant): Fixed typo in leading comment.
4414         (flag_extraneous_semicolon): New global.
4415         (lang_decode_option): Set `flag_extraneous_semicolon' when
4416         -Wall. Decode `-Wextraneous-semicolon'.
4417         * parse.y (type_declaration:): Removed `SC_TK' hack, added
4418         `empty_statement' rule.
4419         (class_body_declaration): Likewise.
4420         (method_body:): Accept `;' as a method body.
4421         (static_initializer:): Removed `SC_TK' hack.
4422         (constructor_block_end:): Likewise.
4423         (empty_statement:): Report deprecated empty declaration. Fixes
4424         gcj/295
4425
4426 2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4427
4428         * parse.y (build_dot_class_method_invocation): Changed parameter
4429         name to `type'. Build signature from `type' and convert it to a
4430         STRING_CST if it's an array.
4431         (patch_incomplete_class_ref): `build_dot_class_method_invocation'
4432         to use `ref_type' directly.
4433
4434 Sun Aug  6 00:47:24 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
4435
4436         * lang-options.h: Added a comma after the last element to avoid
4437         syntax errors when other languages define additional options.
4438
4439 2000-08-04  Zack Weinberg  <zack@wolery.cumb.org>
4440
4441         * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
4442         * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
4443         (jc1): Link with $(BACKEND).
4444         (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
4445
4446 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
4447
4448         * jvspec.c: Adjust type of second argument to
4449         lang_specific_driver, and update code as necessary.
4450
4451         * class.c (build_dtable_decl): Initialize dummy.
4452
4453 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4454
4455         * parse.y (maybe_yank_clinit): When generating bytecode: non empty
4456         method bodies not to rule out discarding `<clinit>'; don't use
4457         <clinit> to initialize static fields with constant initializers.
4458
4459 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4460
4461         * gjavah.c (print_method_info): Added `synth' parameter. Skip
4462         synthetic methods.
4463         (method_synthetic): New global.
4464         (HANDLE_METHOD): Recognize synthetic method and tell
4465         `print_method_info' about it.
4466         (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
4467         processing a synthetic method.
4468         * jcf-reader.c (skip_attribute): New function.
4469         ( skip_attribute): Likewise.
4470
4471 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4472
4473         * parse.y (build_outer_field_access): Fixed comments.
4474         (fix_constructors): Emit the initialization of this$<n> before
4475         calling $finit$.
4476         (resolve_qualified_expression_name): Build an access to `decl' if
4477         necessary.
4478
4479 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4480
4481         * parse-scan.y (curent_class): Non longer const.
4482         (inner_qualifier, inner_qualifier_length): Deleted.
4483         (current_class_length): New global.
4484         (bracket_count): Fixed typo in leading comment.
4485         (anonymous_count): New global.
4486         (class_instance_creation_expression:): Handle anonymous classes.
4487         (anonymous_class_creation:): New rule.
4488         (push_class_context): Rewritten.
4489         (pop_class_context): Likewise.
4490         (INNER_QUALIFIER): Macro deleted.
4491         (report_class_declaration): call `push_class_context' when
4492         entering the function. `fprintf' format modified not to use
4493         INNER_QUALIFIER.
4494         (report_class_declaration): Assign `package_name' and
4495         `current_class' to NULL separately.
4496
4497 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4498
4499         * expr.c (build_invokeinterface): Call layout_class_methods on
4500         target interface.
4501
4502 2000-07-27  Tom Tromey  <tromey@cygnus.com>
4503             Anthony Green  <green@cygnus.com>
4504             Alexandre Petit-Bianco  <apbianco@cygnus.com>
4505
4506         * class.c (make_class_data): Create vtable for abstract classes.
4507         (get_dispatch_table): Changed to cope with abstract classes.
4508
4509 2000-07-27  Tom Tromey  <tromey@cygnus.com>
4510
4511         * parse.y (patch_method_invocation): Don't reverse the argument
4512         list when dealing with anonymous class constructors. Fixed typo in
4513         comment.
4514
4515 2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4516
4517         * parse.y (build_alias_initializer_parameter_list): Reverse
4518         crafted list when building aliases for anonymous class
4519         constructors.
4520
4521 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4522
4523         * parse.y (jdep_resolve_class): Don't bother checking potential
4524         innerclass access if `decl' is NULL.
4525         (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
4526         WFL.
4527
4528 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4529
4530         * parse.c: Remove (again.)
4531
4532 2000-07-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4533
4534         * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
4535         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
4536         outside the `if' statement, alias to innerclass removed, `decl'
4537         used to mark the class complete.
4538
4539 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4540
4541         * parse.y (simple_name:): Fixed typo in error message.
4542
4543 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4544
4545         * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
4546         or its first operand can be error marks.
4547
4548 2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4549
4550         * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
4551         * parse.y (method_header): Likewise.
4552
4553 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4554
4555         * parse.y (process_imports): Consider that one might be trying to
4556         import an innerclass. Fixes gcj/254
4557
4558 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4559
4560         * parse.y (find_as_inner_class): Handle the case where the
4561         enclosing context of an innerclass has been loaded as bytecode.
4562
4563 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4564
4565         * parse.y (simple_name:): Reject `$' in type names.
4566         (resolve_type_during_patch): Use `type' as a second
4567         argument to resolve_no_layout. Fixes gcj/257.
4568
4569 2000-07-18  Bryce McKinlay  <bryce@albatross.co.nz>
4570
4571         * parse.y (find_most_specific_methods_list): Select the only
4572         non-abstract method even if max has been set.
4573         Fixes gcj/285, gcj/298.
4574
4575 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
4576
4577         * lang-specs.h: Added %(jc1) to java compiler options.
4578
4579 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
4580
4581         * .cvsignore: New file.
4582
4583 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4584
4585         * parse.y (not_accessible_p): Access granted to innerclasses
4586         (indirectly) extending the reference type. Fixes gcj/249.
4587
4588 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4589
4590         * parse.y (patch_method_invocation): Fixed comment.
4591         (maybe_use_access_method): Build this$<n>s to the context of the
4592         target method, or a type that extends it. Fixes gcj/242.
4593
4594 2000-07-13  Mark Mitchell  <mark@codesourcery.com>
4595
4596         * parse.c: Remove.
4597
4598 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4599
4600         * parse.y (fold_constant_for_init): Avoid bullish conversion.
4601
4602 2000-07-13  Tom Tromey  <tromey@cygnus.com>
4603
4604         * lang-specs.h: Added %{I*}.
4605
4606 2000-07-13  Zack Weinberg  <zack@wolery.cumb.org>
4607
4608         * lang-specs.h: Use the new named specs.  Remove unnecessary braces.
4609
4610 2000-07-12  Mark Mitchell  <mark@codesourcery.com>
4611
4612         * parse-scan.c: Remove.
4613
4614 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4615
4616         * class.c (set_super_info): Handled protected inner classes.
4617         (common_enclosing_context_p): Bail early if arguments aren't both
4618         inner classes.
4619         (get_access_flags_from_decl): Handle private and protected inner
4620         classes.
4621         * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
4622         (CLASS_PROTECTED): Likewise.
4623         (struct lang_type): New bitfield `poic'.
4624         * parse.y (jdep_resolve_class): Call check_inner_class_access on
4625         inner classes only.
4626         (check_inner_class_access): Renamed arguments, added
4627         comments. Handles protected inner classes (fixes gcj/225)
4628         (not_accessible_p): Fixed comments. Avoid handling inner classes.
4629
4630 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4631
4632         * parse.y (resolve_qualified_expression_name): Verify qualified
4633         access to `this'. Fixes gcj/239.
4634
4635 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4636
4637         * jcf-write.c (generate_classfile): Don't install ConstantValue
4638         for null pointers.
4639
4640 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4641
4642         * parse.y (resolve_qualified_expression_name): Handle inner class
4643         access. Fixes gcj/256.
4644
4645 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4646
4647         * jcf-write.c (generate_classfile): Properly install the
4648         ConstantValue attribute and the initial value constant pool index
4649         on string constants.
4650         * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
4651         class files.
4652
4653 2000-07-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4654
4655         * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
4656         construct.
4657         * parse.y (find_as_inner_class): Fixed typo.
4658         (do_resolve_class): Explore enclosing contexts when searching for
4659         innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
4660         (check_inner_class_access): Check `decl' which can be null in case
4661         of previous errors.
4662
4663 2000-07-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4664
4665         * java-tree.h (java_debug_context): Declared `extern'.
4666         (safe_layout_class): Likewise.
4667         * parse.y (resolve_field_access): Field must be `static' in order
4668         to be replaced by its initial value. Added comments.
4669         (find_applicable_accessible_methods_list): Fixed typo.
4670         (find_most_specific_methods_list): Methods found in innerclasses
4671         take over methods founds in the enclosing contexts.
4672         (java_complete_tree): Loosen restrictions on the type of DECLs
4673         that can be replaced by their initialization values.
4674         (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
4675
4676 2000-07-05  Tom Tromey  <tromey@cygnus.com>
4677
4678         * Make-lang.in (PARSE_DIR): New macro.
4679         (PARSE_RELDIR): Likewise.
4680         (PARSE_C): Likewise.
4681         (PARSE_SCAN_C): Likewise.
4682         ($(PARSE_C)): New target.
4683         ($(PARSE_SCAN_C)): Likewise.
4684         (SET_BISON): New macro.
4685         (BISONFLAGS): Likewise.
4686         (JAVABISONFLAGS): Likewise.
4687
4688 2000-07-02  Bryce McKinlay  <bryce@albatross.co.nz>
4689
4690         * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
4691         argument on the first pass for CNI as well as JNI.
4692         (print_method_info): Set up method name on the first pass only.
4693
4694 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4695
4696         * parse.y (parser_qualified_classname): Removed parameter
4697         `is_static'.
4698         (create_interface): Removed first passed parameter to
4699         parser_qualified_classname.
4700         (create_class): Likewise. Don't install alias on static
4701         innerclasses. Fixes gcj/275.
4702
4703 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4704
4705         * parse.y (maybe_generate_pre_expand_clinit): Don't build a
4706         debugable statement with empty_stmt_node. Fixes gcj/272
4707
4708 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4709
4710         * expr.c (build_instanceof): Layout type after it's loaded. Fixes
4711         gcj/271.
4712
4713 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4714
4715         * jcf-write.c (push_long_const): Appropriately cast short negative
4716         constant to jword.
4717
4718 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4719
4720         * parse.y (verify_constructor_super): Use loop variable
4721         `m_arg_type' initialized with `mdecl_arg_type'.
4722
4723 2000-06-29  Tom Tromey  <tromey@cygnus.com>
4724
4725         * parse.y (resolve_field_access): Handle case where `type_found'
4726         is NULL.
4727
4728 2000-06-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4729
4730         * expr.c (lookup_field): The same field can be found through two
4731         different interface. Don't declare it ambiguous in that case.
4732
4733 2000-06-27  Tom Tromey  <tromey@cygnus.com>
4734
4735         * lex.c (java_lineterminator): Don't recognize \r after \n.  If \r
4736         follows \r, then unget it at a lower level.
4737
4738 2000-06-26  Tom Tromey  <tromey@cygnus.com>
4739
4740         * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
4741         java_complete_tree.
4742
4743 2000-06-25  Tom Tromey  <tromey@cygnus.com>
4744
4745         * parse.y (for_statement): Wrap expression in a WFL if it is a
4746         constant.  For PR gcj/268.
4747
4748 2000-06-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4749
4750         * parse.y (do_resolve_class): Minor optimiztion in the package
4751         list search. Removed unnecessary test and return statement.
4752         (valid_ref_assignconv_cast_p): Order of arguments to
4753         enclosing_context_p fixed.
4754
4755 2000-06-24  Tom Tromey  <tromey@cygnus.com>
4756
4757         * expr.c (lookup_field): Print error and return error_mark_node if
4758         field reference is ambiguous.
4759
4760         * parse.y (check_abstract_method_definitions): Also check if
4761         `other_method' is abstract.
4762
4763 2000-06-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4764
4765         * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
4766         classes.
4767         * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
4768         (struct lang_type): New field `pic'.
4769         (CLASS_PRIVATE): New macro.
4770         * parse.y (check_inner_class_access): New function.
4771         (jdep_resolve_class): Call it.
4772
4773 2000-06-23  Tom Tromey  <tromey@cygnus.com>
4774
4775         * parse.y (patch_incomplete_class_ref): Initialize the returned
4776         class.  For PR gcj/260.
4777
4778 2000-06-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4779
4780         * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
4781
4782 2000-06-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4783
4784         * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
4785         Java specific checks.
4786         * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
4787         screened by DECL_P.
4788         * java-tree.def (CASE_EXPR): Marked 'e'.
4789         (DEFAULT_EXPR): Likewise.
4790         * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
4791         screened by DECL_P.
4792         * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
4793         Java specific checks.
4794         (generate_bytecode_insns): Test try_block for BLOCK before using
4795         BLOCK_EXPR_BODY.
4796         * parse.y (build_wfl_wrap): Added `location' argument. Set
4797         EXPR_WFL_LINECOL accordingly.
4798         (dim_expr:): Wrap constants with WFLs.
4799         (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
4800         (resolve_package): Check for `stmt' not being a BLOCK before
4801         building a debuggable statement with it.
4802         (make_qualified_primary): Added extra parameter to build_wfl_wrap
4803         invocation.
4804         (resolve_field_access): Make sure `decl' is a DECL before treating
4805         it as such.
4806         (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
4807         IDENTIFIER_NODE before treating it as such.
4808         (patch_new_array_init): Make sure `elt' is a TREE_LIST before
4809         treating it as such.
4810         (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
4811         to be applied only on non array types.
4812
4813 2000-06-16  Per Bothner  <per@bothner.com>
4814
4815         * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN):  Don't
4816         define in terms of DECL_RESULT, as that fails when --enable-checking.
4817
4818 2000-06-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4819
4820         * jcf-write.c (CHECK_PUT): Add static prototype.  Make pointer
4821         types the same in comparison.
4822         (CHECK_OP): Add static prototype.
4823
4824 2000-06-13  Jakub Jelinek  <jakub@redhat.com>
4825
4826         * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
4827         * parse.y (java_complete_class): Set DECL_USER_ALIGN.
4828         * parse.c: Rebuilt.
4829
4830 2000-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4831
4832         * decl.c (create_primitive_vtable): Prototype.
4833
4834         * jcf-write.c (generate_bytecode_insns): Initialize variable
4835         `saved_context'.
4836
4837         * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
4838
4839 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
4840
4841         * parse.y (find_applicable_accessible_methods_list): Use a hashtable
4842         to track searched classes, and do not search the same class more than
4843         once. Call find_applicable_accessible_methods_list on immediate
4844         superclass, instead of search_applicable_method_list on all ancestors.
4845         Fix for PR gcj/238.
4846
4847 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
4848
4849         * parse.y (register_fields): Permit static fields in inner classes
4850         if they are final. Fix for PR gcj/255.
4851
4852 2000-06-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4853
4854         * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
4855         * parse.y (find_in_imports): Returned type changed to void,
4856         leading comment fixed.
4857         (register_package): New function.
4858         (qualify_and_find): Likewise.
4859         (package_declaration:): Use `register_package'.
4860         (single_type_import_declaration:): Removed local variable
4861         `node'. Added missing `;' for consistency.
4862         (type_import_on_demand_declaration:): Use `chainon' to link new
4863         entries.
4864         (lookup_field_wrapper): Lookup local variables defined in outer
4865         contexts first.
4866         (java_complete_class): Don't reverse the list of imported on demand.
4867         (do_resolve_class): Reorganized. Removed local variable
4868         `original_name'. Call `qualify_and_find' with the current package
4869         name, invoke `find_in_imports_on_demand' right after. Call
4870         `qualify_and_find' with the packages we've seen so far. Fixed
4871         operations numbering in comments.
4872         (java_expand_class): Don't reverse `package_list'.
4873         (find_most_specific_methods_list): New local variables `abstract'
4874         and `candidates'. Use them to pick the right method.
4875
4876 Tue Jun  6 11:39:05 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
4877
4878         * parse.y (check_modifiers_consistency): Don't subtract out
4879         `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
4880
4881 2000-06-04  Philipp Thomas  <pthomas@suse.de>
4882
4883         * Makefile.in (INTLLIBS): New.
4884         (LIBS): Add above.
4885         (DEPLIBS): Ditto.
4886
4887 Fri Jun  2 16:48:55 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4888
4889         * class.c (get_dispatch_table): Build the vtable dummy entry list
4890         element with a null purpose. Fixed leading comment.
4891         (build_dtable_decl): Build an accurate dtable type when appropriate
4892         and use it.
4893
4894 2000-06-02  Richard Henderson  <rth@cygnus.com>
4895
4896         * lang.c (lang_get_alias_set): New.
4897
4898 2000-05-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4899
4900         * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
4901         before using it as the accessed field.
4902
4903 2000-05-31  Tom Tromey  <tromey@cygnus.com>
4904
4905         * java-tree.h (boolean_array_vtable, byte_array_vtable,
4906         char_array_vtable, short_array_vtable, int_array_vtable,
4907         long_array_vtable, float_array_vtable, double_array_vtable):
4908         Declare.
4909         * expr.c (get_primitive_array_vtable): New function.
4910         (create_primitive_vtable): New function.
4911         (java_lang_expand_expr): Enable code to statically generate
4912         arrays.
4913         * decl.c (init_decl_processing): Create primitive vtables.
4914         (boolean_array_vtable, byte_array_vtable, char_array_vtable,
4915         short_array_vtable, int_array_vtable, long_array_vtable,
4916         float_array_vtable, double_array_vtable): Define.
4917
4918 2000-05-26  Zack Weinberg  <zack@wolery.cumb.org>
4919
4920         * java/parse.y (find_applicable_accessible_methods_list):
4921         Don't add an uninitialized value to the list.
4922
4923 2000-05-25  Tom Tromey  <tromey@cygnus.com>
4924
4925         * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
4926         when trying to see if field's class should be initialized.  Always
4927         initialize field's declaring class, not qualified class.
4928         For PR gcj/162.
4929
4930         * parse.y (array_constructor_check_entry): Pass `wfl_value', not
4931         `wfl_operator', to maybe_build_primttype_type_ref.
4932         Fixes PR gcj/235.
4933
4934 2000-05-23  Bryce McKinlay  <bryce@albatross.co.nz>
4935
4936        * parse.y (patch_method_invocation): Don't try to lookup methods
4937        in primitive types.
4938
4939 2000-05-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4940
4941         * parse.y (resolve_field_access): Call the appropriate <clinit>
4942         before accessing the length of a static array. Craft a decl for
4943         the field while its time. Fixes PR gcj/129.
4944
4945 2000-05-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4946
4947         * parse.y (resolve_package): Correctly set `*next' (was off by
4948         one.)
4949         (resolve_qualified_expression_name): Fixed comment.
4950
4951 Thu Apr 27 17:47:34 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4952
4953         * jcf-parse.c (jcf_parse_source): Reset current_class and
4954         current_function_decl to NULL before parsing a new file.
4955
4956 Thu Apr 27 17:25:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4957
4958         * parse.y (block_end:): If the collected block doesn't feature a
4959         statement, insert an empty statement.
4960
4961 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4962
4963         * parse.y (maybe_yank_clinit): New function.
4964         (maybe_generate_pre_expand_clinit): Always link <clinit> at the
4965         end of the list of methods belonging to a class.
4966         (java_complete_expand_method): Check whether <clinit> is really
4967         necessary and expand it accordingly.
4968
4969 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4970
4971         * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
4972         processed by the method's switch statement.
4973
4974 2000-05-19  Tom Tromey  <tromey@cygnus.com>
4975
4976         * java-tree.h: Added init state enum.
4977         * decl.c (emit_init_test_initialization): Initialize class
4978         initialization check variable by looking at class' state.
4979
4980 2000-05-19  Tom Tromey  <tromey@cygnus.com>
4981
4982         * java-tree.h (build_instanceof): Declare.
4983         (build_get_class): Declare.
4984         * parse.y (patch_binop): Use build_instanceof.
4985         * expr.c (build_instanceof): New function.  If class is final,
4986         don't make a function call.
4987         (expand_java_INSTANCEOF): Use it.
4988         (build_get_class): New function.
4989
4990 2000-05-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
4991
4992         * jcf-write.c (generate_classfile): Scan the source_file for
4993         slashes with the right pointer variable.
4994
4995 Wed May 17 17:27:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
4996
4997         * lang.c (lang_decode_option): Update -Wunused flags by calling
4998         set_Wunused.
4999         * decl.c (poplevel): Replace warn_unused with warn_unused_label.
5000
5001 2000-05-09  Zack Weinberg  <zack@wolery.cumb.org>
5002
5003         * check_init.c (check_init): Constify local char *.
5004         * class.c (push_class): Constify local char *.
5005         * java_tree.h: Update prototypes.
5006         * jcf-io.c (open_class): Constify filename parameter and
5007         return value.
5008         (find_class): Remove redundant string copy.  Cast return from
5009         open_class.
5010         * jcf-parse.c (read_class, parse_class_file, yyparse):
5011         Constify local char *.
5012         * jcf-write.c (generate_bytecode_insns, generate_classfile):
5013         Constify local char *.
5014         * jcf.h (JCF): Constify filename and classname.
5015         (JCF_FINISH): Cast args to FREE to char * when appropriate.
5016         * lang.c (init_parse): Constify parameter and return value.
5017         * lex.c (java_get_line_col): Constify filename parameter.
5018         * parse.h: Constify parser_ctxt.filename.  Update prototypes.
5019         * parse.y (java_parser_context_suspend,
5020         issue_warning_error_from_context, safe_layout_class): Constify
5021         local char *.
5022         * parse.c: Regenerate.
5023
5024 2000-05-08  Tom Tromey  <tromey@cygnus.com>
5025
5026         * expr.c (build_jni_stub): Cache the result of
5027         _Jv_LookupJNIMethod.
5028
5029 2000-05-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5030
5031         * decl.c (predef_filenames_size): Now 7.
5032         (predef_filenames): New seventh entry.
5033
5034 2000-05-04  Tom Tromey  <tromey@cygnus.com>
5035
5036         * boehm.c (mark_reference_fields): Don't mark RawData fields.
5037         Keep track of when we've seen a reference field after a
5038         non-reference field.
5039         (get_boehm_type_descriptor): Handle case where we see
5040         non-reference fields but no trailing reference field.
5041         * decl.c (rawdata_ptr_type_node): Define.
5042         (init_decl_processing): Initialize rawdata_ptr_type_node.
5043         * java-tree.h (rawdata_ptr_type_node): Declare.
5044
5045 2000-05-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5046
5047         * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
5048         specifiers in calls to fprintf.
5049
5050 2000-05-03  Andrew Haley  <aph@cygnus.com>
5051
5052         * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
5053
5054         * javaop.h (WORD_TO_INT): New function.
5055         (IMMEDIATE_s4): Use WORD_TO_INT.
5056         * jcf.h (JPOOL_INT): Ditto.
5057
5058         * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
5059         separator.
5060
5061 2000-04-19  Tom Tromey  <tromey@cygnus.com>
5062
5063         * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
5064         on native function.
5065         * jcf-parse.c (parse_class_file): Call build_jni_stub for native
5066         JNI methods.
5067         * expr.c (build_jni_stub): New function.
5068         * lang-specs.h: -fjni and -femit-class-file are incompatible.
5069         * parse.c: Rebuilt.
5070         * parse.y (java_complete_expand_methods): Expand a native method
5071         and call build_jni_stub if -fjni given.
5072         * lang-options.h: Document -fjni.
5073         * lang.c (flag_jni): New global.
5074         (lang_f_options): Added `jni' entry.
5075         * java-tree.h (soft_lookupjnimethod_node,
5076         soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
5077         Declare.
5078         (flag_jni): Declare.
5079         (build_jni_stub): Declare.
5080         (struct lang_decl): Added `native' flag.
5081         (METHOD_NATIVE): Redefined to use `native' field of lang specific
5082         structure.
5083         * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
5084         soft_jnipopsystemframe_node): New globals.
5085         (init_decl_processing): Set them.  _Jv_InitClass only takes one
5086         argument.
5087
5088         * java-tree.def: Put into `C' mode.
5089
5090 2000-04-27  Tom Tromey  <tromey@cygnus.com>
5091
5092         Fix for PR gcj/2:
5093         * expr.c (expand_invoke): Generate check to see if object pointer
5094         is null in nonvirtual invocation case.
5095         * java-tree.h (soft_nullpointer_node): Declare.
5096         * decl.c (soft_nullpointer_node): New global.
5097         (init_decl_processing): Initialize soft_nullpointer_node.
5098         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
5099         or `private' methods.
5100         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
5101
5102 Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5103
5104         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
5105         from <clinit>
5106
5107 2000-04-26  Tom Tromey  <tromey@cygnus.com>
5108
5109         * zextract.c (find_zip_file_start): New function.
5110         (read_zip_archive): Use it.
5111
5112 2000-04-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5113
5114         * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
5115
5116 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5117
5118         * class.c (common_enclosing_context_p): New function.
5119         * java-tree.h (common_enclosing_context_p): Added prototype.
5120         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
5121         classes sharing an outer context with the current instance.
5122         * parse.y (build_access_to_thisn): Fixed leading comment.
5123         (verify_constructor_super): New local `supper_inner'. Skip
5124         enclosing context argument in the case of inner class constructors.
5125         (patch_method_invocation): Insert proper context as second
5126         parameter to pure inner class constructor super invocations.
5127
5128 Mon Apr 24 14:59:36 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5129
5130         * parse.y (end_class_declaration): Reset the interface number
5131         counter.
5132
5133 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5134
5135         * parse.y (source_start_java_method): Deleted unnecessary code.
5136         (patch_method_invocation): Fixed comment.
5137
5138 2000-04-24  Robert Lipe <robertlipe@usa.net>
5139
5140         * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
5141
5142 2000-04-23  Tom Tromey  <tromey@cygnus.com>
5143
5144         * boehm.c (mark_reference_fields): Use int_byte_position.
5145
5146 2000-04-22  Tom Tromey  <tromey@cygnus.com>
5147
5148         * boehm.c (mark_reference_fields): Only call byte_position on
5149         non-static fields.
5150
5151 2000-04-22  Tom Tromey  <tromey@cygnus.com>
5152
5153         * boehm.c (mark_reference_fields): Added `last_view_index'
5154         argument.  Use DECL_FIELD_OFFSET to determine field's offset.
5155
5156 Thu Apr 20 17:41:28 2000  Mo DeJong  <mdejong@cygnus.com>
5157
5158         * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
5159         * parse.y (check_class_interface_creation): Fixed comments. Select
5160         permitted modifiers for (inner) interfaces. Changed error message
5161         to report rejected modifiers used with local classes.
5162
5163 2000-04-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5164
5165         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
5166         of directly inherited type considered in scope.
5167         * parse.y (do_resolve_class): Search inherited classes for inner
5168         classes.
5169
5170 2000-04-20  Tom Tromey  <tromey@cygnus.com>
5171
5172         * parse.y (not_accessible_p): Use member's class, not current
5173         class, when doing inheritance check for protected reference.
5174         Fixes PR gcj/124.
5175
5176 Thu Apr 20 18:20:58 2000  Jason Schroeder  <shrode@subnature.com>
5177
5178         * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
5179
5180 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5181
5182         * parse.y (lookup_field_wrapper): Search for final local aliases.
5183         (resolve_expression_name): Let lookup_field_wrapper search for
5184         final local aliases. Force the value of `name' if one is found.
5185         (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
5186         an expression name. Fixed comments.
5187
5188 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5189
5190         * parse.y (yyerror): `msg' can be null, don't use it in that case.
5191
5192 2000-04-19  Tom Tromey  <tromey@cygnus.com>
5193
5194         * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
5195
5196 2000-04-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5197
5198         * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
5199
5200 2000-04-18  Tom Tromey  <tromey@cygnus.com>
5201
5202         PR gcj/211:
5203         * gjavah.c (utf8_cmp): Changed return value.
5204         (cxx_keyword_subst): Handle all C++ keywords.  Allocate new return
5205         result.
5206         (cxx_keywords): New global.
5207         (get_field_name): Handle new result of cxx_keyword_subst.
5208         (print_method_info): Likewise.
5209
5210 2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
5211
5212         * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
5213         with a newline, for CNI.
5214         (print_stub_or_jni): Print a space or newline before method name for
5215         CNI as well as JNI.
5216         (print_cxx_classname): Don't write leading "::" in CNI stub method.
5217         (process_file): Include gcj/cni.h if generating CNI stubs.
5218
5219 2000-04-16  Tom Tromey  <tromey@cygnus.com>
5220
5221         * gjavah.c (decompile_method): Use print_field_name.
5222         Fixes PR gcj/205.
5223
5224 2000-04-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5225
5226         * parse.y (java_expand_classes): Reverse the package list once.
5227         (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
5228         reduction.
5229         (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
5230         the `==' and `!=' operators.
5231
5232 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5233
5234         * jcf-write.c (generate_bytecode_insns): At invokation time,
5235         always relate an interface method to the type of its selector.
5236
5237 2000-04-05  Tom Tromey  <tromey@cygnus.com>
5238
5239         Fix for PR gcj/2:
5240         * expr.c (expand_invoke): Generate check to see if object pointer
5241         is null in nonvirtual invocation case.
5242         * java-tree.h (soft_nullpointer_node): Declare.
5243         * decl.c (soft_nullpointer_node): New global.
5244         (init_decl_processing): Initialize soft_nullpointer_node.
5245         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
5246         or `private' methods.
5247         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
5248
5249 2000-04-05  Tom Tromey  <tromey@cygnus.com>
5250
5251         Fix for PR gcj/140:
5252         * parse.y (check_final_assignment): Recognize assignments to the
5253         `length' field of an array when generating class files.
5254
5255 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5256
5257         * class.c (decl_hash): Prototype removed.
5258         (decl_compare): Likewise.
5259
5260 2000-04-05  Tom Tromey  <tromey@cygnus.com>
5261
5262         * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
5263         * parse.y (check_modifiers_consistency): Check for final/volatile
5264         clash.  Fixes PR gcj/164.
5265
5266 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5267
5268         * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
5269         made global.
5270         (java_hash_compare_tree_node): Renamed from `decl_compare, made
5271         global.
5272         (add_method_1): Use `java_hash_hash_tree_node' and
5273         `java_hash_compare_tree_node'.
5274         * java-tree.h: (java_hash_hash_tree_node): Prototyped.
5275         (java_hash_compare_tree_node): Likewise.
5276         * parse.y (find_applicable_accessible_methods_list): Create,
5277         delete and use a hash table to remember already searched interfaces.
5278
5279 2000-04-03  Matt Welsh  <mdw@cs.berkeley.edu>
5280
5281         * jcf-depend.c (add_entry): Fixed bug where list was always replaced
5282         with latest entry.
5283
5284 2000-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5285
5286         * boehm.c (mark_reference_fields, set_bit): Prototype.
5287         (set_bit): Un-ANSI-fy definition.
5288
5289         * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
5290         Prototype.
5291
5292         * decl.c (emit_init_test_initialization): Likewise.
5293
5294         * gjavah.c (jni_print_char): Likewise.
5295
5296         * parse.y (create_new_parser_context): Likewise.
5297
5298 Thu Mar 30 15:26:56 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5299
5300         * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
5301         patch missing hunk. Fixed indentation.
5302
5303 2000-03-30  Tom Tromey  <tromey@cygnus.com>
5304
5305         * gjavah.c (D_NAN_MASK): Only define as word-reversed when
5306         HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
5307
5308 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5309
5310         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
5311         when negative *before* using it as an array index.
5312         * ChangeLog: Fixed typo.
5313
5314 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5315
5316         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
5317         to 0 when it reaches -1.
5318
5319 2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5320
5321         * jcf-parse.c (get_constant): Properly cast `num' during the
5322         invocation of `add_double'.
5323         * jcf-write.c (push_long_const): Properly cast `lo' before
5324         comparing it to short bounds.
5325         * parse-scan.y (interface_declaration:): Rule re-arrange so that
5326         `interface_body:' is reduced after the current interface is
5327         pushed.
5328
5329 2000-03-26  Tom Tromey  <tromey@cygnus.com>
5330
5331         * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
5332         Java-specific `-f' option.
5333
5334 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5335
5336         * decl.c (init_decl_processing): Only call initialize_sizetypes once.
5337         Adjust order of making types.
5338         Make bitsize_*_node values.
5339
5340 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5341
5342         * class.c (make_field_value): Use byte_position.
5343         * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
5344         (java_array_data_offset): Likewise.
5345         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
5346         bzero call.
5347
5348 2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5349
5350         * parse.y (check_abstract_method_definitions): New local
5351         `end_type_reached'. Make sure we also consider `end_type'.
5352         (java_check_abstract_method_definitions): Make sure we eventually
5353         consider `java.lang.Object'.
5354         (maybe_use_access_method): Don't use access method if not in the
5355         context of a pure inner class or if the method's context is right.
5356         (find_applicable_accessible_methods_list): New static flag
5357         `object_done'. Don't search abstract classes as interfaces. Fixed
5358         indentation. Fixed the `java.lang.Object' only search. Search
5359         class interface(s) first, then fully search enclosing contexts.
5360         (find_most_specific_methods_list): Pick the closest candidate when
5361         they're all abstract.
5362
5363 Mon Mar 20 08:58:51 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5364
5365         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
5366         properly initialize `finished_label'. Don't emit gotos for empty
5367         try statements.
5368
5369 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
5370
5371         * except.c (emit_handlers): Clear catch_clauses_last.
5372
5373 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5374
5375         * parse.y (check_method_types_complete): New function.
5376         (create_class): Reset anonymous class counter only when seeing an
5377         non inner classe.
5378         (java_complete_class): JDEP_METHOD: Don't recompute signature
5379         if incomplete.
5380
5381 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5382
5383         * class.c (build_static_ref): Fixed indentation in comment.
5384         * java-tree.def (TRY_EXPR): Fixed typo in name.
5385         (CLASS_LITERAL): Likewise.
5386         * java-tree.h: (TYPE_DOT_CLASS): New macro.
5387         (struct lang_type): New field `dot_class'.
5388         * jcf-write.c (generate_bytecode_insns): Fixed error message.
5389         (generate_classfile): Method `class$' is synthetic.
5390         * parse.y (build_do_class_method): New function.
5391         (build_dot_class_method_invocation): Likewise.
5392         (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
5393         (resolve_qualified_expression_name): Handle CLASS_LITERAL.
5394         (qualify_ambiguous_name): Likewise.
5395         (patch_incomplete_class_ref): Invoke synthetic method if necessary.
5396         (build_try_statement): Fixed leading comment.
5397
5398 Fri Mar 17 08:09:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5399
5400         * class.c (make_field_value): Properly handle sizes.
5401         (get_dispatch_vector): Use tree_low_cst and host_integerp.
5402         (layout_class_method): Count using trees.
5403         * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
5404         * expr.c (java_array_data_offset): Use int_bit_position.
5405         (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
5406         (build_invokevirtual): Use tree_low_cst and do computations with trees.
5407
5408 2000-03-16  Tom Tromey  <tromey@cygnus.com>
5409
5410         * lang.c (flag_hash_synchronization): New global.
5411         (lang_f_options): Added `hash-synchronization'.
5412         * lang-options.h: Mention -fhash-synchronization.
5413         * java-tree.h (flag_hash_synchronization): Declare.
5414         * expr.c (java_lang_expand_expr): Only push `sync_info' value when
5415         hash table synchronization is disabled.
5416         * decl.c (init_decl_processing): Only push `sync_info' value when
5417         hash table synchronization is disabled.
5418         * class.c (make_class_data): Only push `sync_info' field when hash
5419         table synchronization is disabled.  Removed dead code.
5420
5421 2000-03-16  Tom Tromey  <tromey@cygnus.com>
5422
5423         * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
5424
5425 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5426
5427         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
5428         classes.
5429         * parse.y (patch_method_invocation): Handle anonymous classes
5430         creation in static context.
5431
5432 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5433
5434         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
5435         * parse.y (resolve_qualified_expression_name): Use it.
5436         (patch_method_invocation): Likewise.
5437
5438 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5439
5440         * parse.y (register_incomplete_type): JDEP_ENCLOSING set
5441         depending on the type of dependency which dictates what the
5442         current class is.
5443         (unresolved_type_p): Resolved types limited to the current class.
5444
5445 2000-03-15  Tom Tromey  <tromey@cygnus.com>
5446
5447         * decl.c (init_decl_processing): Set type of `sync_info' to be
5448         pointer to Object.
5449
5450         * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
5451         Correctly compute bit number for current slot.  Zero `high' and
5452         `low' in DS_LENGTH case.  Don't skip inherited fields.  Use
5453         mark_reference_fields.
5454         (mark_reference_fields): New function.
5455
5456 Tue Mar 14 17:15:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5457
5458         * parse.y (register_incomplete_type): Fixed initialization of
5459         JDEP_ENCLOSING.
5460
5461 2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5462
5463         * parse-scan.y (inner_qualifier, inner_qualifier_length): New
5464         static globals.
5465         (push_class_context, pop_class_context): New function.
5466         (class_body:): Call pop_class_context.
5467         (interface_body:): Likewise.
5468         (INNER_QUALIFIER): New macro.
5469         (report_class_declaration): Changed output format and use
5470         INNER_QUALIFIER. Call push_class_context.
5471
5472 2000-02-14  Andrew Haley  <aph@cygnus.com>
5473
5474         * check-init.c (check_init): Add new cases for unary and binary
5475         tree nodes.
5476
5477 2000-03-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5478
5479         * parse.y (resolve_package): Set `next' once a type name has been
5480         progressively discovered.
5481         (resolve_qualified_expression_name): Propagate resolution only if
5482         there are remaining qualifiers. Take into account `q' might have
5483         been cleared after re-qualification.
5484         * parse.y (patch_method_invocation): New local `resolved'.
5485         Section dealing with qualified expression rewritten to use
5486         resolve_field_access.
5487
5488 Mon Mar 13 12:21:13 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5489
5490         * parse.h (PUSH_CPC): Fixed indentation.
5491         (DEBUG_CPC): New macro.
5492         (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
5493         SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
5494         * parse.y (class_body_declaration:): Use
5495         SET_CPC_INSTANCE_INITIALIZER_STMT.
5496         (method_declaration:): Check for null current_function_decl.
5497         (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
5498         (java_parser_context_pop_initialized_field): Better handling of
5499         empty lists.
5500         (maybe_make_nested_class_name): Mark nested class name as
5501         qualified when necessary.
5502         (end_class_declaration): Don't call java_parse_context_resume when
5503         one or more error occurred.
5504         (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
5505         (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
5506         SET_CPC_INITIALIZER_STMT.
5507         (method_header): Check for inner classes declaring static methods.
5508         (resolve_qualified_expression_name): Handle situation where `this'
5509         is implied.
5510
5511 Mon Mar 13 11:36:51 2000  Hans Boehm <boehm@acm.org>
5512
5513         * typeck.c (build_prim_array_type): Correctly set the high word too.
5514
5515 2000-03-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5516
5517         * parse.y (java_complete_expand_methods): Leave <clinit> out of
5518         ordinary methods.
5519         (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
5520         list of methods for interfaces.
5521
5522 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5523
5524         * parse.y (qualify_ambiguous_name): Properly handle expressions
5525         using `null'.
5526
5527 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5528
5529         * parse.y (check_final_assignment): Extended to process
5530         COMPOUND_EXPR.
5531         (patch_assignment): Have check_final_assignment called only once.
5532
5533 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5534
5535         * java-tree.h (IS_INIT_CHECKED): New flag.
5536         * check-init.c (check_init): Test and set IS_INIT_CHECKED.
5537         * parse.y (patch_string): Call force_evaluation_order on the
5538         completed string concatenation tree.
5539         * expr.c (force_evaluation_order): Call force_evaluation_order on
5540         function's arguments too.
5541
5542 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5543
5544         * decl.c (emit_init_test_initialization): Mark KEY as unused.
5545         * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
5546         (build_anewarray): Likewise.
5547         * parse.y (patch_newarray): Likewise.
5548         * parse.c: Regenerated.
5549
5550 2000-03-06  Bryce McKinlay  <bryce@albatross.co.nz>
5551
5552         * decl.c (init_decl_processing): Added new class fields `depth',
5553         `ancestors', and `idt' to class_type_node. Use
5554         _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
5555         * class.c (make_class_data): Push initial values for new fields.
5556         * java-tree.h: Updated prototype for `build_invokeinterface'.
5557         * expr.c (build_invokeinterface): Changed parameters to accept
5558         `method' tree. Calculate index of `method' in its declaring
5559         interface. Build call to _Jv_LookupInterfaceMethodIdx.
5560         (expand_invoke): Call `build_invokeinterface' with new parameters.
5561         * parse.y (patch_invoke): Call `build_invokeinterface' with new
5562         parameters.
5563
5564 2000-03-06  Bryce McKinlay <bryce@albatross.co.nz>
5565
5566         * typeck.c (lookup_do): Search superinterfaces first
5567         when looking up an interface method. From Godmar Back
5568         <gback@cs.utah.edu>
5569
5570 2000-03-06  Tom Tromey  <tromey@cygnus.com>
5571
5572         * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
5573
5574 2000-03-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5575
5576         * java-tree.h (lookup_argument_method2): Declared.
5577         (safe_layout_class): Prototype moved from parse.h.
5578         * parse.h (safe_layout_class): Prototype moved to java-tree.h.
5579         * parse.y (java_check_regular_methods): Local `super_class' gone.
5580         Call lookup_argument_method2 instead of lookup_argument_method.
5581         Perform modifier match for methods found declared in implemented
5582         interfaces. Fixed indentation problem. Overriding/hiding error
5583         report to take place only for methods found in classes.
5584         * typeck.c (lookup_argument_method): Changed leading
5585         comment. Re-written by calling lookup_do.
5586         (lookup_argument_method2): New function.
5587         (lookup_java_method): Re-written by calling lookup_do.
5588         (lookup_do): New function.
5589
5590 Thu Mar  2 15:18:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5591
5592         * check-init.c (check_init): Removed dead code. Handle (blank)
5593         final variables.
5594         * parse.y (declare_local_variables): New local `final_p', set it
5595         and use it to initialize LOCAL_FINAL.
5596         (check_final_assignment): Only check FIELD_DECLs.
5597
5598 2000-02-17  Tom Tromey  <tromey@cygnus.com>
5599
5600         * Makefile.in (JAVA_OBJS): Added boehm.o.
5601         (boehm.o): New target.
5602         * Make-lang.in (JAVA_SRCS): Added boehm.c.
5603         * java-tree.h (flag_use_boehm_gc): Declare.
5604         (get_boehm_type_descriptor): Declare.
5605         * lang.c (lang_f_options): Added `use-boehm-gc'.
5606         (flag_use_boehm_gc): New global.
5607         * lang-options.h: Added -fuse-boehm-gc.
5608         * boehm.c: New file.
5609         * class.c (get_dispatch_table): If class uses a Boehm type
5610         descriptor, put it in the vtable.
5611         (make_class_data): Removed dead code.
5612
5613 2000-03-03  Per Bothner  <per@bothner.com>
5614
5615         * decl.c (init_decl_processing):  Initialize sizetype properly.
5616
5617 2000-03-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5618
5619         * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
5620         (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
5621         * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
5622         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
5623         (jcf_parse): New local `current'. Load innerclasses seen in outer
5624         context being processed.
5625         * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
5626         * jcf-write.c (append_innerclasses_attribute): New function.
5627         (append_innerclasses_attribute_entry): Likewise.
5628         (get_access_flags): Handle static classes. Set anonymous and local
5629         classes to be private.
5630         (generate_classfile): Attribute count adjusted. Call
5631         append_innerclasses_attribute.
5632         * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
5633         PURE_INNER_CLASS_TYPE_P.
5634         * parse.y (parser_qualified_classname): New parameter `is_static',
5635         produce non qualified name accordingly.
5636         (block_statement:): Set LOCAL_CLASS_P when declaring local class.
5637         (create_interface): Added argument to parser_qualified_classname.
5638         (create_class): Added argument to parser_qualified_classname. Setup
5639         alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
5640         (add_inner_class_fields): Fixed indentation.
5641         (method_declarator): Use PURE_INNER_CLASS_DECP_P.
5642         (method_declarator): Fixed typo in comment.
5643         (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
5644         (build_current_thisn): Likewise.
5645         (patch_method_invocation): Likewise.
5646
5647 2000-03-01  Martin von Loewis  <loewis@informatik.hu-berlin.de>
5648
5649         * decl.c (current_function_decl): Move to toplev.c.
5650
5651 Mon Feb 28 08:20:42 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5652
5653         * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
5654         (DECL_BIT_INDEX): Use underlying representation.
5655         * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
5656
5657 Sun Feb 27 16:40:33 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5658
5659         * expr.c (build_java_ret): Pass proper type to size_binop.
5660
5661 2000-02-25  Anthony Green  <green@cygnus.com>
5662
5663         * expr.c (build_class_init): Mark the decl to be ignored by
5664         check_init.
5665         * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
5666         * check-init.c: Move DECL_BIT_INDEX to java-tree.h
5667         * class.c (init_test_hash_newfunc): New function.
5668         (decl_hash): New function.
5669         (decl_compare): New function.
5670         * decl.c (emit_init_test_initialization): New function.
5671         (complete_start_java_method): Traverse the init test hashtable,
5672         calling emit_init_test_initialization.
5673         (always_initialize_class_p): Define.
5674         * expr.c (build_class_init): Use initialization tests when
5675         emitting class initialization code.
5676         (always_initialize_class_p): Declare.
5677         * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
5678         1.
5679         * java-tree.h: Include hash.h.
5680         (DECL_FUNCTION_INIT_TEST_TABLE): Define.
5681         (struct lang_decl): Add init_test_table field.
5682         (init_test_hash_entry): Define.
5683
5684 Fri Feb 25 18:41:31 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5685
5686         * gjavah.c (main): Avoid using `argi' to report unimplemented
5687         options.
5688
5689 Fri Feb 25 18:47:25 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5690
5691         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
5692         initialize locals to avoid warnings. Local `exception_type' moved
5693         into if statement.
5694
5695 Fri Feb 25 18:00:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5696
5697         * parse.y (resolve_expression_name): Use `orig' as a second
5698         argument to resolve_field_access.
5699         (resolve_field_access): Removed unnecessary code when dealing with
5700         static fields.
5701
5702 Wed Feb 23 17:41:50 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5703
5704         * class.c (push_super_field): Don't push the field twice.
5705         * jcf-parse.c (parse_source_file): Call java_reorder_fields.
5706         * parse.h (java_reorder_fields): Prototyped.
5707         * parse.y (java_reorder_fields): New function.
5708         (java_layout_class): Simplified not to worry about re-ordering.
5709
5710 2000-02-23  Tom Tromey  <tromey@cygnus.com>
5711
5712         * gjavah.c (print_name): In JNI case, correctly quote string.
5713         (print_method_info): Don't handle overrides in JNI mode.
5714
5715 2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5716
5717         * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
5718         value type set to `boolean_type_node'.
5719
5720 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
5721
5722         * jcf-dump.c (main): Test for correct condition after
5723         output file creation.
5724
5725 2000-02-19  Anthony Green  <green@cygnus.com>
5726
5727         * jcf-depend.c (add_entry): Fix test for first list entry.
5728
5729 Sat Feb 19 18:43:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5730
5731         * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
5732         * constants.c (build_constants_constructor): Likewise.
5733
5734 2000-02-19  Anthony Green  <green@cygnus.com>
5735
5736         * jcf-depend.c (add_entry): Add entries to the end of the list.
5737
5738 Wed Nov 03 02:16:00 PST 1999  Pekka Nikander  <pekka.nikander@hut.fi>
5739
5740         * decl.c (INT_TYPE_SIZE): Define if necessary.
5741         (expand_java_return): Handle the case of a native integer smaller
5742         than a JVM integer.
5743
5744 2000-02-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
5745
5746         * gjavah.c (help): Use GCCBUGURL.
5747         * jv-scan.c (help): Likewise.
5748         * jcf-dump.c (help): Likewise.
5749
5750 Thu Feb 17 14:30:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5751
5752         * jcf-write.c (generate_bytecode_insns): Don't generate empty
5753         `finally' clauses.
5754
5755 Thu Feb 17 13:20:58 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5756
5757         * jcf-parse.c (load_class): Call `fatal' if no file containing
5758         the target class are found.
5759
5760 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
5761
5762         * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
5763         lex.c, lex.h, and PARSE_H to...
5764         (parse.o, parse-scan.o): ...here, respectively.
5765
5766         * lex.c: Split out code that may trigger SIGFPE from yylex()
5767         to its own function.
5768         * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
5769
5770 2000-02-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5771
5772         * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
5773
5774 2000-02-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5775
5776         * parse.y (outer_field_access_p): Stop in time when outer contexts
5777         are exhausted.
5778         (resolve_qualified_expression_name): Properly qualify *everything*
5779         after a package.type to be resoled as expression names.
5780         (find_applicable_accessible_methods_list): Save/restore `class' to
5781         isolate it from a possible outer context search.
5782
5783 2000-02-15  Tom Tromey  <tromey@cygnus.com>
5784
5785         * gjavah.c (jni_print_char): New function.
5786         (print_full_cxx_name): Use it.
5787         (decode_signature_piece): Likewise.
5788         (print_cxx_classname): Likewise.
5789
5790 2000-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5791
5792         * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
5793         version.o.
5794         (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
5795
5796         * gjavah.c: Include version.h.
5797
5798         * jcf-dump.c: Likewise.
5799
5800         * jv-scan.c: Likewise.
5801
5802 Sat Feb 12 04:34:04 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5803
5804         * parse.y (outer_field_access_fix): First parameter now a tree
5805         node. Check for assignement to final. First argument to
5806         build_outer_field_access_fix modified to accommodate prototype.
5807         (build_outer_field_access): Don't check for assignment to final
5808         here.
5809         (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
5810         possibly returned by outer_field_access_fix. Changed
5811         outer_field_access_fix's first argument.
5812         (check_final_assignment): $finit$'s context is OK.
5813         (patch_unaryop): Use node instead of its line/column value when
5814         calling outer_field_access_fix.
5815
5816 Fri Feb 11 17:38:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5817
5818         * parse.y (interface_declaration:): No longer tagged
5819         <node>. Re-installed default action.
5820         (class_member_declaration:): Handle inner interfaces.
5821         (interface_member_declaration): Handle inner interfaces and
5822         classes.
5823         (create_interface): Push error if one seen. Suspend parsing
5824         context when processing an inner interface.
5825         (register_fields): Inner class static field limitations not to
5826         apply to inner interfaces.
5827
5828 Thu Feb 10 22:07:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5829
5830         * jcf-parse.c (load_class): Update `java_error_count' when a
5831         class' file can't be found.
5832         (parse.y): Avoid (byte)code generation when errors seen.
5833
5834 Thu Feb 10 20:10:43 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5835
5836         * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
5837         decodes a valid node.
5838         (patch_binop): Handle TRUNC_DIV_EXPR.
5839
5840 Thu Feb 10 16:04:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5841
5842         * parse.y (resolve_package): New local `acc'. Try to progressively
5843         build and guess a package and type name.
5844
5845 Thu Feb 10 12:52:09 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5846
5847         * parse.y (find_applicable_accessible_methods_list): Load and
5848         layout the search class if necessary.
5849         (java_complete_tree): Keep to original type of the folded initial
5850         value.
5851
5852 2000-02-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5853
5854         * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
5855         Generate error message if circularity is detected. New static
5856         local `list'.
5857         * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro.  *
5858         * jcf-write.c (generate_bytecode_insns): Very simply handle
5859         SAVE_EXPR.
5860         * parse.y (java_check_circular_reference): Use
5861         `cyclic_inheritance_report' during report, if necessary.
5862         (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
5863         walking NEW_ARRAY_INIT twice.
5864
5865 2000-02-09  Tom Tromey  <tromey@cygnus.com>
5866
5867         * parse.y (check_class_interface_creation): Allow inner classes to
5868         be `private' or `protected', check modifiers' consistency. Prevent
5869         block local classes from bearing any modifiers.
5870
5871 2000-02-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5872
5873         * except.c (check_start_handlers): Re-add prototype lost in last
5874         patch.
5875         (maybe_start_try): Remove excess argument to `check_start_handlers'.
5876
5877 2000-02-09  Andrew Haley  <aph@cygnus.com>
5878
5879         * decl.c (clear_binding_level): Remove excess initializer.
5880         (maybe_poplevels): Remove unused variable.
5881         (force_poplevels): Ditto.
5882         (struct binding_level): Add comment.
5883
5884 2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5885
5886         * jcf-write.c (generate_classfile): Don't consider
5887         pre-initialization with reference value (use <clinit> instead.)
5888         * parse.y (java_fix_constructors): No generated constructor for
5889         interfaces.
5890         (build_outer_field_access): Removed debug message.
5891         (outer_field_expanded_access_p): Adapted to bytecode generation.
5892         (build_outer_field_access_method): Use fix_method_argument_names.
5893         (build_outer_method_access_method): Fixed indentation. Added
5894         comment. Handle access method generation for static and also void
5895         methods.
5896         (build_access_to_thisn): Inserted debug message.
5897         (maybe_build_thisn_access_method): Use fix_method_argument_names.
5898         (resolve_qualified_expression_name): Fixed comment.
5899         (not_accessible_p): Adapted to bytecode generation. Added comment.
5900         (patch_method_invocation): Added comment.
5901         (maybe_use_access_method): Fixed leading comment. Handle static
5902         methods.
5903         (java_complete_lhs): Don't shortcut handling of initialized upon
5904         declaration String type static fields when generating bytecode.
5905         (patch_unaryop): Handle outer field access when generating
5906         bytecode.
5907
5908 Thu Feb  3 20:23:19 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5909
5910         * java-tree.h (FIELD_THISN): New macro.
5911         * jcf-write.c (append_synthetic_attribute): New function.
5912         (generate_classfile): Set "Synthetic" attribute on this$<n>,
5913         val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
5914         * parse.y (add_inner_class_fields): Set FIELD_THISN for created
5915         this$<n> fields.
5916         (build_outer_field_access): Turned on access functions usage and
5917         generation when compiling to bytecode.
5918         (maybe_use_access_method): Likewise.
5919
5920 2000-01-25  Andrew Haley  <aph@cygnus.com>
5921
5922         * java-except.h (struct eh_range): Add `expanded' field.
5923         (maybe_start_try): Add end_pc arg.
5924         (maybe_end_try): Ditto.
5925         * java-tree.h (force_poplevels): new function.
5926         * expr.c (expand_byte_code): Don't call maybe_start_try or
5927         maybe_end_try.
5928         * except.c (add_handler): Reset expanded.
5929         (expand_start_java_handler): Set expanded.
5930         (check_start_handlers): Don't expand a start handler that's
5931         already been expanded.
5932         (maybe_start_try): Add end_pc arg.  Only expand a handler which
5933         ends after end_pc.
5934         (expand_end_java_handler): call force_poplevels.
5935         (force_poplevels): new function.
5936         * decl.c (binding_level): Add start_pc of binding level.
5937         (maybe_pushlevels): Call maybe_start_try when pushing binding
5938         levels.
5939         (maybe_poplevels): Call maybe_end_try when popping binding levels.
5940         (LARGEST_PC): Define.
5941         (clear_binding_level): Use LARGEST_PC.
5942
5943         * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
5944         * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
5945         (binding_depth, is_class_level, current_pc): new variables.
5946         (struct binding_level): ditto.
5947         (indent): new function.
5948         (push_jvm_slot): add debugging info.
5949         (maybe_pushlevels): ditto.
5950         (maybe_poplevels): ditto.
5951         (pushlevel): ditto.
5952         (poplevel): ditto.
5953         (start_java_method): ditto.
5954         (give_name_to_locals): comment only.
5955         * except.c (binding_depth, is_class_level, current_pc):
5956         new variables.
5957         (expand_start_java_handler): add debugging info.
5958         (expand_end_java_handler): ditto.
5959
5960 2000-02-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5961
5962         * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
5963         (print_name_for_stub_or_jni, process_file): Constify a char*.
5964
5965 2000-02-03  Tom Tromey  <tromey@cygnus.com>
5966
5967         * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
5968
5969 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
5970
5971         * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
5972         assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
5973         defined to be 1.
5974
5975 Wed Feb  2 18:43:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5976
5977         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
5978         * java-tree.h (TYPE_II_STMT_LIST): New macro.
5979         (struct lang_type): New field `ii_block'.
5980         * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
5981         CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
5982         * parse.h (struct parser_ctxt): New field `instance_initializers'.
5983         (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
5984         CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
5985         CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
5986         macros.
5987         * parse.y (add_instance_initializer): New function.
5988         (in_instance_initializer): New static global.
5989         (class_body_declaration:): Link instance initializer block.
5990         (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
5991         (array_creation_expression:): Remove unused local.
5992         (java_parser_context_push_initialized_field): Fixed leading
5993         comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
5994         CPC_INSTANCE_INITIALIZER_LIST.
5995         (java_parser_context_pop_initialized_field): Likewise.
5996         (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
5997         (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
5998         CPC_INITIALIZER_STMT.
5999         (fix_constructors): New local `class_type'. Use it. Call
6000         add_instance_initializer.
6001         (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
6002         (patch_return): Forbid return in instance initializers.
6003         (patch_throw_statement): Enforce exception handling in the context
6004         of instance initializers.
6005
6006 2000-02-03  Tom Tromey  <tromey@cygnus.com>
6007
6008         * Make-lang.in (java.mostlyclean): Remove executables in
6009         `mostlyclean'.
6010
6011 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
6012
6013         * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
6014         HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
6015         (java_float_finite): Convert to use union Word from javaop.h.
6016         (java_double_finite): Convert to use union DWord from javaop.h.
6017
6018 2000-02-02  Tom Tromey  <tromey@cygnus.com>
6019
6020         * gjavah.c (options): Added `jni' entry.
6021         (help): Document -jni.
6022         (flag_jni): New global.
6023         (process_file): Handle JNI output.  Don't print text from
6024         -prepend, -add, etc, when generating stubs.  Only remove `.class'
6025         suffix if it actually exists.
6026         (main): Create a `.c' file when run with `--jni --stubs'.  Create
6027         correct output file name with `--jni'.
6028         (print_include): Mangle header name differently in JNI case.
6029         (HANDLE_METHOD): In JNI mode, call print_method_info to generate
6030         method list.
6031         (print_method_info): Handle JNI case.  Put signature info into
6032         method name.  Handle case when STREAM is NULL.
6033         (print_name_for_stub_or_jni): New function.
6034         (print_stub_or_jni): Renamed from `print_stub'.  Handle JNI.
6035         (print_cxx_classname): Handle JNI.
6036         (print_full_cxx_name): Likewise.
6037         (decode_signature_piece): Likewise.
6038         (overloaded_jni_method_exists_p): New function.
6039         (struct method_name): Added `signature' and `sig_length' fields.
6040         (HANDLE_END_FIELD): Do nothing in JNI mode.
6041
6042 2000-02-02  Tom Tromey  <tromey@cygnus.com>
6043
6044         * jv-scan.c: Include version.c, <getopt.h>.
6045         (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
6046         (options): New array.
6047         (usage): New function.
6048         (version): New function.
6049         (main): Use getopt_long to parse command line.
6050         * jcf-dump.c: Include version.c, <getopt.h>.
6051         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
6052         OPT_JAVAP): New macros.
6053         (options): New array.
6054         (usage): Return `void'.  Changed message.
6055         (help): New function.
6056         (version): New function.
6057         (main): Use getopt_long_only to parse command line.
6058         * gjavah.c: Include <getopt.h>.
6059         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
6060         OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
6061         OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
6062         (options): New array.
6063         (java_no_argument): Removed.
6064         (help): Updated with missing options.
6065         (main): Use getopt_long_only to parse command line.
6066         (usage): Changed message.
6067
6068 Tue Feb  1 22:23:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6069
6070         * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
6071         * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
6072         ANONYMOUS_ARRAY_INITIALIZER): New access macros.
6073         * parse.y (array_creation_expression:): Handle anonymous arrays.
6074         (build_array_from_name): Don't set `ret_name' if null.
6075         (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
6076         (qualify_ambiguous_name): Likewise.
6077         (java_complete_expand_class): Likewise.
6078
6079 Tue Feb  1 14:59:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6080
6081         * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
6082         * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
6083         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
6084         (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
6085         (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
6086         AIPL_FUNCTION_COMPLETED_INVOCATION.
6087         (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
6088         AIPL_FUNCTION_INVOCATION_READY.
6089         (AIPL_FUNCTION_DECLARATION): New enum entry.
6090         * parse.y (reorder_static_initialized): New function.
6091         (java_parser_context_pop_initialized_field): Use it.
6092         (add_inner_class_fields): Use
6093         MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
6094         augmented. Install marker after last alias initializer, if any.
6095         (generate_finit): Fixed typo. Don't try to retain only the used
6096         fields.
6097         (method_header): Compute and set DECL_FUNCTION_NAP.
6098         (method_declarator): Fixed comment. Insert alias initializer in
6099         parameter list.
6100         (build_alias_initializer_parameter_list): Fixed leading
6101         comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
6102         replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
6103         (java_complete_expand_class): Code to retain only used aliases
6104         removed.
6105         (java_complete_expand_methods): New local `first_decl'. Generate
6106         $finit$ first, then expand the constructors, regular methods and
6107         <clinit>.
6108         (java_complete_expand_method): Don't report error on missing
6109         return statement if previously detected bogus.
6110         (fix_constructors): Don't patch constructor parameters list.
6111         (patch_method_invocation): Use new AIPL enum values. Reverse
6112         alias initializer list for anonymous classes.
6113
6114 2000-01-30  Anthony Green  <green@redhat.com>
6115
6116         * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
6117         determine how many stack slots to pop.
6118
6119 2000-01-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6120
6121         * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
6122         error handling/recovery.
6123         * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
6124
6125 Fri Jan 28 20:10:57 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6126
6127         * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
6128         FIELD_LOCAL_ALIAS_USED): New macros.
6129         (DECL_FUNCTION_NAP): New macro.
6130         (struct lang_decl): New field `nap'.
6131         (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
6132         (struct lang_type): New fields `finit_stmt_list' and
6133         `clinit_stmt_list'.
6134         (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
6135         * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
6136         (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
6137         UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
6138         (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
6139         AIPL_FUNCTION_INVOCATION_READY): New enum fields.
6140         (BUILD_THROW): Macro line separator re-indented.
6141         * parse.y (end_class_declaration): New function.
6142         (maybe_generate_pre_expand_clinit): New name for
6143         java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
6144         pre-expand static fields.
6145         (maybe_generate_clinit): Function deleted.
6146         (check_for_static_method_reference): Prototype's parameter list
6147         indented.
6148         (generate_finit): New name for maybe_generate_finit. Changed
6149         leading comment. Function rewritten to use
6150         TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
6151         (build_alias_initializer_parameter_list): New function.
6152         (java_parser_context_pop_initialized_field): Likewise.
6153         (add_inner_class_fields): Likewise.
6154         (type_declaration:): Call end_class_declaration.
6155         (class_member_declaration:): Likewise.
6156         (formal_parameter_list:): Fixed typos.
6157         (formal_parameter:): Use ARG_FINAL_P to mark created tree list
6158         element. Improved error handling.
6159         (block_statement:): Call end_class_declaration.
6160         (anonymous_class_creation:): Likewise.
6161         (create_anonymous_class): Fixed comments.
6162         (create_class): Call add_inner_class_fields.
6163         (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
6164         (method_header): Use MARK_FINAL_PARMS.
6165         (finish_method_declaration): Use UNMARK_FINAL_PARMS.
6166         (method_declarator): Propagate final argument flag.
6167         (craft_constructor): New local `artificial'. Call
6168         build_alias_initializer_parameter_list. Use
6169         CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
6170         (source_start_java_method): Mark parm decls with LOCAL_FINAL if
6171         necessary.
6172         (complete_expand_class): Get rid of unused outer context local
6173         alias fields.
6174         (java_complete_expand_methods): Fixed leading
6175         comment. Generate/pre-expand <clinit> first. Changed method
6176         expansion order to regular, $finit$, constructors, <clinit>.
6177         (java_complete_expand_method): Set current_function_decl.
6178         (fix_constructors): Fix constructor parameter list to account for
6179         outer context local alias initializers.
6180         (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
6181         (resolve_expression_name): Lookup outer context local aliases. New
6182         local `access', use it.
6183         (patch_method_invocation): Patch inner class ctor invocation with
6184         outer context local aliases initialization values. $finit$
6185         invocation patching now includes things generated with
6186         build_alias_initializer_parameter_list.
6187         (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
6188         (build_super_invocation): Likewise.
6189         (patch_assignment): Changed comment.
6190
6191 2000-01-27  Andrew Haley  <aph@cygnus.com>
6192
6193         * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
6194         (emit_if): Ditto.
6195         (emit_jsr): Ditto.
6196
6197 2000-01-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6198
6199         * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
6200         concatenation.
6201         (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
6202
6203         * parse.y (register_fields): Don't pass a format specifier to
6204         OBSOLETE_MODIFIER_WARNING.
6205         (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
6206         instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
6207         specifier.
6208         (check_modifiers): Change function into a macro.
6209         (check_class_interface_creation): Pass a literal format string.
6210
6211 2000-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6212
6213         * buffer.h: PROTO -> PARAMS.
6214         * check-init.c: Likewise.
6215         * class.c: Likewise.
6216         * constants.c: Likewise.
6217         * convert.h: Likewise.
6218         * decl.c: Likewise.
6219         * except.c: Likewise.
6220         * expr.c: Likewise.
6221         * gjavah.c: Likewise.
6222         * java-except.h: Likewise.
6223         * java-tree.h: Likewise.
6224         * jcf-depend.c: Likewise.
6225         * jcf-dump.c: Likewise.
6226         * jcf-parse.c: Likewise.
6227         * jcf-path.c: Likewise.
6228         * jcf-reader.c: Likewise.
6229         * jcf-write.c: Likewise.
6230         * jcf.h: Likewise.
6231         * jv-scan.c: Likewise.
6232         * jvgenmain.c: Likewise.
6233         * jvspec.c: Likewise.
6234         * lang.c: Likewise.
6235         * lex.c: Likewise.
6236         * lex.h: Likewise.
6237         * parse-scan.y: Likewise.
6238         * parse.h: Likewise.
6239         * parse.y: Likewise.
6240         * typeck.c: Likewise.
6241         * verify.c: Likewise.
6242         * xref.c: Likewise.
6243         * xref.h: Likewise.
6244         * zextract.c: Likewise.
6245         * zipfile.h: Likewise.
6246
6247 2000-01-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6248
6249         * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
6250         (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
6251         * constants.c (build_constant_data_ref): Check for cached
6252         current_constant_pool_data_ref. Cache current_constant_pool_data_ref
6253         in TYPE_CPOOL_DATE_REF.
6254         * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
6255         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
6256         (struct lang_type): New fields `cpool' and `cpool_data_ref'.
6257         (LOCAL_FINAL): New macro.
6258         * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
6259         constant pool -- don't try to reuse.
6260         (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
6261         TYPE_LANG_SPECIFIC.
6262         (find_in_current_zip): Use TYPE_JCF.
6263         * parse.h (java_check_final): Prototype removed.
6264         * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
6265         (maybe_create_class_interface_decl,
6266         check_class_interface_creation): Likewise.
6267         (java_expand_finals): Function removed.
6268         (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
6269         (block_statement:): Fixed comment.
6270         (anonymous_class_creation:): Likewise.
6271         (check_class_interface_creation): Reversed Jan 12, 2000 extra
6272         argument patch.
6273         (check_class_interface_creation): Loosened error report on (inner)
6274         public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
6275         (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
6276         (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
6277         argument patch.
6278         (create_interface): Likewise.
6279         (anonymous_class_counter): New static global.
6280         (create_anonymous_class): Reversed Jan 12, 2000 extra argument
6281         patch. Fixed comments.
6282         (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
6283         anonymous_class_counter when declaring a toplevel class.
6284         (craft_constructor): Fixed constructor name when handling
6285         anonymous classes. Anonymous class constructors to feature hidden
6286         this$<n> parameter.
6287         (java_fix_constructors): Added comment.
6288         (java_check_final): Function removed.
6289         (java_complete_expand_methods): Fixed comment. Don't generate
6290         class data, save its outgoing constant pool instead.
6291         (verify_constructor_super): Skip anonymous class constructor
6292         hidden this$<n> parameter.
6293         (java_expand_classes): New local `saved_ctxp'. Removed call to
6294         java_expand_finals and java_check_final. Expand anonymous class
6295         constructors. Generate class data.
6296         (build_super_invocation): Skip anonymous class hidden this$<n>
6297         parameter.
6298         * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
6299         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
6300         (set_java_signature): Likewise.
6301
6302 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
6303
6304         * gjavah.c: Delete ACC_VISIBILITY define.
6305         * jcf.h: Add ACC_VISIBILITY define.
6306         * parse.y: final: rule tagged <value>.
6307         (java_check_regular_methods): Use ACC_VISIBILITY define for
6308         default package access check.
6309         (local_variable_declaration_statement): Use final: rule.
6310
6311 Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
6312
6313         * parse.y (format_parameter:): Use final: rule instead of modifiers:.
6314         (final:): New rule.
6315
6316 2000-01-17  Tom Tromey  <tromey@cygnus.com>
6317
6318         * gjavah.c (print_field_info): Allow non-static final fields.
6319
6320 Fri Jan 14 18:03:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6321
6322         * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
6323         * parse.y (patch_anonymous_class): New function.
6324         (create_anonymous_class): Register incomplete type when the
6325         class/interface to extends/implement isn't known yet.
6326         (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
6327         (verify_constructor_super): Tuned error message.
6328
6329 Fri Jan 14 00:14:24 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6330
6331         * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
6332         (ANONYMOUS_CLASS_P): New macro.
6333         (TYPE_SIGNATURE, TYPE_JCF): New macros.
6334         (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
6335         * parse.y (create_class): Added leading argument.
6336         (maybe_create_class_interface_decl,
6337         check_class_interface_creation): Likewise.
6338         (craft_constructor): New function.
6339         (verify_constructor_super): Added argument in prototype.
6340         (class_declaration:): Inserted leading argument.
6341         (for_begin:): Use FOR_LOOP_P.
6342         (anonymous_class_creation): Create WFL of the anonymous class to
6343         instantiate. Call build_new_invocation. Added comments.
6344         (check_class_interface_creation): Handle parameter `anonymous' in
6345         verbose mode class creation announce.
6346         (link_nested_class_to_enclosing): Exclude anonymous classes.
6347         (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
6348         anonymous class, even though they appear to have an enclosing
6349         context.
6350         (create_interface): Pass extra argument to
6351         check_class_interface_creation.
6352         (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
6353         (create_class): Call check_class_interface_creation and
6354         maybe_create_class_interface_decl with extra new argument. Don't
6355         add private this$<n> to anonymous classes.
6356         (method_declarator): Insert hidden this$<n> to anonymous class
6357         constructors.
6358         (java_fix_constructors): Deleted code creating default
6359         constructor. Call craft_constructor instead.
6360         (java_check_regular_methods): Set `saw_constructor' to 1 for
6361         anonymous classes.
6362         (fix_constructors): Pass extra argument to verify_constructor_super.
6363         (verify_constructor_super): New local `sdecl', use it. Search for
6364         matching constructor (possibly featuring arguments) in super
6365         class.
6366         (lookup_method_invoke): Craft constructor according to arguments
6367         list when dealing with anonymous class constructors.
6368         (build_super_invocation): Pass arguments to anonymous class super
6369         constructors.
6370         (search_loop): Use FOR_LOOP_P.
6371         (labeled_block_contains_loop_p): Likewise.
6372
6373 Wed Jan 12 00:38:47 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6374
6375         * class.c (set_super_info): Set CLASS_STATIC when appropriate.
6376         (enclosing_context_p): New function.
6377         (get_access_flags_from_decl): Handle CLASS_STATIC.
6378         (maybe_layout_super_class): Extra first argument passed to
6379         do_resolve_class.
6380         (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
6381         ID_INIT_P.
6382         * decl.c (access0_identifier_node): New global.
6383         (init_decl_processing): access0_identifier_node initialized.
6384         (pushdecl): Set DECL_CONTEXT only on non type decls.
6385         * expr.c (lookup_field): Lookup inner class fields in enclosing
6386         contexts.
6387         (expand_invoke): Use ID_INIT_P.
6388         (expand_java_field_op): Use DECL_CLINIT_P.
6389         * java-tree.def (CLASS_LITERAL): New tree code.
6390         * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
6391         DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
6392         (struct lang_decl): New field `inner_access'.
6393         (enclosing_context_p): Prototyped.
6394         (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
6395         ID_CLINIT_P): New macros.
6396         (CLASS_STATIC): New macro.
6397         (CLASS_ACCESS0_GENERATED_P): New macro.
6398         (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
6399         TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
6400         INNER_CLASS_P): New macros.
6401         (DECL_INNER_CLASS_LIST): New macro.
6402         * jcf-parse.c (yyparse): Avoid the use of ANSI string
6403         concatenation.
6404         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
6405         the shift value to int. Fixed typo in comment.
6406         * lex.c (inst_id, wpv_id): Initialize.
6407         * mangle.c (unicode_mangling_length): Take `$' into account.
6408         * parse.h (DRECOVER, RECOVER): Terminate properly.
6409         (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
6410         (typedef struct _jdep): New field `enclosing'.
6411         (JDEP_ENCLOSING): New macro.
6412         (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
6413         (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
6414         (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
6415         GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
6416         GET_ENCLOSING_CPC_CONTEXT): New macros.
6417         (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
6418         (do_resolve_class): Added extra argument in prototype.
6419         * parse.y (resolve_class): Added extra argument in prototype.
6420         (maybe_create_class_interface_decl): Likewise.
6421         (maybe_use_access_method, build_wfl_wrap): New functions.
6422         (java_complete_expand_classes, java_complete_expand_class):
6423         Likewise.
6424         (java_parser_context_push_initialized_field,
6425         java_parser_context_suspend, java_parser_context_resume):
6426         Likewise.
6427         (maybe_make_nested_class_name, make_nested_class_name,
6428         set_nested_class_simple_name_value,
6429         link_nested_class_to_enclosing, find_as_inner_class,
6430         find_as_inner_class_do, check_inner_class_redefinition,
6431         build_thisn_assign, build_current_thisn, build_access_to_thisn,
6432         maybe_build_thisn_access_method, build_outer_field_access,
6433         build_outer_field_access_methods, build_outer_field_access_expr,
6434         build_outer_method_access_method, build_new_access_id,
6435         build_outer_field_access_method, outer_field_access_p,
6436         outer_field_expanded_access_p, outer_field_access_fix,
6437         build_incomplete_class_ref, patch_incomplete_class_ref,
6438         create_anonymous_class): Likewise.
6439         (inst_id, wpv_id): New static global variables.
6440         (synchronized:): New rule, tagged <node>.
6441         (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
6442         rules.
6443         (anonymous_class_creation:): New rule, tagged <node>.
6444         (NEW_TK): Tagged <node>.
6445         (type_literals, array_type_literal): New rules, tagged <node>.
6446         (class_declaration:): Removed action when reducing by class_body:
6447         (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
6448         using GET_CPC in sub-rules.
6449         (class_member_declaration): Handle inner classes.
6450         (method_declaration): When reducing method_header:, reset
6451         current_function_decl when appropriate.
6452         (method_declarator:): Set the number of formal parameter to 0 for
6453         method declared without arguments.
6454         (constructor_declarator:): Likewise.
6455         (static_initializer:): List of elements kept in a list.
6456         (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
6457         use of the keyword `static' for type declarations.
6458         (block_statement:): Handle inner class declarations.
6459         (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
6460         type qualified `this'.
6461         (class_instance_creation_expression): Use anonymous_class_creation:
6462         to handle inner class instances creation. Handle qualified `new'.
6463         (something_dot_new): Added appropriate actions.
6464         (create_new_parser_context): New function.
6465         (java_push_parser_context, java_parser_context_save_global,
6466         java_parser_context_suspend): Use create_new_parser_context.
6467         (check_modifiers): Changed leading comment.
6468         (check_class_interface_creation): Handle interclasses.
6469         (add_superinterfaces): Fixed comment.
6470         (create_interface): Build qualified name from the raw_name instead
6471         of its matching WFL. Push the initialized fields list. raw_name added
6472         as an extra argument to maybe_create_class_interface_decl.
6473         (create_class): Build qualified name from the raw_name instead of
6474         its matching WFL. Removed assignment to current_parsed_class_un.
6475         Call PUSH_ERROR before returning an error. Suspend the current
6476         parser context when processing an inner class. Push the
6477         initialized fields list. raw_name added as an extra argument to
6478         maybe_create_class_interface_decl. Add the private this$<n>
6479         field.
6480         (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
6481         (register_fields): Get the class type from GET_CPC and handle
6482         previous errors.  Added code to handle the creation of static
6483         fields in inner classes. Initialized fields initialization
6484         statements kept in a list of lists.
6485         (maybe_generate_finit): Initialized fields initialization
6486         statements kept in a list of lists. Use GET_CPC.
6487         (maybe_generate_clinit): Likewise.
6488         (method_header): Use GET_CPC and GET_CPC_UN.
6489         (parser_qualified_classname): Handle inner classes.
6490         (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
6491         (java_fix_constructors): Hide pointer to enclosing context
6492         instance in constructor list when dealing with inner classes.
6493         (jdep_resolve_class): Call resolve_class with extra first argument
6494         JDEP_ENCLOSING.
6495         (resolve_class): Add enclosing context as a first extra argument
6496         to do_resolve_class.
6497         (do_resolve_class): Call find_as_inner_class. Handle WFLs
6498         properly.
6499         (resolve_no_layout): Extra argument added to resolve_class
6500         invocation.
6501         (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
6502         (java_get_real_method_name): Use GET_CPC_UN.
6503         (check_abstract_method_definitions): Use DECL_CLINIT_P.
6504         (java_check_abstract_methods): Handle static method declared in
6505         inner classes by an error.
6506         (java_check_regular_methods): Use DECL_CLINIT_P.
6507         (source_start_java_method): Also set DECL_MAX_LOCALS.
6508         (create_artificial_method): Call java_parser_context_save_global
6509         and java_parser_context_restore_global instead of saving/restoring
6510         the context by hand.
6511         (expand_start_java_method): Improved verbose mode message.
6512         (java_complete_expand_methods): Fixed leading comment. Use
6513         DECL_CLINIT_P.
6514         (fix_constructors): Added assignment to this$<n> if necessary.
6515         (java_expand_classes): Call java_complete_expand_classes instead
6516         of java_complete_expand_methods.
6517         (make_qualified_primary): Simplified.
6518         (merge_qualified_name): Optimized for missing left or right parts.
6519         (resolve_expression_name): Handle access to outer class fields from
6520         interclasses.
6521         (resolve_qualified_expression_name): New macro
6522         RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
6523         classes. Report error on non appropriate qualification of
6524         `new'. Handle qualified `this'.
6525         (not_accessible_p): Allow access to outer class private fields from
6526         inner classes.
6527         (patch_method_invocation): Handle method invocations through
6528         access methods and inner class constructor invocations.
6529         (find_applicable_accessible_methods_list): Search enclosing
6530         contexts of an inner class.
6531         (search_applicable_methods_list): Fixed typo.
6532         (argument_types_convertible): Handle inner class constructors'
6533         hidden outer context reference argument.
6534         (qualify_ambiguous_name): Handle qualified `this'.
6535         (java_complete_lhs): Handle use of field accessed through
6536         artificial access methods in various cases of assignments. Handle
6537         CLASS_LITERAL node.
6538         (check_final_assignment): Use DECL_CLINIT_P.
6539         (valid_ref_assignconv_cast_p): Handle the destination being an
6540         enclosing context of the source.
6541         (patch_unaryop): Handle use of field accessed through artificial
6542         access methods.
6543         (patch_return): Use DECL_CLINIT_P.
6544         (patch_throw_statement): Use DECL_CLINIT_P.
6545         (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
6546         * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
6547         ID_INIT_P.
6548
6549 2000-01-16  Anthony Green  <green@cygnus.com>
6550
6551         * parse.y (build_string_concatenation): Only use
6552         StringBuffer(String) shortcut if String arg is constant.
6553
6554 Wed Jan 12 20:20:11 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6555
6556         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
6557         the shift value to int. Fixed typo in comment.
6558
6559 2000-01-11  Mumit Khan  <khan@xraylith.wisc.edu>
6560
6561         * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
6562         * jcf-write.c: Likewise.
6563         * parse.y: Likewise.
6564         * parse.c: Regenerate.
6565
6566 2000-01-09  Anthony Green  <green@cygnus.com>
6567
6568         * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
6569         bytecodes in the correct order.
6570
6571 2000-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6572
6573         * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
6574
6575 Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>
6576
6577         * expr.c (java_lang_expand_expr): Switch to permanent obstack
6578         before building constant array decl.
6579
6580 Thu Jan  6 00:54:10 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6581
6582         * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
6583         method invocation and typo in conditional expression.
6584         (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
6585         the appropriate NOTE_POP.
6586         * parse.y (patch_binop): Shift value mask to feature the right
6587         type.
6588
6589 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6590
6591         * class.c (assume_compiled, assume_compiled_node): Add static
6592         prototype.
6593         (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
6594
6595         * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
6596
6597         * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
6598
6599         * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
6600         to `__modifier' to avoid stringifying it.
6601
6602         * parse.y (verify_constructor_circularity): Don't call a variadic
6603         function with a non-literal format string.
6604         (java_check_abstract_methods): Move unreachable code inside
6605         `continue' statement.
6606         (lookup_method_invoke): Call xstrdup, not strdup.
6607
6608         * expr.c (expand_java_field_op): Avoid the use of ANSI string
6609         concatenation.
6610
6611         * jcf-parse.c (yyparse): Likewise.
6612
6613         * jv-scan.c (main): Likewise.
6614
6615 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6616
6617         * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
6618         ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
6619         ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
6620         concatenation.
6621
6622         * parse.y (synchronized, variable_redefinition_error,
6623         check_class_interface_creation, create_interface, create_class,
6624         method_header, finish_method_declaration,
6625         check_modifiers_consistency, method_declarator,
6626         complete_class_report_errors, check_abstract_method_definitions,
6627         java_check_regular_methods, check_throws_clauses,
6628         java_check_abstract_methods, read_import_dir,
6629         check_pkg_class_access, declare_local_variables, fix_constructors,
6630         cut_identifier_in_qualified, resolve_expression_name,
6631         resolve_qualified_expression_name, patch_method_invocation,
6632         java_complete_lhs, patch_assignment, try_builtin_assignconv,
6633         patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
6634         patch_exit_expr, patch_exit_expr, patch_switch_statement,
6635         patch_try_statement, patch_synchronized_statement,
6636         patch_throw_statement, check_thrown_exceptions,
6637         patch_conditional_expr): Likewise.
6638
6639 Fri Dec 24 00:25:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6640
6641         * Makefile.in (LIBDEPS): Added gcc's errors.o
6642         (../jcf-dump$(exeext):): Link with gcc's errors.o
6643         (../gcjh$(exeext):): Likewise.
6644         * expr.c (expand_java_NEW): Layout the entire target type instead of
6645         laying out its methods only.
6646         (lookup_field): Layout the class after having loaded it.
6647         * java-tree.h (java_debug_context): Declared.
6648         * jcf-io.c (toplev.h): Included.
6649         (find_class): Removed assignment to jcf's outofsynch
6650         field. Force source file to be read if newer than its matching
6651         class file. Tweaked debug messages.
6652         * jcf-parse.c (jcf_out_of_synch): Deleted.
6653         (read_class): Call to jcf_out_of_synch removed.
6654         * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
6655         (jcf_out_of_synch): Prototype deleted.
6656         * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
6657         `deprecated' and `class_err': integer turned into bit fields.
6658         New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
6659         * parse.y (package_list): New global.
6660         (package_declaration:): Record newly parsed package name.
6661         (extra_ctxp_pushed_p): Static global deleted.
6662         (java_parser_context_save_global): Create buffer context for the
6663         purpose of saving globals, if necessary.
6664         (java_parser_context_restore_global): Pop context pushed for the
6665         purpose of saving globals, if necessary.
6666         (java_debug_context_do): New prototype and function.
6667         (java_debug_context): Likewise.
6668         (do_resolve_class): Use already parsed package names to qualify
6669         and lookup class candidate.
6670         (java_pre_expand_clinit): Removed unnecessary local variable.
6671
6672 1999-12-17  Tom Tromey  <tromey@cygnus.com>
6673
6674         * gjavah.c (decode_signature_piece): Print "::" in JArray<>.  This
6675         fixes PR gcj/119.
6676         (process_file): Use `\n\' at end of each line in string.
6677
6678 Thu Dec 16 00:09:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6679
6680         * expr.c (expand_invoke): Layout the loaded class before
6681         attempting to use it.
6682         (expand_java_field_op): Allow final field assignments to take
6683         place in $finit$.
6684         * typeck.c (convert): Return error_mark_node if expr is null.
6685
6686 1999-12-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6687
6688         * class.c (class_depth): Return -1 if the class doesn't load
6689         properly.
6690         * expr.c (can_widen_reference_to): Check for errors during depth
6691         computation and return 0 accordingly.
6692         * jcf-parse.c (parse_source_file): Call java_fix_constructors to
6693         create default constructors and add an other error check.
6694         * parse.h (java_fix_constructors): Prototyped.
6695         * parse.y (java_pre_expand_clinit): Likewise.
6696         (build_super_invocation): Re-prototyped to feature one argument.
6697         (java_check_circular_reference): Directly use `current'.
6698         (java_fix_constructors): New function.
6699         (java_check_regular_methods): Don't create default constructors
6700         here, but abort if none were found.
6701         (java_complete_expand_methods): Pre-process <clinit> calling
6702         java_pre_expand_clinit.
6703         (java_pre_expand_clinit): New function.
6704         (fix_constructors): build_super_invocation invoked with the
6705         current method declaration as an argument.
6706         (build_super_invocation): Use the context of the processed method
6707         decl argument instead of current_class.
6708         * typeck.c (lookup_java_method): Take WFLs in method names into
6709         account.
6710
6711 Tue Dec 14 14:20:16 1999  Per Bothner  <per@bothner.com>
6712
6713         * class.c (make_class_data): flag_keep_inline_functions to keep
6714         private methods in the method array.
6715
6716 1999-12-15  Anthony Green  <green@cygnus.com>
6717
6718         * check-init.c (check_init): Take into account both types of
6719         `throw's when checking for uninitialized variables.
6720
6721 Fri Dec 10 21:53:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6722
6723         * parse.y (java_complete_lhs): Force convertion of array
6724         dimensions to int_type_node, that's what runtime's ABI expects.
6725
6726 Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6727
6728         * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
6729         operand of a WFL, until the Java front-end gets fixed with regard
6730         to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
6731
6732 1999-12-10  Andrew Haley  <aph@cygnus.com>
6733
6734         * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
6735         decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
6736         expr.c (build_java_athrow): Add support for sjlj-exceptions.
6737         java-tree.h: Ditto.
6738         jcf-write.c: Ditto.
6739
6740 Wed Dec  8 15:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6741
6742         * expr.c (java_lang_expand_expr): Switch to permanent obstack
6743         before calling expand_eh_region_start and expand_start_all_catch.
6744         * except.c (expand_start_java_handler): Switch to permanent
6745         obstack before calling expand_eh_region_start.
6746         (expand_end_java_handler): Switch to permanent obstack before
6747         calling expand_start_all_catch.
6748
6749 1999-12-5  Anthony Green  <green@cygnus.com>
6750
6751         * decl.c (init_decl_processing): Mark throw_node as a noreturn
6752         function with side effects.
6753         (init_decl_processing): Mark all memory allocating DECLs with
6754         DECL_IS_MALLOC.
6755
6756 Wed Dec  1 04:25:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6757
6758         * except.c (expand_end_java_handler): Call
6759         expand_resume_after_catch and end_catch_handler.
6760
6761 Tue Nov 30 12:36:15 1999  Anthony Green  <green@cygnus.com>
6762
6763         * verify.c (verify_jvm_instructions): Create new return label
6764         chain if non existent (don't rely on the verified state of the jsr
6765         target.)
6766
6767 Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6768
6769         * jcf-write.c (generate_bytecode_insns): Fixed indentation for
6770         COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
6771
6772         * parse.y (patch_assignment): Removed bogus final class test on
6773         lhs when checking on whether to emit an ArrayStoreException runtime
6774         check.
6775         * expr.c (expand_java_arraystore): Likewise.
6776
6777 1999-11-28 Anthony Green <green@cygnus.com>
6778
6779         * decl.c (find_local_variable): Reuse single slot decls when
6780           appropriate.
6781
6782 Wed Nov 24 17:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6783
6784         * jcf-parse.c (saw_java_source): Global variable removed.
6785         (read_class): Don't use `saw_java_source'. Added extra braces.
6786         (yyparse): Code setting `saw_java_source' removed.
6787
6788 1999-11-24  Mark Mitchell  <mark@codesourcery.com>
6789
6790         * except.c (emit_handlers): Zero catch_clauses after emitting them.
6791
6792 Tue Nov 23 17:29:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6793
6794         * verify.c (merge_type_state): Non verified subroutines being
6795         considered more than once to trigger passive type merge.
6796
6797 Tue Nov 23 10:55:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6798
6799         * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
6800         in case of error. Error message tuned.
6801
6802 1999-11-21  Anthony Green  <green@cygnus.com>
6803
6804         * constants.c (find_methodref_index): Unwrap method names before
6805         inserting them in the constant pool.
6806
6807         * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
6808
6809         * class.c (assume_compiled_node): New typedef.
6810         (assume_compiled_tree): New static data.
6811         (find_assume_compiled_node): New function.
6812         (add_assume_compiled): New function.
6813         (assume_compiled): New function.
6814         * class.c (make_class_data): Use assume_compiled.
6815         (is_compiled_class): Use assume_compiled.
6816
6817         * java-tree.h (add_assume_compiled): Declare.
6818
6819         * lang.c (lang_decode_option): Parse new options.
6820
6821 Wed Nov 17 21:09:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6822
6823         * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
6824         int_type_node: that's what `_Jv_AllocObject' expects.
6825
6826 Thu Nov 11 01:57:14 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6827
6828         * parse.y (lookup_method_invoke): Use lang_printable_name to
6829         reliably build the type name during error report. Fixes PR gcj/97.
6830
6831 1999-11-09  Tom Tromey  <tromey@cygnus.com>
6832
6833         * jcf-path.c: Include <sys/stat.h>.
6834         (jcf_path_init): Search for libjava.zip.  Fixes PR gcj/84.
6835         (DIR_UP): New macro.
6836
6837 Tue Nov  9 12:12:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6838
6839         * parse.y (source_end_java_method): Resume permanent allocation,
6840         reversing Apr 27 1998 patch.
6841         (patch_string_cst): Pop obstacks after having pushed the permanent
6842         ones.
6843
6844 1999-11-05  Tom Tromey  <tromey@cygnus.com>
6845
6846         * class.c (finish_class): Emit inlined methods if any native
6847         methods exist in the class.  Fixes PR gcj/85.
6848
6849 Thu Nov  4 16:27:01 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6850
6851         * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
6852         (qualify_ambiguous_name): Likewise.
6853
6854 Wed Nov  3 15:20:02 MST 1999  Godmar Back <gback@cs.utah.edu>
6855
6856         * typeck.c: (lookup_java_method):  search all inherited
6857         interfaces when looking up interface method.
6858
6859 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6860
6861         * parse.y (method_header:): Issue error message for rule `type
6862         error'.
6863         (synchronized:): Error report when not using synchronized.
6864
6865 Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6866
6867         * parse.y (resolve_qualified_expression_name): Prevent `this' from
6868         being used before the superclass constructor has been called.
6869         (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
6870         instead of `CALL_THIS_CONSTRUCTOR_P'.
6871
6872 Sat Oct 30 21:35:13 1999  Todd T. Fries <todd@lighthouse.fries.net>
6873
6874         * check-init.c: Fix typo in comment.
6875
6876 Fri Oct 29 14:35:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6877
6878         * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
6879         and final method.
6880
6881 Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6882
6883         * parse.y (expression_statement:): Call function to report
6884         improper invocation of a constructor.
6885         (parse_ctor_invocation_error): New function.
6886
6887 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
6888
6889         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
6890         remember_end_note.
6891
6892 1999-10-21  Tom Tromey  <tromey@cygnus.com>
6893
6894         * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
6895         in generated `main'.
6896
6897 Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6898
6899         * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
6900         (qualify_ambiguous_name): Likewise.
6901
6902 Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6903
6904         * parse.y (java_complete_tree): fold_constant_for_init to work on
6905         permanent_obstack.
6906         (java_complete_lhs): Likewise.
6907         (array_constructor_check_entry): Complete an initializer element
6908         on permanent_obstack.
6909
6910 1999-10-19  Tom Tromey  <tromey@cygnus.com>
6911
6912         * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
6913         From Mike Moreton <mike@pillim.demon.co.uk>.
6914
6915 1999-10-15  Greg McGary  <gkm@gnu.org>
6916
6917         * java-tree.h (flag_bounds_check): Remove extern decl.
6918         * lang.c (flag_bounds_check): Remove global variable.
6919         (lang_f_options): Remove "bounds-check" entry.
6920         (lang_init_options): Default flag_bounds_check to "on".
6921
6922 1999-10-14  Tom Tromey  <tromey@cygnus.com>
6923
6924         * jvgenmain.c (usage): New function.
6925         (main): Use it.  Also, handle `-D' options.
6926         * jvspec.c (lang_specific_driver): Recognize -D.
6927         (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
6928
6929         * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
6930
6931 1999-10-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6932
6933         * jcf-dump.c (print_constant, disassemble_method): Don't call a
6934         variadic function with a non-literal format string.
6935
6936         * parse-scan.y (report_main_declaration): Likewise.
6937
6938         * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
6939
6940         * parse.y (read_import_dir, patch_assignment, patch_binop,
6941         patch_array_ref): Likewise.
6942
6943         * typeck.c (build_java_array_type): Likewise.
6944
6945         * verify.c (verify_jvm_instructions): Likewise.
6946
6947 Tue Oct 12 22:28:10 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6948
6949         * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
6950
6951 1999-10-07  Anthony Green  <green@cygnus.com>
6952
6953         * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
6954         where CHECK_PUT may fail for valid reasons.
6955
6956         * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
6957         UNSAFE_PUTN): New macros.
6958
6959 1999-10-04  Tom Tromey  <tromey@cygnus.com>
6960
6961         * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
6962         well.  Fixes Java PR gcj/59.
6963         * parse-scan.y (yyerror): Report errors.
6964
6965 Fri Sep 24 12:23:05 1999  Glenn Chambers  <GChambers@provsol.com>
6966
6967         * decl.c (insert_block): Remove unconditional `abort'.
6968
6969 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
6970
6971         * decl.c (builtin_function): No longer static.  New arg CLASS.  Arg
6972         FUNCTION_CODE now of type int.  All callers changed.
6973         Set the builtin's DECL_BUILT_IN_CLASS.
6974
6975 1999-09-23  Tom Tromey  <tromey@cygnus.com>
6976
6977         * jvspec.c (lang_specific_driver): Don't read spec file if
6978         -fsyntax-only given.
6979
6980 1999-09-22  Tom Tromey  <tromey@cygnus.com>
6981
6982         * lang-specs.h: Added `%(jc1)' to the jc1 spec.
6983
6984         * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
6985         (WORDS_TO_LONG): Likewise.
6986         (WORDS_TO_DOUBLE): Likewise.
6987
6988 Tue Sep 14 16:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6989
6990         * jcf-write.c (RELOCATION_VALUE_0): New macro.
6991         (RELOCATION_VALUE_1): Likewise.
6992         (emit_iinc, emit_reloc, push_constant1, push_constant2,
6993         push_in_const, push_long_const): Prototyped.
6994         (push_constant1): Argument `index' is of type HOST_WIDE_INT.
6995         (push_constant2): Likewise.
6996         (push_int_const): Cast find_constant1's integer arguments to `jword'.
6997         (find_constant_wide): Cast find_constant2's integer arguments to
6998         `jword'.
6999         (find_constant_index): Cast find_constant2's and find_constant2's
7000         integer arguments to `jword'.
7001         (emit_pop): Argument `value' is of type HOST_WIDE_INT.
7002         (emit_switch_reloc): Use RELOCATION_VALUE_0.
7003         (emit_if): Use RELOCATION_VALUE_1.
7004         (emit_goto): Likewise.
7005         (emit_jsr): Likewise.
7006         (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
7007         argument to push_long_const to HOST_WIDE_INT.
7008
7009 1999-09-15  Andreas Schwab  <schwab@suse.de>
7010
7011         * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
7012
7013 1999-09-20  Nick Clifton  <nickc@cygnus.com>
7014
7015         * lang.c (lang_decode_option): Extend comment.
7016
7017 Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7018
7019         * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
7020         instead of fndecl.
7021
7022 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7023
7024         * gjavah.c (get_field_name, print_method_info, print_include,
7025         add_namelet): Use xmalloc, not malloc.
7026
7027         * jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
7028         (munge): Use xrealloc, not realloc, trust xrealloc to handle a
7029         NULL pointer.
7030
7031         * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
7032
7033         * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
7034
7035         * jcf-path.c (add_entry): Likewise.
7036
7037         * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
7038
7039         * jv-scan.c (xmalloc): Remove definition.
7040
7041         * jvgenmain.c (xmalloc): Likewise.
7042
7043         * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
7044
7045         * lex.c (java_store_unicode): Use xrealloc, not realloc.
7046
7047         * parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
7048         concat, not xmalloc/sprintf.
7049         (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
7050         (xstrdup): Remove definition.
7051
7052         * parse.y (duplicate_declaration_error_p,
7053         constructor_circularity_msg, verify_constructor_circularity,
7054         check_abstract_method_definitions, java_check_regular_methods,
7055         java_check_abstract_methods, patch_method_invocation,
7056         check_for_static_method_reference, patch_assignment, patch_binop,
7057         patch_cast, array_constructor_check_entry, patch_return,
7058         patch_conditional_expr): Use xstrdup, not strdup.
7059
7060         * zextract.c (ALLOC): Use xmalloc, not malloc.
7061
7062 Sun Sep 12 23:30:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7063
7064         * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
7065
7066         * jvspec.c: Include gcc.h.  Don't include gansidecl.h.
7067         (do_spec, lang_specific_pre_link, lang_specific_driver,
7068         input_filename, input_filename_length): Don't declare.
7069         (main_class_name, jvgenmain_spec, lang_specific_driver):
7070         Constify a char*.
7071         (lang_specific_driver): All calls to the function pointer
7072         parameter now explicitly call `fatal'.
7073
7074 Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7075
7076         * parse.y (find_applicable_accessible_methods_list): Search
7077         abstract classes as interfaces.
7078
7079 Thu Sep  9 17:33:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7080
7081         * class.c (finish_class): We're now outside a valid method
7082         declaration. Tell the rest of gcc so.
7083
7084 1999-09-08  Bruce Korb  autogen@linuxbox.com
7085
7086         * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
7087
7088 1999-09-07  Tom Tromey  <tromey@cygnus.com>
7089
7090         * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
7091         java-array.h.
7092         (decode_signature_piece): Don't emit "::" in JArray<>.
7093         (print_namelet): Only print trailing `;' when printing a class.
7094
7095 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
7096
7097         * java-tree.h: Delete declarations for all tree nodes now moved to
7098         global_trees.
7099         * decl.c: Delete their definitions.
7100
7101 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
7102
7103         * Make-lang.in (jc1): Depend on ggc-callbacks.o.
7104         * Makefile.in (OBJS): Add ggc-callbacks.o.
7105         (OBJDEPS): Likewise.
7106
7107 1999-09-03  Tom Tromey  <tromey@cygnus.com>
7108
7109         * parse.y (strip_out_static_field_access_decl): Return operand if
7110         it satisfies JDECL_P.
7111
7112 1999-09-02  Tom Tromey  <tromey@cygnus.com>
7113
7114         * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
7115         Handle nested arrays, like `[[I'.
7116
7117 1999-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7118
7119         * class.c (finish_class): Remove unused parameter, all callers
7120         changed.
7121
7122         * expr.c (build_java_athrow): Change return type to void.
7123         (java_lang_expand_expr): Make sure each case in switch returns a
7124         value.
7125
7126         * java-tree.h (finish_class): Fix prototype to take void args.
7127
7128         * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
7129         (main): Issue return from main, not exit.
7130
7131         * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
7132
7133         * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
7134
7135         * jv-scan.c (main): Issue return from main, not exit.
7136
7137         * parse.y (check_abstract_method_definitions,
7138         java_check_abstract_method_definitions): Add static prototypes.
7139         (java_complete_expand_methods): Fix call to `finish_class'.
7140
7141         * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
7142         and `prevpc'.
7143
7144 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7145
7146         * lang.c (language_string): Constify.
7147
7148 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7149
7150         * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
7151         Remove hacks for stuff which comes from libiberty.
7152
7153         * Make-lang.in: Likewise.
7154
7155 Mon Aug 30 16:41:41 1999  Hans-Peter Nilsson  <hp@axis.se>
7156
7157         * Makefile.in (xref.o): Depend on xref.c explicitly.
7158
7159 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7160
7161         * java-tree.h (lang_printable_name): Constify a char*.
7162
7163         * lang.c (lang_printable_name): Likewise.
7164
7165 Fri Aug 27 23:31:57 1999  Jeffrey A Law  (law@cygnus.com)
7166
7167         * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
7168         comments in C code.
7169
7170 1999-08-26  Tom Tromey  <tromey@cygnus.com>
7171
7172         * gjavah.c (print_cxx_classname): Print "::" before qualified
7173         name.
7174
7175 Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7176
7177         * parse.y (lookup_cl): Changed leading comment. Now does its best
7178         to set the column number.
7179         (qualify_ambiguous_name): Take WFL wrappers into account.
7180
7181 Wed Aug 25 15:37:15 1999  Gregg Townsend  <gmt@cs.arizona.edu>
7182
7183         * verify.c (verify_jvm_instructions): Don't check instruction
7184         validity beyond end of method.
7185
7186 1999-08-25  Tom Tromey  <tromey@cygnus.com>
7187
7188         * jvspec.c (lang_specific_driver): Correctly handle --help again.
7189
7190 1999-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7191
7192         * gjavah.c (print_name, print_base_classname, utf8_cmp,
7193         cxx_keyword_subst, generate_access, name_is_method_p,
7194         get_field_name, print_field_name, super_class_name, print_include,
7195         decode_signature_piece, print_class_decls, usage, help,
7196         java_no_argument, version, add_namelet, print_namelet): Add static
7197         prototype.
7198         (print_base_classname, utf8_cmp, cxx_keyword_subst,
7199         name_is_method_p): Constify a char*.
7200         (get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
7201         Provide a final else clause in an if-else-if.
7202         (print_field_info): Add missing final arg in function call to
7203         `print_field_name'.
7204         (print_method_info, decompile_method, decode_signature_piece,
7205         print_c_decl, print_full_cxx_name, print_stub,
7206         print_mangled_classname, super_class_name, print_include,
7207         add_namelet, add_class_decl, print_class_decls, process_file,
7208         help): Constify a char*.
7209
7210         * jcf-write.c (jcf_handler, push_constant1, push_constant2,
7211         push_int_const, find_constant_wide, find_constant_index,
7212         push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
7213         emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
7214         emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
7215         emit_if, emit_goto, emit_jsr, call_cleanups,
7216         make_class_file_name): Add static prototypes.
7217         (generate_bytecode_return, generate_bytecode_insns): Pass a
7218         NULL_PTR, not a NULL_TREE.
7219
7220         * jv-scan.c: Include "jcf.h".
7221         (main): Declare using DEFUN macro.
7222
7223         * jvspec.c (find_spec_file, lang_specific_pre_link,
7224         lang_specific_driver): Add prototypes.
7225         (find_spec_file): Constify a char*.
7226
7227         * keyword.gperf (hash, java_keyword): Add prototypes.
7228
7229         * lang.c (lang_print_error): Add static prototype.
7230         (lang_init): Prefer memcpy over bcopy to avoid casts.
7231
7232         * lex.c (yylex): Add static prototype.
7233
7234         * parse-scan.y: Include "lex.c" earlier.
7235
7236         * parse.h: Remove redundant declaration for `yylex'.
7237
7238         * parse.y (java_decl_equiv, binop_compound_p, search_loop,
7239         labeled_block_contains_loop_p): Add static prototypes.
7240         (not_accessible_p): Make static to match prototype.
7241
7242         * verify.c (start_pc_cmp): Don't needlessly cast away const.
7243
7244 Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7245
7246         * parse.y (check_method_redefinition): Changed leading comment.
7247         (check_abstract_method_definitions): New function.
7248         (java_check_abstract_method_definitions): New function.
7249         (java_check_regular_methods): Call it.
7250         (verify_constructor_super): Fixed indentation.
7251         (lookup_method_invoke): Likewise.
7252
7253 Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7254
7255         * parse.y (method_header): Return a null pointer if the current
7256         class node is null.
7257         (finish_method_declaration): Return if the current function decl
7258         is null.
7259         (source_start_java_method): Likewise.
7260         (java_method_add_stmt): Likewise.
7261
7262 Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7263
7264         * class.c (emit_register_class): Removed unnecessary call to
7265         start_sequence.
7266         * parse.y (labeled_block_contains_loop_p): Removed unused local
7267         variable.
7268
7269 Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7270
7271         * parse.y (java_refold): Added prototype.
7272
7273 Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7274
7275         * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
7276         (java_stabilize_reference): Removed unnecessary `else'.
7277         (java_complete_lhs): Set flag to remember boolean. Call
7278         java_refold. Added comments.
7279         (java_decl_equiv): New function.
7280         (binop_compound_p): Likewise.
7281         (java_refold): Likewise.
7282         (patch_unaryop): Striped static field access assigned to decl and
7283         op. Changed promotion scheme for ++/-- operators.
7284         (search_loop): New function.
7285         (labeled_block_contains_loop_p): Likewise.
7286         (patch_loop_statement): Call labeled_block_contains_loop_p. Added
7287         comment.
7288         (patch_bc_statement): Call search_loop. Fixed comment.
7289
7290 1999-08-14  Anthony Green  <green@cygnus.com>
7291
7292         * expr.c (java_lang_expand_expr): Mark static array data as
7293         referenced.
7294
7295 Tue Aug 10 00:28:31 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
7296
7297         * jvgenmain.c (main): NUL-terminate name_obstack.
7298
7299 1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7300
7301         * check-init.c (check_bool2_init, done_alternative): Add static
7302         prototypes.
7303
7304         * class.c (add_interface_do, maybe_layout_super_class): Likewise.
7305         (add_method, build_utf8_ref, build_class_ref,
7306         append_gpp_mangled_type, layout_class_method): Constify a char*.
7307
7308         * decl.c (push_promoted_type, make_binding_level): Add static
7309         prototypes.
7310         (push_promoted_type, pushdecl): Constify a char*.
7311
7312         * except.c (find_handler_in_range, link_handler,
7313         check_start_handlers): Add static prototypes.
7314
7315         * expr.c (process_jvm_instruction): Constify a char*.
7316
7317         * gjavah.c (main): Constify a char*.
7318
7319         * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
7320         Constify a char*.
7321
7322         * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
7323         static prototypes.
7324         (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
7325         munge, print_ents): Constify a char*.
7326
7327         * jcf-dump.c (disassemble_method): Constify a char*.
7328         (print_constant_pool, print_exception_table): Add static prototypes.
7329         (print_constant, print_exception_table, main, disassemble_method):
7330         Constify a char*.
7331
7332         * jcf-io.c (find_classfile, find_class): Likewise.
7333
7334         * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
7335         (set_source_filename, predefined_filename_p): Add static prototypes.
7336         (set_source_filename, get_constant, get_class_constant,
7337         find_in_current_zip): Constify a char*.
7338
7339         * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
7340         static prototypes.
7341         (add_entry, add_path, jcf_path_classpath_arg,
7342         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
7343
7344         * jcf-reader.c (get_attribute, jcf_parse_preamble,
7345         jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
7346         jcf_parse_one_method, jcf_parse_methods,
7347         jcf_parse_final_attributes): Add static prototypes.
7348         (get_attribute): Constify a char*.
7349
7350         * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
7351         jcf_dependency_add_target, jcf_path_classpath_arg,
7352         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
7353
7354         * jv-scan.c (main): Constify a char*.
7355         (gcc_obstack_init): Add prototype arguments.
7356
7357         * jvgenmain.c (gcc_obstack_init): Likewise.
7358         (main): Constify a char*.
7359
7360         * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
7361         static prototypes.
7362         (put_decl_string, lang_print_error): Constify a char*.
7363         (lang_init): Remove redundant extern prototype.
7364
7365         * mangle.c (emit_unicode_mangled_name): Constify a char*.
7366
7367         * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
7368         Add static prototypes.
7369         (get_type_from_signature): Constify a char*.
7370
7371         * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
7372         Add static prototypes.
7373         (start_pc_cmp): Prefer PTR over GENERIC_PTR.
7374         (verify_jvm_instructions): Constify a char*.
7375
7376         * xref.c (xref_flag_value): Likewise.
7377
7378         * xref.h (xref_flag_value): Likewise.
7379
7380         * zextract.c (makeword, makelong): Add static prototypes.
7381         (makeword, makelong): Constify a uch*.
7382
7383 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7384
7385         * lang.c (java_dummy_print): Constify a char*.
7386         (lang_print_error): Likewise.
7387         (lang_init): Remove redundant prototype for `print_error_function'.
7388         (lang_init_source): Likewise.
7389         (lang_identify): Constify a char*.
7390
7391 1999-08-09  Tom Tromey  <tromey@cygnus.com>
7392
7393         * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
7394         (WORDS_TO_LONG): Likewise.
7395         (WORDS_TO_DOUBLE): Likewise.
7396
7397 1999-08-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7398
7399         * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
7400
7401         * expr.c (java_stack_pop, java_array_data_offset,
7402         build_java_throw_out_of_bounds_exception, case_identity,
7403         build_java_check_indexed_type): Add static prototypes.
7404         (linenumber_table, expand_invoke, expand_java_field_op,
7405         build_primtype_type_ref, expand_byte_code): Constify a char*.
7406
7407         * java-tree.h (build_primtype_type_ref, linenumber_table):
7408         Constify a char*.
7409         (java_lang_expand_expr): Add prototype.
7410
7411         * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
7412         `java_lang_expand_expr'.
7413
7414         * lex.c (java_lex_error): Constify a char*.
7415         (java_get_unicode, java_read_char, java_allocate_new_line,
7416         java_unget_unicode, java_sneak_unicode): Prototype.
7417
7418         * parse-scan.y (current_class, package_name, method_declarator,
7419         report_class_declaration, yyerror): Constify a char*.
7420
7421         * parse.h (java_report_errors): Prototype.
7422         (yyerror): Constify a char*.
7423
7424         * parse.y (classitf_redefinition_error, check_modifiers,
7425         parse_jdk1_1_error, lookup_package_type,
7426         lookup_package_type_and_set_next, get_printable_method_name,
7427         purify_type_name): Constify a char*.
7428         (build_super_invocation, maybe_generate_finit,
7429         verify_constructor_super, parser_add_interface,
7430         add_superinterfaces, jdep_resolve_class, note_possible_classname,
7431         java_complete_expand_methods, java_expand_finals,
7432         cut_identifier_in_qualified, java_stabilize_reference,
7433         do_unary_numeric_promotion, operator_string, do_merge_string_cste,
7434         merge_string_cste): Prototype.
7435         (single_type_import_declaration, yyerror,
7436         variable_redefinition_error, build_array_from_name,
7437         build_unresolved_array_type, check_class_interface_creation,
7438         resolve_class, complete_class_report_errors,
7439         note_possible_classname, read_import_dir,
7440         find_in_imports_on_demand, resolve_package, fix_constructors,
7441         check_deprecation, lookup_method_invoke,
7442         maybe_build_primttype_type_ref, array_constructor_check_entry):
7443         Constify a char*.
7444         (java_complete_expand_methods, java_expand_finals): Make static.
7445         (convert_narrow): Remove static prototype.
7446
7447 Tue Aug  3 20:21:20 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
7448
7449         * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
7450
7451 1999-08-02  Richard Henderson  <rth@cygnus.com>
7452
7453         * decl.c: Include defaults.h instead of expr.h.
7454         * parse.y: Likewise.
7455
7456 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
7457
7458         * java/decl.c (start_java_method): Change all uses of
7459         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
7460         Ensure expr.h is included.
7461         * java/expr.c (pop_arguments): Ditto.
7462         * java/parse.y (expand_start_java_method): Ditto.
7463
7464 1999-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7465
7466         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
7467
7468 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
7469
7470         * decl.c: Include "function.h".
7471         * except.c: Likewise.
7472         * parse.y: Likewise.
7473         * Makefile.in: Update dependencies.
7474
7475 1999-07-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7476
7477         * expr.c (build_java_soft_divmod): Provide a default case in switch.
7478         (java_lang_expand_expr): Mark parameters `target', `tmode' and
7479         `modifier' with ATTRIBUTE_UNUSED.
7480
7481         * gjavah.c (process_file): Add braces around ambiguous `else'.
7482
7483         * jcf-dump.c (print_access_flags, localvar_free): Change return
7484         type to void.
7485
7486         * parse.y (java_complete_expand_method): Initialize variable
7487         `exception_copy'.
7488         (resolve_qualified_expression_name): Likewise for `field_decl'.
7489         (patch_method_invocation): Likewise for `class_to_search'.
7490         (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
7491         (patch_assignment): Likewise for `lhs_type'.
7492
7493         * verify.c (verify_jvm_instructions): Remove unused variable
7494         `caller'.
7495
7496 1999-07-25  Richard Henderson  <rth@cygnus.com>
7497
7498         * decl.c (va_list_type_node): New.
7499
7500 1999-07-25  Anthony Green  <green@cygnus.com>
7501
7502         * gjavah.c (print_stub): New function.
7503         (METHOD_IS_NATIVE): New macro.
7504         (print_mangled_classname): Make static.
7505         (HANDLE_END_FIELD): Don't emit fields during stub generation.
7506         (process_file): Perform stub generation.
7507         (HANDLE_METHOD): Don't emit class decls during stub
7508         generation.
7509         (HANDLE_END_METHOD): Take into account stub generation.
7510         (print_method_info): Handle stub generation.
7511         (print_stub): New function.
7512         (print_cxx_classname): Make signature consistant with others.
7513         (help): Describe -stubs option.
7514         (main): Create stub file.
7515         (version): Use version.c.
7516         (print_full_cxx_name): New function.
7517         (print_c_decl): Use print_full_cxx_name.
7518
7519 Thu Jul 22 12:41:12 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7520
7521         * check-init.c (check_init): Handle MAX_EXPR.
7522
7523 1999-07-15  Andrew Haley  <aph@cygnus.com>
7524
7525         * lang.c (flag_use_divide_subroutine): New variable.
7526         * typeck.c: (convert_ieee_real_to_integer): Bounds check
7527         fp-to-integer conversion.
7528         (convert): Call convert_ieee_real_to_integer when flag_fast_math
7529         is not set.
7530
7531         * expr.c (build_java_soft_divmod): New function.
7532         (build_java_binop): Call build_java_soft_divmod if
7533         flag_use_divide_subroutine is set.
7534         * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
7535         soft_lrem_node: new builtin functions.
7536         (init_decl_processing) Initialize the new builtins.
7537         * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
7538         soft_lrem_node: new builtin functions.
7539         (build_java_soft_divmod): New function.
7540         * parse.y: Call build_java_soft_divmod if
7541         flag_use_divide_subroutine is set.
7542         * parse.c: Rebuilt.
7543
7544         * jvspec.c (lang_specific_driver): Always allow an extra arg (for
7545         a --specs= arg) even if not linking.
7546         * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
7547         -fuse-divide-subroutine
7548
7549 Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7550
7551         * parse.y (resolve_and_layout): Check methods only once.
7552         (resolve_qualified_expression_name): Verify thrown exceptions
7553         compatibility.
7554         (check_thrown_exceptions): Reject exceptions thrown in
7555         initializer. Error message tuned.
7556
7557 1999-07-14  Andrew Haley  <aph@cygnus.com>
7558
7559         * expr.c (expand_expr): Do not return the last statement in a
7560         block as the block's value.
7561
7562 Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7563
7564         * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
7565         CALL_EXPR, to avoid order of evaluation changes.
7566
7567 Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7568
7569         * parse.y (qualify_ambiguous_name): Do not use
7570         IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
7571
7572 Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7573
7574         * check-init.c (check_init): Handle MAX_EXPR.
7575         * expr.c (force_evaluation_order): Force method call arguments to
7576         be evaluated in left-to-right order.
7577         * parse.y (qualify_ambiguous_name): Loop again to qualify
7578         NEW_ARRAY_EXPR properly.
7579
7580 Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7581
7582         * parse.y (patch_invoke): Resolve unresolved invoked method
7583         returned type.
7584         (qualify_ambiguous_name): STRING_CST to qualify expression for
7585         type name resolution.
7586
7587 1999-06-24  Andrew Haley  <aph@cygnus.com>
7588
7589         * class.c (finish_class): Whenever a deferred method is
7590         output, rescan the list of methods to see if a new candidate for
7591         output can be found.
7592
7593 1999-06-28  Tom Tromey  <tromey@cygnus.com>
7594
7595         * jvspec.c (lang_specific_driver): Recognize --help.
7596
7597 Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7598
7599         * parse.y (resolve_package): Fixed bogus return statement.
7600         (patch_method_invocation): Resolve method invocation beginning with
7601         a package name qualifier.
7602
7603 1999-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7604
7605         * Make-lang.in (java.stage1): Depend on stage1-start.
7606         (java.stage2): Likewise for stage2-start.
7607         (java.stage3): Likewise for stage3-start.
7608         (java.stage4): Likewise for stage4-start.
7609
7610 Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7611
7612         * parse.y (java_complete_lhs): When doing cross referencing, don't
7613         try to keep file location on a WFL expanded as a CALL_EXPR.
7614
7615 Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7616
7617         * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
7618         compiling to class file a void method with an empty method body.
7619         As a side effect, the bytecode backend will generate the
7620         appropriate `return' instruction.
7621
7622 Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7623
7624         * parse.y (lookup_package_type_and_set_next): New function prototype.
7625         (resolve_package): Search current and imported packages.
7626         (lookup_package_type_and_set_next): New function.
7627
7628 1999-06-22  Andrew Haley  <aph@cygnus.com>
7629
7630         * verify.c (verify_jvm_instructions): Check for pending blocks
7631         before invalid PC test and opcode switch, not after.
7632
7633 1999-06-21  Andrew Haley  <aph@cygnus.com>
7634
7635         * except.c (find_handler_in_range): The upper limit for exception
7636         ranges is exclusive, not inclusive: (start <= pc < end).
7637         (link_handler): find child pointer which points to outer by
7638         searching sibling list: previous code incorrectly assumed that
7639         outer->outer->first_child must point to outer.
7640         * verify.c (verify_jvm_instructions): FIXME added to code for
7641         `athrow'.
7642         (verify_jvm_instructions): Do not assume that the last block
7643         processed in a subroutine is a block which ends with a `ret'
7644         instruction.  With some control flows it is possible that the last
7645         block ends with an `athrow'.
7646
7647 Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7648
7649         * parse.y (qualify_ambiguous_name): Reorganized the post
7650         evaluation of non WFL leading expression nodes.
7651
7652 Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7653
7654         * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
7655         CONVERT_EXPR.
7656
7657 Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7658
7659         * parse.y (qualify_ambiguous_name): Handle qualified expression
7660         beginning with a STRING_CST.
7661
7662 Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7663
7664         * parse.y (register_fields): Set DECL_INITIAL on both
7665         pre-initialized static and public fields.
7666         (resolve_field_access): Static field access expressions to always
7667         use pointer types.
7668         (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
7669         qualification. CONVERT_EXPR to be resolved as an expression name.
7670         (java_complete_lhs): Identify and access qualified final
7671         initialized field in switch statement case expression.
7672         (fold_constant_for_init): Pre-initialized field decl constant to
7673         be folded.
7674
7675 Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7676
7677         * parse.y (note_possible_classname): Mark returned node with
7678         QUALIFIED_P only if the original class name contained a '/'.
7679
7680 Sat Jun  5 11:46:59 1999  Anthony Green  <green@cygnus.com>
7681
7682         * Make-lang.in (gcjh): More parallel build fixes.
7683
7684 1999-06-03  Mike Stump  <mrs@wrs.com>
7685
7686         * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
7687
7688 Wed Jun  2 10:44:38 1999  Anthony Green  <green@cygnus.com>
7689
7690         * except.c (link_handler): Chain exception handlers in order.
7691
7692 Wed Jun  2 10:41:24 1999  Anthony Green  <green@cygnus.com>
7693
7694         * expr.c (expand_byte_code): Fill unreachable bytecode regions
7695         with nops and process as usual in order to always set correct EH
7696         ranges.  Emit detailed warnings about unreachable bytecodes.
7697
7698 Wed Jun  2 10:35:13 1999  Anthony Green  <green@cygnus.com>
7699
7700         * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
7701         constant.
7702
7703 Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7704
7705         * parse.y (lookup_field_wrapper): Unified returned value to NULL
7706           or the searched field decl.
7707
7708 Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7709
7710         * parse.y (fold_constant_for_init): Convert numerical constant
7711         values to the type of the assigned field.
7712
7713 Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7714
7715         * expr.c (lookup_field): Relaxed the test on class loading error
7716         detection.
7717         * parse.y (fold_constant_for_init): Enabeled old code.
7718
7719 Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7720
7721         * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
7722         decide the validity of the cast of a java.lang.Cloneable reference
7723         to an array.
7724         (patch_conditional_expr): Fixed first argument passed to
7725         binary_numeric_promotion.
7726
7727 Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7728
7729         * parse.y (qualify_ambiguous_name): Take into account that a
7730         CONVERT_EXPR might specify a type as a WFL.
7731
7732 Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7733
7734         * parse.y (patch_assignment): Save the rhs before using it as an
7735         argument to _Jv_CheckArrayStore.
7736
7737 Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7738
7739         * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
7740
7741 Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7742
7743         * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
7744         floating point litteral only when the exponent indicator has been
7745         parsed.
7746
7747 Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7748
7749         * parse.y (formal_parameter:): Construct argument tree list
7750         element even if a yet unsupported final parameter was encountered.
7751
7752 Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7753
7754         * parse.y (finish_method_declaration): Issue errors for native or
7755         abstract methods declared with a method body, as well as for non
7756         native or non abstract methods with no method body.
7757
7758 1999-05-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7759
7760         * class.c (build_utf8_ref): Initialize variable `field'.
7761
7762         * decl.c (init_decl_processing): Initialize variable `field'.
7763
7764         * expr.c (build_known_method_ref): Mark parameters `method_type',
7765         `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
7766         (process_jvm_instruction): Likewise for parameter `length'.
7767
7768         * jvspec.c (lang_specific_driver): Mark variables `saw_math',
7769         `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
7770         ATTRIBUTE_UNUSED.
7771
7772         * parse.y (maybe_generate_clinit): Remove unused variable
7773         `has_non_primitive_fields'.
7774         (find_in_imports_on_demand): Initialize variables `node_to_use'
7775         and `cl'.
7776         (patch_binop): Likewise for variable `prom_type'.
7777         (patch_unaryop): Likewise for variable `prom_type'.
7778
7779         * verify.c (verify_jvm_instructions): Likewise for variable `last'.
7780
7781         * xref.c (xref_table): Add missing initializer.
7782
7783 1999-05-14  Tom Tromey  <tromey@cygnus.com>
7784
7785         * java-except.h (struct eh_range): Removed unused `next' member.
7786         * verify.c (verify_jvm_instructions): Call check_nested_ranges
7787         after adding all exception handlers.  Sort exception ranges in
7788         order of start PC.
7789         (struct pc_index): New structure.
7790         (start_pc_cmp): New function.
7791         * except.c (add_handler): Return `void'.  Don't call link_handler;
7792         instead construct an ordinary linked list and do range
7793         coalescing.
7794         (check_nested_ranges): New function.
7795         (link_handler): Changed interface to allow merging of eh_ranges.
7796         Split overlapping ranges.  Return `void'.
7797
7798 Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7799
7800         * parse.y (constructor_block_end:): New rule, tagged <node>.
7801         (constructor_body:): Use `constructor_block_end' instead of
7802         `block_end'.
7803
7804 Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7805
7806         * parse.y (statement_nsi:): Pop `for' statement block.
7807         (java_complete_lhs): Labeled blocks containing no statement are
7808         marked as completing normally.
7809
7810 Fri May 14 12:31:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7811
7812         * xref.c (xref_set_current_fp): New function, defined.
7813         * xref.h (xref_set_current_fp): New function, prototyped.
7814
7815 Fri May 14 11:57:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7816
7817         * check-init.c (check_init): Take into account that
7818         LABELED_BLOCK_STMT can be empty.
7819
7820 Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7821
7822         * parse.y (java_check_regular_methods): Warning check on not
7823         overriding methods with default access in other packages does not
7824         apply to `<clinit>'.
7825         (java_complete_lhs): If block body is an empty_stmt_node, replace
7826         it by NULL_TREE. This prevents gcc from generating an irrelevant
7827         warning.
7828
7829 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7830
7831         * check-init.c (check_init): Removed code accepting to see things
7832         falling through default:, when doing xrefs.
7833         * java-tree.h (do_not_fold): New global variable, declared.
7834         * parse.y (do_not_fold): New global variable, defined.
7835         (java_complete_expand_method): Set `do_not_fold' to the value of
7836         `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
7837         and reinstall them after them have been purged; do not check for
7838         initializations; do not issue missing return errors.
7839         (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
7840         when doing xrefs.
7841         (patch_binop): Skip the fold part when doing xrefs.
7842         (build_string_concatenation): Skip the concatenation part when
7843         doing xrefs.
7844         (patch_synchronized_statement): Do not generate a try-finally when
7845         doing xrefs.
7846         (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
7847         and keep the location where the throw was seen.
7848         * typeck.c (convert): When `do_not_fold' is set, do not attempt
7849         any treatment on the converted node an simply return a NOP_EXPR of
7850         the targeted type.
7851         * xref.c (xref_get_data): New function, defined.
7852         * xref.h (xref_get_data): New function, declared.
7853         (XREF_GET_DATA): Use xref_get_data.
7854
7855 1999-05-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7856
7857         * gjavah.c (print_include): Cast the result of `strlen' to int
7858         when comparing against a signed value.
7859         (add_namelet): Likewise.
7860
7861 1999-05-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7862
7863         * expr.c (expand_invoke): Mark parameter `nargs' with
7864         ATTRIBUTE_UNUSED.
7865         (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
7866
7867         * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
7868         ATTRIBUTE_UNUSED.
7869
7870         * jcf-reader.c (get_attribute): Cast a value to long
7871         when comparing against a signed expression.  Likewise.
7872
7873         * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
7874         HOST_BITS_PER_CHAR.
7875
7876 1999-05-11  Andrew Haley  <aph@cygnus.com>
7877
7878         * parse.y (source_end_java_method): If the current method contains
7879         any exception handlers, force asynchronous_exceptions: this is
7880         necessary because signal handlers in libjava may throw exceptions.
7881         * decl.c (end_java_method): Ditto.
7882
7883 1999-05-11  Tom Tromey  <tromey@cygnus.com>
7884
7885         * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
7886         flags.
7887         * jvspec.c (THREAD_NAME): Removed.
7888         (GC_NAME): Likewise.
7889         (MATHLIB): Likewise.
7890         (WITHLIBC): Likewise.
7891         (GCLIB): Likewise.
7892         (THREADLIB): Likewise.
7893         (MATH_LIBRARY): Likewise.
7894         (lang_specific_driver): Don't add `-l' options to command line.
7895         Instead, add a single --specs option.  Recognize `-L' options and
7896         use them to search for spec file.
7897         (find_spec_file): New function.
7898         (SPEC_FILE): New define.
7899
7900 Tue May 11 11:46:36 1999  Dave Brolley  <brolley@cygnus.com>
7901
7902         * lang-options.h: -MD, -MMD, -M and -MM not needed here for
7903         cpplib-enabled build.
7904
7905 1999-05-05  Per Bothner  <bothner@cygnus.com>
7906
7907         * class.c (make_field_value):  DECL_INITIAL may be a string literal;
7908         temporarily zero it while calling rest_of_decl_compilation.
7909
7910         * java-tree.h (string_ptr_type_node):  Add declaration.
7911         * decl.c:  Define and initialize string_ptr_type_node.
7912         * parse.y (patch_string_cst):  Use string_ptr_type_node.
7913
7914         * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
7915         * parse.y (for_statement):  Now unconditionally exit_block.
7916         (finish_labeled_statement):  No longer exit_block if for-loop.
7917         (patch_loop_statement):  Check harder if the loop is already labeled.
7918
7919         * parse.y (patch_initialized_static_field):  Removed function.
7920         (maybe_generate_clinit):  Removed special handling for interfaces.
7921         (java_complete_expand_methods):  Do a preliminary java_complete_tree
7922         on <clinit> to determine if it can be removed.
7923         (java_complete_expand_method):  Remove special handling for <clinit>.
7924         (java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
7925         optimize if we get back empty_stmt_node.
7926         For MODIFY_EXPR, re-do checking of static initializers.
7927         (fold_constant_for_init):  Don't return immediate if VAR_DECL.
7928         For VAR_DECL, pass correct context.
7929
7930         * verify.c (verify_jvm_instructions):  Better error messages.
7931
7932 1999-05-03  Tom Tromey  <tromey@cygnus.com>
7933
7934         * parse-scan.y (interface_declaration): Call
7935         report_class_declaration for interfaces.
7936
7937 1999-04-30 20:54 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
7938
7939         * Makefile.in: Remove -v from bison command lines.
7940
7941 Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7942
7943         * check-init.c (check_init): Exclude a case of error when doing
7944         xrefs.
7945         * class.c (layout_class_method): Don't generate the error message
7946         twice when compiling from source.
7947         * lang-options.h: Added `-Wredundant-modifers' and
7948         `-Wunusupported-jdk11' flags and help text.
7949         * lang.c (lang_decode_option): Added support for
7950         `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
7951         flag_static_local_jdk11 and flag_redundant set accordingly.
7952         * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
7953         * parse.h (EXPR_WFL_ADD_COL): New macro.
7954         (DECL_END_SOURCE_LINE): Likewise.
7955         (DECL_INHERITED_SOURCE_LINE): Likewise.
7956         * parse.y (static_ref_err): New function, prototyped.
7957         (CCB_TK): Now tagged <operator>.
7958         (class_body:): Remember the location of the closing '}' of a class
7959         definition when doing xrefs.
7960         (block:): Likewise.
7961         (block_end:): Likewise.
7962         (create_class): Remember the location of the inherited class
7963         identifier when doing xrefs.
7964         (register_fields): Added test on first operand of `init' before
7965         testing it TREE_CODE.
7966         (method_header): Store the location of the class identifier in the
7967         class decl when doing xrefs.
7968         (finish_method_declaration): Don't combine first/last method line
7969         when doing xref.
7970         (java_check_regular_methods): Warning check on not overriding
7971         methods with default access on other packages move before check on
7972         static methods. Initialization of `aflags' also moved up.
7973         (resolve_expression_name): Call static_ref_err to report the error.
7974         (static_ref_err): New function, implemented.
7975         (resolve_field_access): Returned simplified static field access
7976         when doing xrefs.
7977         (resolve_qualified_expression_name): Check for illegal use of
7978         static fields in a non static context. Call static_ref_err to
7979         report error in various places.
7980         (java_complete_tree): Do not fold initialized static fields when
7981         doing xrefs.
7982         (java_complete_lhs): Likewise.
7983
7984 1999-04-29  Anthony Green  <green@cygnus.com>
7985
7986         * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
7987         create internal labels.
7988         (lookup_label): Ditto.
7989
7990 Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7991
7992         * class.c (layout_class_method): Generate <clinit>'s rtl for
7993         interfaces.
7994         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
7995         for interfaces' <clinit>.
7996         * expr.c (lookup_field): Search for fields in interfaces.
7997         (expand_invoke): Fixed indentation.
7998         (expand_java_field_op): Likewise. Use IS_CLINIT.
7999         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
8000         (IS_CLINIT): New macro.
8001         * parse.y (type_declaration:): Call maybe_generate_clinit after an
8002         interface was parsed.
8003         (maybe_generate_clinit): Don't generate if the current class is an
8004         interface with only fields of primitive types.
8005         (reset_method_name): Use IS_CLINIT.
8006         (java_complete_expand_method): Expand <clinit> when it exists for
8007         interfaces. Use IS_CLINIT.
8008         (resolve_expression_name): Use DECL_CONTEXT instead of
8009         current_class to build static field references.
8010         (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
8011         ARRAY_REF when doing xreferencing.
8012         (check_final_assignment): Fixed typo in leading comment. Use
8013         IS_CLINIT.
8014         (patch_array_ref): Don't fully expand array references when
8015         xreferencing.
8016         (patch_return): Use IS_CLINIT.
8017         (patch_throw_statement): Likewise.
8018
8019 1999-04-22  Tom Tromey  <tromey@cygnus.com>
8020
8021         * Make-lang.in (JAVA_SRCS): Added check-init.c.
8022
8023 Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8024
8025         * decl.c (predef_filenames, predef_filenames_size): New globals
8026         (init_decl_processing): predef_filenames and predef_filenames_size
8027         initialized.
8028         * java-tree.h (predef_filenames, predef_filenames_size): Declared
8029         extern.
8030         * jcf-parse.c (predefined_filename_p): New function.
8031         (yyparse): Check that files on the command line are specified only
8032         once and issue a warning otherwise.
8033         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
8034         * parse.y (source_end_java_method): Nullify NOP method bodies, to
8035         avoid a gcc warning with -W -Wall turned on.
8036         (java_expand_classes): Abort if errors were encountered.
8037         (java_complete_lhs): If the cross reference flag is set, wrap
8038         field DECL node around a WFL when resolving expression name.
8039
8040 Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8041
8042         * lang.c (lang_decode_option): Fixed returned value when parsing
8043         `-fxref=...' and `-Wall'.
8044         * parse.y (source_end_java_method): Do not generate code when
8045         flag_emit_xref is set.
8046         (resolve_expression_name): Do not build static field access when
8047         flag_emit_xref is set.
8048         (resolve_field_access): No special treatment on `length' when
8049         flag_emit_xref is set. Do not build qualified static field access
8050         when flag_emit_xref is set.
8051         (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
8052         when flag_emit_xref is set.
8053         (patch_assignment): Do not generate array store runtime check when
8054         flag_emit_xref is set.
8055         * xref.c (xref_flag_value): Fixed function declaration
8056         indentation.
8057         (xset_set_data): New function.
8058         * xref.h (xref_set_data): Added prototype for new function.
8059         (typedef struct xref_flag_table): New field data.
8060         (XREF_GET_DATA): New macro.
8061
8062 1999-04-19  Tom Tromey  <tromey@cygnus.com>
8063
8064         * xref.h (enum): Removed trailing comma.
8065
8066         * parse.y (resolve_qualified_expression_name): Added missing
8067         `break'.
8068
8069 Thu Apr 15 13:08:03 1999  Anthony Green  <green@cygnus.com>
8070
8071         * gjavah.c: New prototypes for java_float_finite and
8072         java_double_finite.
8073
8074 Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8075
8076         * parse.y (patch_unaryop): Fixed ++/-- operator check on array
8077         references.
8078
8079 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
8080
8081         * Makefile.in (TREE_H): Add tree-check.h.
8082         (RTL_H): Add genrtl.h.
8083
8084 Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8085
8086         * parse.y (patch_assignment): Added ArrayStoreException runtime
8087         check.
8088
8089 1999-04-06  Per Bothner  <bothner@cygnus.com>
8090
8091         * expr.c (pop_type_0):  New function.
8092         (pop_type):  Use pop_type_0.
8093         * java-tree.h (pop_type_0):  New declaration.
8094         * verify.c (verify_jvm_instructions):  Check return instructions.
8095
8096         * parse.y (patch_binop):  Don't fold if non-constant and emiting
8097         class files.
8098
8099 Mon Apr  5 16:06:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8100
8101         * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
8102
8103         * gjavah.c: Include math.h earlier.  Include tree.h/java-tree.h.
8104         (main_jcf): Don't define.
8105         (process_file): Don't set `main_jcf'.
8106
8107         * java-tree.h (main_jcf): Don't declare.
8108
8109         * jcf-parse.c (main_jcf): Add static definition.
8110
8111         * lang.c (main_jcf): Don't define.
8112
8113 Mon Apr  5 15:43:51 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8114
8115         * class.c (add_method_1): Cast the argument of `bzero' to PTR.
8116
8117         * decl.c (copy_lang_decl): Likewise for `bcopy'.
8118
8119         * jcf-depend.c: Include "config.h", not <config.h>.
8120
8121         * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
8122         `bcopy' to PTR.
8123
8124         * jcf-path.c: Include "config.h", not <config.h>.
8125
8126         * lex.c: Don't include various system header files.
8127         (java_init_lex): Cast the argument of `bzero' to PTR
8128
8129         * parse-scan.y (java_push_parser_context): Likewise.
8130
8131         * parse.y (java_push_parser_context): Likewise.
8132         (patch_bc_statement): Match format specifier to variable argument.
8133
8134         * xref.c: Don't include <stdio.h>.
8135
8136 Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8137
8138         * parse.y (struct parser_ctxt *ctxp): Now global.
8139         (declare_local_variables): Use WFL compound value for the
8140         declaration source line value, when doing cross-referencing.
8141
8142 1999-03-31  Tom Tromey  <tromey@cygnus.com>
8143
8144         * gjavah.c (print_field_info): Allow constants of other types.
8145         (print_include): Generate include when new name is proper prefix
8146         of already printed name.
8147         (add_namelet): Likewise.
8148         (cxx_keyword_subst): New function.
8149         (print_method_info): Use it.
8150         (print_field_name): New function.
8151         (get_field_name): New function.
8152         (print_field_info): Use get_field_name and print_field_name.
8153
8154 Wed Mar 31 11:00:32 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8155
8156         * Makefile.in (keyword.h): Generate using gperf language 'C', not
8157         'KR-C', so gperf uses the `const' keyword on strings.
8158
8159         * keyword.gperf (java_keyword): Const-ify a char*.
8160
8161 Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8162
8163         * parse.y (patch_bc_statement): Fixed identation and a bogus
8164         `printf' format.
8165
8166 Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8167
8168         * parse.y (patch_assignment): Allow static variables in other
8169         classes to be assigned.
8170
8171 Sun Mar 28 22:12:10 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8172
8173         * class.c (maybe_add_interface): Remove unused variable
8174         `interface_binfo'.
8175         (make_class_data): Use = for assignment, not ==.  Likewise.
8176         (emit_register_classes): Remove unused variable `decl'.
8177
8178         * lex.c: Fix comment so as not to contain an embedded `/*'.
8179
8180         * verify.c (verify_jvm_instructions): Remove unused variable
8181         `self_type'.
8182
8183 Sat Mar 27 15:49:18 1999  Per Bothner  <bothner@cygnus.com>
8184
8185         * parse.y (complete_loop_body):  Rename to finish_loop_body.
8186         (complete_labeled_statement):  Rename to finish_labeled_statement.
8187         (complete_for_loop):  Rename to finish_for_loop.
8188         (complete_method_declaration):  Rename to finish_method_declaration.
8189
8190         * java-tree.h (continue_identifier_node):  New global node.
8191         * decl.c:  Define and initialize continue_identifier_node.
8192         * parse.y (generate_labeled_block):  Remove - no longer needed.
8193         (build_loop_body):  Use continue_identifier_node for continue block.
8194         (finish_labeled_statement):  Also do pop_labeled_block actions.
8195         (java_complete_lhs):  POP_LOOP even if error.
8196         (build_labeled_block):  Special handling for continue_identifier_node.
8197         (patch_loop_statement):  Re-organize.
8198         (patch_bc_statement):  Re-write.
8199
8200 Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8201
8202         * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
8203         using a WFL compound value.
8204         * parse.y (xref.h): Include.
8205         (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
8206         WFL compound value.
8207         (register_fields): Set WFL compound value to lineno if doing
8208         xrefs.
8209         (java_complete_expand_method): Call expand_xref if flag_emit_xref
8210         is set.
8211         * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
8212         * xref.h (expand_xref): Prototype renamed from xref_generate.
8213
8214 Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8215
8216         * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
8217         (GET_CURRENT_BLOCK): New macro.
8218         * parse.y (current_static_block): New global variable.
8219         (method_body:): Define action.
8220         (complete_method_declaration): Set current_function_decl to NULL
8221         when work on the current method is done.
8222         (declare_local_variables): Use GET_CURRENT_BLOCK.
8223         (java_method_add_stmt): Likewise.
8224         (java_complete_expand_method): Disable the use of `this' when
8225         expanding <clinit>.
8226         (enter_a_block): If no current method exist, use
8227         current_static_block to link static initializer blocks.
8228         (exit_block): Rewritten to use current_static_block when no current
8229         method decl exists.
8230         (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
8231         (patch_return): Forbid the use of `return' in static initializers.
8232         (patch_throw_statement): Fixed indentation. Issue specific error
8233         for uncaught thrown checked exception in static initializer
8234         blocks. Removed FIXME.
8235
8236 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
8237
8238         * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
8239         Link gcj from gcc.o.
8240
8241 Tue Mar 23 10:48:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8242
8243         * parse.y (find_applicable_accessible_methods_list): When dealing
8244         with interface: ensure that a given interface or java.lang.Object
8245         are searched only once.
8246
8247 Tue Mar 23 10:05:27 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8248
8249         * gjavah.c (print_c_decl): Remove unused argument `flags'.
8250
8251         * jcf-dump.c (print_access_flags): Add braces around if-else.
8252
8253         * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
8254         COMBINE_INPUTS.
8255
8256         * lex.c (build_wfl_node): Add static prototype.
8257
8258         * lex.h (build_wfl_node): Remove static prototype.
8259
8260         * parse.y: Include lex.c early enough to declare everything needed.
8261         Ensure calls to `build_wfl_node' pass the proper arguments.
8262         (create_class): Remove unused variable `super_decl'.
8263         (get_printable_method_name): Initialize variable `name'.
8264
8265 Mon Mar 22 20:14:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8266
8267         * Changelog: Fixed 1999-03-22 typos.
8268         * lang.c (lang_decode_option): Fixed typo in error string in the
8269         XARG section.
8270
8271 1999-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8272
8273         * Makefile.in (JAVA_OBJS): Added entry xref.o.
8274         (xref.o): New rule.
8275         * java-tree.h (flag_emit_xref): Declared extern.
8276         * lang.c (xref.h): Included.
8277         (flag_emit_xref): New global variable.
8278         (lang_decode_option): Added support for -fxref.
8279         * xref.c: Created.
8280         * xref.h: Likewise.
8281
8282 1999-03-21  Manfred Hollstein  <manfred@s-direktnet.de>
8283
8284         * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
8285         linked with.
8286
8287 Sun Mar 21 08:30:30 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8288
8289         * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
8290         $(srcdir)/../system.h and $(JAVA_TREE_H).
8291         (jcf-io.o): Depend on $(JAVA_TREE_H).
8292         (mangle.o): Likewise.
8293
8294         * check-init.c (check_cond_init): Add static prototype.
8295
8296         * class.c (build_java_method_type, hashUtf8String,
8297         make_field_value, get_dispatch_vector, get_dispatch_table,
8298         append_gpp_mangled_type, mangle_static_field): Likewise.
8299         (strLengthUtf8): Hide unused definition.
8300         (hashUtf8String): Const-ify.
8301         (make_field_value): Un-ANSI-fy.
8302
8303         * constants.c: Move inclusion of jcf.h above java-tree.h.
8304         (set_constant_entry, find_class_or_string_constant,
8305         find_name_and_type_constant, get_tag_node,
8306         build_constant_data_ref): Add static prototype.
8307
8308         * decl.c (push_jvm_slot, builtin_function,
8309         lookup_name_current_level): Likewise.
8310         (builtin_function): Const-ify.
8311
8312         * except.c (expand_start_java_handler, expand_end_java_handler):
8313         Add static prototype.
8314
8315         * expr.c (flush_quick_stack, push_value, pop_value,
8316         java_stack_swap, java_stack_dup, build_java_athrow,
8317         build_java_jsr, build_java_ret, expand_java_multianewarray,
8318         expand_java_arraystore, expand_java_arrayload,
8319         expand_java_array_length, build_java_monitor, expand_java_pushc,
8320         expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
8321         expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
8322         expand_compare, expand_test, expand_cond, expand_java_goto,
8323         expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
8324         expand_java_field_op, java_push_constant_from_pool): Likewise.
8325
8326         (decode_newarray_type, expand_iinc): Un-ANSI-fy.
8327         (build_java_arraynull_check): Mark parameters `node' and `type'
8328         with ATTRIBUTE_UNUSED.
8329         (note_label): Likewise for parameter `current_pc'.
8330         (expand_java_call, expand_java_ret): Hide unused definition.
8331
8332         * java-tree.h (make_class, build_constants_constructor,
8333         java_set_exception_lang_code, pop_labeled_block, emit_handlers,
8334         init_outgoing_cpool, register_class, emit_register_classes,
8335         java_layout_seen_class_methods): Prototype.
8336         (unicode_mangling_length): Const-ify.
8337         (append_gpp_mangled_name, append_gpp_mangled_classtype,
8338         emit_unicode_mangled_name, format_int, format_uint,
8339         jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
8340         jcf_print_utf8_replace, open_class): Prototype.
8341
8342         * jcf-dump.c: Include "config.h", not <config.h>.  Don't include
8343         <stdio.h>.  Include tree.h/java-tree.h.
8344         (utf8_equal_string usage, process_class): Add static prototype.
8345         (open_class): Don't prototype this here.
8346         (utf8_equal_string): Match arguments to format specifiers.
8347         (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
8348         TABLE_SWITCH, disassemble_method): Likewise.
8349
8350         * jcf-io.c: Include tree.h/java-tree.h.
8351         (open_class, find_classfile, jcf_print_utf8,
8352         jcf_print_utf8_replace): Const-ify.
8353
8354         * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
8355         parse_class_file): Add static prototype.
8356         (find_in_current_zip): Match definition to existing static
8357         prototype.
8358
8359         * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
8360         (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
8361         finish_jcf_block, define_jcf_label, get_jcf_label_here,
8362         put_linenumber, localvar_alloc, localvar_free, get_access_flags,
8363         write_chunks, adjust_typed_op, generate_bytecode_conditional,
8364         generate_bytecode_return, perform_relocations, init_jcf_state,
8365         init_jcf_method, release_jcf_state, generate_classfile):
8366         Add static prototype.
8367         (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
8368         (make_class_file_name): Const-ify.
8369
8370         * jcf.h (find_classfile): Const-ify.
8371
8372         * jv-scan.c (reset_report): Remove prototype.
8373
8374         * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
8375         (error): Rewrite to allow varargs.
8376
8377         * lang.c (lang_f_options): Const-ify.
8378
8379         * lex.c (java_parse_escape_sequence): Add static prototype.
8380         (java_allocate_new_line): Match definition to existing static
8381         prototype.
8382
8383         * mangle.c Include tree.h/java-tree.h.
8384         (unicode_mangling_length, emit_unicode_mangled_name,
8385         append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
8386
8387         * parse.h (jdep_code): Remove trailing comma in enumeration.
8388         (java_get_line_col): Move prototype outside of !JC1_LITE test.
8389         (reset_report): Add prototype.
8390
8391         * verify.c (push_pending_label, merge_types): Add static
8392         prototypes.
8393
8394         * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
8395
8396 1999-03-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8397
8398         * parse.y (find_applicable_accessible_methods_list): Extend the
8399         search to superinterfaces when relevant.
8400         (search_applicable_methods_list): New function.
8401
8402 1999-03-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8403
8404         * class.c (unmangle_classname): Implemented stricter testing
8405         before setting the QUALIFIED_P flag on an identifier.
8406
8407 Tue Mar 16 15:15:41 1999  Per Bothner  <bothner@cygnus.com>
8408
8409         * parse.y (java_complete_lhs):  Call force_evaluation_order
8410         after patch_newarray.
8411         (patch_binop):  Don't call fold if there are side effects.
8412
8413 1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8414
8415         * parse.y (java_stabilize_reference): Use save_expr instead of
8416         building a SAVE_EXPR node.
8417         (java_complete_lhs): Patch the resulting string of the `+='
8418         operator (if necessary) and complete the RHS after having built
8419         the cast.
8420
8421 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
8422
8423         * class.c (make_class):  Don't set CLASS_P here (because
8424         this function is also called by build_java_array_type).
8425         (push_class):  Set CLASS_P here instead.
8426         * parse.h (TYPE_CLASS_P):  Check for TYPE_ARRAY_P is redundant.
8427
8428         * jcf-dump.c (print_access_flags):  Take extra parameter to indicate
8429         context.  If the context is class, perfer "super" over "synchronized".
8430         * jcf-write.c (generate_classfile):  Don't add ACC_SUPER if interface.
8431
8432         * parse.y (create_class):  Don't call parser_check_super here;
8433         it is not robust.  Always wait until later.
8434
8435         * parse.y (method_header):  For interfaces, set ACC_ABSTRACT (to
8436         match what JDK 1.2 does), but don't set ACC_PUBLIC.
8437
8438 Sat Mar 13 18:16:34 1999  Per Bothner  <bothner@cygnus.com>
8439
8440         * lex.c (java_read_char):  UNGET invalid non-initial utf8 character.
8441         * lex.h (UNGETC):  Change misleading macro.
8442
8443 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8444
8445         * parse.y (java_stabilize_reference): Return NODE when patching a
8446         COMPOUND_EXPR.
8447         (java_complete_lhs): Put parenthesis around truth values.
8448
8449 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8450
8451         * class.c (layout_class_method): Don't make rtl for interface
8452         methods.
8453         * parse.h (GET_TYPE_NAME): New macro.
8454         * parse.y (if_then_statement:): Fixed indentation.
8455         (if_then_else_statement:): Likewise.
8456         (for_statement:): Fixed spacing.
8457         (try_statement:): Fixed indentation.
8458         (create_interface): Don't force interfaces to be abstract.
8459         (method_header): Abstract methods are OK in interfaces.
8460         (declare_local_variables): Fixed typo in comment.
8461         (java_complete_expand_method): Fixed indentation.
8462         (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
8463         non accessible fields.
8464         (java_stabilize_reference): New function.
8465         (java_complete_lhs): Fixed indentation. Use
8466         java_stabilize_reference in compound assignement. Insert the
8467         cast. If not processing `+' fix string constants before processing
8468         binop.
8469
8470 Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8471
8472         * constants.c (find_class_or_string_constant): Cast variable `j'
8473         to a `jword' when comparing against one.
8474
8475         * expr.c (java_lang_expand_expr): Remove unused variables
8476         `has_finally_p' and `op0'.
8477
8478         * gjavah.c (print_field_info): Cast a value to jint when comparing
8479         against one.  Likewise for a jlong.
8480         (add_namelet): Likewise cast a `sizeof' to an int when comparing
8481         against a signed quantity.
8482
8483         * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
8484         (print_signature): Don't needlessly dereference variable `str'
8485
8486         * jcf-reader.c (get_attribute): Mark variables `max_stack' and
8487         `max_locals' with ATTRIBUTE_UNUSED.
8488         (jcf_parse_class): Likewise for variable `index'.
8489
8490         * parse.h (reverse_jdep_list): Remove static prototype.
8491
8492         * parse.y (build_jump_to_finally): Remove prototype and definition.
8493         (reverse_jdep_list): Add static prototype.
8494
8495         * typeck.c (convert_ieee_real_to_integer): Remove unused variables
8496         `assignment' and `expr_decl'.
8497
8498         * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
8499
8500 1999-03-12  Andrew Haley  <aph@cygnus.com>
8501
8502         * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
8503         we'll need a directory separator and a null character.
8504
8505 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
8506
8507         * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
8508
8509   Tue Mar  9 11:52:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8510
8511         * parse.y (method_header): Don't set ACC_ABSTRACT flags on
8512         interfaces.
8513
8514 Fri Mar  5 15:17:29 1999  Per Bothner  <bothner@cygnus.com>
8515
8516         * lex.c (java_parse_end_comment):  Take extra parameter (next char).
8517
8518         * class.c (build_utf8_ref):  Fix possible name class/ambiguity.
8519
8520         * class.c (layout_class_method):  A static method in a base class
8521         is never overridden, so treat it like it doesn't exist.
8522         However, do complain about private non-static method overriding
8523         public static method.
8524
8525         * parse.y:  Don't set unused INITIALIZED_P flag.
8526         * java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
8527
8528         * parse.y (find_expr_with_wfl):  Optimize tail-calls.
8529         (build_array_from_name):  Re-order &index[string] to &string[index].
8530
8531         * parse.y (java_complete_lhs):  Don't call patch_assignment if rhs is
8532         error_mark (it might catch more errors, but it is more likely to lose).
8533
8534 Sat Mar  6 11:17:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8535
8536         * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
8537         (parse-scan.o): Depend on toplev.h.
8538
8539         * class.c (make_method_value): Add prototype.  Make it static.
8540         Remove unused second argument, caller changed.
8541
8542         * expr.c (java_lang_expand_expr): Remove unused variable
8543         `return_label'.
8544
8545         * java-tree.h: Don't prototype find_in_current_zip.
8546         Add prototypes for verify_constant_pool, start_java_method,
8547         end_java_method, give_name_to_locals, expand_byte_code,
8548         open_in_zip, set_constant_value, find_constant1, find_constant2,
8549         find_utf8_constant, find_string_constant, find_class_constant,
8550         find_fieldref_index, find_methodref_index, write_constant_pool,
8551         count_constant_pool_bytes and encode_newarray_type.
8552
8553         * jcf-dump.c: Remove unused variable `LONG_temp'.
8554
8555         * jcf-parse.c: Include parse.h.
8556         (jcf_parse_source): Remove unused parameter, all callers changed.
8557         (jcf_figure_file_type): Add static prototype.
8558         (find_in_current_zip): Likewise.  Also remove unused parameter,
8559         all callers changed.
8560         (read_class): Initialize variable `saved_pos'.
8561
8562         * jcf-reader.c (jcf_parse_preamble): Mark variables
8563         `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
8564
8565         * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
8566         (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
8567         (java_parse_doc_section): Initialize variable `seen_star'.
8568         (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
8569         (java_lex_error): Mark parameters `msg' and `forward' with
8570         ATTRIBUTE_UNUSED.
8571         (java_get_line_col): Mark parameters `filename' and `line' with
8572         ATTRIBUTE_UNUSED.
8573
8574         * parse-scan.y: Include toplev.h.
8575         (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
8576
8577         * parse.h: use `struct JCF', not plain `JCF'.
8578         (java_parser_context_save_global, java_expand_classes
8579         java_parser_context_restore_global, java_parse): Add prototypes.
8580
8581         * typeck.c (convert_ieee_real_to_integer): Remove unused variable
8582         `node'.
8583
8584 Wed Feb 24 16:13:59 1999  Per Bothner  <bothner@deneb.cygnus.com>
8585
8586         *  check-init.c (check_init):  COPYN takes word count, not bit count.
8587
8588 Fri Feb 26 14:06:21 1999  Per Bothner  <bothner@cygnus.com>
8589
8590         * typeck.c (convert_ieee_real_to_integer):  Use save_expr instead of
8591         explicit build_decl.  (Avoids crash in reload when optimizing.)
8592
8593 Thu Feb 25 21:05:04 1999  Per Bothner  <bothner@cygnus.com>
8594
8595         * decl.c (complete_start_java_method):  Handle synchronized method
8596         even when compiling from bytecode.
8597
8598 1999-02-26  Tom Tromey  <tromey@cygnus.com>
8599
8600         * gjavah.c (add_class_decl): Only generate `#include' if outer
8601         class is not the name of the class we are processing.  Correctly
8602         append `.h' in #include.
8603         (process_file): Clean up newlines around generated `#include's.
8604         (decode_signature_piece): Correctly handle inner classes.
8605         (struct include): New structure.
8606         (all_includes): New global.
8607         (print_include): New function.
8608         (add_class_decl): Use it.
8609         (process_file): Likewise.
8610         (add_class_decl): Generate include for java-array.h if array
8611         seen.
8612         (process_file): Don't generate java-array.h include.
8613
8614         * gjavah.c (add_namelet): Check for standard package names here.
8615         (add_class_decl): Don't check for standard package names here.
8616
8617 1999-02-25  Tom Tromey  <tromey@cygnus.com>
8618
8619         * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
8620         When reading a zip file, only use strncmp if both strings are
8621         bigger than the buffer length.  Initialize `k' when looping
8622         through zip file.
8623
8624 1999-02-24  Tom Tromey  <tromey@cygnus.com>
8625
8626         * gjavah.c (struct namelet): New structure.
8627         (add_namelet): New function.
8628         (print_namelet): New function.
8629         (print_class_decls): Use add_namelet and print_namelet to generate
8630         namespaces and not classes.
8631         (method_printed): New global.
8632         (HANDLE_END_METHOD): Examine method_printed.
8633         (print_method_info): Set method_printed when required.  Print
8634         error if function to be ignored is marked virtual.  Handle $finit$
8635         method.
8636         (METHOD_IS_FINAL): New macro.
8637         (print_field_info): Use it.
8638         (HANDLE_METHOD): Clear method_printed.
8639         (method_pass): New global.
8640         (HANDLE_END_FIELD): Call add_class_decl on the first pass.
8641         (process_file): Do two passes over both fields and methods.
8642         (HANDLE_METHOD): Examine method_pass.
8643         (root): New global.
8644         (add_class_decl): New function.
8645         (print_class_decls): Don't scan over entire constant pool.
8646
8647 1999-02-23  Tom Tromey  <tromey@cygnus.com>
8648
8649         * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
8650         disable linking in that case.
8651
8652 1999-02-20  Tom Tromey  <tromey@cygnus.com>
8653
8654         * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
8655         not 0x1f.
8656
8657 Sun Feb 21 14:56:11 1999  Per Bothner  <bothner@cygnus.com>
8658
8659         * decl.c (build_result_decl), java-tree.h:  New method.
8660         (complete_start_java_method):  Handle synchronized methods.
8661         Don't build DECL_RESULT here.  (Ordering dependency problem.)
8662         (start_java_method):  Call build_result_decl here instead  ...
8663         * parse.y (java_complete_expand_method):  ... and here.
8664         (expand_start_java_method): Don't call complete_start_java_method here.
8665         (java_complete_expand_method):  Call it here instead.
8666         * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
8667         * java-tree.h:  ... here.
8668
8669         * expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
8670         * parse.y (java_complete_lhs):  Don't call force_evaluation_order
8671         for ARRAY_REF - it doesn't work when array bounds are checked.
8672         (patch_array_ref):  Handle it here instead.
8673
8674         * jcf-write.c (generate_classfile):  Emit "Exceptions" attribute.
8675
8676 Fri Feb 19 15:35:01 1999  Per Bothner  <bothner@cygnus.com>
8677
8678         Force left-to-right evaluation of binary operations etc.
8679         * expr.c (force_evaluation_order), java-tree.h:  New function.
8680         * parse.y (java_complete_lhs):  Pass binary operations, procedure
8681         calls, and ARRAY_REFs to force_evaluation_order.
8682         (various):  Set TREE_SIDE_EFFECTS more carefully.
8683
8684         Tolerate random (non-UTF8) encoding in comments without complaining.
8685         * lex.c (java_read_char):  Return 0xFFFE if bad UTF8 encoding.
8686         (java_is_eol):  Handle '\r' followed by '\n' instead of vice versa.
8687
8688         * parse.y (resolve_qualified_expression_name):  Handle error_mark.
8689         (java_complete_node case EXPR_WITH_FILE_LOCATION):  Likewise.
8690
8691         * parse.y (java_complete_lhs):  Ignore an empty statement in a
8692         COMPOUND_EXPR.  Don't complain about empty statement after return.
8693
8694 Fri Feb 19 13:00:56 1999  Per Bothner  <bothner@cygnus.com>
8695
8696         * parse.y (obtain_incomplete_type):  Don't wrap unknown types
8697         in TREE_LIST - just chain the POINTER_TYPEs together.
8698         (resolve_class):  If type already resolved, return decl.
8699         After resolving, update TREE_TYPE(class_type), and name (if array).
8700         * parse.h (do_resolve_class), parse.y:  Make non-static.
8701         * class.c (maybe_layout_super_class):  Take this_class argument.
8702         Do do_resolve_class if necessary.
8703         (layout_class, layout_class_methods): Adjust calls appropriately.
8704         * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
8705         JDEP_RESOLVED_P):  Redefined for new TREE_LIST-less convention.
8706         * typeck.c (build_java_array_type):  Don't call layout_class.
8707
8708 Wed Feb 17 15:47:20 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8709
8710         * parse.y (check_pkg_class_access): Allow private class access
8711         within the same package.
8712         (strip_out_static_field_access_decl): New function.
8713         (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
8714         operator argument before testing its nature.
8715
8716 Wed Feb  3 12:38:43 1999  Per Bothner  <bothner@cygnus.com>
8717
8718         * java-tree.def (FINALLY_EXPR):  Removed.  (Now uses TRY_FINALLY_EXPR.)
8719         (TRY_EXPR):  Simplify - it no longer has a finally clause.
8720         * check-init.c (check_init):  Handle TRY_FINALLY_EXPR.
8721         Simpler handling of TRY_EXPR, which no longer has a finally clause.
8722         * expr.c (java_lang_expand_expr):  Likewise.
8723         * java-tree.h (CATCH_EXPR_GET_EXPR):  Removed - no longer needed.
8724         * parse.h (java_get_catch_block), parse.y:  Removed - no longer needed.
8725         * parse.y (java_complete_lhs):  Add support for TRY_FIANLLY_EXPR.
8726         (build_try_statement):  Remove finally parameter and handling.
8727         (build_try_finally_statement):  New function.
8728         (patch_try_statement):   No longer need to support finally clause.
8729         (try_statement):  Update grammar action rules.
8730         * jcf-write.c (generate_bytecode_insns):  Handle TRY_FINALLY_EXPR.
8731         Simpler handling of TRY_EXPR, which no longer has a finally clause.
8732
8733 1998-11-26  Andrew Haley  <aph@viagra.cygnus.co.uk>
8734
8735         * jcf-parse.c (get_constant): Add braces around computation of 'd'
8736         when REAL_ARITHMETIC is not defined.  [Oct 26 fix got overwritten -PB]
8737
8738 1999-02-17  Andrew Haley  <aph@cygnus.com>
8739
8740         * class.c (build_utf8_ref): Back out broken patch which was
8741         intended to to output signatures using '.' as a separator.
8742
8743         * class.c (make_class_data): Output signatures using '.' as a
8744         separator, rather than '/'.
8745         (mangled_classname): Likewise.
8746         (make_field_value): Likewise.
8747         (make_method_value): Likewise.
8748         * constants.c (alloc_class_constant): Likewise.
8749         * expr.c (build_invokeinterface): Likewise.
8750
8751 Thu Feb 11 21:25:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8752
8753         * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
8754         of an ancient workaround.
8755
8756 Wed Feb 10 23:27:33 1999  Jeffrey A Law  (law@cygnus.com)
8757
8758         * jvspec.c (xmalloc): Kill the prototype.  It does not belong
8759         here anymore.
8760
8761 1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8762
8763         * lex.c (yylex): Encode \0 as UTF8.
8764
8765 1999-02-10  Tom Tromey  <tromey@cygnus.com>
8766
8767         * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
8768         * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
8769         (libgcj_zip): Renamed.
8770         * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
8771         LIBJAVA_ZIP_FILE.
8772         (jcf_path_init): Use LIBGCJ_ZIP_FILE.
8773
8774         * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
8775         (GC_NAME): Renamed -lgc to -lgcjgc.
8776
8777 Tue Feb  9 19:31:09 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8778
8779         * lex.c (java_lang_cloneable): Initialize.
8780         * parse.y (java_lang_cloneable): New static variable.
8781         (qualify_ambiguous_name): Take CONVERT_EXPR into account when
8782         doing one more qualification round.
8783         (valid_ref_assignconv_cast_p): Reject null source or
8784         destination. Allow an array to be cast into java.lang.Cloneable.
8785         (patch_cast): Swapped two first arguments to first call to
8786         valid_ref_assignconv_cast_p.
8787
8788 Mon Feb  8 11:50:50 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8789
8790         * parse.h: DECL_P renamed JDECL_P.
8791         * parse.y: DECL_P replaced by JDECL_P.
8792         (build_array_from_name): Always use pointer's type.
8793         (patch_bc_statement): Extra code to search continue target in a
8794         for loop. Fixed comments. Continue target is current loop when
8795         unlabeled.
8796
8797 1999-02-05  Andrew Haley  <aph@cygnus.com>
8798
8799         * class.c (make_class_data): The superclass of an interface should
8800         be null, not class Object.
8801
8802         * lex.c (java_lex): Sign extend hex literals.
8803
8804 1999-02-04  Andrew Haley  <aph@cygnus.com>
8805
8806         * class.c (build_utf8_ref): Output signatures using '.' as a
8807         separator, rather than '/'.
8808         (make_class_data): Likewise.
8809
8810 Wed Feb  3 22:50:17 1999  Marc Espie <Marc.Espie@liafa.jussieu.fr>
8811
8812         * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
8813         mkstemp.o.  Get them from libiberty now.
8814
8815 Tue Feb  2 19:49:12 1999  Jeffrey A Law  (law@cygnus.com)
8816
8817         * jcf-io.c: Do not include sys/stat.h or sys/wait.h
8818
8819 Tue Feb  2 20:04:50 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8820
8821         * jvspec.c (xmalloc): Fix the prototype to match the one obtained
8822         from libiberty.h
8823
8824 Tue Feb  2 10:39:47 1999  Per Bothner  <bothner@cygnus.com>
8825
8826         Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
8827         * jcf-write.c (generate_bytecode_return):  New function.
8828         (generate_bytecode_insns):  Use it, for RETURN_EXPR.
8829
8830         * jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
8831         generate special [fd]const_[01] instructions.
8832
8833         * jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
8834
8835         * verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
8836         handling OPCODE_lookupswitch or OPCODE_tableswitch.
8837
8838 Mon Feb  1 20:44:47 1999  Per Bothner  <bothner@cygnus.com>
8839
8840         * parse.y (patch_method_invocation):  Handle calling static methods,
8841         even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
8842
8843         * parse.y (java_complete_lhs):  Don't complain about unreachable
8844         exit condition in a do-while statement.
8845
8846 Fri Jan 29 18:19:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8847
8848         * lex.c (java_read_char): Fixed utf8 decoding.
8849         (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
8850         range.
8851         * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
8852         comments. Local variable `all_primitive' is gone. Broadened
8853         acceptance of `0' to floating point targets. `long' can now be
8854         widened to `double' or `float'.
8855         (valid_method_invocation_conversion_p): Added leading
8856         comment. Fixed tabulation.
8857         (build_string_concatenation): Optimize out left or right empty
8858         string constants.
8859
8860 Thu Jan 28 18:51:26 1999  Per Bothner  <bothner@cygnus.com>
8861
8862         * jcf-write.c (localvar_alloc):  Only emit entry for
8863         LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
8864         (generate_bytecode_insns):  Only call put_linenumber if
8865         debug_info_level > DINFO_LEVEL_NONE.
8866         * jvspec.c (lang_specific_driver):  If no -O* or -g* option
8867         is specified, add -g1 (for compatibility wih javac).
8868
8869 Thu Jan 28 09:17:51 1999  Hans-Peter Nilsson  <hp@axis.se>
8870
8871         * java/Makefile.in: Add missing dependencies for jcf-dump.o,
8872         gjavah.o, check-init.o, jv-scan.o
8873
8874 Mon Feb  1 09:50:48 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8875
8876         * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
8877
8878         * gjavah.c: Include config.h and system.h.
8879
8880         * javaop.h (inline): Don't define, its handled by system.h.
8881         (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
8882         from `inline' to `static inline'.
8883
8884         * jcf.h (inline): Don't define, its handled by system.h.
8885
8886         * lex.c (inline): Likewise.
8887
8888 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
8889
8890         * lang-specs.h: Map -Qn to -fno-ident.
8891
8892 Fri Jan 29 16:51:56 1999  Richard Henderson  <rth@cygnus.com>
8893
8894         * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
8895
8896 1999-01-29  Tom Tromey  <tromey@cygnus.com>
8897
8898         * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
8899         then cast it to Object before calling `append' method.
8900
8901 Thu Jan 28 14:45:39 1999  Per Bothner  <bothner@cygnus.com>
8902
8903         * check-init.c (check_bool2_init, check_bool_init, check_init):
8904         Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
8905         * jcf-write.c (generate_bytecode_insns):  Likewise.
8906
8907 Thu Jan 28 11:50:11 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8908
8909         * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
8910         * parse.y (patch_cast): Allow a boolean to be cast into a
8911         boolean.
8912
8913 Wed Jan 27 10:19:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8914
8915         * parse.y: (class_declaration:): Fixed indentation.
8916         (class_member_declaration:): Extra `;' after field declaration now
8917         accepted.
8918         (interface_declaration:): Removed debug messages in error reports.
8919         (patch_binop): Nodes created and returned inherit the orignal
8920         node's COMPOUND_ASSIGN_P flag value.
8921         (patch_cast): Fix cast from char to floating point.
8922
8923 Mon Jan 25 17:39:19 1999  Andrew Haley  <aph@cygnus.com>
8924
8925         * except.c, java-except.h (expand_resume_after_catch): new
8926         function.
8927         * expr.c (java_lang_expand_expr): call expand_resume_after_catch
8928         to branch back to main flow of control after a catch block.
8929
8930 Sat Jan 23 23:02:43 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8931
8932         * Makefile.in (parse.o): Depend on $(CONFIG_H) and
8933         $(srcdir)/../system.h.
8934         (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
8935         (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
8936         (jcf-write.o): Likewise.
8937         (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8938         (mangle.o): Depend on $(srcdir)/../toplev.h.
8939         (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8940         (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
8941
8942         * class.c: Include output.h and parse.h.
8943         (mangled_classname): Add the `const' keyword to a char*.
8944         (find_named_method): Hide unused function definition.
8945         (build_utf8_ref): Change type of variable `c' to unsigned char.
8946         Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
8947         (build_class_ref): Add the `const' keyword to a char*.
8948         (layout_class_method): Remove unused variable `buf'.
8949
8950         * decl.c (find_local_variable): Remove unused variable `rtl'.
8951         (pushdecl): Likewise for variables `different_binding_level' and
8952         `oldglobal'.
8953         (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
8954         (maybe_build_cleanup): Likewise for parameter `decl'.
8955
8956         * except.c (expand_start_java_handler): Mark parameter `range'
8957         with ATTRIBUTE_UNUSED.
8958
8959         * expr.c: Include except.h.
8960         (pop_type): Remove unused variable `i'.
8961         (pop_value): Likewise for variables `n_words' and `i'.
8962         (expand_java_arrayload): Likewise for variable `convert'.
8963         (java_lang_expand_expr): Likewise for variables `op0', `type',
8964         `mode', `unsignedp', `node' and `elements'.
8965         (expand_byte_code): Likewise for variables `prev_eh_ranges' and
8966         `eh_ranges'.
8967         (process_jvm_instruction): Add a `const' qualifier to a char*.
8968
8969         * gjavah.c (output_directory): Add the `const' keyword to a char*.
8970         (temp_directory): Likewise.
8971         (print_c_decl): Likewise.
8972         (print_method_info): Likewise.
8973         (decode_signature_piece): Likewise.
8974         (print_mangled_classname): Likewise.
8975
8976         * java-except.h: Provide prototypes for maybe_start_try,
8977         maybe_end_try and add_handler.
8978
8979         * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
8980         (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
8981         (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
8982         init_expr_processing, push_super_field, init_class_processing,
8983         can_widen_reference_to, class_depth, verify_jvm_instructions,
8984         maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
8985         set_local_type, merge_type_state, push_type, load_type_state,
8986         add_interface, find_in_current_zip, append_gpp_mangled_classtype,
8987         emit_unicode_mangled_name): Add prototypes.
8988
8989         * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
8990         (print_signature_type): Use ISDIGIT, not isdigit.
8991         (print_signature): Remove unused variable `j'.
8992
8993         * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
8994         int when comparing against one.
8995
8996         * jcf-parse.c: Include toplev.h.
8997
8998         * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
8999         (localvar_free): Remove unused variable `i'.
9000         (generate_bytecode_conditional): Likewise for variable `kind'.
9001
9002         * jv-scan.c: Include config.h and system.h.  Remove redundant
9003         OS header and gansidecl.h includes.
9004         (warning): Add the `const' keyword to a char*.  Also add
9005         ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
9006         __STDC__, when determining whether to use ANSI-isms.
9007         (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
9008         (xmalloc): Don't redundantly prototype here.
9009         (main): Remove unused parameter `envp'.  Also fix the arguments
9010         passed to function `fatal' to match the format specifier.
9011
9012         * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
9013
9014         * mangle.c: Include toplev.h.
9015         (emit_unicode_mangled_name): Declare parameter `len'.
9016
9017         * parse.y (parse_warning_context): Add the `const' keyword to a
9018         char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
9019         `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
9020         (issue_warning_error_from_context): Add the `const' keyword to
9021         a char*.
9022         (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
9023         not `__STDC__' for whether to use ANSI-isms.
9024
9025         * typeck.c (incomplete_type_error): Mark parameters `value' and
9026         `type' with ATTRIBUTE_UNUSED.
9027         (parse_signature_type): Use ISDIGIT, not isdigit.
9028
9029         * verify.c (check_pending_block): Add the `const' keyword to a char*.
9030         (verify_jvm_instructions): Likewise.  Remove unused variables
9031         `field_name' and `default_val'.
9032
9033         * zextract.c: Include config.h and system.h.  Remove redundant
9034         OS header includes.
9035
9036         * zipfile.h: Prototype `read_zip_archive'.
9037
9038 Thu Jan 21 16:00:06 1999  Andrew Haley  <aph@cygnus.com>
9039
9040         * typeck.c (convert): Allow conversions to void type: some
9041         optimizations in gcc do this.
9042
9043 Thu Jan 21 15:21:49 1999  Andrew Haley  <aph@cygnus.com>
9044
9045         * typeck.c (convert_ieee_real_to_integer): New function.
9046         (convert): When not using fast-math and using hardware fp, convert
9047         an IEEE NaN to zero.
9048
9049 1999-01-18  Andrew Haley  <aph@cygnus.com>
9050
9051         * parse.y (patch_binop): Do a type conversion from signed to
9052         unsigned and then back to signed when a ">>>" is found.
9053
9054 Sun Jan 17 22:34:22 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9055
9056         * java-tree.h: (check_for_initialization): Added prototype.
9057         * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
9058         * parse.y (do_resolve_class): Removed unused locals.
9059         (read_import_dir): Likewise.
9060         (resolve_qualified_expression_name): Array creation
9061         expressions are valid primary expressions.
9062         (qualify_ambiguous_name): Likewise.
9063         (patch_synchronized_statement): Removed unused local.
9064
9065 Sun Jan 17 21:55:42 1999  Jeffrey A Law  (law@cygnus.com)
9066
9067         * Makefile.in (zextract.o): Add dependencies.
9068
9069         * Makefile.in: Do not put ^Ls at the start of a line.
9070
9071 Fri Jan 15 20:16:20 1999  Per Bothner  <bothner@cygnus.com>
9072
9073         * expr.c (process_jvm_instruction):  Coerce to correct Throwable
9074         sub-type the result of the call that gets the exception value.
9075
9076         * parse.y (java_complete_expand_methods):  If flags_syntax_only,
9077         don't call finish_class.
9078
9079         * parse.y (java_check_regular_methods):  If METHOD_PRIVATE,
9080         clear found before continuing.
9081
9082         * verify.c (verify_jvm_instructions):  On an array load, allow
9083         and handle top of stack to be TYPE_NULL.
9084
9085         * gjavah.c (generate_access):  Translate Java package private or
9086         protected access to C++ public, but with a comment.
9087
9088 1999-01-13  Andrew Haley  <aph@cygnus.com>
9089
9090         * expr.c (generate_name): Name prefix changed to avoid clashes
9091         with assembler temp labels.
9092
9093         * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
9094         MODIFY_EXPR.  Without this, code for the assignement may not be
9095         generated at all and the synchronized statement will read an
9096         uninitialized variable.
9097
9098 Wed Jan 13 01:24:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9099
9100         * class.c (maybe_layout_super_class): Fixed returned value.
9101         * lex.c: Added 1999 to the copyright.
9102         (java_init_lex): Initialize java_lang_imported.
9103         * lex.h: Added 1999 to the copyright.
9104         * parse.h: Added 1999 to the copyright.
9105         (REGISTER_IMPORT): Fixed typo in trailing macro.
9106         (CURRENT_OSB): New macro.
9107         (struct parser_ctxt): New fields osb_depth, osb_limit.
9108         * parse.y (java_lang_id): New global variable.
9109         (type_import_on_demand_declaration): Don't import java.lang.* twice.
9110         (array_creation_expression:): Use CURRENT_OSB.
9111         (dims:): Uses a stack to keep track of array dimensions.
9112         (cast_expression:): Use CURRENT_OSB.
9113         (find_expr_with_wfl): Return NULL if node found doesn't meet the
9114         conditions.
9115         (register_fields): Fixed typos in comment.
9116         (check_method_redefinition): Fixed comment indentation.
9117         (java_check_regular_methods): Set saved found wfl to NULL after
9118         having reinstalled it in the previously found DECL_NAME.
9119
9120 Sun Jan 10 13:36:14 1999  Richard Henderson  <rth@cygnus.com>
9121
9122         * gjavah.c (java_float_finite): Use a union to do type punning.
9123         (java_double_finite): Likewise.
9124
9125 Sat Jan  9 11:25:00 1999  Per Bothner  <bothner@cygnus.com>
9126
9127         * parse.y (build_new_array_init):  Don't set EXPR_WFL_LINECOL
9128         on CONSTRUCTOR (since that trashes TREE_CST_RTL).
9129         (patch_new_array_init):  Clear TREE_CONSTANT also if INDIRECT_REF.
9130         (register_fields):  Set TREE_STATIC on NEW_ARRAY_INIT, not on
9131         CONSTRUCTOR (which causes expand_expr to call output_constant_def).
9132         * expr.c (java_lang_expand_expr):  Check TREE_STATIC of NEW_ARRAY_INIT.
9133
9134 Fri Jan  8 15:48:03 1999  Per Bothner  <bothner@cygnus.com>
9135
9136         * check-init.c (check_init):  If compiling to native, we don't
9137         see THROW_EXPR.  Instead, look for a call to throw_node (_Jv_Throw).
9138
9139 1999-01-08  Tom Tromey  <tromey@cygnus.com>
9140
9141         * parse-scan.y (variable_declarator_id): Set or increment
9142         bracket_count.
9143         (bracket_count): New global.
9144         (formal_parameter): Handle case where bracket pairs trail variable
9145         declarator id.
9146
9147 1999-01-07  Andrew Haley  <aph@viagra.cygnus.co.uk>
9148
9149         * jcf-parse.c (yyparse): variable len changed from a char to an
9150         int to prevent overflow.
9151
9152 Wed Jan  6 17:19:46 1999  Per Bothner  <bothner@cygnus.com>
9153
9154         * java-tree.h:  Declare read_class.
9155         * jcf-parse.c (read_class):  New function.
9156         (load_class):  Now just call read_class.
9157
9158         * java-tree.h (java_parse_abort_on_error):  Only return if new errors.
9159         * jcf-parse.c (parse_source_file):  Declare save_error_count,
9160         which is needed by java_parse_abort_on_error macro,
9161         * parse.y (java_layout_classes, java_expand_classes):  Likewise.
9162
9163         * parse.y (register_fields):  Set TREE_STATIC flag of NEW_ARRAY_INIT
9164         constructor, if initializing a static field.
9165         (patch_new_array_init):  Set TREE_CONSTANT if it is.
9166         * expr.c (java_lang_expand_expr):  For a static array constructor
9167         of primitive elements, allocate the array itself statically.
9168         Disabled until we can set the vtable field statically.
9169
9170         * check-init.c:  New file.  Checks for definite assignment.
9171         * Makefile.in (JAVA_OBJS):  Add check-init.o.
9172         * parse.y (java_complete_expand_method): Call check_for_initialization.
9173         * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY):  Moved to java-tree.h.
9174
9175 Wed Jan  6 14:53:10 1999  Graham <grahams@rcp.co.uk>
9176
9177         * parse.y : include system.h instead of including
9178         standard headers directly with the exception of <dirent.h>.
9179
9180 Wed Jan  6 16:20:06 1999  Per Bothner  <bothner@cygnus.com>
9181
9182         * lex.h:  Moved static function declarations to lex.c,
9183         to shut up some -Wall warnings.
9184         * lex.c:  Static function declarations moved here.
9185         * jcf-dump.c:  Small fixes to shut up -Wall warnings.
9186
9187 Tue Jan  5 22:15:40 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9188
9189         * Make-lang.in ($(GCJ).o): Depend on prefix.h.
9190
9191 Tue Dec 22 11:25:19 1998  Per Bothner  <bothner@cygnus.com>
9192
9193         * expr.c (process_jvm_instruction):  Do load_type_state after JSR.
9194         * verify.c (verify_jvm_instructions):  Fix off-by-one error.
9195
9196         * jcf-write.c (CHECK_PUT):  Add (void) cast to avoid -Wall warnings.
9197         (localvar_alloc):  Change return type to void,
9198         (emit_unop):  Remove unused variable size.
9199
9200         * jcf-write.c (struct jcf_block):  Add new union.
9201         (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC):  New macros.
9202         (call_cleanups):  New functions.
9203         (struct jcf_partial):  New fields num_finalizers and return_value_decl.
9204         (generate_bytecode_insns):  Support CLEANUP_POINT_EXPR and
9205         WITH_CLEANUP_EXPR.  Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
9206         * lang.c (lang_init):  Call using_eh_for_cleanups.
9207         * parse.y (java_complete_lhs):  For SYNCHRONIZED_EXPR, defer
9208         completing operands to patch_synchronized_statement.
9209         Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
9210         (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
9211         WITH_CLEANUP_EXPR instead of TRY_EXPR.
9212
9213 Sun Dec 20 16:15:44 1998  John F. Carr  <jfc@mit.edu>
9214
9215         * Make-lang.in: Comment out control-Ls; they upset some makes.
9216
9217 1998-12-18  Tom Tromey  <tromey@cygnus.com>
9218
9219         * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
9220         consistently.
9221
9222 1998-12-17  Tom Tromey  <tromey@cygnus.com>
9223
9224         * parse.y (DIR_SEPARATOR): New define.
9225         (check_class_interface_creation): Use it.
9226
9227         * parse-scan.y (report_main_declaration): Recognize
9228         `java.lang.String' in argument to main.
9229
9230 Wed Dec 16 16:18:59 1998  Per Bothner  <bothner@cygnus.com>
9231
9232         * parse.y (create_interface):  Remove bogus test.
9233
9234 Wed Dec 16 14:42:19 1998  Per Bothner  <bothner@cygnus.com>
9235
9236         * jcf-parse.c (get_constant):  Set TREE_TYPE for string constants.
9237         (HANDLE_CONSTANTVALUE):  If flag_emit_class_files, call get_constant.
9238
9239 1998-12-16  Tom Tromey  <tromey@cygnus.com>
9240
9241         * parse-scan.y (qualified_name): Use correct sprintf format.
9242
9243 1998-12-15  Tom Tromey  <tromey@cygnus.com>
9244
9245         * gjavah.c (print_field_info): Changed how most negative number is
9246         printed.
9247
9248 Mon Dec 14 18:49:29 1998  Per Bothner  <bothner@cygnus.com>
9249
9250         * parse.y (fold_constant_for_init):  New function.
9251         (resolve_expression_name):  Don't replace static final
9252         constant-initialized fields by its value.
9253         (java_complete_lhs):  New.  Same as java_complete_tree, except does
9254         not replace static final constant-initialized fields by their values.
9255         (register_fields):  If there is an initializer, set DECL_INITIAL and
9256         MODIFY_EXPR_FROM_INITIALIZATION_P.
9257         (java_complete_tree):  For MODIFY_EXPR, use java_complete_lhs for lhs.
9258         Only call patch_initialized_static_field if
9259         MODIFY_EXPR_FROM_INITIALIZATION_P.
9260         (patch_initialized_static_field):  If not valid constant, clear
9261         DECL_INITIAL.
9262
9263         * parse.y (lookup_field_wrapper):  Fix thinko.
9264
9265         * parse.y (java_complete_tree):  In EXPR_WITH_FILE_LOCATION,
9266         set and restore global lineno.
9267
9268 1998-12-14  Tom Tromey  <tromey@cygnus.com>
9269
9270         * gjavah.c (print_field_info): If value to print is the smallest
9271         value of its size, then print as hex to avoid later warnings from
9272         C++ compiler.
9273
9274 1998-12-14  Tom Tromey  <tromey@cygnus.com>
9275
9276         * gjavah.c (decompile_method): Decompile `return null'.
9277         (process_file): Generate `#pragma interface'.
9278         (method_declared): New global.
9279         (print_method_info): Set it.
9280         (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
9281         (print_method_info): Handle abstract methods.
9282
9283 Sun Dec 13 17:31:40 1998  Per Bothner  <bothner@cygnus.com>
9284
9285         * parse.y (patch_method_invocation):  If class_decl is null
9286         (e.g. an array type), use original type.
9287
9288         * parse.y (check_thrown_exceptions):  Temporary hack to suppress
9289         errors about uncaught exception from clone (of array, specifically).
9290
9291 1998-12-13  Tom Tromey  <tromey@cygnus.com>
9292
9293         * gjavah.c (decompile_method): Handle all types of `return'
9294         opcode.  Decompile `return this' and `return'.
9295         (method_access): New global.
9296         (print_method_info): Set it.
9297         (decompile_method): Don't decompile a synchronized method.
9298
9299 1998-12-13  Tom Tromey  <tromey@cygnus.com>
9300
9301         * jcf-reader.c (jcf_parse_one_method): Recognize
9302         HANDLE_END_METHOD.
9303         * gjavah.c (HANDLE_END_METHOD): New macro.
9304         (HANDLE_CODE_ATTRIBUTE): New macro.
9305         (decompile_method): New function.
9306         (print_method_info): Don't print `;\n' at end of function decl.
9307         Include java-opcodes.h.
9308         (decompiled): New global.
9309
9310 Sat Dec 12 20:13:19 1998  Per Bothner  <bothner@cygnus.com>
9311
9312         * class.c (build_class_ref):  Handle PRIMTYPE.class if
9313         flag_emit_class_files.
9314         * expr.c (expand_java_field_op):  Don't optimize java.lang.XXX.TYPE
9315         if flag_emit_class_files.
9316         * parse.y (java_complete_tree):  Pre-liminary support for
9317         COMPONENT_REF - only to handle PRIMCLASS.TYPE.
9318
9319         * parse.y (patch_synchronized_statement):   Don't call monitorexit
9320         unless block CAN_COMPLETE_NORMALLY.  Propagate that flag properly.
9321
9322         * java-tree.h (DECL_LOCAL_STATIC_VALUE):  Removed - no longer used.
9323
9324         * zipfile.h (opendir_in_zip):  New declaration.
9325         * jcf-io.c (saw_java_source):  Moved to jcf-parse.c.
9326         (opendir_in_zip):  New function, using code from open_in_zip.
9327         (open_in_zip):  Call opendir_in_zip.
9328         (find_class):  Remove no-longer-used do_class_file parameter,
9329         but add source_ok parameter.  Change logic so if we find a .java file,
9330         we don't look for .class in later classpath emtries.
9331         * jcf-parse.c (load_class):  Pass saw_java_source to find_class.
9332         (jcf_figure_file_type):  Only call open_in_zip if correct magic number.
9333         * gjavah.c: Update call to find_class.
9334         * jcf-dump.c:  Likewise.
9335
9336         * jcf-write.c (put_linenumber):  Handle duplicate line numbers.
9337         (generate_bytecode_insns):  For EXPR_WITH_FILE_LOCATION, do
9338         nothing if body is empty_stmt_node.
9339         Various little fixes so SP gets correctly adjusted.
9340         For NEW_ARRAY_INIT, handle IGNORE_TARGET.
9341         For CALL_EXPR, test if static first.
9342         (generate_classfile):  Ignore fields that are DECL_ARTIFICIAL,
9343         such as the ones we create for Object and Class.
9344         Set and restore current_function_decl.
9345         * parse.y:  Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
9346         (note_possible_classname):  New function.
9347         (read_import_entry):  Removed.  Merged with read_import_dir.
9348         (read_import_dir):  Don't call find_class - that only gives us
9349         the first classpath entry having the needed package.
9350         Use the struct buffer data structure from buffer.h.
9351         (read_import_dir, find_in_imports_on_demand):  The remembered
9352         class names now use '.' (not '/') as package separator.
9353
9354         * parse.y (java_complete_expand_methods):  Call write_classfile
9355         here, and not in java_expand_classes (which only gets first class).
9356
9357 Sat Dec 12 19:46:04 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9358
9359         * parse.y (<type_declaration>):  Do maybe_generate_clinit last.
9360         (register_fields):  If a static fields has an initializer, just
9361         chain it on ctxp->static_initialized, and handle later.
9362         (java_complete_expand_methods):  Force <clinit> first.
9363         (resolve_expression_name, resolve_field_access):  Just get DECL_INITIAL
9364         - it's already been completed.
9365         (patch_initialized_static_field):  New function.
9366         (java_complete_field):  Call it.
9367
9368 Sat Dec 12 19:21:11 1998  Per Bothner  <bothner@cygnus.com>
9369
9370         * expr.c (encode_newarray_type, build_new_array):  New functions.
9371         * java-tree.h:  Declare build_new_array.
9372         * jcf-write.c (patch_newarray):  Use build_new_array.
9373
9374         * expr.c (java_lang_expand_exp):  Support NEW_ARRAY_INIT.
9375         * jcf-write.c (generate_bytecode_insns):  Support NEW_ARRAY_INIT.
9376
9377         * parse.y (patch_new_array_init):  Re-organize.
9378         Now is passed the actual array (pointer) type of the value.
9379         Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
9380         (patch_array_constructor):  Removed - merged into patch_new_array_init.
9381         (java_complete_tree):  Update patch_new_array_init.
9382
9383         * jcf-write.c (find_constant_index):  New function.
9384         (generate_bytecode_insns):  Use find_constant_index.
9385         (generate_classfile):  Use find_constant_index for ConstantValue.
9386
9387 1998-12-11  Tom Tromey  <tromey@cygnus.com>
9388
9389         * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
9390         * decl.c (init_decl_processing): Renamed dtable -> vtable.
9391         * class.c (make_class_data): Renamed dtable -> vtable, and
9392         dtable_method_count -> vtable_method_count.
9393
9394 Thu Dec 10 20:00:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9395
9396         * decl.c (long_zero_node, float_zero_node, double_zero_node): New
9397         global variables, initialized.
9398         * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
9399         Declared new global variables.
9400         * lex.c (java_lex): Return long_zero_node, float_zero_node,
9401         double_zero_node, integer_zero_node upon direct matching.
9402         * parse.y (purify_type_name): Added function prototype.
9403         (duplicate_declaration_error_p): Consider new_type as potentially
9404         being a incomplete type. Use purify_type_name on type string.
9405         (method_header): saved_type: unused variable removed. Don't figure
9406         return type if method name is invalid.
9407         (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
9408         processed by patch_unaryop.
9409         (patch_unaryop): Fixed typo in comment. Re-convert pre/post
9410         increment/decrement node into its original type after binary
9411         numeric promotion on its operands.
9412
9413 Thu Dec 10 11:02:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9414
9415         * parse.y (array_initializer:): Array init operand is NULL_TREE
9416         instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
9417         now an error. Fixed indentation problems.
9418         (patch_string): Handle error_mark_node as an argument.
9419         (patch_new_array_init): Fixed indentation problems.
9420         (array_constructor_check_entry): Removed check on null wfl_value.
9421         Return an error if wfl_value's walk returns an error.
9422
9423 Wed Dec  9 15:37:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9424
9425         * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
9426         * lex.c (java_lex): Remember column position before advancing one
9427         token. Retain location information on OCB_TK.
9428         * lex.h (typedef struct java_lc): Added new field.
9429         * parse.h (GET_SKIP_TYPE): New macro.
9430         (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
9431         * parse.y (build_new_array_init, patch_new_array_init,
9432         patch_array_constructor, maybe_build_array_element_wfl,
9433         array_constructor_check_entry): New function prototypes.
9434         (switch_block:): Tagged <node>.
9435         (OCB_TK): Tagged <operator>.
9436         (array_initializer:): Installed actions.
9437         (variable_initializer): Build location information on element if
9438         necessary.
9439         (switch_statement:): Fixed indentation typo.
9440         (switch_block:): Redefined default action.
9441         (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
9442         (patch_assignment): Removed duplicate code.
9443         (maybe_build_array_element_wfl, build_new_array_init,
9444         patch_new_array_init, patch_array_constructor,
9445         array_constructor_check_entry): New functions.
9446
9447 Mon Dec  7 15:13:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9448
9449         * parse.y (array_initializer): Tagged <node>.
9450         (variable_initializer:): Use default rule.
9451         (array_initializer:): Defined actions.
9452         (variable_initializers:): Likewise.
9453         (resolve_qualified_expression_name): Use DECL_CONTEXT to build
9454         non-static field accesses.
9455         (patch_invoke): Fixed indentation typo.
9456         (java_complete_tree): Likewise.
9457         (build_labeled_block): Changed leading comment. Generate an error
9458         in case of duplicate loop labels.
9459         (patch_conditional_expr): Patch results of string concatenation
9460         operations.
9461
9462 Sun Dec  6 13:45:00 1998  Per Bothner  <bothner@cygnus.com>
9463
9464         * constants.c (find_methodref_index):  When the class is an interface,
9465         generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
9466
9467         * decl.c (finit_identifier_node):  Use "$finit$", rather than
9468         "<finit>" (which Sun's verifier rejects).
9469         * parse.y (maybe_generate_finit):  Leave out meaningless final flag.
9470         (generate_field_initialization_code):  Removed.
9471         (fix_constructors)  Don't add call to $finit$ here (wrong order).
9472         (patch_method_invocation):  Add $finit$ call here.
9473
9474         * java-tree.h (CALL_USING_SUPER):  New macro.
9475         * parse.y (patch_invoke):  Remove im local variable.
9476         (patch_method_invocation, patch_invoke):  Don't pass super parameter.
9477         (patch_invoke):  Use CALL_USING_SUPER instead of from_super parameter.
9478         (resolve_qualified_expression_name):  Maybe set CALL_USING_SUPER.
9479
9480         * jcf-write.c (get_access_flags):  Fix typo ACC_PUBLIC -> ACC_FINAL.
9481
9482         * parse.y (java_complete_tree):  Don't complain about unreachable
9483         statement if it is empty_stmt_node.
9484
9485         * jcf-write.c (find_constant_wide):  New function.
9486         (push_long_const):  Use find_constant_wide.
9487
9488         * jcf-write.c (generate_bytecode_insn):  Fix bug in switch handling.
9489         (generate_bytecode_insn):  Use correct dup variant for MODIFY_EXPR.
9490         Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
9491         Emit invokeinterface when calling an interface method.
9492         Emit invokespecial also when calling super or private methods.
9493
9494         * jcf-write.c (generate_classfile):  Emit ConstantValue attributes.
9495
9496 Sun Dec  6 13:21:18 1998  Per Bothner  <bothner@cygnus.com>
9497
9498         * jcf-dump.c (INVOKE):  If invokeinterface, print number of args.
9499
9500 Thu Dec  3 17:11:12 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9501
9502         * java-tree.h (java_layout_seen_class_methods): New function
9503         prototype.
9504         (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
9505         * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
9506         * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
9507         * parse.y (method_declarator:): Defined action.
9508         (issue_warning_error_from_context): input_filename saved, set to
9509         the appropriate value and restored after java_error is called.
9510         (build_unresolved_array_type): Fixed comment.
9511         (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
9512         (method_header): Deal with return type the same way type are
9513         handled for fields and method's parameters and local variables
9514         types are handled.
9515         (check_method_redefinition): Removed extra CR.
9516         (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
9517         (java_layout_seen_class_methods): New function.
9518         (java_layout_classes): Call java_layout_seen_class_methods.
9519
9520 Thu Dec  3 15:56:50 1998  Per Bothner  <bothner@cygnus.com>
9521
9522         * parse,y (patch_synchronized_statement):  Set CAN_COMPLETE_NORMALLY.
9523
9524 Thu Dec  3 15:08:30 1998  Per Bothner  <bothner@cygnus.com>
9525
9526         * jcf-dump.c (main):  Fix error message.
9527         * jcf-path.c (add_entry):  Style fix.
9528
9529 Wed Dec  2 15:52:25 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9530
9531         * class.c (layout_class_method): Call build_java_argument_signature
9532         on constructors too.
9533         * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
9534         (patch_method_invocation): Define a primary when resolving an
9535         expression name. Augmented comment on code checking illegal `this'
9536         usage. Loosened it test by accepting NEW_CLASS_EXPR.
9537
9538 Tue Dec  1 13:53:24 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9539
9540         * class.c (layout_class_method): Don't report error on non-static
9541         overriding static if the method is private.
9542         * java-tree.h (finish_class): Prototype added.
9543         * lex.c (java_get_line_col): Handle col argument -2 value.
9544         * parse.h: All static method declarations moved to parse.y.
9545         * parse.y: Now contains all static method declarations previously
9546         found in parse.h.
9547         (find_expr_with_wfl, missing_return_error,
9548         unreachable_stmt_error): New functions.
9549         (java_get_real_method_name): Identify constructors bearing class
9550         names in source code compiled classes only.
9551         (java_complete_expand_methods): Call missing_return_error.
9552         (invocation_mode): Private methods invoked as static methods.
9553         (java_complete_tree): Call unreachable_stmt_error.
9554
9555 1998-12-01  Tom Tromey  <tromey@cygnus.com>
9556
9557         * Makefile.in (+target): Removed.
9558         (+xmake_file): Likewise.
9559         (+tmake_file): Likewise.
9560         (.NOEXPORT): Removed duplicate.
9561
9562 Fri Nov 27 13:20:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9563
9564         * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
9565
9566         * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
9567
9568         * jvgenmain.c: Remove the xmalloc prototype, we get it from
9569         libiberty.h.  Provide an xmalloc definition.
9570
9571         * jvspec.c: Remove the xmalloc prototype.
9572
9573         * parse-scan.y: Include config.h and system.h.  Don't include
9574         OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
9575         Provide an xstrdup definition.
9576
9577 Thu Nov 26 22:03:58 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
9578
9579         * jcf-path.c (add_entry): Recognize ".jar" too.
9580         * lang-specs.h: Likewise.
9581
9582 Thu Nov 26 12:44:07 1998  Per Bothner  <bothner@cygnus.com>
9583
9584         * jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
9585         soft_monitorenter_node, soft_monitorexit_node, throw_node.
9586
9587         * jcf-write.c (generate_bytecode_insns):
9588         Handle pre/post-increment/decrement of long.
9589
9590         * jcf-write.c (generate_bytecode_insns):
9591         Handle missing exception handler (finally for synchronized).
9592
9593 Wed Nov 25 09:47:15 1998  Per Bothner  <bothner@cygnus.com>
9594
9595         * java-tree.h (end_params_node):  Declare global.
9596         * decl.c (end_params_node):  New global.
9597         (init_decl_processing, start_java_method):  Use end_params_node for
9598         end of list of parameter types.  Follows correct gcc conventions.
9599         * expr.c (pop_argument_types, pop_arguments):  Likewise.
9600         * lang.c (put_decl_node):  Likewise.
9601         * typeck.c (various places):  Likewise.
9602         * class.y (various places):  Likewise.
9603         * parse.y (various places):  Likewise.
9604
9605         * parse.y (java_complete_tree):  Move CAN_COMPLETE_NORMALLY.
9606         (build_jump_to_finally):  Add missing CAN_COMPLETE_NORMALLY.
9607
9608         * class.c:  Add #include flags.h, remove no-longer needed declaration.
9609
9610         * class.c (layout_class_method):  Remove commented-out code, re-format.
9611         Don't add vtable entry (or index) for private methods.
9612         * expr.c (expand_invoke):  A private method is implicitly final.
9613         * class.c (make_class_data):  If inlining or optimizing,
9614         skip private methods.
9615
9616         * class.c (finish_class):  New function.  Calls existing methods,
9617         but alls emits deferred inline functions.
9618         * jcf-parse.c (parse_class_file):  Call finish_class.
9619         * parse.y (java_complete_expand_methods):  Likewise.
9620
9621         * expr.c (build_java_binop):  Explicit default, to silence -Wall.
9622
9623         * expr.c (CHECK_PC_IN_RANGE):  Add void cast to kill warnings.
9624
9625 Wed Nov 25 00:50:58 1998  Marc Espie <espie@quatramaran.ens.fr>
9626
9627         * jcf-write.c (generate_bytecode_conditional): Fix typo.
9628
9629 Tue Nov 24 17:06:38 1998  Per Bothner  <bothner@cygnus.com>
9630
9631         * (generate_classfile): Always write class access flag with
9632         ACC_SUPER set.
9633
9634 Tue Nov 24 16:34:33 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9635
9636         * class.c (maybe_layout_super_class): New function.
9637         (layout_class): Reorganized. Loop on class methods dispatched into
9638         a new function. Call maybe_layout_super_class.
9639         (layout_class_methods, layout_class_method): New functions.
9640         * expr.c (expand_java_NEW): Call layout_class_methods on loaded
9641         class.
9642         (expand_invoke): Likewise.
9643         * java-tree.h (all_class_list): New global variable declared.
9644         (layout_class_methods, layout_class_method): New function
9645         prototypes.
9646         (LAYOUT_SEEN_CLASS_METHODS): New macro.
9647         * jcf-parse.c (all_class_list): New global variable.
9648         (load_class): Extended what class_or_name can be. Use parser
9649         context mechanism to save globals before calling jcf_parse.
9650         (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
9651         is set on the file name.
9652         (jcf_parse): Layout class methods when Object is loaded, otherwise
9653         record class in all_class_list for delayed method layout.
9654         (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
9655         * lang.c (put_decl_node): Decode <init> into the decl context
9656         class name.
9657         * lex.c (java_allocate_new_line): Use xmalloc.
9658         * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
9659         pointers, not TREE_LIST elements.
9660         (struct parser_ctxt): Fixed comment indentations, added comments
9661         and reordered some fields.
9662         (java_check_methods): Function prototype removed.
9663         * parse.y (java_push_parser_context): Use xmalloc.
9664         (java_parser_context_restore_global): Pop extra pushed ctxp only
9665         when there's nothing next.
9666         (maybe_create_class_interface_decl): Fixed comment, add new
9667         created class decl to all_class_list.
9668         (method_header): Use GET_REAL_TYPE on argument's types.
9669         (method_declarator): Use GET_REAL_TYPE, change type to the real
9670         type in TREE_LIST dependency node. Build argument list with the
9671         real type.
9672         (create_jdep_list): Use xmalloc. Removed allocation error message.
9673         (obtain_incomplete_type): Fixed leading comment. Broadened
9674         incoming argument meaning.
9675         (register_incomplete_type): Use xmalloc. Removed allocation error
9676         message.
9677         (safe_layout_class): Fixed leading comment.
9678         (jdep_resolve_class): Reversed if statement condition and switch
9679         if and else bodies.
9680         (resolve_and_layout): Fixed leading comment. Broadened incoming
9681         argument meaning.
9682         (complete_class_report_errors): New local variable name, for
9683         clarity. purify_type_name used for all error cases.
9684         (java_get_real_method_name): Stricter check on constructors.
9685         (java_check_regular_methods): Reverse methods list only if not
9686         already laid out. Layout artificial constructor.
9687         (java_check_methods): Deleted.
9688         (source_start_java_method): Obtain incomplete type for patchable
9689         method arguments.
9690         (java_layout_classes): Fixed leading comment. Use
9691         LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
9692         statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
9693         before returning. Fixed comments.
9694         (java_expand_classes): Check for errors up front.
9695         (patch_method_invocation): Class to search is resolved and laid
9696         out.
9697
9698 Tue Nov 24 12:57:13 1998  Per Bothner  <bothner@cygnus.com>
9699
9700         * expr.c (java_lang_expand_expr):  Add missing emit_queue.
9701
9702         * javaop.h (int8):  Removed - not used.
9703         (jbyte):  Redefine portably with correct signedness.
9704
9705         * jcf-write.c (generate_bytecode_insns):  Don't free sw_state.cases.
9706
9707         * jcf-write.c (generate_bytecode_insns):  Fix typo
9708         OPCODE_getstatic to OPCODE_getfield.
9709
9710         * java-tree.def (CASE_EXPR, DEFAULT_EXPR):  Kind is 'x', not '1'.
9711         * parse.y (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR,
9712         set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
9713
9714 Thu Nov 19 11:16:55 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9715
9716         * jcf-parse.c (jcf_parse_source): Function returned type is
9717         void. Added prototype.
9718         (jcf_parse): Function returned type is void.
9719         (yyparse): Remove call to fclose on the last parsed file.
9720
9721         * java-tree.h (jcf_parse): Changed jcf_parse prototype.
9722
9723 Wed Nov 18 23:54:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9724
9725         * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
9726         (layout_class): Cope with methods featuring WFL in decl names.
9727         * decl.c (unqualified_object_id_node): New global variable,
9728         initialized.
9729         (build_decl_no_layout): Removed.
9730         * expr.c (build_primtype_type_ref): Handle Double.
9731         (java_lang_expand_expr): Fixed indentations.
9732         * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
9733         (flag_wall, flag_redundant, flag_not_overriding,
9734         flag_static_local_jdk1_1, unqualified_object_id_node): Global
9735         variable declarations.
9736         (build_decl_no_layout): Removed prototype.
9737         (java_get_real_method_name): Added prototype.
9738         (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
9739         (java_parse_abort_on_error): Macro now just returns.
9740         * jcf-parse.c (jcf_parse_source): Check fclose returned
9741         value. Call emit_register_classes if java_report_errors returns
9742         zero.
9743         * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
9744         flag_static_local_jdk1_1): New integer flags.
9745         (lang_decode_option): New flags set here.
9746         * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
9747         (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
9748         the flag_redundant variable.
9749         (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
9750         when parsing java.lang.Object class.
9751         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
9752         NULL_TREE to build.
9753         (resolve_qualified_expression_name): Fixed indentation.
9754         (patch_array_ref): Changed prototype.
9755         (not_initialized_as_it_should_p): Prototype removed.
9756         (java_report_errors): Added function prototype.
9757         * parse.y (formal_parameter:): Changed error message for not yet
9758         supported final parameters.
9759         (class_type_list:): Set both PURPOSE and VALUE of created
9760         TREE_LIST to be class_type.
9761         (primary_no_new_array:): Handle class literals on primitive types.
9762         (parse_warning_context): Reinstalled correct force_error and
9763         do_warning flags setups.
9764         (java_report_errors): Changed prototype. Return java_error_count
9765         value.
9766         (variable_redefinition_error): Consider treating variable type as
9767         a fake pointer.
9768         (create_interface): Warn about redundant abstract modifier if
9769         flag_redundant is set. Changed error message.
9770         (lookup_field_wrapper): Save/restore globals before/after looking
9771         up field.
9772         (duplicate_declaration_error_p): Consider treating declaration
9773         type as a fake pointer.
9774         (register_fields): Extract real type from dependency node. Check
9775         for duplicate field declaration after type adjustment. Use
9776         DECL_INITIAL to store static final initialized values.
9777         (method_header): Extract real function type from dependency node.
9778         (check_abstract_method_header): Use GET_METHOD_NAME.
9779         (obtain_incomplete_type): Layout fake pointer type.
9780         (safe_layout_class): Don't try to check for methods before layout.
9781         (java_complete_class): Don't check for correct throws clause
9782         elements inheritance here.
9783         (resolve_and_layout): Broadened name parameter meaning.
9784         (reset_method_name): Use GET_METHOD_NAME.
9785         (java_get_real_method_name): New function.
9786         (java_check_regular_methods): Don't check methods in
9787         java.lang.Object.  Verify lineage of throws clause elements. Use
9788         flag_no_overriding in warning report.
9789         (check_throws_clauses): Don't check if class was from
9790         bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
9791         (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
9792         (declare_local_variables): Use flag_static_local_jdk1_1 to report
9793         warning on unsupported final local variables. Use build_decl
9794         instead of build_decl_no_layout. Get real local variable type from
9795         dependency node.
9796         (source_start_java_method): Get real parameter type from
9797         dependency node. Call build_decl instead of build_decl_no_layout.
9798         (java_layout_classes): Reverse tree and layout type and class as
9799         required. Mark class as loaded when done.
9800         (resolve_field_access): Fixed indentation. Restricted condition
9801         leading to static field access code generation. Set field_type
9802         decl's TREE_TYPE if QUAL_DECL_TYPE not available.
9803         (resolve_qualified_expression_name): Initialize type_found to
9804         null. Handle static field resolved during qualification. Fixed
9805         layout on non primitive field decl types.
9806         (not_accessible_p): Fixed typo in comment.
9807         (patch_method_invocation): Resolve and layout class to search from
9808         type.
9809         (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
9810         layout non primitive type, if necessary. Make method node only to
9811         report errors.
9812         (find_applicable_accessible_methods_list): Consider WFL'ed method
9813         decl names. Fixed indentation.
9814         (argument_types_convertible): Resolve and layout target type if
9815         necessary.
9816         (java_complete_tree): Fixed indentation problems. Rewrote
9817         CALL_EXPR thrown exceptions check. Re-installed further processing
9818         of the assignment in certain cases.
9819         (patch_assignment): Call maybe_build_primttype_type_ref to perform
9820         inlining on class literals.
9821         (valid_builtin_assignconv_identity_widening_p): Cope with constant
9822         0 literal.
9823         (valid_method_invocation_conversion_p): Likewise.
9824         (patch_string): Temporary disable forbidden use of `this' in
9825         explicit constructor invocations when doing string concatenation
9826         within their scope.
9827         (patch_unaryop): Added comment. Reinstalled code to disable
9828         further check on assignment operation with cast expression RHS.
9829         (patch_switch_statement): Fixed indentation.
9830         (build_try_statement): Call build_decl instead of
9831         build_decl_no_layout.
9832         (patch_synchronized_statement): Likewise.
9833         (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
9834         IS_UNCHECKED_EXPRESSION_P.
9835         (check_thrown_exceptions_do): Changed leading comment. Resolve and
9836         layout argument exception type.
9837         (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
9838         of IS_UNCHECKED_EXPRESSION_P.
9839
9840 Wed Nov 18 14:21:48 1998  Anthony Green  <green@cygnus.com>
9841
9842         * jcf-parse.c (yyparse): Open class file in binary mode.
9843
9844 Sun Nov 15 17:14:17 1998  Per Bothner  <bothner@cygnus.com>
9845
9846         * jvgenmain.c:  Need to #include "gansidecl.h" (to get PROTO).
9847
9848         * jcf-write.c (perform_relocations):  Move check out one loop.
9849
9850 Sun Nov 15 15:09:56 1998  Anthony Green  <green@hoser.cygnus.com>
9851
9852         * Make-lang.in: Fix reference to srcdir.
9853         * jv-scan.c: Add missing xmalloc prototype.
9854         * jvgenmain.c: Ditto.
9855
9856 Sun Nov 15 14:36:29 1998  Per Bothner  <bothner@cygnus.com>
9857
9858         * decl.c (error_mark_node), java-tree.h:  New global.
9859         * parse.y:  Use empty_stmt_node instead of size_zero_node.
9860         (build_if_else_statement):  If missing else, use empty_stmt_node.
9861
9862         * parse.y (not_initialized_as_it_should_p):  Removed, with its callers.
9863         (java_complete_expand_method):  Complain if return is missing.
9864         (java_check_regular_methods):  Comment out incorrect error check.
9865         (not_accessible_p):  Fix incorrect handling of protected methods.
9866         (patch_method_invocation):  Pass correct context to not_accessible_p.
9867         (find_applicable_accessible_methods_list):  Likewise.
9868         (qualify_ambiguous_name):  If ARRAY_REF, it's an expression name.
9869         (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR, set
9870         TREE_TYPE (to void_type_node);  otherwise expand_expr crashes.
9871         (patch_if_else_statement):  Fix setting of CAN_COMPLETE_NORMALLY.
9872
9873         * jcf-write.c (CHECK_OP, CHECK_PUT):  Add some error checking.
9874         (push_int_const):  Remove reundant NOTE_PUSH.
9875         (generate_bytecode_insns - case STRING_CST):  Do NOTE_PUSH.
9876         (- case SWITCH_EXPR):  Fix code generation bug.
9877         (- case PREDECREMENT_EXPR etc):  Remove redundant NOTE_PUSH.
9878         (generate_classfile):  More robust for abstract methods.
9879
9880 Sun Nov 15 13:52:39 1998  Anthony Green  <green@cygnus.com>
9881
9882         * Makefile.in: jv-scan and jvgenmain all require libiberty.
9883         * Make-lang.in: Ditto.
9884
9885         * jv-scan.c: Remove xmalloc and xstrdup definitions.
9886         * jvgenmain: Ditto.
9887
9888 Sun Nov 15 14:10:56 1998  Per Bothner  <bothner@cygnus.com>
9889
9890         * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
9891
9892         * jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.
9893
9894 Sat Nov 14 17:19:18 1998  Per Bothner  <bothner@cygnus.com>
9895
9896         Allow uses of interface types to verify.  This is not really
9897         type-safe, but it matches what Sun does, and is OK as long as
9898         there are appropriate run-time checks.
9899         * verify.c (merge_types):  If merging two interface types,
9900         just set the result to java.lang.Object.
9901         * expr.c (pop_type):  Any interface is matches by java.lang.Object.
9902
9903 1998-11-13  Tom Tromey  <tromey@cygnus.com>
9904
9905         * gjavah.c (main): Handle --output-class-directory argument.
9906         * jvspec.c (lang_specific_driver): Translate `-d' into
9907         -foutput-class-dir.
9908         * jcf.h (jcf_write_base_directory): Declare.
9909         * lang.c (lang_decode_option): Recognize -foutput-class-dir.
9910         * lang-options.h: Mention -foutput-class-dir.
9911         * jcf-write.c (jcf_write_base_directory): New global.
9912         (make_class_file_name): Put generated .class file into `-d'
9913         directory, or into source directory if -d not given.  Function now
9914         static.
9915         (write_classfile): Free class file name.  Handle case where class
9916         file name is NULL.
9917         (DIR_SEPARATOR): New macro.
9918         Include <sys/stat.h>
9919
9920         * Makefile.in (prefix): New macro.
9921
9922 Thu Nov 12 14:15:07 1998  Per Bothner  <bothner@cygnus.com>
9923
9924         * parse.y (patch_invoke):  Do less if flag_emit_class_files.
9925         * expr.c (build_known_method_ref):  Don't check flag_emit_class_files
9926         here (done in patch_invoke instead).
9927         (case_identity):  Moved here from parse.y.
9928
9929         * java-tree.h (CAN_COMPLETE_NORMALLY):  New macro.
9930         * parse.y (java_complete_tree etc):  Maybe set CAN_COMPLETE_NORMALLY.
9931         * parse.y (java_complete_tree):  Re-order COMPOUND_EXPR in BLOCK
9932         so they can be efficiently scanned without recursion.
9933         Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
9934         * expr.c (java_lang_expand_expr):  Expand statements of COMPOUND_EXPR
9935         in BLOCK iteratively, rather than recursively.
9936
9937         * parse.y (do_unary_numeric_promotion):  New function.
9938         (patch_unaryop, patch_binop, patch_array_ref):  Use it.
9939
9940         * parse.y (patch_newarray):  Various fixes.
9941
9942         Re-do handling of switch statements (for proper block scoping).
9943         * parse.y:  Add just a single block for the enture switch block,
9944         but don't create any "case blocks".
9945         (group_of_labels):  Rmeoved unneeded non-terminal.
9946         CASE_EXPR and DEFAULT_EXPR are added to current block.
9947         * expr.c (java_lang_expand_expr):  Inline SWITCH_EXPR here.
9948         Now also need to handle CASE_EXPR and DEFAULT_EXPR.
9949         * java-tree.h (SWITCH_HAS_DEFAULT):  New macro.
9950         * parse.y (wfl_operator, print_int_node): Make non-static.
9951         (java_complete_tree):  CASE_EXPR and DEFAULT_EXPR are now processed
9952         as part of recursive scan of block.
9953         (java_expand_switch ):  Removed - inlined into java_lang_expand_expr.
9954         (patch_switch_statement):  Most tests move dinto java_complete_tree.
9955
9956         * parse.y:  Make various production be non-typed (void).
9957         * parse.y (parse_error):  Merged into issue_warning_error_from_context.
9958         * parse.y (add_stmt_to_compound):  Don't create/change extra node.
9959         (patch_method_invocation_stmt):  Renamed to patch_method_invocation.
9960
9961         * jcf-write.c (struct jcf_handler):  New type.
9962         (struct jcf_switch_state):  New type.
9963         (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC):  New relocation kinds.
9964         (alloc_handler, emit_unop, emit_reloc):  New functions.
9965         (adjust_typed_op):  Add extra parameter ("max type" offset).
9966         (emit_switch_reloc, emit_case-reloc):  New function.
9967         (generate_bytecode_conditional):  Handle REAL_TYPE comparisons.
9968         (generate_bytecode_insns):  Support REAL_CST, switch statements,
9969         exception handling, method calls, object/array creation, and more.
9970
9971         * class.c:  Remove some unused variables.
9972         * constants.c (find_string_constant):  New function.
9973         (count_constant_pool_bytes):  Fix to correctly handle wide constants.
9974         * decl.c (complete_start_java_method):  Don't _Jv_InitClass
9975         if flag_emit_class_files.
9976
9977 1998-11-12  Tom Tromey  <tromey@cygnus.com>
9978
9979         * jcf-io.c (find_class): Added explanatory comment.
9980
9981         * jcf-path.c (add_entry): Look for `.zip' at end of filename.  Add
9982         trailing slash to `.zip' entries.
9983
9984         * jvspec.c (lang_specific_driver): Correctly handle case where
9985         GC_NAME not defined.
9986
9987 1998-11-11  Tom Tromey  <tromey@cygnus.com>
9988
9989         * jvspec.c (GC_NAME): New define.
9990         (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
9991         if required.
9992         * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
9993
9994 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
9995
9996         * jcf-dump.c (TABLE_SWITCH):  Fix typos.
9997
9998 1998-11-11  Tom Tromey  <tromey@cygnus.com>
9999
10000         * jcf-dump.c (main): Correctly recognize `--'-style long options.
10001
10002 Tue Nov 10 12:34:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10003
10004         * class.c (is_compiled_class): Call safe_layout_class for class
10005         compiled from source.
10006         * conver.h (convert_to_integer, convert_to_real,
10007         convert_to_pointer): Added prototypes.
10008         * decl.c (init_decl_processing): Non longer push the decls of
10009         `methodtable', `constants', `Class', `Field', `dispatchTable'
10010         `jexception' and `Method'.
10011         * expr.c (build_invokeinterface): New function.
10012         (expand_invoke): static variable CLASS_IDENT now in
10013         build_invokeinterface. Use build_invokeinterface.
10014         (expand_java_field_op): Moved code to inline
10015         java.lang.PRIMTYPE.TYPE into a function.
10016         (build_primtype_type_ref): New function.
10017         * java-tree.def (INSTANCEOF_EXPR): New tree code.
10018         * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
10019         FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
10020         (DECL_CONSTRUCTOR_P): Fixed typo in comment.
10021         (DECL_LOCAL_STATIC_VALUE): New macro.
10022         (build_invokeinterface, build_primtype_type_ref): New function
10023         prototypes.
10024         (java_parse_abort_on_error): Macro rewritten.
10025         * jcf-parse.c (current_method): Add comment to declaration.
10026         (parse_zip_file_entries, process_zip_dir, void parse_source_file):
10027         Function prototypes fixed.
10028         (jcf_parse_source): push/pop parser context. save/restore global.
10029         (parse_source_file): Fixed leading comment. Now take a
10030         IDENTIFIER_NODE as an argument. Doesn't check methods, layout
10031         classes and pop the parser context anymore.
10032         (yyparse): Push parser context, save globals, parse the source
10033         file, restore globals and pop the parser context when processing a
10034         source file.
10035         * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
10036         * lex.c (java_parse_doc_section): New function.
10037         (java_lex): Call java_parse_doc_section when appropriate. Build an
10038         operator around INSTANCEOF_TK.
10039         * lex.h (java_lineterminator, java_sprint_unicode,
10040         java_unicode_2_utf8, java_lex_error, java_store_unicode):
10041         Prototypes rewritten.
10042         (java_parse_escape_sequence, java_letter_or_digit_p,
10043         java_parse_doc_section, java_parse_end_comment, java_get_unicode,
10044         java_read_unicode, java_store_unicode, java_read_char,
10045         java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
10046         Added function prototypes.
10047         * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
10048         define.
10049         (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
10050         New macros
10051         (struct parser_ctxt): New fields: deprecated,
10052         current_parsed_class_un, gclass_list.
10053         (fix_method_argument_names, issue_warning_error_from_context,
10054         resolve_package, lookup_package_type): New function prototypes.
10055         (resolve_expression_name): Fixed function prototype.
10056         (find_applicable_accessible_methods_list): Fixed indentation, added
10057         extra argument in prototype.
10058         (check_final_assignment, build_null_of_type, check_deprecation,
10059         check_method_redefinition, reset_method_name,
10060         java_check_regular_methods, java_check_abstract_methods,
10061         maybe_build_primttype_type_ref): New function prototype.
10062         * parse.y (conver.h): Include.
10063         (INSTANCEOF_TK): Tagged <operator>.
10064         (single_type_import_declaration): Use REGISTER_IMPORT macro.
10065         (relational_expression:): Build binop for instanceof.
10066         (java_push_parser_context): Remember ctxp->gclass_list across
10067         contexts.
10068         (java_pop_parser_context): Simply return if no context
10069         exists. Remember gclass_list across contexts.
10070         (issue_warning_error_from_context): New function.
10071         (parse_error_context): Don't setup ctxp->elc here. Call
10072         issue_warning_error_from_context instead.
10073         (parse_warning_context): Likewise.
10074         (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
10075         setup. Link new class/interface to ctxp->gclass_list.
10076         (add_superinterfaces): Register interface as incomplete if not
10077         loaded.
10078         (create_class): Remember class unqualified name in
10079         ctxp->current_parsed_class_un. Check class deprecation.
10080         (register_fields): Check field deprecation. Remember static final
10081         field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
10082         processing INIT.
10083         (method_header): New local variable ORIG_ARG. Use unqualified
10084         current class name for check on constructor errors. Promote return
10085         type if of record type. Argument list fix moved in
10086         fix_method_argument_names, called here. Check method deprecation.
10087         (fix_method_argument_names): New function.
10088         (method_declarator): Promote record typed arguments.
10089         (safe_layout_class): Check class methods before layout.
10090         (java_complete_class): Compute field layout when patched.
10091         (do_resolve_class): Try to load class after having it renamed
10092         after the package name.
10093         (get_printable_method_name): Use DECL_CONTEXT.
10094         (reset_method_name): New function.
10095         (check_method_redefinition): Use reset_method_name.
10096         (java_check_regular_methods): New local variable
10097         SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
10098         names for error report. Check for compile-time error when method
10099         found has default (package) access.
10100         (java_check_abstract_methods): Now takes an interface DECL node as
10101         an argument. Also reinstall real name on unchecked
10102         overriding/hiding methods for error report.
10103         (java_check_methods): Fixed leading comment. Get classes to verify
10104         from ctxp->gclass_list. Use CHECK_METHODS macro and set
10105         CLASS_METHOD_CHECKED_P on class verification.
10106         (lookup_java_method2): Get real method name if necessary.
10107         (find_in_imports): Don't check package class access here.
10108         (resolve_package, lookup_package_type): New functions.
10109         (java_layout_classes): Fixed leading comment. Take classes to be
10110         laid out from ctxp->gclass_list.
10111         (java_complete_expand_methods): Don't expand native and abstract
10112         methods.
10113         (java_expand_classes): New function.
10114         (resolve_expression_name): Use additional argument ORIG.  Retrieve
10115         values of static final field of primitive types.
10116         (resolve_field_access): Handles static final field of promotive
10117         type.
10118         (resolve_qualified_expression_name): Handle STRING_CST as
10119         primaries and package name resolution. Check deprecation on found
10120         decls. Set where_found and type_found on non static field resolved
10121         during qualification. Layout non primitive field decl types.
10122         (check_deprecation): New function.
10123         (maybe_access_field): Simplified.
10124         (patch_method_invocation_stmt): Local variable CLASS_TYPE
10125         removed. Reverse method's argument when primary is a type. Don't
10126         use CLASS_TYPE to report problems, use IDENTIFIER_WFL
10127         instead. Include abstract class in the list of class searchable
10128         for constructors. Use DECL_CONTEXT of found method for access
10129         checks. Check method deprecation.
10130         (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
10131         converting arguments. Handle INVOKE_INTERFACE.
10132         (lookup_method_invoke): Search constructor using existing
10133         infrastructure (don't rely on lookup_java_constructor anymore).
10134         (find_applicable_accessible_methods_list): Extra argument flag
10135         LC. Now include constructor in the search.
10136         (qualify_ambiguous_name): Conditional expression are primaries.
10137         (not_initialized_as_it_should_p): static final are always
10138         initialized.
10139         (java_complete_tree): Pass extra NULL argument to
10140         resolve_expression_name. Stricter test to carry on patching
10141         assignments. New case for INSTANCEOF_EXPR.
10142         (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
10143         (check_final_assignment, maybe_build_primttype_type_ref): New
10144         functions.
10145         (patch_assignment): Detect resolved static finals and carry normal
10146         assignment error check on them. Inline PRIMTYPE.TYPE read access.
10147         (try_builtin_assignconv): Access constant 0 on all primitive
10148         types.
10149         (valid_builtin_assignconv_identity_widening_p): Accept identical
10150         types. Accept all promoted type on int type.
10151         (valid_ref_assignconv_cast_p): Accept a null pointer to be
10152         assigned to a reference.
10153         (valid_method_invocation_conversion_p): Accept to check null
10154         pointers.
10155         (build_binop): Merge declaration and initialization of local
10156         variable BINOP.
10157         (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
10158         numeric types. Improved validity test for qualify operators on
10159         references.
10160         (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
10161         and PREINCREMENT_EXPR. Also detect resolved static finals of a
10162         primitive type and issue the appropriate error message.
10163         (resolve_type_during_patch): Mark class loaded when resolved.
10164         (patch_cast): Allow null to be cased to reference types.
10165         (build_null_of_type): New function.
10166         (patch_array_ref): Handle array on references correctly.
10167         (patch_return): Removed unused local variable MODIFY. Force
10168         boolean to be returned as integers. Allows null to be returned by
10169         a function returning a reference.
10170         * typeck.c (convert_to_integer, convert_to_real,
10171         convert_to_pointer): Prototypes moved to convert.h
10172         (lookup_argument_method): Use method real name, if necessary.
10173
10174 1998-10-30  Tom Tromey  <tromey@cygnus.com>
10175
10176         * class.c (build_class_ref): Changed name of primitive classes to
10177         start with `_Jv_'.
10178
10179         * class.c (make_class_data): Renamed fields: nmethods to
10180         method_count, method_count to dtable_method_count.  Always set
10181         `state' field to 0.
10182         * decl.c (init_decl_processing): Likewise.
10183
10184 Wed Oct 28 08:03:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10185
10186         * class.c (layout_class): Don't mangle <finit>, produce
10187         __finit<class> instead. Don't verify artificial methods.
10188         * decl.c (finit_identifier_node): New declared global.
10189         (init_decl_processing): finit_identifier_node initialized.
10190         * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
10191         * java-tree.h (finit_identifier_node): Declared as extern.
10192         (struct lang_decl): New field called_constructor.
10193         (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
10194         (CLASS_HAS_FINIT_P): New macro.
10195         (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
10196         explicit constructor invocation.
10197         (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
10198         CALL_SUPER_CONSTRUCTOR_P): New macros.
10199         (write_classfile): Added prototype.
10200         * jcf-parse.c (jcf_parse_source): Parse and remember for
10201         generation if the file was seen on the command line.
10202         (parse_source_file): Don't write the class file here.
10203         (yyparse): Loop on files rewritten. Set current_jcf.
10204         (parse_zip_file_entries): Parse class file only if it was found.
10205         * lang.c (init_parse): Don't open command line provided filename
10206         here.
10207         (lang_parse): Don't set main_jcf anymore.
10208         * parse.h (ABSTRAC_CHECK): Capitalized arguments.
10209         (JCONSTRUCTOR_CHECK): New macro.
10210         (JBSC_TYPE_P): New macro.
10211         (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
10212         (COMPLETE_CHECK_OP_2): New macro.
10213         (struct parse_ctxt): New field explicit_constructor_p.
10214         (check_class_interface_creation): Fixed prototype indentation.
10215         (patch_method_invocation_stmt): Prototype reflects added argument.
10216         (patch_invoke): Likewise.
10217         (complete_method_declaration, build_super_invocation,
10218         verify_constructor_circularity,
10219         build_this_super_qualified_invocation, get_printable_method_name,
10220         patch_conditional_expr, maybe_generate_finit, fix_constructors,
10221         verify_constructor_super, create_artificial_method,
10222         start_artificial_method_body, end_artificial_method_body,
10223         generate_field_initialization_code): New function prototypes.
10224         * parse.y: Fixed leading comment
10225         (constructor_header:, constructor_body:, block_end:): Rules tagged
10226         <node>.
10227         (type_declaration:): Call maybe_generate_finit.
10228         (method_declaration:): Action for method_body: placed in new
10229         function complete_method_declaration, called here.
10230         (constructor_declaration:): Defined actions. Removed leading
10231         FIXME.
10232         (constructor_header:): New rule with action.
10233         (constructor_body:): Rule rewritten using block_begin: and
10234         block_end:. Defined actions.
10235         (constructor_declarator:, explicit_constructor_invocation:):
10236         Defined actions.
10237         (block:): Use new rules block_begin: block_end:.
10238         (block_begin:, block_end:): New rules and actions.
10239         (block_statements:): Fixed error message for explicit
10240         constructors.
10241         (method_invocation:): Call build_this_super_qualified_invocation
10242         if primary is `this' or `super' was seen.
10243         (conditional_expression:): Action defined.
10244         (extra_ctxp_pushed_p): New static global flag.
10245         (java_parser_context_save_global): Create parser context if
10246         necessary. Use extra_ctxp_pushed_p to remember it.
10247         (java_parser_context_restore_global): Pop extra parser context if
10248         one exists.
10249         (build_array_from_name): Array on primitive types are marked
10250         loaded.
10251         (register_fields): Restore new name in field initializer
10252         expression if type was altered. Non static fields initialized upon
10253         declaration marked initialized.
10254         (maybe_generate_finit): New function.
10255         (maybe_generate_clinit): Use create_artificial_method,
10256         start_artificial_method_body, end_artificial_method_body. Generate
10257         debug info for enclosed initialization statements.
10258         (method_header): Fixed leading comment. Check constructor
10259         flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
10260         accordingly.
10261         (complete_method_declaration, constructor_circularity_msg,
10262         verify_constructor_circularity): New functions.
10263         (get_printable_method_name): New function.
10264         (check_method_redefinition): Don't rename <finit> methods. Fix
10265         declared constructor names. Error message for
10266         constructors modified.
10267         (java_check_regular_methods): Local variable seen_constructor
10268         renamed saw_constructor. Skip verification on constructors. Create
10269         default constructor with create_artificial_method.
10270         (java_check_methods): Removed unnecessary empty line.
10271         (create_artificial_method, start_artificial_method_body,
10272         end_artificial_method_body): New functions.
10273         (java_layout_classes): Changed leading comment. Reverse fields
10274         list if necessary. Always layout java.lang.Object if being
10275         defined.
10276         (java_complete_expand_methods): Verify constructor circularity.
10277         (java_complete_expand_method): Call fix_constructor on
10278         constructors.  Local variable no_ac_found removed. Restore
10279         bindings if method body expansion failed.
10280         (fix_constructors, verify_constructor_super,
10281         generate_field_initialization_code): New function.
10282         (java_expand_classes): Fixed leading comment. Write class file
10283         here.
10284         (resolve_expression_name): Check for illegal instance variable
10285         usage within the argument scope of an explicit constructor
10286         invocation.
10287         (resolve_qualified_expression_name): Pass extra from_super flag
10288         when invoking patch_method_invocation_stmt. New case for
10289         conditional expression when used as a primary. Check for error
10290         when acquiring super.
10291         (patch_method_invocation_stmt): Added extra argument super. New
10292         local variable is_static_flag. Set class_to_search according to
10293         the nature of the constructor invocation. Don't add `this'
10294         argument when expanding NEW_CLASS_EXPR. Check for illegal method
10295         invocation within the argument scope of explicit constructor
10296         invocation. Set is_static according to is_static_flag. Provide
10297         extra `super' argument to patch_invoke invocation.
10298         (patch_invoke): New argument from_super. Loop on arguments
10299         indentation fixed. Pass from_super to invocation_mode. New switch
10300         case INVOKE_SUPER. Fixed error message in switch default case.
10301         Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
10302         value.
10303         (invocation_mode): Return INVOKE_SUPER mode when appropriate.
10304         (lookup_method_invoke): Fixed prototypes in candidates list. Error
10305         message takes constructors into account.
10306         (find_applicable_accessible_methods_list): Fixed indentation.
10307         (qualify_ambiguous_name): Take explicit constructor invocation
10308         into account. Deal with a conditional expression as a primary to
10309         a method call.
10310         (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
10311         case. Added extra argument to patch_method_invocation_stmt.
10312         Register calls made to explicit constructor `this'. Don't call
10313         save_expr in ARRAY_REF case when emitting class files. Check for
10314         illegal use of this when expanding explicit constructor invocation
10315         arguments.
10316         (complete_function_arguments): Set and reset parser context
10317         explicit_constructor_p field value when appropriate.
10318         (build_super_invocation, build_this_super_qualified_invocation):
10319         New functions.
10320         (patch_assignment): Fixed typo.
10321         (patch_unaryop): Check on final fields occurs only when a decl
10322         exits.
10323         (patch_return): Take constructors into account.
10324         (patch_conditional_expr): New function.
10325         * typeck.c (build_java_signature): Removed unnecessary empty line.
10326
10327 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
10328
10329         * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
10330
10331 1998-10-28  Tom Tromey  <tromey@cygnus.com>
10332
10333         * decl.c (init_decl_processing): Renamed fields.
10334         * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
10335         interface_len, msize fields.
10336
10337         * class.c (make_class_data): Removed subclass_head and
10338         subclass_next fields.
10339         * decl.c (init_decl_processing): Removed subclass_head and
10340         subclass_next fields.
10341
10342 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
10343
10344         * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
10345         * mangle.c (emit_unicode_mangled_name): Similarly.
10346
10347 Mon Oct 26 12:17:23 1998  Nick Clifton  <nickc@cygnus.com>
10348
10349         * jcf-parse.c (get_constant): Place braces around code to compute
10350         'd' when REAL_ARITHMETIC is not defined.
10351
10352 Sun Oct 25 14:58:05 1998  H.J. Lu  (hjl@gnu.org)
10353
10354         * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
10355         dependency.
10356
10357 1998-10-23  Tom Tromey  <tromey@cygnus.com>
10358
10359         * lang-specs.h: `.zip' files are input to jc1.
10360
10361 Thu Oct 22 23:01:54 1998  Per Bothner  <bothner@cygnus.com>
10362
10363         * jvspecs.c:  Add (but don't enable) support for combining multiple
10364         .class and .java input filenames to a single jc1 invocation.
10365         Add support for -C flag (copile to .class files).
10366         Translate -classpath and -CLASSPATH arguments.
10367         * lang-specs.h:  Don't set %2 spec.
10368
10369 1998-10-22  Tom Tromey  <tromey@cygnus.com>
10370
10371         * jcf-path.c (add_entry): Don't add trailing separator if entry is
10372         a .zip file.
10373         (add_path): Don't add trailing separator to non-empty path
10374         elements.
10375
10376         * lang.c (lang_decode_option): Check for -fclasspath and
10377         -fCLASSPATH before examining other `-f' options.
10378
10379         * java-tree.h (finalize_identifier_node): Don't declare.
10380         * class.c (make_class_data): Don't push "final" field.
10381         * decl.c (init_decl_processing): Don't push "final" field.
10382         (finalize_identifier_node): Removed.
10383         (init_decl_processing): Don't set finalize_identifier_node.
10384
10385         * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
10386
10387 Sun Oct 11 10:31:52 1998  Anthony Green  <green@cygnus.com>
10388
10389         * Make-lang.in (java): Depend on jcf-dump and jv-scan.
10390         (JV_SCAN_SOURCES): New macro.
10391         (JCF_DUMP_SOURCES): Likewise.
10392         (jcf-dump$(exeext)): New target.
10393         (jv-scan$(exeext)): New target.
10394
10395 1998-10-22  Tom Tromey  <tromey@cygnus.com>
10396
10397         * Makefile.in (LEX): Removed.
10398         (LEXFLAGS): Likewise.
10399         (SET_BISON): New macro.
10400         (BISON): Removed.
10401         ($(PARSE_C)): Use SET_BISON.  Run bison from srcdir to avoid
10402         spurious diffs in parse.c.
10403         ($(PARSE_SCAN_C)): Likewise.
10404         (PARSE_DIR): New macro.
10405         (PARSE_C): Use it.
10406         (PARSE_SCAN_C): Likewise.
10407         (PARSE_RELDIR): New macro.
10408
10409         * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
10410
10411         * jcf-io.c (find_class): Use saw_java_source to determine when to
10412         look for `.java' file.
10413         * jcf-parse.c (saw_java_source): New global.
10414         (yyparse): Set it if `.java' file seen.
10415
10416         * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
10417         (GCJH_SOURCES): Likewise.
10418         * Makefile.in (datadir): New macro.
10419         (libjava_zip): Likewise.
10420         (JAVA_OBJS): Added jcf-path.o.
10421         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
10422         (../gcjh$(exeext)): Likewise.
10423         (jcf-path.o): New target.
10424         * java-tree.h (fix_classpath): Removed decl.
10425         * jcf-parse.c (fix_classpath): Removed.
10426         (load_class): Don't call fix_classpath.
10427         * parse.y (read_import_dir): Don't call fix_classpath.
10428         * lex.h: Don't mention classpath.
10429         * lex.c (java_init_lex): Don't initialize classpath.
10430         * jcf-io.c (classpath): Removed global.
10431         (find_class): Use jcf_path iteration functions.  Correctly search
10432         class path for .java file.
10433         (open_in_zip): New argument `is_system'.
10434         * jcf-dump.c (main): Call jcf_path_init.  Recognize all new
10435         classpath-related options.
10436         * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
10437         and -I.
10438         (lang_init): Call jcf_path_init.
10439         * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
10440         * lang-specs.h: Handle -I.  Minor cleanup to -M options.
10441         Correctly put braces around second string in each entry.
10442         * gjavah.c (main): Call jcf_path_init.  Recognize all the new
10443         classpath-related options.
10444         (help): Updated for new options.
10445         * jcf.h: Declare functions from jcf-path.c.  Don't mention
10446         `classpath' global.
10447         * jcf-path.c: New file.
10448
10449         * jcf-depend.c: Include jcf.h.
10450
10451         * jcf-write.c (localvar_alloc): Returns `void'.
10452         (localvar_free): Removed unused variable.
10453
10454         * lang.c (OBJECT_SUFFIX): Define if not already defined.
10455         (init_parse): Use OBJECT_SUFFIX, not ".o".
10456
10457 Wed Oct 21 07:54:11 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10458
10459         * class.c (emit_register_classes): Renamed from
10460         emit_register_class.
10461         * java-tree.h (emit_register_classes): Prototype renamed from
10462         emit_register_class.
10463         * jcf-parse.c (yyparse): Call emit_register_classes once before
10464         returning.
10465         * parse.y (java_expand_classes): No longer register classes.
10466
10467 Tue Oct 20 09:15:38 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10468
10469         * class.c (is_compiled_class): New local variable
10470         seen_in_zip. Identify classes found in currently compiled source
10471         file(s).
10472         * decl.c (complete_start_java_method): Fixed typo.
10473         * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
10474         HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
10475         (CLASS_P): Moved around.
10476         (java_parse_abort_on_error): Macro moved from jcf-parse.c
10477         * jcf-parse.c (java_parse_abort_on_error): Macro moved to
10478         java-parse.h
10479         (jcf_parse_source): Changed leading comment. Removed unnecessary
10480         fclose and CLASS_FROM_SOURCE_P marking.
10481         (parse_source_file): New local variables remember_for_generation
10482         and filename. Mark parsed file name identifier node. Removed block
10483         executed when parse_only was null. Set remember_for_generation.
10484         Use it as an argument to java_pop_parser_context.
10485         (yyparse): New local variables several_files, list, next node and
10486         current_file_list. Split ampersand separated file names into
10487         current_file_list. Iterate through the list and parse accordingly.
10488         * parse.h (java_pop_parser_context): New function prototype.
10489         * parse.y (ctxp_for_generation): New static global variable.
10490         (java_pop_parser_context): New argument generate. Link popped ctxp
10491         to ctxp_for_generation list accordingly.
10492         (java_complete_expand_methods): Fixed indentation.
10493         (java_expand_classes): New function.
10494
10495 Sat Oct 17 11:25:21 1998  Per Bothner  <bothner@cygnus.com>
10496
10497         * Makefile.in:  Link with libiberty.a instead of memmove.o.
10498
10499 Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10500
10501         * lex.c (setjmp.h): No longer included.
10502         * lex.h (setjmp.h): Included.
10503         * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
10504         (duplicate_declaration_error_p): Renamed from
10505         duplicate_declaration_error.
10506         (build_array_from_name): New function prototype.
10507         * parse.y (setjmp.h): No longer included.
10508         (variable_declarator_id): Define action.
10509         (build_array_from_name): New function.
10510         (duplicate_declaration_error_p): Renamed from
10511         duplicate_declaration_error.  Fixed leading comment.
10512         (register_fields): Main `for' loop reorganized. Uses
10513         SET_TYPE_FOR_RESOLUTION and build_array_from_name.
10514         (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
10515         build_array_from_name.
10516         (resolve_class): Set CLASS_LOADED_P on newly build array dimension
10517         types.
10518         (read_import_dir): Don't try to skip `.' and `..'.
10519         (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
10520         build_array_from_name. Main `for' loop reorganized.
10521         (resolve_qualified_expression_name): When building access to a
10522         field, use the type where the field was found, not its own type.
10523         (maybe_access_field): Use field DECL_CONTEXT if the type where the
10524         field was found is null.
10525         (qualify_ambiguous_name): Sweep through all successive array
10526         dimensions.
10527
10528 Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10529
10530         * java-tree.h (pop_labeled_block, lang_printable_name,
10531         maybe_add_interface, set_super_info, get_access_flags_from_decl,
10532         interface_of_p, inherits_from_p, fix_classpath,
10533         complete_start_java_method, emit_handlers, init_outgoing_cpool,
10534         make_class_data, register_class, alloc_name_constant): New
10535         function prototypes.
10536         * lang.c (lang_decode_option): Set argc argument unused. Fixed
10537         indentation. Added cast to remove warning.
10538         (lang_printable_name): Set v argument unused.
10539         (lang_print_error): Added argument to lang_printable_name call.
10540         (java_dummy_print, print_lang_decl, print_lang_type,
10541         print_lang_identifier, lang_print_xnode): All argument marked
10542         unused.
10543         * lex.c (java_unget_unicode): Removed unnecessary argument.
10544         (java_allocate_new_line): Unused local variable is gone.
10545         (java_read_char): Added parenthesis in expressions to remove
10546         warnings.  Added final return statement.
10547         (java_read_unicode): Added parenthesis in expression to remove
10548         warning.
10549         (java_parse_end_comment): Fixed java_unget_unicode invocation.
10550         (java_parse_escape_sequence): Likewise.
10551         (java_lex): Unused local variables are gone. Fixed
10552         java_unget_unicode invocation.
10553         * lex.h (set_float_handler): Prototype added when JC1_LITE not
10554         defined.
10555         * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
10556         lang_printable_name invocation in macro.
10557         (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
10558         Likewise.
10559         (duplicate_declaration_error): Suppressed unused argument in
10560         prototype.
10561         (identical_subpath_p): Function declaration is gone.
10562         (patch_invoke): Suppressed unused argument in prototype.
10563         (patch_cast, build_labeled_block, check_thrown_exceptions):
10564         Likewise.
10565         * parse.y (setjmp.h): Included
10566         (toplev.h): Likewise.
10567         (field_declaration:): Suppressed unused local
10568         (label_decl:): Fixed build_labeled_block invocation.
10569         (java_pop_parser_context): Put extra parenthesis around assignment
10570         in if.
10571         (yyerror): Suppressed unused local variables.
10572         (variable_redefinition_error): Fixed lang_printable_name
10573         invocation.
10574         (create_interface): Suppressed unused local variables.
10575         (create_class): Likewise.
10576         (duplicate_declaration_error): Suppressed unused argument. Fixed
10577         lang_printable_name invocation.
10578         (register_fields): Suppressed unused local variable. Fixed
10579         duplicate_declaration_error invocation.
10580         (method_header): Suppressed unused local variable.
10581         (method_declarator, parser_check_super): Likewise.
10582         (java_complete_class): Suppressed unused local variable. Fixed
10583         fatal error message.
10584         (complete_class_report_errors): Added default: in switch.
10585         (java_check_regular_methods): Fixed lang_printable_name
10586         invocations.
10587         (check_throws_clauses): Likewise.
10588         (java_check_abstract_methods): Suppressed unused local
10589         variable. Fixed lang_printable_name invocation.
10590         (read_import_entry): Added supplemental return statement.
10591         (read_import_dir): Suppressed unused local variables.
10592         (check_pkg_class_access, declare_local_variables): Likewise.
10593         (source_start_java_method): Suppressed unused extern variable
10594         declarations
10595         (expand_start_java_method): Suppressed unused extern and local
10596         variable declarations.
10597         (java_complete_expand_methods): Likewise.
10598         (java_complete_expand_method): Suppressed unused local variables.
10599         (make_qualified_name): Likewise.
10600         (resolve_qualified_expression_name): Added default: in
10601         switch. Fixed lang_printable_name invocation.
10602         (class_instance_creation_expression): Added parenthesis around
10603         expressions.
10604         (patch_method_invocation_stmt): Fixed lang_printable_name and
10605         patch_invoke invocations.
10606         (check_for_static_method_reference): Fixed lang_printable_name
10607         invocation.
10608         (patch_invoke): Suppressed unused arguments and local variables.
10609         (lookup_method_invoke): Suppressed unused local variables.
10610         (qualify_ambiguous_name): Added default: in switch.
10611         (identical_subpath_p): Function removed.
10612         (patch_assignment): Suppressed unused local variables. Suppressed
10613         unnecessary if statement. Fixed lang_printable_name invocations.
10614         (try_builtin_assignconv): Fixed lang_printable_name invocations.
10615         (valid_ref_assignconv_cast_p): Parenthesis around
10616         expression. Suppressed unused local variables.
10617         (build_binop): Suppressed unused local variables. fixed
10618         lang_printable_name invocations.
10619         (string_constant_concatenation): Suppressed unused local
10620         variables.
10621         (patch_unaryop): Fixed lang_printable_name invocation.
10622         (patch_cast): Suppressed unnecessary argument. Fixed
10623         lang_printable_name invocation.
10624         (patch_array_ref): Fixed lang_printable_name invocation.
10625         (patch_newarray, patch_return, patch_if_else_statement): Likewise.
10626         (build_labeled_block): Suppressed unused argument.
10627         (generate_labeled_block): Fixed build_labeled_block invocation.
10628         (build_loop_body): Suppressed unused local variables.
10629         (patch_loop_statement): Likewise.
10630         (patch_exit): Fixed lang_printable_name invocation.
10631         (patch_switch_statement): Likewise.
10632         (case_identity): First argument marked unused.
10633         (patch_try_statement): Fixed lang_printable_name invocations.
10634         (patch_synchronized_statement, patch_throw_statement): Likewise.
10635         (check_thrown_exceptions): Fixed check_thrown_exceptions and
10636         lang_printable_name invocations.
10637         (check_thrown_exceptions_do): Suppressed unused argument.
10638
10639 1998-10-14  Tom Tromey  <tromey@cygnus.com>
10640
10641         * jcf-write.c (write_classfile): Add output class file as target.
10642         * lang-options.h: Added -MD, -MMD, -M, and -MM.
10643         * jcf.h: Added declarations for dependency-tracking functions.
10644         * lang-specs.h: Handle -M, -MM, MD, and -MMD.
10645         * lang.c (lang_decode_option): Recognize -MD and -MMD.
10646         (finish_parse): Call jcf_dependency_write.
10647         (dependency_tracking): New global.
10648         (DEPEND_SET_FILE): New define.
10649         (DEPEND_ENABLE): New define.
10650         (init_parse): Enable dependency tracking if required.
10651         Include "flags.h".
10652         * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
10653         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
10654         (../gcjh$(exeext)): Likewise.
10655         (jcf-depend.o): New target.
10656         * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
10657         (GCJH_SOURCES): Likewise.
10658         * jcf-io.c (open_class): Call jcf_dependency_add_file.  Added
10659         dep_name argument.
10660         (find_classfile): Added dep_name argument.
10661         (find_class): Compute name of dependency.
10662         (open_in_zip): Call jcf_dependency_add_file.
10663         * gjavah.c (output_file): No longer global.
10664         (usage): Don't mention "gjavah".
10665         (help): Likewise.
10666         (java_no_argument): Likewise.
10667         (version): Likewise.
10668         (main): Recognize and handle -M family of options.
10669         (print_mangled_classname): Return is void.
10670         (process_file): Handle case where output is suppressed.
10671         (HANDLE_END_FIELD): Likewise.
10672         (HANDLE_METHOD): Likewise.
10673         * jcf-depend.c: New file.
10674
10675 Tue Oct 13 23:34:12 1998  Jeffrey A Law  (law@cygnus.com)
10676
10677         * java-tree.def: Add missing newline at EOF.
10678
10679 1998-10-13  Tom Tromey  <tromey@cygnus.com>
10680
10681         * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
10682         (main): Likewise.  Exit with SUCCESS_EXIT_CODE at end of
10683         function.
10684         Include <config.h> and "system.h".
10685         (disassemble_method): Undefine RET to avoid clash with
10686         config/i386/i386.h.
10687
10688 Tue Oct 13 03:50:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10689
10690         * decl.c (runtime_exception_type_node, error_exception_type_node):
10691         New global variables.
10692         (init_decl_processing): Initialized.
10693         * expr.c (java_lang_expand_expr): Set caught exception type to
10694         null if catch handler argument doesn't exit.
10695         * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
10696         tree codes.
10697         * java-tree.h (runtime_exception_type_node,
10698         error_exception_type_node): Global variables declared.
10699         (DECL_FUNCTION_THROWS): New macro.
10700         (DECL_FUNCTION_BODY): Modified comment.
10701         (DECL_SPECIFIC_COUNT): Likewise.
10702         (struct lang_decl): New field throws_list.
10703         (IS_UNCHECKED_EXPRESSION_P): New macro.
10704         * lex.c (java_lex): Generate location information for THROW_TK.
10705         * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
10706         EXCEPTIONS_P): New macros.
10707         (enum jdep_code): New value JDEP_EXCEPTION.
10708         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
10709         BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
10710         PATCH_METHOD_RETURN_ERROR): New macros.
10711         (patch_method_invocation_stmt): Added new argument to prototype.
10712         (patch_synchronized_statement, patch_throw_statement,
10713         check_thrown_exceptions, check_thrown_exceptions_do,
10714         purge_unchecked_exceptions, check_throws_clauses): New function
10715         prototypes.
10716         * parse.y Fixed typo in keyword section.
10717         (throw:): Rule tagged <node>.
10718         (THROW_TK): Keyword tagged <operator>.
10719         (method_header:): Last argument to call to method_header passed
10720         from throws: rule.
10721         (throws:, class_type_list:, throw_statement:,
10722         synchronized_statement:, synchronized:): Defined actions.
10723         (method_header): New local variable current. Register exceptions
10724         from throws clause.
10725         (java_complete_tree): Complete and verify exceptions from throws
10726         clause.
10727         (complete_class_report_errors): Error message on exceptions not
10728         found
10729         (java_check_regular_methods): Fixed typo. Shortcut on private
10730         overriding methods. Changed error message on method
10731         redefinition. Check for throws clause compatibility.
10732         (check_throws_clauses): New function.
10733         (java_check_abstract_methods): Use DECL_NAME for wfl or current
10734         method. Changed error message on method redefinition.
10735         (currently_caught_type_list): New static variable.
10736         (java_complete_expand_methods): Purge unchecked exceptions from
10737         throws clause list. Call PUSH_EXCEPTIONS before walk and
10738         POP_EXCEPTIONS after.
10739         (resolve_qualified_expression_name): Pass new argument as NULL to
10740         patch_method_invocation_stmt.
10741         (patch_method_invocation_stmt): New argument ref_decl. Invoke
10742         PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
10743         argument list when appropriate. Use new argument if non null to
10744         store selected method decl.
10745         (patch_invoke): Convert if necessary args of builtin types before
10746         forming CALL_EXPR. Argument list no longer reversed here.
10747         (invocation_mode): Treat final methods as static methods.
10748         (java_complete_tree): New cases for THROW_EXPR: and
10749         SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
10750         function call.
10751         (complete_function_arguments): No more RECORD_TYPE
10752         conversion. Function parameter nodes no longer saved.
10753         (valid_ref_assignconv_cast_p): Avoid handling null type.
10754         (patch_binop): Fixed null constant reference handling.
10755         (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
10756         BUILD_THROW macros.
10757         (patch_try_statement): Fixed comments. Record caught types in
10758         list, push the list, expand try block and pop the list.
10759         (patch_synchronized_statement, patch_throw_statement,
10760         check_thrown_exceptions, check_thrown_exceptions_do,
10761         purge_unchecked_exceptions): New functions.
10762         * typeck.c (lookup_argument_method): Allow WFL in place of method
10763         DECL_NAME during method definition check
10764
10765 1998-10-09  Tom Tromey  <tromey@cygnus.com>
10766
10767         * gjavah.c (decode_signature_piece): New function.
10768         (print_c_decl): Use it.  Added `name_override' argument.
10769         (print_method_info): Use name_override argument to print_c_decl.
10770         (seen_fields): Removed.
10771         (print_field_info): Don't update seen_fields.
10772         (struct method_name): New structure.
10773         (method_name_list): New global.
10774         (print_method_info): Add new method to list of methods.
10775         (name_is_method_p): New function.
10776         (print_field_info): If field name has same name as method, then
10777         change field name.
10778         (process_file): Parse methods before fields.
10779         (field_pass): New global.
10780         (HANDLE_END_FIELD): Take field_pass into account.
10781
10782 Wed Oct  7 12:10:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
10783
10784         * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
10785         (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
10786
10787 Sat Oct  3 13:29:46 1998  Anthony Green  <green@cygnus.com>
10788
10789         * jvspec.c: Fix bug in jvgenmain_spec patch.
10790
10791 Fri Oct  2 17:22:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10792
10793         * Makefile.in (lang.o:): Install dependency on java-tree.def.
10794         * decl.c (soft_exceptioninfo_call_node): New global variable.
10795         (init_decl_processing): Fixed indentation. soft_badarrayindex_node
10796         takes extra integer argument. soft_exceptioninfo_call_node
10797         initialized.
10798         * except.c (java_set_exception_lang_code): New function
10799         (method_init_exceptions): Called here.
10800         (prepare_eh_table_type): New function.
10801         (expand_end_java_handler): Called here.
10802         * expr.c (build_java_throw_out_of_bounds_exception): Now features
10803         one argument. Modified generation of call to
10804         soft_badarrayindex_node to use new argument.
10805         (build_java_arrayaccess): Pass faulty index value to
10806         build_java_throw_out_of_bounds_exception.
10807         (generate_name): New function.
10808         (java_lang_expand_expr): New local variables node, current,
10809         has_finally_p. Expand TRY_EXPR node.
10810         (process_jvm_instruction): Replace top of the stack with thrown
10811         object reference when entering exception handler.
10812         * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
10813         specific tree codes.
10814         * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
10815         global.
10816         (DECL_SPECIFIC_COUNT): New macro.
10817         (prepare_eh_table_type, java_set_exception_lang_code,
10818         generate_name): New function declarations.
10819         (match_java_method): Declaration deleted.
10820         (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
10821         macros.
10822         * lex.c (TRY_TK, CATCH_TK): Generate location information.
10823         * parse.h (redefinition_error, refine_accessible_methods_list,
10824         can_cast_to_p): Function declaration removed.
10825         (classitf_redefinition_error, variable_redefinition_error,
10826         parse_jdk1_1_error, find_applicable_accessible_methods_list,
10827         find_most_specific_methods_list, argument_types_convertible,
10828         enter_a_block, valid_builtin_assignconv_identity_widening_p,
10829         valid_cast_to_p, valid_method_invocation_conversion_p,
10830         try_reference_assignconv, add_stmt_to_compound,
10831         build_jump_to_finally, build_tree_list, patch_try_statement,
10832         java_get_catch_block): New function declarations.
10833         * parse.y (string_buffer_type): Global variable deleted.
10834         (group_of_labels, catches, catch_clause, catch_clause_parameter,
10835         finally): Rules tagged <node>.
10836         (TRY_TK, CATCH_TK): Token tagged <operator>.
10837         (class_body_declaration:, class_member_declaration:,
10838         formal_parameter:, explicit_constructor_invocation:,
10839         interface_member_declaration:, constant_declaration:,
10840         primary_no_new_array:, class_instance_creation_expression:,
10841         array_creation_expression:): Issue error on unsuported JDK1.1
10842         features.
10843         (try_statement:, catches:, finally:): Define actions.
10844         (catch_clause_parameter): New rule.
10845         (catch_clause:): Use new rule catch_clause_parameter.
10846         (parse_jdk1_1_error): New function.
10847         (redefinition_error): Renamed classitf_redefinition_error.
10848         (variable_redefinition_error): New function.
10849         (check_class_interface_creation): Call
10850         classitf_redefinition_error.
10851         (java_complete_tree): Added error message on JDEP_TYPE: case.
10852         (complete_class_report_errors): Fixed indentation.
10853         (declare_local_variables): Call variable_redefinition_error.
10854         (source_end_java_method): Call java_set_exception_lang_code and
10855         emit_handlers where appropriate.
10856         (java_method_add_stmt): Call add_stmt_to_block.
10857         (add_stmt_to_block): New function.
10858         (lookup_method_invoke): Fixed outside comment. new local variable
10859         candicates.  Call find_applicable_accessible_methods_list and
10860         find_most_specific_methods_list when searching for a
10861         method. Modified error report to list possible candidates when
10862         applicable.
10863         (find_applicable_accessible_methods_list,
10864         find_most_specific_methods_list, argument_types_convertible): New
10865         function.
10866         (refine_accessible_methods_list): Function deleted.
10867         (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
10868         expr (if applicable) before calling patch_array_ref.
10869         (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
10870         (enter_block): Fixed comment.
10871         (enter_a_block): New function.
10872         (patch_assignment): Reorganized. Call try_reference_assignconv for
10873         references. Call valid_cast_to_p instead of can_cast_to_p.
10874         (try_reference_assignconv,
10875         valid_builtin_assignconv_identity_widening_p): New functions.
10876         (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
10877         (valid_cast_to_p, valid_method_invocation_conversion_p): New
10878         functions.
10879         (build_string_concatenation): Don't resolve StringBuffer.
10880         (patch_cast): Fixed inverted arguments.
10881         (patch_array_ref): Code to save array expr deleted. Call
10882         valid_cast_to_p instead of can_cast_to_p.
10883         (generate_labeled_block): Call generate_name.
10884         (build_jump_to_finally, build_try_statement, java_get_catch_block,
10885         patch_try_statement): New functions.
10886         * typeck.c (match_java_method): Function deleted.
10887
10888 Fri Oct  2 13:48:36 1998  Anthony Green  <green@cygnus.com>
10889
10890         * jvspec.c: jvgenmain_spec uses different temporary file names.
10891
10892 Fri Oct  2 12:50:19 1998  Anthony Green  <green@cygnus.com>
10893
10894         * jvspec.c (lang_specific_driver): Fail if user specifies
10895         --main= when not linking.
10896
10897 Mon Sep 28 13:48:33 1998  Tom Tromey  <tromey@cygnus.com>
10898
10899         * class.c (make_class_data): Push value for `thread' field.
10900         * decl.c (init_decl_processing): Added `thread' field to class.
10901
10902         * class.c (add_field): Always make static fields externally
10903         visible.
10904
10905 Sat Sep 26 08:22:47 1998  Anthony Green  <green@cygnus.com>
10906
10907         * expr.c (build_java_athrow,
10908         build_java_throw_out_of_bounds_exception, expand_invoke,
10909         build_newarray, expand_java_multianewarray, build_java_monitor):
10910         Update comments to reflect _Jv_* function names.
10911
10912 Fri Sep 25 16:03:02 1998  Per Bothner  <bothner@cygnus.com>
10913
10914         * decl.c (complete_start_java_method):  DECL_RESULT is always promoted.
10915         * decl.c (start_java_method):  Handle PROMOTE_PROTOTYPES target macro.
10916         * parse.y (expand_start_java_method):  Likewise.
10917
10918 Thu Sep 24 12:20:35 1998  Per Bothner  <bothner@cygnus.com>
10919
10920         * expr.c (pop_arguments):  Handle PROMOTE_PROTOTYPES target macro.
10921
10922         * class.c (push_class):  IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
10923         (add_field):  No longer need to convert from RECORD_TYPE to pointer,
10924         * expr.c:  Remove no-longer-needed calls to promote_type.
10925         * decl.c (give_name_to_locals):  Liekwise.
10926         * jcf-parse.c (get_class_constant):  Compensate for new signatures.
10927         * parse.y:  Add/remove promote_type calls as appropriate.
10928         * typeck.c (parse_signature_type):  Returns POINTER_TYPE for objects.
10929         (parse_signature_string):  Likewise.
10930         (build_java_array_type):  Fix for now signature convenions.
10931
10932         * lex.c (java_lex):  Fix (from Alex) for JC1_LITE problem.
10933
10934 Wed Sep 23 14:49:35 1998  Tom Tromey  <tromey@cygnus.com>
10935
10936         * class.c (init_class_processing): libjava function renamed to
10937         _Jv_RegisterClass.
10938
10939 Tue Sep 22 12:00:02 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10940
10941         * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
10942         * java-tree.def: Fixed DEFTREECODE third argument.
10943         (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
10944         CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
10945         * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
10946         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
10947         JAVA_THIS_EXPR): Now replaced by tree code definitions.
10948         (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
10949         * lang.c (java_tree_code_type, java_tree_code_length,
10950         java_tree_code_name): New arrays.
10951         (lang_init): Append Java tree node definitions to Gcc ones.
10952         * lex.c (expression_obstack): Declared as extern when JC1_LITE
10953         defined.
10954         (java_init_lex): Initialize wfl_append, wfl_string_buffer,
10955         wfl_to_string.
10956         (java_lex): Allow declaration of empty string constants. Retain
10957         location information on CASE_TK and DEFAULT_TK.
10958         * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
10959         JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
10960         Modified to be more robust.
10961         (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
10962         (build_new_invocation, try_builtin_assignconv,
10963         patch_switch_statement, string_constant_concatenation,
10964         build_string_concatenation, patch_string_cst, patch_string,
10965         java_expand_switch): New function declarations.
10966         * parse.y: Rules related to switch and EH tagged <node>.
10967         (label_id): Set to NULL_TREE
10968         (wfl_string_buffer, wfl_append, wfl_to_string): New static global
10969         tree nodes.
10970         (this_or_super:): Fixed indentation.
10971         (statement:, statement_nsi:, statement_without_trailing_substatement:,
10972         statement_expression:): Removed call to RULE on all sub-rules.
10973         (switch_expression:, switch_labels:): New rules.
10974         (switch_statement:, switch_block:, switch_block_statement_groups:,
10975         switch_block_statement_group:, switch_labels:, switch_label:):
10976         Defined actions.
10977         (throw_statement:, synchronized_statement:, try_statement:):
10978         Defined temporary actions.
10979         (class_instance_creation_expression:): Call
10980         build_new_invocation. Fixed indentation.
10981         (field_access): Fixed indentation.
10982         (method_invocation): Likewise.
10983         (make_qualified_primary): Use THIS_EXPR.
10984         (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
10985         resolving from SUPER, set *type_found.
10986         (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
10987         (java_complete_tree): Removed unused local variable `location'. Case
10988         for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
10989         NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
10990         on MODIFY_EXPR: and all binary operator tree code cases. Removed
10991         STRING_CST: case. default: checks for patchable strings.
10992         (complete_function_arguments): Transform string constant or
10993         crafted StringBuffer if necessary.
10994         (build_method_invocation): Fixed comments.
10995         (build_new_invocation): New function.
10996         (patch_assignment): Call try_builtin_assignconv to figure a valid
10997         assignment conversion between builtin types.
10998         (try_builtin_assignconv): New function.
10999         (build_binop): Use URSHIFT_EXPR directly to call build.
11000         (operator_string): Use UNARY_PLUS_EXPR.
11001         (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
11002         operator.
11003         (do_merge_string_cste, merge_string_cste,
11004         string_constant_concatenation, build_string_concatenation,
11005         patch_string, patch_string_cst): New function.
11006         (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
11007         (patch_unaryop): Likewise. New test of valid ++/-- operands.
11008         (build_newarray_node): Use NEW_ARRAY_EXPR.
11009         (build_this): Use THIS_EXPR.
11010         (build_return): Enable debug information on return statement.
11011         (build_if_else_statement): Likewise.
11012         (complete_labeled_statement): Fixed related comment.
11013         (build_loop_body): Fixed comment.
11014         (build_bc_statement): Enable debug information on break/continue
11015         statements.
11016         (patch_bc_statement): Fixed typos. Handle SWITCH statement
11017         context.
11018         (patch_switch_statement, case_identity, java_expand_switch): New
11019         functions.
11020
11021 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
11022
11023         * buffer.h (BUFFER_INIT):  New macro.
11024         * jcf-write.c (struct jcf_partial):  New type.  Put global stuff here.
11025         Pass (struct jcf_partial *state) to most functions.
11026         (jcf_block, jcf_relocation):  New types.
11027         Support labels, branches, conditionals, loops.
11028
11029 Mon Sep 21 15:08:48 1998  Tom Tromey  <tromey@cygnus.com>
11030
11031         * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
11032
11033 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
11034
11035         * decl.c (integer_type_node):  Make it have INT_TYPE_SIZE.
11036         * verify.c (verify_jvm_instructions):  Use int_type_not (32 bits),
11037         not integer_type_node (INT_TYPE_SIZ bits).
11038
11039         * parse.y (patch_if_else_statement):  Accept promoted_boolean_type_node.
11040
11041         * jcf-reader.c (get_attribute):  New HANDLE_EXCEPTION_TABLE hook.
11042         * jcf-dump.c (print_exception_table):  New function.
11043         (disassemble_method):  Better handling of wide instructions.
11044         Make more robust for bad input.
11045
11046 Wed Sep 30 20:53:51 1998  Jeffrey A Law  (law@cygnus.com)
11047
11048         * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
11049         FreeBSD.
11050
11051 Thu Sep 17 19:45:01 1998  Jeffrey A Law  (law@cygnus.com)
11052
11053         * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
11054
11055 Thu Sep 17 16:21:52 1998  Tom Tromey  <tromey@cygnus.com>
11056
11057         * Makefile.in ($(PARSE_H)): Removed target.
11058
11059 Thu Sep 17 01:57:07 1998  Jeffrey A Law  (law@cygnus.com)
11060
11061         * Makefile.in (JAVA_OBJS): Add memmove.o
11062         (memmove.o): New target & rules.
11063
11064 Tue Sep 15 23:21:55 1998  Tom Tromey  <tromey@cygnus.com>
11065
11066         * expr.c (expand_invoke): Don't generate a call to the class init
11067         code.
11068
11069 Mon Sep 14 10:14:47 1998  Jeffrey A Law  (law@cygnus.com)
11070
11071         * Makefile.in: Add many missing dependencies.
11072         * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
11073         as appropriate.
11074         * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
11075         * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
11076
11077 Fri Sep 11 14:05:21 1998  Per Bothner  <bothner@cygnus.com>
11078
11079         * decl.c (complete_start_java_method):  If method is static (and
11080         not private) call _Jv_InitClass.
11081         * expr.c (expand_invoke):  Don't call build_class_init.
11082
11083         * jvspec.c (jvgenmain_spec):  Fix spec for generated .o file.
11084
11085 Thu Sep 10 10:33:31 1998  Jeffrey A Law  (law@cygnus.com)
11086
11087         * Make-lang.in (GCJ): Define before using.
11088
11089 Wed Sep  9 21:23:10 1998  Jeffrey A Law  (law@cygnus.com)
11090
11091         * gjavah.c (java_no_argument): Renamed from no_argument to avoid
11092         losing due to namespace pollution in GNU getopt.h
11093
11094 Wed Sep  9 13:33:39 1998  Tom Tromey  <tromey@cygnus.com>
11095
11096         * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
11097         (java.all.cross): Likewise.
11098         (java.rest.encap): Likewise.
11099
11100 Tue Sep  8 10:34:05 1998  Jeffrey A Law  (law@cygnus.com)
11101
11102         * gjavah.c (print_class_decls): Fix thinko in arglist
11103         * jcv-io.c (find_classfile): Similarly.
11104
11105 Mon Sep  7 13:59:49 1998  Jeffrey A Law  (law@cygnus.com)
11106
11107         * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
11108
11109 Sat Sep  5 16:08:01 1998  Tom Tromey  <tromey@cygnus.com>
11110
11111         * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
11112         (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
11113         * Makefile.in (PARSE_C): New macro.
11114         (PARSE_H): Likewise.
11115         (PARSE_SCAN_C): Likewise.
11116         ($(PARSE_C)): Target renamed from parse.c.
11117         ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
11118         (clean): Remove parse-scan.c as well.
11119         (parse.o): Depend on $(PARSE_C).
11120
11121 Sat Sep  5 08:48:40 1998  Anthony Green  <green@cygnus.com>
11122
11123         * README, license.terms: Removed.
11124
11125         * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
11126         decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
11127         javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
11128         jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
11129         keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
11130         lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
11131         verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
11132         and Java trademark attribution.
11133
11134 Fri Sep  4 10:42:05 1998  Tom Tromey  <tromey@cygnus.com>
11135
11136         * Makefile.in: Use gcjh, not gjavah.
11137         * config-lang.in (stagestuff): Use gcjh, not gjavah.
11138         * Make-lang.in: Changed gjavah to gcjh everywhere.
11139
11140 Thu Sep  3 18:04:09 1998  Per Bothner  <bothner@cygnus.com>
11141
11142         * gjavah.c:  Support new -prepend -add -append flags.
11143         (print_method_info):  Method is not virtual if class is final.
11144
11145 Thu Sep  3 12:03:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11146
11147         * jv-scan.c: Fixed copyright assignment.
11148         * keyword.gperf: Likewise.
11149         * keyword.h: Likewise.
11150         * lex.c: Fixed copyright assignment.
11151         (java_lex): Push unicode back when parsing '<'.
11152         * lex.h: Fixed copyright assignment.
11153         * parse-scan.y: Likewise.
11154         * parse.h: Fixed copyright assignment.
11155         (build_debugable_stmt, complete_for_loop): New function prototypes.
11156         * parse.y: Fixed copyright assignment.
11157         (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
11158         size_zero_node when completing a loop with no exit condition.
11159         (for_statement_nsi:): Define action.
11160         (for_init:, for_update:): Return size_zero_node when empty.
11161         (declare_local_variables): Call build_debugable_stmt.
11162         (build_debugable_stmt): New function.
11163         (build_loop_body): Build debugable statement around loop
11164         condition part.
11165         (complete_loop_body): Take into account the debugable statement
11166         around the EXIT_EXPR.
11167         (complete_loop_body): New function.
11168         (patch_exit_expr): Fixed condition inversion.
11169
11170 Wed Sep  2 11:53:58 1998  Tom Tromey  <tromey@cygnus.com>
11171
11172         * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
11173         name of thread define.
11174         * jvspec.c (THREAD_NAME): New macro.
11175         (GCLIB): Likewise.
11176         (THREADLIB): Likewise.
11177         (lang_specific_driver): Recognize attempt to link with thread
11178         library or gc library.  Recognize -ljava on command line so it
11179         isn't linked against more than once.
11180
11181 Wed Sep  2 11:28:35 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11182
11183         * parse-scan.y (report_main_declaration): Name of the class
11184         containing `main' can be a qualified name.
11185
11186 Mon Aug 31 13:25:58 1998  Tom Tromey  <tromey@cygnus.com>
11187
11188         * config-lang.in: Changed gjavac to gjc everywhere.
11189         * Make-lang.in: Changed gjavac to gjc everywhere.
11190
11191 Thu Aug 27 02:28:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11192
11193         * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
11194         (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
11195         and install the files.
11196         * Makefile.in (JAVA_OBJS_LITE): New variable.
11197         (compiler:): Now include jv-scan as a dependency.
11198         (../jv-scan$(exeext), parse-scan.c): New targets.
11199         (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
11200         * config-lang.in (compilers): Removed gcj, gjavah from the list.
11201         * jcf-parse.c (parse_source_file): Call java_layout_classes and
11202         check for errors even if parse_only.
11203         * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
11204         defined.
11205         (yylex): New function. Uses java_lex body.
11206         (java_lex): Removed commented out statement. Remove local variable
11207         literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
11208         appropriate.  Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
11209         DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
11210         SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
11211         if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
11212         SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
11213         where appropriate.
11214         (java_lex_error): Empty if JC1_LITE is defined.
11215         (java_get_line_col): Return 0 if JC1_LITE is defined.
11216         * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
11217         SET_MODIFIER_CTX): Moved into the section containing the macros
11218         conditionally defined by JC1_LITE.
11219         (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
11220         argument if JC1_LITE is defined.
11221         (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
11222         REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
11223         is defined.
11224         (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
11225         FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
11226         SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
11227         to different values according to JC1_LITE.
11228         * parse.h (int_fits_type_p, stabilize_reference): Prototype not
11229         declared if JC1_LITE set.
11230         (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
11231         defined if JC1_LITE not set.
11232         (struct parser_ctx): Reorganized and skip the jc1 front end part
11233         if JC1_LITE set.
11234         (java_layout_classes): New function definition.
11235         (java_push_parser_context, java_init_lex, yyparse, yylex,
11236         yyerror): Prototype always declared. All other static function
11237         prototypes declared only if JC1_LITE is not set.
11238         * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
11239         declared in parse.h.
11240         (java_layout_classes): New function.
11241         (java_complete_expand_methods): No longer layout the class here.
11242         * parse-scan.y: New file.
11243         * jv-scan.c: New file.
11244
11245 Tue Aug 25 10:17:54 1998  Tom Tromey  <tromey@cygnus.com>
11246
11247         * gjavah.c (main): Handle -friend option.
11248         (friend_specs): New global.
11249         (generate_access): Handle friend_specs.
11250         (process_file): Likewise.
11251         (MAX_FRIENDS): New macro.
11252         (friend_count): New global.
11253         (print_cxx_classname): Added `prefix' argument.  Ignore arrays.
11254         Changed all callers.
11255
11256 Mon Aug 24 20:19:27 1998  Per Bothner  <bothner@cygnus.com>
11257
11258         * jcf-dump.c (process_class):  Move JCF_FINISH use to main,
11259         (main):  Handle processing all the entries of a named .zip archive.
11260         * jcf-io.c (jcf_trim_old_input):  New function.
11261         * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le):  New macros.
11262
11263 Mon Aug 24 07:35:13 1998  Per Bothner  <bothner@cygnus.com>
11264
11265         * lang.c (flag_assume_compiled):  Make default be on.
11266
11267 Fri Aug 21 17:29:04 1998  Per Bothner  <bothner@cygnus.com>
11268
11269         * jcf-dump.c:  Add bunches of flags to control output more.
11270         (process_class):  New function;  support printing more than one class.
11271         (main): Support new --print-main and --javap flags.
11272         * jcf-reader.c (IGNORE_ATTRIBUTE):  New hook.
11273         * jcf.h (CPOOL_INDEX_IN_RANGE):  New macro.
11274
11275 Thu Aug 20 14:24:47 1998  Per Bothner  <bothner@cygnus.com>
11276
11277         Change mangling of dispatch table to match C++ vtable (w/thunks).
11278         * class.c (build_dtable_decl), java-tree.h:  New function.
11279         (make_class_data):  Call it.
11280         * decl.c (init_decl_processing):  Likewise.
11281
11282 Wed Aug 19 17:57:07 1998  Warren Levy  <warrenl@cygnus.com>
11283
11284         * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
11285         soft_anewarray; adjust args passed.
11286         * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
11287         match _Jv_NewObjectArray.
11288
11289 Wed Aug 19 09:33:23 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11290
11291         * decl.c (push_labeled_block, pop_labeled_block): New functions.
11292         * expr.c (loopup_label): Call create_label_decl.
11293         (create_label_decl): New function.
11294         (java_lang_expand_expr): Call expand_start_bindings with argument
11295         set to zero.
11296         * java-tree.h Added space after PROTO in function declarations
11297         when necessary.
11298         (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
11299         (create_label_decl, push_labeled_block): New function
11300         declarations.
11301         * lex.c (label_id): Initialize.
11302         (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
11303         switch.
11304         * parse.h Added space after PROTO in function declarations when
11305         necessary.
11306         (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
11307         LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
11308         LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
11309         PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
11310         macros.
11311         (struct parser_ctxt): New fields current_loop,
11312         current_labeled_block.
11313         (build_if_else_statement, patch_if_else_statement,
11314         add_stmt_to_compound, patch_exit_expr, build_labeled_block,
11315         generate_labeled_block, complete_labeled_statement,
11316         build_bc_statement, patch_bc_statement, patch_loop_statement,
11317         build_new_loop, build_loop_body, complete_loop_body): New function
11318         declarations.
11319         * parse.y (java_warning_count): New global variable.
11320         (label_id): New static variable.
11321         (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
11322         (block:): Return size_zero_node when block is empty.
11323         (empty_statement:): Return size_zero_node.
11324         (statement:): Implement supplemental action when for_statement: is
11325         reduced.
11326         (label_decl:): New rule.
11327         (labeled_statement:): Rewritten using label_decl. Actions
11328         implemented.
11329         (labeled_statement_nsi:): Likewise.
11330         (if_then_statement): Actions implemented.
11331         (while_expression): New rule.
11332         (while_statement:): Rewritten using while_expression. Actions
11333         implemented.
11334         (while_statement_nsi:): Likewise.
11335         (do_statement_begin:): New rule.
11336         (do_statement:): Rewritten using do_statement_begin. Actions
11337         implemented.
11338         (for_statement:): Rewritten using for_begin. Actions implemented.
11339         (for_statement_nsi:): Likewise.
11340         (for_header:, for_begin:): New rules.
11341         (for_init:): Actions implemented.
11342         (statement_expression_list:, break_statement:,
11343         continue_statement:): Likewise.
11344         (yyerror): Count number of issued warning(s).
11345         (java_report_errors): Report error(s) and/or warning(s).
11346         (java_complete_class): Use build_java_argument_signature to
11347         recompute completed method signature.
11348         (java_check_regular_methods): New locals method_wfl and aflags.
11349         Use method_wfl instead of lookup_cl during error reports. Fixed
11350         indentation and modified some error messages. Use
11351         lang_printable_name in method instead of the DECL_NAME. New code
11352         to issue warnings on methods not overriding corresponding methods
11353         private to a different package.
11354         (java_method_add_stmt): Call add_stmt_to_compound.
11355         (add_stmt_to_compound): New function.
11356         (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
11357         LOOP_EXPR, EXIT_EXPR and COND_EXPR.
11358         (build_if_else_statement, patch_if_else_statement,
11359         build_labeled_block, generate_labeled_block,
11360         complete_labeled_statement, build_new_loop, build_loop_body,
11361         complete_loop_body, patch_loop_statement, build_bc_statement,
11362         patch_bc_statement, patch_exit_expr): New functions.
11363         * typeck.c (build_java_signature): Build argument signature before
11364         enclosing it in between parenthesis.
11365
11366 Mon Aug 17 17:44:24 1998  Warren Levy  <warrenl@cygnus.com>
11367
11368         * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
11369         (JAVA_OBJS): Added reminder comment
11370
11371 Thu Aug 13 10:01:45 1998  Nick Clifton  <nickc@cygnus.com>
11372
11373         * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
11374         be interpreted as a long long.
11375
11376 Thu Aug 13 14:34:07 1998  Warren Levy  <warrenl@cygnus.com>
11377
11378         * decl.c (init_decl_processing): Use _Jv_InitClass, not
11379         soft_initialise_class.  Use _Jv_NewMultiArray, not
11380         soft_multianewarray.  Use _Jv_ThrowBadArrayIndex, not
11381         soft_badarrayindex.  Use _Jv_CheckCast, not soft_checkcast.  Use
11382         _Jv_CheckArrayStore, not soft_checkarraystore.  Use
11383         _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
11384
11385 Wed Aug 12 14:23:13 1998  Per Bothner  <bothner@cygnus.com>
11386
11387         * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
11388         length_identifier_node):  New global tree node constants.
11389         * parse.y (kw_super, kw_this, kw_length):  Removed globals.
11390         Replace uses by super_identifier_node etc.
11391         * lex.c (kw_super, kw_this, kw_length):  Don't initialize.
11392
11393         * parse.y (resolve_field_access):  Don't special-case ".length" if
11394         flag_emit_class_files.
11395         (patch_array_ref):  Leave as ARRAY_REF if flag_emit_class_files.
11396         * jcf-write.c (generate_bytecode_insns):  Handle ARRAY_REF opcode
11397         and ARRAY.length.
11398
11399 Tue Aug 11 11:31:55 1998  Per Bothner  <bothner@cygnus.com>
11400
11401         * decl.c (init_decl_processing): Remove unused method_type_node fields.
11402         * class.c (make_method_value):  Remove init for removed fields.
11403
11404         * class.c (layout_class):  Use build_java_argument_signature.
11405         * java-tree.h (TYPE_ARGUMENT_SIGNATURE):  New macro.
11406
11407         * typeck.c (push_java_argument_signature):  Removed.  Merged into ...
11408         (build_java_argument_signature):  Use TYPE_ARGUMENT_SIGNATURE cache.
11409         (build_java_signature):  Don't use push_java_argument_signature.
11410
11411         * typeck.c (lookup_argument_method):  New function.
11412         * parse.y (java_check_regular_methods):  Use lookup_argument_method
11413         instead of lookup_java_method2 followed by lookup_java_method.
11414
11415         * parse.y (check_method_redefinition):  Minor optimization.
11416
11417         * jcf-write.c (generate_bytecode_insns):  Handle RETURN_EXPR,
11418         MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
11419
11420 Mon Aug 10 09:57:15 1998  Tom Tromey  <tromey@cygnus.com>
11421
11422         * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
11423         c-pragma.o.
11424
11425         * gjavah.c (java_float_finite): Use K&R-style definition.
11426         (java_double_finite): Likewise.
11427         (generate_access): Now returns void.  Changed all callers.
11428         (last_access_generated): Removed.
11429         (process_file): Only make a single pass over the .class file.
11430
11431 Wed Jul 29 17:50:23 1998  Per Bothner  <bothner@cygnus.com>
11432
11433         * class.c (get_dispatch_table):  Add extra dummy vtable entry,
11434         for compatibility for G++ (with -fvtable-thunks).
11435         * expr.c (build_invokevirtual):  Add one for extra dummy vtable entry.
11436
11437         * gjavah.c (process_file):  Use public inheritance for super-class.
11438
11439 Wed Jul 29 13:19:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11440
11441         * lex.c (java_init_lex): Initialize ctxp->package.
11442         * parse.h (struct parser_ctxt): package and package_len replaced
11443         by tree package, an identifier node. Field method_decl_list is
11444         gone. Fixed comments.
11445         (lookup_field_wrapper, merge_qualified_name, not_accessible,
11446         class_in_current_package): New function prototypes.
11447         * parse.y (array_type:): Set class loaded flag on primitive type
11448         arrays.
11449         (package_declaration:): Assign ctxp->package to the
11450         identifier node.
11451         (method_invocation:): Handle invocation of method qualified by
11452         `super'.
11453         (single_type_import_declaration:): Removed ambiguity check.
11454         (java_pop_parser_context): New local variable `next'. Reset and
11455         set IMPORT_CLASSFILE_NAME flags on current and previous import
11456         list.
11457         (java_accstring_lookup): Use new local macro COPY_RETURN.
11458         (lookup_field_wrapper): New function.
11459         (parser_qualified_classname): Use merge_qualified_name.
11460         (parser_check_super_interface): Broaden error message.
11461         (do_resolve_class): Check for qualified class name in the current
11462         compilation unit if appropriate.
11463         (process_imports): Check for already defined classes.
11464         (check_pkg_class_access): Got rid of call to
11465         get_access_flags_from_decl.
11466         (java_complete_expand_methods): Call safe_layout_class based on
11467         the current class size.
11468         (make_qualified_primary): Build a WFL qualification on primary if
11469         none exists.
11470         (merge_qualified_name): New function.
11471         (make_qualified_name): Use merge_qualified_name.
11472         (resolve_expression_name): Use safe_lookup_field.
11473         (resolve_field_access): Got rid of call to get_access_flags_from_decl.
11474         (resolve_qualified_expression_name): Likewise. Check on resolved
11475         element accessibility.
11476         (not_accessible_p, class_in_current_package): New functions.
11477         (maybe_access_field): Got rid of call to get_access_flags_from_decl.
11478         (patch_method_invocation_stmt): Merged common pieces. Check
11479         accessibility of invoked method.
11480         (check_for_static_method_reference): Add returned type in error
11481         message.
11482         (invocation_mode): Get rid of bogus check on PRIVATE methods.
11483         (refine_accessible_methods_list): Merged two conditions in test.
11484         (java_complete_class): Sanity check on stabilize_ref gone.
11485         * zextract.c (read_zip_archive): Cast lseek second argument to long.
11486
11487 Tue Jul 28 21:39:22 1998  Per Bothner  <bothner@cygnus.com>
11488
11489         * class.c (hashUtf8String):  Fix - use new JavaSoft specification.
11490
11491 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
11492
11493         * gjavah.c (F_NAN): Removed.
11494         (F_NAN_MASK): New macro.
11495         (F_POSITIVE_INFINITY): Removed.
11496         (F_NEGATIVE_INFINITY): Likewise.
11497         (java_float_finite): Rewrote.
11498         (D_NAN_MASK): Renamed.
11499         (java_double_finite): Rewrote.
11500         (D_POSITIVE_INFINITY): Removed.
11501         (D_NEGATIVE_INFINITY): Likewise.
11502
11503         * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
11504         If verbose, print underlying representation of value in hex.
11505
11506 Fri Jul 24 14:14:32 1998  Per Bothner  <bothner@cygnus.com>
11507
11508         * buffer.h, buffer.c:  New files.
11509         * Makefile.in (JAVA_OBJS):  Add buffer.o.
11510
11511         Support locals variables and writing their debug entries to .class.
11512         * jcf-write.c:  Simplify some by user new buffer type.
11513         (vode_buffer_grow):  Removed.
11514         (struct localvar_info):  New type.
11515         (localsvars, localvartable):  New buffers.
11516         (localvar_alloc, localvar_free):  New functions.
11517         (generate_bytecode_insns):  Handle local variables.
11518         (generate_classfile):  Write LocalVariableTable attribute.
11519
11520 Fri Jul 24 13:46:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11521
11522         * jcf-io.c (open_in_zip): Check the zipfile magic number.
11523         * zipfile.h (ZIPMAGIC): New macro.
11524
11525 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
11526
11527         * Makefile.in (gjavah.o): Updated dependencies.
11528         (jcf-dump.o): Likewise.
11529         (all.indirect): Use ../gjavah.
11530         (../gjavah$(exeext)): Likewise.
11531         (clean): Don't remove gjavah.
11532         (clean): Remove parse.c, not java/parse.c.
11533         * Make-lang.in (java): Added gjavah.
11534         (gjavah$(exeext)): New target.
11535         (GJAVAH_SOURCES): New macro.
11536         (java.all.build): Added gjavah.
11537         (java.all.cross): Likewise.
11538         (java.rest.encap): Likewise.
11539         * config-lang.in (compilers, stagestuff): Added gjavah.
11540
11541 Thu Jul 23 18:33:56 1998  Tom Tromey  <tromey@cygnus.com>
11542
11543         * gjavah.c (java_float_finite): New function.
11544         (java_double_finite): Likewise.
11545         (F_POSITIVE_INFINITY): New macro.
11546         (F_NEGATIVE_INFINITY): Likewise.
11547         (F_NAN): Likewise.
11548         (D_POSITIVE_INFINITY): Likewise.
11549         (D_NEGATIVE_INFINITY): Likewise.
11550         (D_NAN): Likewise.
11551         (print_field_info): Use java_float_finite and java_double_finite.
11552
11553 Thu Jul 23 15:28:24 1998  Per Bothner  <bothner@cygnus.com>
11554
11555         * parse.y (method_header):  Name "this" implicit argument.
11556
11557 Wed Jul 22 15:47:30 1998  Per Bothner  <bothner@cygnus.com>
11558
11559         * jcf-write.c:  Write out LineNumberTable attribute in .class file.
11560         (linenumber_buffer, linenumber_ptr, linenumber_limit):  New statics.
11561         (put_linenumber):  New function.
11562         (generate_bytecode_insns, generate_classfile):  Write line numbers.
11563
11564 Wed Jul 22 14:39:00 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11565
11566         * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
11567         (lookup_name, build_known_method_ref, build_class_init,
11568         build_invokevirtual, invoke_build_dtable, match_java_method,
11569         build_field_ref, pushdecl_force_head, build_java_binop,
11570         binary_numeric_promotion, build_decl_no_layout,
11571         build_java_arrayaccess, build_newarray, build_anewarray,
11572         build_java_array_length_access, build_java_arraynull_check): New
11573         extern function prototypes.
11574         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
11575         JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
11576         java-tree.h.
11577         * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
11578         to NULL
11579         * jcf.h (jcf_out_of_synch): New extern function prototype.
11580         * parse.h: Static/global function implemented in parse.y
11581         prototyped and declarations moved at the end of the file.
11582         (DECL_P): Check that the argument isn't null.
11583         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
11584         JAVA_THIS_EXPR): No longer defined here. See java-tree.h
11585         (QUAL_DECL_TYPE): New macro.
11586         (PARAMS): Macro definition removed.
11587         * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
11588         (return_statement:): Call build_return.
11589         (field_access:): Call make_qualified_primary in sub rule.
11590         (method_invocation:): Build method invocation and call
11591         make_qualified_primary when processing primaries.
11592         (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
11593         get_type_from_signature.
11594         (java_check_regular_method): Extra integer 0 argument when calling
11595         lookup_java_method2.
11596         (lookup_java_interface_method2): Extra method DECL argument when
11597         calling lookup_java_interface_method2.
11598         (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
11599         COMPOUND_EXPR node.
11600         (java_complete_expand_method): Layout current class iff not
11601         already done. Don't process interface's methods.
11602         (java_complete_expand_method): Use super class only if it
11603         exists. Use current class otherwise.
11604         (make_qualified_primary): New function.
11605         (resolve_expression_name): Process qualified expression or
11606         expression from primary the same way.
11607         (resolve_expression_name): Two last arguments to
11608         resolve_field_access are now NULL_TREEs.
11609         (resolve_field_access): New variable is_static. Local field must
11610         be DECLs. is_static computed on field DECLs only. Append code in
11611         where_found to the field access if necessary. Use QUAL_DECL_TYPE
11612         to initialize field_type.
11613         (resolve_qualified_expression_name): New local variable,
11614         previous_call_static and is_static. Handle primaries with function
11615         calls, casts, array references and `this'. `super' now handled as
11616         `(super_class)this'. Use is_static to clarify boolean expressions.
11617         Added code to handle case where a proper handle is required to
11618         access a field. Use QUAL_DECL_TYPE where applicable.
11619         (maybe_access_field): New function.
11620         (patch_method_invocation_stmt): New arguments primary, where,
11621         is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
11622         deleted. Use `where' as a type to search from if specified. Check
11623         for static method reference where forbidden. Append primary or
11624         current_this to the argument list if not calling constructor nor
11625         static methods.
11626         (check_for_static_method_reference): New function.
11627         (patch_invoke): Layout the class on which new is done if
11628         necessary.
11629         (lookup_method_invoke): Changed format to report errors on
11630         methods.
11631         (qualify_ambiguous_name): New local variable this_found. Now
11632         handle things from primaries. Method call are considered
11633         expression names.
11634         (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
11635         changed into NULLs.
11636         (not_initialized_as_it_should_p): Comply with the new DECL_P.
11637         (java_complete_tree): New case fo RETURN_EXPR. Process function
11638         call arguments in separate function.
11639         (complete_function_arguments): New function.
11640         (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
11641         anymore.
11642         (patch_assignment): Take the return function slot into account as
11643         a RHS. Distinguish assignment from a return.
11644         (valid_ref_assignconv_cast_p): Use build_java_argument_signature
11645         when checking methods in interfaces.
11646         (resolve_type_during_patch): NULL argument to unresolve_type_p
11647         instead of NULL_TREE.
11648         (patch_newarray): Fixed typo in comment.
11649         (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
11650         (build_return, patch_return): New functions.
11651         * typeck.c (lookup_java_constructor): Fixed typo in comment.
11652
11653 Tue Jul 21 12:10:04 1998  Per Bothner  <bothner@cygnus.com>
11654
11655         * constants.c (find_name_and_type_constant, find_fieldref_index,
11656         find_methodref_index):  New methods.
11657         * expr.c (build_invoke_non_interface):  If flag_emit_class_files,
11658         just return given method.  Also, rename to build_known_method_ref.
11659         (expand_invoke):  Rename call to build_invoke_non_interface.
11660         * java-tree.h, parse.h:  Update prototype.
11661         * parse.y, decl.c, jcf-parse.c:  Suppress calls to back-end functions
11662         (such as expand_expr_stmt) if flag_emit_class_files.
11663         * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
11664         STACK_TARGET, IGNORE_TARGET):  New macros.
11665         (code_buffer, code_ptr, code_limit, code_S, code_SP_max):  New globals.
11666         (generate_bytecode_insn):  New function to generate method's bytecode.
11667         (generate_classfile):  Node generate Code attribute for a method.
11668         (code_buffer_grow, push_constant1, push_constant2, push_int_const,
11669         push_long_const, field_op, adjust_typed_op, maybe_wide):
11670         New functions used by generate_bytecode_insn.
11671
11672         * typeck.c (signature_include_return):  Remove variable.
11673         (push_java_argument_signature, build_java_argument_signature):  New.
11674         (build_java_signature):  Use push_java_argument_signature.
11675         * parse.y:  Use build_java_argument_signature instead of fiddling
11676         with signature_include_return.
11677
11678 Fri Jul 17 09:48:51 1998  Tom Tromey  <tromey@cygnus.com>
11679
11680         * gjavah.c (print_c_decl): Always generate JArray<>* for array
11681         types.
11682
11683         * Makefile.in (all.indirect): Added gjavah$(exeext).
11684         (gjavah$(exeext)): Added $(exeext).
11685         (clean): Likewise.
11686
11687 Thu Jul 16 15:29:20 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11688
11689         * class.c (layout_class): Call to java_layout_parsed_class replace
11690         by safe_layout_class.
11691         * expr.c (build_java_array_length_access): Removed static storage
11692         class in the function definition.
11693         (build_java_arraynull_check): Likewise.
11694         Also fixed typos in two comments.
11695         * lex.c (java_init_lex): Initialize static global kw_length.
11696         (java_lex): Use BUILD_OPERATOR on RETURN_TK.
11697         * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
11698         java_lex_error.
11699         (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
11700         * parse.h (resolve_no_layout): New static function declaration.
11701         (get_identifier_in_static): Declaration removed.
11702         (java_layout_parsed_class): Function name declaration changed to
11703         safe_layout_class.
11704         (build_newarray_node, patch_newarray, resolve_type_during_patch,
11705         not_initialized_as_it_should_p, build_this): New static function
11706         declarations.
11707         (pushdecl_force_head, build_java_binop, int_fits_type_p,
11708         binary_numeric_promotion, stabilize_reference,
11709         build_decl_no_layout, build_java_arrayaccess): Extern function
11710         declarations moved into their own section.
11711         (build_newarray, build_anewarray, build_java_array_length_access,
11712         build_java_arraynull_check): New extern function declarations.
11713         (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
11714         (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
11715         fake tree codes.
11716         (CALL_CONSTRUCTOR_P): New macro.
11717         * parse.y (kw_length): New static global tree node.
11718         (return_statement): Tagged <node>.
11719         (RETURN_TK): Tagged <operator>.
11720         (variable_declarator_id:): Build variable declaration with an
11721         empty initialization value if a syntax error was found in the
11722         initialization part of the variable declaration.
11723         (statement_without_trailing_substatement:): return_statement: now
11724         uses the default rule.
11725         (return_statement:): Temporarily fixed to return NULL_TREE.
11726         (primary_no_new_array:): Call build_this when THIS_TK was parsed.
11727         (class_instance_creation_expression:): Class creation rules now
11728         call build_method_invocation upon reduction.
11729         (array_creation_expression:): Rules call build_newarray_node upon
11730         reduction.
11731         (dim_exprs:): Build a list of dimension expressions.
11732         (dim_expr:): Store location of the OSB_TK in the dimension
11733         expression node.
11734         (method_invocation:): Added a new error rule.
11735         (build_unresolved_array_type): WFL argument may also be an array
11736         on a primitive type. Name of the argument changed to reflect this.
11737         (method_declarator): Insert argument type at the beginning of the
11738         argument type list and later reverse the list.
11739         (unresolved_type_p): Argument 'returned' may be optionally
11740         NULL_TREE.
11741         (java_layout_class_from_source): Function renamed
11742         safe_layout_class.
11743         (resolve_and_layout): Now call resolve_no_layout and
11744         safe_layout_class.
11745         (resolve_no_layout): New function.
11746         (purify_type_name): New function.
11747         (complete_class_report_errors): Call purify_type_name during error
11748         report on a type not found.
11749         (process_imports): error_found local variable doesn't need to be
11750         initialized to zero.
11751         (declare_local_variables): New local type_wfl. Fixed typo in error
11752         message. type_wfl assigned to unresolved type and used to register
11753         incomplete type. Build a WFL around the variable initialization
11754         statement so that debug info can be generated on it.
11755         (source_start_java_method): Reverse argument list after they've
11756         been processed.
11757         (current_this): New static global variable.
11758         (java_complete_expand_methods): Set current_this when appropriate.
11759         (resolve_expression_name): Build correct static and non static
11760         field access bearing a simple name.
11761         (resolve_field_access): Resolve the length field of arrays. Handle
11762         f.m() cases.
11763         (patch_method_invocation_stmt): Set the type of the method
11764         invocation to error_mark_node. This value is later overridden by a
11765         valid type, if any. Don't handle qualified constructor invocation
11766         as qualified method invocation. Call lookup_method_invoke with its
11767         new flag. It's no longer necessary to access the selected method
11768         as the value of a tree list. Handle constructor invocation.
11769         (patch_invoke): Reverse argument list when invoking non interface
11770         methods. Insert call to new as the first argument of the
11771         constructor.
11772         (invocation_mode): Return a INVOKE_STATIC is the invoked method is
11773         defined within a final class. Return INVOKE_STATIC if the invoked
11774         method is a constructor.
11775         (lookup_method_invoke): New lc argument is a flag to indicate a
11776         constructor lookup. Now handle constructor lookup. Choose the most
11777         specific method in case several were matching the invocation
11778         requirements. Return a method decl instead of a tree list featuring
11779         one single method decl element.
11780         (refine_accessible_methods_list): New lc flag argument to
11781         indicate that a constructor is being looked up.
11782         (not_initialized_as_it_should_p): New function.
11783         (java_complete_tree): Now process fake tree codes
11784         JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
11785         save_expr on resolved function call arguments. Case on
11786         UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
11787         (patch_assignment): LHS can be a field access expression. When
11788         dealing with reference, lhs_type is the promoted type of the
11789         rhs_type, not the RHS. Use not_initialized_as_it_should_p where
11790         applicable.
11791         (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
11792         (patch_binop): Use not_initialized_as_it_should_p where
11793         applicable.
11794         (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
11795         (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
11796         where applicable.
11797         (resolve_type_during_patch): New function.
11798         (patch_cast): Call resolve_type_during_patch to resolve type and
11799         report error accordingly.
11800         (patch_array_ref): Use not_initialized_as_it_should_p where
11801         applicable. Array base expression is saved before being
11802         used. Promote the type of an array elements if it contains non
11803         builtin types.
11804         (build_newarray_node, patch_newarray, build_this): New functions.
11805
11806 Thu Jul 16 10:46:47 1998  Tom Tromey  <tromey@cygnus.com>
11807
11808         * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
11809         increment it in `for' statement.
11810         (print_field_info): If number is inf or nan, don't print it.
11811         (print_method_info): If method name is `delete', just ignore it.
11812         (print_c_decl): Special-case jstringArray.
11813
11814         * gjavah.c (help): New function.
11815         (no_argument): New function.
11816         (usage): Changed text.
11817         (main): Rewrote argument handling.  Now handles -v, --help,
11818         --version.
11819         (version): New function.
11820         (found_error): New global.
11821         (main): Return found_error.
11822         (generate_access): Set found_error.
11823         (print_c_decl): Likewise.
11824
11825 Wed Jul 15 10:36:27 1998  Tom Tromey  <tromey@cygnus.com>
11826
11827         * gjavah.c (print_c_decl): Don't print "," when examining field.
11828         Skip type name when looking at "[L" types.
11829         (process_file): Now static.
11830         (generate_access): Now returns int.
11831         (last_access_generated): New global.
11832         (process_file): Clear last_access_generated; make multiple passes
11833         over the class.
11834         (print_field_info): Just return if generate_access returns true.
11835         (print_method_info): Likewise.  Also, allow <init> functions to
11836         pass through.
11837         (print_c_decl): Added is_init argument.  Print constructors
11838         properly.
11839         (print_cxx_classname): Use UTF8_GET to extract characters from
11840         string.
11841         (print_base_classname): New function.
11842         (print_class_decls): New function.
11843         (process_file): Use it.
11844         (utf8_cmp): New function.
11845
11846 Mon Jul 13 14:21:47 1998  Nick Clifton  <nickc@cygnus.com>
11847
11848         * lang-options.h: Format changed to match changes in gcc/toplev.c
11849         to implement a --help option.
11850
11851 1998-07-10  Brendan Kehoe  <brendan@cygnus.com>
11852
11853         * decl.c (init_decl_processing): Revert change to dtable_type.
11854
11855 Thu Jul  9 18:22:12 1998  Per Bothner  <bothner@cygnus.com>
11856
11857         * java-tree.h (CLASS_P):  Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
11858
11859 1998-07-08  Brendan Kehoe  <brendan@cygnus.com>
11860
11861         * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
11862
11863         * lang.c (lang_init): Default flag_exceptions to 1, without
11864         checking to see if it's 2 first.
11865
11866 Wed Jul  8 03:01:32 1998  Jeffrey A Law  (law@cygnus.com)
11867
11868         * constants.c: Include "system.h".
11869         * decl.c: Likewise.
11870         * lang.c (flag_new_exceptions): Get via extern now.
11871         (lang_init_options): New functions.  Turn on flag_new_exceptions.
11872
11873 Tue Jul  7 12:56:48 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11874
11875         * lex.c (java_lex): Return 0 when we see an invalid character in
11876         the input.
11877
11878         * lex.c (java_read_char): Specify extra argument when calling
11879         java_lex_error.
11880         (java_read_unicode, java_parse_end_comment,
11881         java_parse_escape_sequence): Likewise,
11882         (java_lex): Specify extra argument when calling
11883         java_lex_error. Test that IDs are beginning with a legal character
11884         for IDs. Handle invalid characters with an error message and a
11885         call to java_lex_error.
11886         (java_lex_error): Adjust column position by new argument
11887         `forward'. Issue an error even if in the middle of reporting an
11888         other error.
11889
11890 1998-07-07  Brendan Kehoe  <brendan@cygnus.com>
11891
11892         * jcf-io.c (find_class): Zero out BUFFER before we use it, since
11893         we don't explicitly put a null pointer when we're copying it.
11894
11895 Tue Jul  7 09:38:38 1998  Tom Tromey  <tromey@cygnus.com>
11896
11897         * gjavah.c (print_cxx_classname): New function.
11898         (super_class_name): Likewise.
11899         (print_super_fields): Removed.
11900         (in_super): Removed.
11901         (print_field_info): Never generate #defines.
11902         (print_c_decl): Changed generated types to match JNI.  No longer
11903         print class name before method name.
11904         (print_method_info): Print "static" before static methods.
11905         Print "virtual" before non-final methods.
11906         (usage): Use exit(1), not exit(-1).
11907         (main): Likewise.
11908         (print_field_info): Use %.17g to print a double.
11909         (last_access): New globals.
11910         (process_file): Initialize last_access.
11911         (usage): Now static.
11912         (ACC_VISIBILITY): New define.
11913         (generate_access): New function.
11914         (print_field_info): Call it.
11915         (print_method_info): Likewise.  Also, generate information for all
11916         methods, not just native methods.  Return void.
11917         (print_c_decl): Return void.
11918         (print_field_info): Return void.
11919
11920 Thu Jul  2 16:53:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11921
11922         * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
11923         processing the jc1 grammar file. Prefix bison functions and
11924         variables with java_.
11925         (parse.c): Dependencies on parse.h and lex.h
11926         * expr.c (build_java_arrayaccess): Function now global.
11927         * java-tree.h: Comment reorganized to carry on previous
11928         classification effort.
11929         (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
11930         RESOLVE_TYPE_NAME_P): New flags on WFLs.
11931         * jcf-parse.c (parse_source_file): java_parse_source_file renamed
11932         java_parse (new prefix java_ generated by bison).
11933         (java_layout_parsed_class, java_register_parsed_class): Function
11934         call removed.
11935         (yyparse): Removed unnecessary call to init_outgoing_cpool.
11936         * lex.c (static tree wfl_op): Variable deleted.
11937         (java_init_lex): Initialize kw_super and kw_this. Initialize more
11938         ctxp fields to NULL_TREE.
11939         (java_lex): No longer create WFL for operators. Filename caching
11940         mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
11941         created as STRING_CST and later expanded. Removed extra argument
11942         to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
11943         and SUPER.
11944         (build_wfl_node): Removed code in comments.
11945         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
11946         store token and location data in the current bison token.
11947         * parse.h: Removed pre-processor based symbol prefixes hack. Moved
11948         static/extern function declaration at the beginning of the file.
11949         (struct qualification): Data structure definition deleted.
11950         (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
11951         (qualify_ambiguous_name): Function declaration modified. Function
11952         now returns nothing.
11953         (build_array_ref, patch_array_ref, make_qualified_name,
11954         resolve_qualified_expression_name, maybe_generate_clinit,
11955         resolve_field_access): New static function declarations.
11956         (build_java_arrayaccess): New extern function declaration.
11957         (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
11958         (CALL_EXPR_PRIMARY): Macro deleted.
11959         (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
11960         (struct parser_ctxt): Field initialized_final
11961         removed. non_static_initialized, static_initialized: New fields.
11962         * parse.y (static tree kw_super, static tree kw_this): New global
11963         static.
11964         (%union): tree wfl field of operator member replaced by int
11965         location. WFLs are non longer created for operators.
11966         (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
11967         (qualified_name:): Now calls make_qualified_name to build the
11968         identifier.
11969         (type_declaration:): Consider generating <clinit> when class
11970         parsing completed.
11971         (variable_declarator:): Directly build an assignment node when the
11972         variable is initialized when declared.
11973         (this_or_super:): Build a WFL and set current location when THIS
11974         or SUPER are parsed.
11975         (expression_statement:): Wrap statement around a WFL.
11976         (primary_no_new_array:): Fixed typo. Changed value returned by
11977         THIS_TK because of its new type (temporary).
11978         (dim_exprs:): Temporary fix because of OSB_TK's new type.
11979         (field_access:): Build qualified name with SUPER.
11980         (method_invocation:): Fixed returned value because of SUPER's new
11981         type.
11982         (array_access:): Use OSB_TK location information.
11983         (post_increment_expression:, post_decrement_expression:,
11984         unary_expression:, pre_increment_expression:,
11985         pre_decrement_expression:, unary_expression_not_plus_minus:,
11986         cast_expression:, multiplicative_expression:,
11987         additive_expression:, shift_expression:, relational_expression:,
11988         equality_expression:, and_expression:, exclusive_or_expression:,
11989         inclusive_or_expression:, conditional_and_expression:,
11990         conditional_or_expression:, assignment:): Use new location/token
11991         information available on operators.
11992         (create_class): Set super_decl_type to NULL_TREE when processing
11993         java.lang.Object.
11994         (register_fields): Field initialization is now a MODIFY_EXPR
11995         node. Chain initialization code to the matching lists (according
11996         the the field declaration modifiers).
11997         (maybe_generate_clinit): New function.
11998         (method_header): Don't set method's DECL_NAME to a WFL when adding
11999         methods to java.lang.Object.
12000         (resolve_and_layout): Now can return NULL_TREE if the type
12001         resolution fails. Otherwise, return the class DECL instead of its
12002         TYPE.
12003         (check_method_redefinition): Don't patch method DECL_NAME if it
12004         belongs to java.lang.Object.
12005         (process_imports): Simply assign error_found to the value returned
12006         by check_pkg_class_access.
12007         (declare_local_variables): Don't use their init statements (if
12008         any) when parsing error were previously found. Reuse MODIFY_EXPR
12009         build during parsing as an init statement.
12010         (java_method_add_stmt): Now return the current method body.
12011         (java_layout_parsed_class, java_register_parsed_class): Functions
12012         removed.
12013         (java_complete_expand_methods): Initialize the constant pool on a
12014         per class basis. Layout the classes before expanding their method
12015         bodies. Don't try expand artificial constructor code if error were
12016         found. Make the classes data and register them if no error were
12017         found.
12018         (java_complete_expand_method): Retrieve an artificial constructor
12019         argument list before entering its body. Assign the top block to
12020         the artificial constructor function body and set types of declared
12021         blocks and compound statements to void. Walk method body if not an
12022         artificial constructor.
12023         (make_qualified_name, cut_identifier_in_qualified): New functions.
12024         (resolve_expression_name): Fixed comments. Save/restore the
12025         current class CLASS_LOADED_P flag value. Build non qualified
12026         static field access and handle qualified expression names.
12027         (resolve_field_access, resolve_qualified_expression_name): New
12028         functions.
12029         (patch_method_invocation_stmt): Use the new expression resolution
12030         scheme, calling resolve_field_access when the function call is
12031         resolved as an expression.
12032         (qualify_ambiguous_name): Function rewritten to work on qualified
12033         expression produced by make_qualified_name.
12034         (java_complete_tree): Promote type when function's argument are
12035         RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
12036         the assignment to discover further errors if RHS is a expression
12037         name that fails to evaluate. Declare LHS initialized even though
12038         the assignment failed. Don't use the location variable and removed
12039         extra argument in patch function calls. Now handle the ARRAY_REF
12040         case and build internal string representation when STRING_CSTs are
12041         walked.
12042         (build_method_invocation): Don't wrap function call around a WFL.
12043         (build_assignment): Likewise. Use the operator location
12044         information.
12045         (patch_assignment): Handle array access LHSs. Handle error
12046         provenance, resulting in a better error report.
12047         (build_binop): Use op_location from operator as binop location
12048         information.
12049         (build_unaryop, build_incdec, build_cast): Likewise.
12050         (patch_binop): Extract location information from the node. Fixed
12051         typo in error message.
12052         (patch_unary_op): Extract location information from the node.
12053         (build_array_ref, patch_array_ref): New functions.
12054
12055 Wed Jul  1 13:11:36 1998  Tom Tromey  <tromey@cygnus.com>
12056
12057         * expr.c (expand_java_INSTANCEOF): Changed calling convention to
12058         match _Jv_IsInstanceOf.
12059         * decl.c (init_decl_processing): Use _Jv_NewArray, not
12060         soft_newarray.  Use _Jv_IsInstanceOf, not soft_instanceof.
12061
12062 Tue Jun 30 14:12:54 1998  Tom Tromey  <tromey@cygnus.com>
12063
12064         * decl.c (init_decl_processing): Functions are now named
12065         _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
12066
12067 Mon Jun 29 14:47:10 1998  Per Bothner  <bothner@cygnus.com>
12068
12069         * java-tree.h (load_class):  Add prototype.
12070         * class.c (is_compiled_class):  Add missing arg to load_class.
12071         * expr.c (expand_java_NEW):  Call load_class.
12072         * parse.y (process_import):  Removed bogus use of void return value.
12073
12074 Thu Jun 25 11:50:48 1998  Per Bothner  <bothner@cygnus.com>
12075
12076         * decl.c, java-tree.h (soft_athrow_node):  Renamed to soft_node.
12077         Function name is "_Jv_Throw" instead of "soft_athrow".
12078         * decl.c, java-tree.h (soft_new_node):  Renamed to alloc_object_node.
12079         Function name is "_Jv_AllocObject" instead of "soft_new".
12080         Takes an extra parameter (object size).
12081         * expr.c:  Update calls.
12082
12083 Wed Jun 24 13:59:02 1998  Per Bothner  <bothner@cygnus.com>
12084
12085         * lex.c (java_get_line_col):  Handle end-of-file.
12086         * except.c (expand_end_java_handler):  Handle null type (i.e. finally).
12087
12088 Wed Jun 24 09:22:34 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
12089
12090         * lang.c (lang_init): Make -fexceptions the default.
12091         * except.c (maybe_start_try, maybe_end_try): Don't do anything if
12092         exception handling is not turned on.
12093
12094 Tue Jun 23 10:17:09 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
12095
12096         * lang.c (flag_new_exceptions): Make this this default.
12097         * decl.c (end_java_method): Call emit_handlers.
12098         * except.c (method_init_exceptions): Set language code and version.
12099         (expand_start_java_handler): Enable exception, and call
12100         expand_eh_region_start.
12101         (expand_end_java_handler): Enable exception, and set up catch blocks.
12102         (emit_handlers): New routine to generate the saved handlers.
12103         * java-except.h (emit_handlers): Add prototype.
12104
12105 Fri Jun 12 11:31:24 1998  Per Bothner  <bothner@cygnus.com>
12106
12107         We used to have three different representations of the constant pool:
12108         the CPool structure, the tree_constant_pool, and the constructures
12109         used to build the Class object (which may need class and string
12110         constants) in compiled code.  None were appropriate for compiling
12111         to .class files, so I did a major overhaul.
12112
12113         First, the tree_constant_pool array was removed.  Things were
12114         modified to the CPool structure in the JCF could be used.
12115         Second, a "capacity" field was added to the CPool, and functions
12116         written to search for a matching constant, adding one if not found.
12117         The code that generated the Class object was changed to use a CPool.
12118         The actual TREE_LISTs used to build the CONSTRUCTORs used for
12119         the static Class object are now only in build_constants_constructor.
12120         Finally, I wrote code which can generate a .class file (including its
12121         constant pool) from the RECORD_TYPE of a class.  This is a big step
12122         on the way to compiling Java source into .class files.
12123
12124         * jcf-write.c:  New file. Writes out a RECORD_TYPE as a .class file.
12125         * Makefile.in (JAVA_OBJS):  Added jcf-write.o.
12126
12127         * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
12128         CONSTANT_ResolvedString, CONSTANT_ResolvedClass):  New macros.
12129         (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
12130         COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
12131         (COMPONENT_REF_CLASS):  Replaced by COMPONENT_REF_CLASS_INDEX.
12132         (lang_type):  Removed constant_pool field.
12133         * jcf.h (CPool):  Renamed size to count.  Added field capacity.
12134         (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
12135         CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT):  New macros.
12136         Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
12137
12138         * constants.c (current_constant_pool_tags, current_constant_pool_data,
12139         current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
12140         * constants.c (build_constants_constructor):  Use new outgoing_cpool.
12141         (set_constant_entry, find_constant1, find_constant2,
12142         find_class_constant, count_constant_pool_bytes, write_constant_pool,
12143         find_utf8_constant, find_class_or_string_constant):  New functions.
12144
12145         * jcf-parse.c (load_class):  Don't save/restore tree-constant_pool.
12146         (get_constant):  Use current_jcf.cpool instead of tree_constant_pool.
12147         (give_name_to_class, get_class_constant):  Likewise.
12148         * jcf-parse.c, java-tree.h (tree_constant_pool):  Removed.
12149         (get_name_and_type_constant, get_ref_constant):  Removed.
12150         * parse.h (parser_ctxt):  Remove field tree_constant_pool.
12151         * parse.y:  Don't save/restore tree_constant_pool.
12152         * verify.c (verify_jvm_instructions):  Update for new approach.
12153         * expr.c (expand_invoke, expand_java_field_op): Likewise.
12154
12155         * lang-options.h:  Added -femit-class-file, -femit-class-files.
12156         * lang.c (flag_emit_class_files), java-tree.h:  New flag.
12157         (lang_f_options):  Added "emit-class-file(s)".
12158
12159         * expr.c (build_java_arrayaccess):  Generate more efficient array
12160         bounds checking, by using unsigned compare.
12161
12162         * expr.c (expand_invoke):  Re-arrange error checks to make more robust.
12163
12164 Wed Jun 10 17:34:42 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12165
12166         * parse.h: New comment on the handling of unresolved type
12167         identifiers. JDEPs are now part of the jdep_code enum.
12168         (typedef struct jdep): Now use enum jdep_code or int, depending on
12169         availability. Both are narrowed down to an 8 bits bitfield.
12170         (CALL_EXPR_PRIMARY): Fixed comment.
12171
12172 Wed Jun 10 10:54:39 1998  Tom Tromey  <tromey@cygnus.com>
12173
12174         * Make-lang.in (java): Added gjavac and jvgenmain.
12175         (java.start.encap): Depend on gjavac.
12176         (java.rest.encap): Depend on jvgenmain.
12177
12178         * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
12179         (JAVA_CROSS_NAME): Likewise.
12180         (java.all.build): Depend on jvgenmain and gjavac.
12181         (java.all.cross): Depend on jvgenmain and gjavac-cross.
12182         (jvgenmain$(exeext)): New target.
12183         (java.install-common): Wrote.
12184         * config-lang.in (compilers, stagestuff): Added gjavac and
12185         jvgenmain.
12186
12187 Wed Jun 10 12:19:04 1998  Dave Brolley  <brolley@cygnus.com>
12188
12189         * lang.c (lang_decode_option): New argc/argv interface.
12190
12191 Tue Jun  9 18:12:46 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12192
12193         * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
12194         * decl.c (build_decl_no_layout): New function.
12195         * expr.c (java_lang_expand_expr): Layout declarations found in
12196         blocks before they're pushed.
12197         * jcf-parse.c (load_class): Save current line when parsing class
12198         file.
12199         (parse_source_file): Register class before expanding their
12200         methods.
12201         * lang.c (put_decl_node): Produce `null' when `void *' is
12202         processed.
12203         * lex.c (static tree wfl_op): New static global, for error report
12204         on casts.
12205         (java_init_lex): wfl_operator and wfl_op initialized
12206         here. Filename caching added for wfl_op. Return wfl_op when `(' is
12207         parsed.
12208         * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
12209         patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
12210         build_unresolved_array_type): New static function definitions.
12211         (build_decl_no_layout): New extern function declared.
12212         (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
12213         faulty modifier exists.
12214         (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
12215         (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
12216         (UNARY_PLUS_EXPR): New fake operator.
12217         (struct parser_ctxt): New field osb_number.
12218         * parse.y (static tree wfl_operator): New static WFL for operator
12219         bound error messages.
12220         (DECR_TK, INCR_TK): Moved.
12221         (OP_TK): Tagged <operator>.
12222         (array_type:): Now call build_unresolved_array_type.
12223         (dim_expr:): Count the number of '[' seen.
12224         (post_increment_expression, post_decrement_expression,
12225         pre_increment_expression, pre_decrement_expression,
12226         unary_expression_not_plus_minus, unary_expression:): Actions are
12227         now building the corresponding unary expressions.
12228         (cast_expression:): Actions are now building cast expressions.
12229         (build_unresolved_array_type): New function.
12230         (create_interface): Reset the number of declared interfaces.
12231         (create_class): Likewise.
12232         (method_header): Methods declared within the scope of an interface
12233         are now implicitly set public and abstract.
12234         (java_complete_class): Variable's and parameter's type are patched
12235         with a promoted type.
12236         (declare_local_variables): Resolved non builtin types are promoted
12237         before being used to build a variable decl. Removed type patch
12238         posted on variable initialization statement.
12239         (source_start_java_method): Use build_decl_no_layout to build the
12240         decl of a parameter of incomplete type.
12241         (java_register_parsed_class): Process interfaces too. Call
12242         rest_of_decl_compilation on each processed class declarations.
12243         (java_complete_expand_methods): Don't attempt to expand things in
12244         interfaces.
12245         (java_complete_tree): Process CONVERT_EXPR, even though it always
12246         has a type. Propagate error_mark_node to node's type too. Promote
12247         method's call argument type and return error_mark_node if
12248         argument's completion didn't work. MODIFY_EXPR can have a WFL as a
12249         RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
12250         handle unary operator nodes.
12251         (build_assignment): Added comment.
12252         (print_int_node): New function.
12253         (patch_assignment): New second argument. New error handling. Use
12254         print_int_node. Handle references. Use can_cast_to_p to issue
12255         different error message according to the context and check upon
12256         the initialization of the RHS.
12257         (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
12258         (operator_string): Handle more operators.
12259         (patch_binop): No longer use a function static
12260         wfl_operator. Improved error message on shift distance.
12261         (build_unaryop, build_incdec, build_cast, patch_unaryop,
12262         patch_cast): New functions.
12263
12264 Fri Jun  5 18:03:07 1998  Per Bothner  <bothner@cygnus.com>
12265
12266         * jvspec.c:  New file.
12267         * Make-lang.in:  New rules to build gjavac from jvspec.c and ../gcc.c.
12268
12269         * java-tree.h (identifier_subst):  Add declaration.
12270
12271 Thu Jun  4 13:44:23 1998  Tom Tromey  <tromey@cygnus.com>
12272
12273         * jvgenmain.c (main): Generate call to JvRunMain.
12274
12275         * class.c (make_class_data): Push value for "sync_info" field.
12276         * decl.c (init_decl_processing): Push "sync_info" field.
12277
12278 Wed Jun  3 20:39:14 1998  Per Bothner  <bothner@cygnus.com>
12279
12280         * typeck.c (build_java_array_type):  Set TYPE_NAME to actual
12281         Java (source) name, not signature.
12282         Set TYPE_ALIGN to (at least) that of element_type.
12283
12284 Tue Jun  2 15:19:19 1998  Per Bothner  <bothner@cygnus.com>
12285
12286         * class.c:  Moved classname-mangling-rekated code to ...
12287         * mangle.c:  ... this new file.
12288         * jvgenmain.c:  New program (needs mangle.c) to generate main program.
12289         * Makefile.in:  Update for above changes.
12290
12291 Mon Jun  1 09:58:36 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12292
12293         * expr.c (truthvalue_conversion): Convert integer and floating
12294         point value to their truth value.
12295         * lex.c (java_lex): Handle the `null' literal.
12296         * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
12297         (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
12298         ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
12299         New macros.
12300
12301         * parse.y: Reorganization/documentation on token declaration.
12302         (binop_lookup[]): New added new tree codes.
12303         (relational_expression): Build corresponding binary operators.
12304         (equality_expression, conditional_and_expression,
12305         conditional_or_expression): Likewise.
12306         (java_complete_class): Fix crash in debug message.
12307         (java_complete_tree): Check initialization of method call
12308         arguments. Further bogus node evaluation to detect more error
12309         during assignments. Handles more binary operators.
12310         (patch_assignment): Use DECL_P.
12311         (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
12312         code.
12313         (operator_string): Handle more case. Compacted source.
12314         (patch_binop): Changed function comment. Checking for
12315         uninitialized first operand takes the compound assignment into
12316         account and uses DECL_P. Checking for uninitialized second operand
12317         delayed to routine's end. Use macros to issue type bound error
12318         messages and issue messages on both operands if their types are
12319         different. Force fixed type into node. Handle all binary
12320         operators.
12321
12322 Wed May 27 10:30:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12323
12324         * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
12325         * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
12326         build operator node and return tokens.
12327         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
12328         * parse.h (java_complete_tree): Changed returned type in prototype.
12329         (build_method_invocation, build_assignment, patch_assignment,
12330         patch_binop): New static function declarations.
12331         (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
12332         BUILD_EXPR_WFL): New macros.
12333         * parse.y (enum tree_code binop_lookup[]): New static for token to
12334         TREE_CODE lookup.
12335         (%union): Parser union has new sub-structure `operator'.
12336         (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
12337         PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
12338         ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
12339         ASSIGN_ANY_TK): Tokens tagged `operator'.
12340         (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
12341         AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
12342         MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
12343         REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
12344         (assignment_operator:): Rule tagged `operator'.
12345         (expression_statement:): Re-installed default rule.
12346         (method_invocation:): Sub rules call build_method_invocation.
12347         (postfix_expression:): Don't attempt to resolve name here. Just
12348         return an ID.
12349         (multiplicative_expression:): Sub-rules build corresponding binop
12350         expression node.
12351         (additive_expression:, shift_expression:, and_expression:,
12352         exclusive_or_expression:, inclusive_or_expression:): Likewise.
12353         (assignment:): Sub rule invoke build_assignment.
12354         (assignment_operator:): Default rules on sub rules.
12355         (force_error): Added documentation on this variable.
12356         (declare_local_variables): Build initialization calling
12357         build_assignment.
12358         (expand_start_java_method): Removed unused rtx declaration. Mark
12359         arguments as already initialized.
12360         (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
12361         (java_complete_expand_methods): Don't process next method if
12362         completion of the previous one triggered errors.
12363         (java_complete_expand_method): Call source_end_java_method if no
12364         error were found during completion.
12365         (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
12366         locals declaratilon. Handle names found within a class. Return
12367         error_mark_node when things aren't found.
12368         (patch_method_invocation_stmt): Return error_mark_node on failures.
12369         (patch_invoke): Removed unused local. Return the correct node.
12370         (java_complete_tree): Now returns a value. The BLOCK section binds
12371         local identifiers and the type of a BLOCK is now void. Assign the
12372         result of operand completion on COMPOUND_EXPR. Assign the
12373         encapsulated node of a WFL to the result of its completion, except
12374         when the node is an identifier. Now handle MODIFY_EXPR and several
12375         binary operators. Return error_mark_node on errors.
12376         (build_method_invocation, build_assignment, patch_assignment,
12377         build_binop, operator_string, patch_binop): New functions.
12378         * typeck.c (binary_numeric_promotion): New function.
12379
12380 Thu May 21 12:01:04 1998  Per Bothner  <bothner@cygnus.com>
12381
12382         * class.c (identifier_subst):  New convenience wrapper for ident_subst.
12383         Replace most uses of ident_subst by identifier_subst.
12384
12385         * class.c (push_class_static_dummy_field):  Removed function.
12386         (build_class_ref):  Find Class object decl by looking up "CNAME.class",
12387         instead of looking got "class" static field.  Create that decl here.
12388         (class_identifier_node):  Removed;  no longer needed.
12389         (init_class_processing):  Don't init class_identifier_node.
12390         * jcf-parse.c (jcf_parse):  Don't call push_class_static_dummy_field.
12391         Do nreverse 0 times (instead of twice) for Object and Class.
12392         * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
12393
12394 Wed May 20 16:35:04 1998  Per Bothner  <bothner@cygnus.com>
12395
12396         * jcf-parse.c (parse_class-file):  Set lino to smallest line number,
12397         while initializing linenumber_count and linenumber_table.
12398         Do it before init_function_start (which calls emit_line_note).
12399         * expr.c (expand_byte_code):  Don't need to clear lineno here.
12400
12401 Mon May 18 16:23:32 1998  Tom Tromey  <tromey@cygnus.com>
12402
12403         * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
12404         then mangle number as _N_.
12405
12406         * class.c (mangle_class_field): New function.
12407         (build_class_ref): Set assembler name of class reference using
12408         mangle_class_field.
12409         (push_class_static_dummy_field): Likewise.
12410
12411 Sun May 17 12:52:35 1998  Michael Tiemann <tiemann@cygnus.com>
12412
12413         * parse.y (source_start_java_method): Use TREE_SET_CODE instead
12414         of assigning to TREE_CODE.  The latter method exploits a feature
12415         of GCC that is not ANSI compliant.
12416
12417 Thu May 12 13:44:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12418
12419         * decl.c (pushdecl_force_head): New function.
12420         (pushlevel): Removed conditional printf.
12421         (complete_start_java_method): Don't enter local variable scope if
12422         function is compiled from source code.
12423         * expr.c: parse.h now included
12424         (java_lang_expand_expr): New function.
12425         * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
12426         printf. Terminate buffer when doing directories.
12427         * jcf-parse.c (parse_source_file): Call lang_init_source before
12428         parsing and before code generation.
12429         * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
12430         use printf if the macro is defined.
12431         * lang.c (lang_init): Install lang_expand_expr hook on
12432         java_lang_expand_expr.
12433         (java_dummy_print): New function.
12434         (lang_init_source): New function.
12435         * lex.c (java_lex): Remember location of an opening brace at the
12436         second nesting level.
12437         (java_is_eol): Unget character seen after a CR if it is EOF.
12438         * parse.h: Now includes lex.h
12439         (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
12440         printf if the macro is defined.
12441         (expand_start_java_method, build_expr_block, enter_block,
12442         exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
12443         New static function declarations.
12444         (pushdecl_force_head): New extern function declaration.
12445         (INCOMPLETE_TYPE_P): New macro.
12446         (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
12447         (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
12448         BLOCK_EXPR_ORIGIN): New macros.
12449         (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
12450         DECL_SOURCE_LINE_LAST): New macros.
12451         (struct parser_ctxt): Removed field current_method_decl, redundant
12452         with the field current_function_decl. Added fields
12453         first_ccb_indent1 and pending_block.
12454         * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
12455         BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
12456         tagged <node>
12457         (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
12458         (compilation_unit:): Cosmetic on sub rule.
12459         (type_declaration:): Cosmetic on sub rules. Added an error rule.
12460         (variable_initializer:): Installed default rule on expression:.
12461         (method_declaration:): method_header: starts a new
12462         method. method_body: installs the function body, absorbs blocks
12463         emitted for temporary variable scopings, pops function's body block
12464         and merges function's last statement lineno in DECL_SOURCE_LINE.
12465         (method_body:): Installed default rules.
12466         (block:): Call enter_block when an opening brace is seen.  Absorb
12467         scoping blocks and call exit_block when a closing brace is seen.
12468         (block_statement:): Cosmetic changes.
12469         (method_invocation:): Create WFL around CALL_EXPR node.
12470         (patch_stage): Added comment around definition.
12471         (method_header): Try to use first_ccb_indent1 as the first line of
12472         the method, so BP debug info are emitted at the first opening
12473         brace of the function. If the function has no body, use the
12474         location of the function's name. Override currently defined method
12475         name with the matching WFL so we can point redefinition errors
12476         using the location where the function's name was declared.
12477         (check_abstract_method_header): Interprets DECL_NAME as an
12478         identifier or as a WFL, accordingly.
12479         (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
12480         (check_method_redefinition): Use DECL_NAME as a WFL. Extract
12481         location and name information out of it and reinstall DECL_NAME to
12482         its original identifier node value.
12483         (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
12484         function's source code).
12485         (read_import_dir): Test the value returned by find_class and issue
12486         a fatal accordingly.
12487         (declare_local_variables): Push a new block for the scope of the
12488         new variable(s) if code has been already generated at that nesting
12489         level. Pinpoint redefinition errors using the variable id
12490         WFLs. Generate initialization code if necessary. If the variable
12491         type is incomplete, register a patch on its decl.
12492         (source_start_java_method): Rewritten. Define a new block for the
12493         function's parameters. Build parameter decl out of function's
12494         arguments and register them for a patch if their types are
12495         incomplete.
12496         (expand_start_java_method): Includes the part of
12497         source_start_java_method that was pushing the parameter decls and
12498         completing the method start code.
12499         (source_end_java_method): Removed call the expand_end_bindings and
12500         poplevel (already taken care of). Reinstall function's arguments
12501         and get function's last line of code before calling
12502         expand_function_end.
12503         (java_method_add_stmt): New comment before the function's
12504         code. Complement the second operand of the current COMPOUND_EXPR
12505         if necessary.
12506         (java_complete_expand_methods): Don't generate debug info on line
12507         zero when expanding a generated constructor.
12508         (java_complete_expand_method): Set start and end line numbers for
12509         a artificially generated constructor to one and manually call
12510         enter_block and exit_block when defining it. For all methods:
12511         expand function's start calling the new expand_start_java_method
12512         and invoke java_complete_tree on the effective method's body, if
12513         any.
12514         (resolve_expression_name): Now use lookup_name_in_blocks to search
12515         local variable decls and print out an error when variables are
12516         undefined.
12517         (patch_method_invocation_stmt): Inserted comment before the
12518         function's code.
12519         (lookup_method_invoke): Chain method's arguments using chainon
12520         with the current arg list as a second argument. Inserted missing
12521         IDENTIFIER_POINTER when reporting an error on methods not found.
12522         (refine_accessible_methods_list): Don't retain constructors.
12523         (patch_arguments): Function removed.
12524         (java_complete_tree): Inserted comment before the function's
12525         code. New case for BLOCKs. Moved the WFL case a bit
12526         further. Complete function's arguments.
12527         (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
12528         maybe_absorb_scoping_blocks): New functions.
12529
12530 Mon Apr 27 10:50:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12531
12532         * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
12533         previously set.
12534         * jcf-parse.c (parse_source_file, java_error_count): New forward
12535         and extern declarations.
12536         (java_parse_abort_on_error): Macro moved.
12537         (jcf_parse_source): fatal called if fopen fails. Now calls
12538         parse_source_file.
12539         (parse_source_file): New parse_only parameter. Reflects the
12540         elimination of the second pass.
12541         (yyparse): parse_source_file called with argument set to 0.
12542         * jcf.h (JCF_ZERO): Sets java_source to zero.
12543         * lex.c (java_init_lex): pass argument is gone. Function modified
12544         to be called once during the analysis of a file.
12545         (java_unget_unicode): Fixed typo in fatal message.
12546         (java_get_line_col): Likewise.
12547         (java_lval): Likewise. String literals no longer built during
12548         second pass.
12549         * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
12550         account.
12551         * parse.h (MODIFIER_WFL): New macro.
12552         (parse_check_super, parser_check_super_interface): Now return int.
12553         (parser_chain_incomplete_item, not_builtin_p,
12554         complete_method_decl): Declarations removed.
12555         (build_method_invocation_stmt, build_invoke): Renamed using the
12556         `patch' instead of `build'
12557         (register-incomplete_type, obtain_incomplete_type,
12558         java_complete_tree, java_complete_expand_method,
12559         unresolved_type_p, create_jdep_list): New function declarations.
12560         (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
12561         END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
12562         (jdep): New typedef on new struct _jdep.
12563         (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
12564         JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
12565         JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
12566         JDEP_RESOLVED_P): New macros.
12567         (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
12568         JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
12569         JDEP_VARIABLE): New enum values and jdep kinds.
12570         (jdeplist): New typedef on struct _jdeplist.
12571         (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
12572         macros.
12573         (CALL_EXPR_PRIMARY): New macro.
12574         (struct parser_ctxt): Fields java_pass, current_method_decl,
12575         method_decl_list deleted. New field jdeplist.
12576         (INCOMPLETE_P): Macro deleted.
12577         * parse.y (single_type_import_declaration:): Removed pass switch.
12578         (type_import_on_demand_declaration): Likewise.
12579         (field_declaration:): Removed pass switch on all sub rules.
12580         (class_declaration:): Call the complete_class_decl removed on
12581         class_body rules.
12582         (method_declaration:): Removed second pass switch. No longer chain
12583         methods decl when method_header reduced.
12584         (method_header:): Sub rules no longer depend on pass switch.
12585         (method_declarator:): Likewise.
12586         (method_body:): Likewise.
12587         (abstract_method_declaration:): Likewise.
12588         (block_statement:): Likewise.
12589         (local_variable_declaration:): Likewise.
12590         (argument_list:): Likewise.
12591         (method_invocation:): Likewise. Call to build_method_invocation_stmt
12592         removed. Partial CLASS_EXPR tree node built instead.
12593         (postfix_expression:): Removed pass switch on all sub rules.
12594         (java_pop_parser_context): Free classd_list content.
12595         (yyerror): Call obstrack_grow0 to finalize error message.
12596         (check_class_interface_creation): Comment modified to reflect new
12597         returned value meaning. Removed second pass switch. Return 1 if an
12598         error was found, 0 otherwise. Adjust pointer on filename if a
12599         leading path separator was found.
12600         (maybe_create_class_interface_decl): Removed first pass switch
12601         when linking the class decl to the class_list. Install a new
12602         jdep_list for the class.
12603         (add_superinterfaces): List of unresolved interfaces is
12604         gone. Unresolved interfaces are directly added to the current
12605         dependencies list.
12606         (create_interface): Second pass shortcut removed.
12607         ctpx->modifier_ctx access through MODIFIER_WFL.
12608         (create_class): Second pass shortcut removed. Call to
12609         register_incomplete_type replaces the call to
12610         parser_chain_incomplete_item.
12611         (complete_class_decl): Function removed.
12612         (duplicate_declaration_error): New way of retrieving redeclared
12613         item type.
12614         (register_fields): Call to lookup_modifier_cl replaced by
12615         MODIFIER_WFL. New way of handling unresolved type, using
12616         unresolved_type_p and obtain_incomplete_type.
12617         register_incomplete_type replaces call to parser_chain_incomplete_item.
12618         (patch_stage): New static global variable.
12619         (method_header): New way of handling unresolved type, using
12620         unresolved_type_p and obtain_incomplete_type. patch_stage used to
12621         indicates that the method decl needs to be patched.
12622         (check_abstract_method_header): Call to lookup_modifier_cl
12623         replaced by MODIFIER_WFL.
12624         (method_declarator): Incomplete argument type are registered
12625         calling register_incomplete_type. Patch on the declared method is
12626         issued in that case.
12627         (unresolved_type_p): New function.
12628         (parser_check_super_interface): New comment to reflect function's
12629         modified returned type (int). Function and has a new argument
12630         this_wfl. Call to parse_error_context uses this_wfl instead of
12631         relying on lookup_cl.
12632         (parser_check_super): Comment reflects function's new returned
12633         type (int). Function returns non zero value on error.
12634         (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
12635         register_incomplete_type, jdep_resolve_class): New functions to
12636         handle incomplete types in declarations.
12637         (java_complete_class): Rewritten to work with the new incomplete
12638         type handling scheme.
12639         (complete_class_report_errors): Likewise.
12640         (complete_method_decl): Removed: it jobs is now handled by
12641         java_complete_class.
12642         (do_resolve_class): Class loaded in not already loaded and not
12643         found in Java source code.
12644         (java_check_regular_methods, java_check_abstract_methods): Don't
12645         call complete_method_decl anymore.
12646         (lookup_modifier_cl, not_builtin_p): Functions deleted.
12647         (read_import_dir): Got rid of the pass number dependency.
12648         (declare_local_variables): New handling of unresolved types (patch
12649         issued).
12650         (source_start_java_method): New parameter level. Function called
12651         with level set to 1 when argument types are potentially
12652         unresolved.  Called to complete the job with level set to 2 once
12653         types are complete.
12654         (source_end_java_method): Call to permanent_allocation
12655         removed. Waiting to be replaced by a more suitable obstack
12656         management.
12657         (java_complete_expand_methods, java_complete_expand_method,
12658         java_expand_finals): New functions.
12659         (build_method_invocation_stmt): Renamed
12660         patch_method_invocation_stmt. Extracts function call expression
12661         (wfl) and arguments (args) from CALL_EXPR tree operands.
12662         (build_invoke): Renamed patch_invoke. Fixed typo in fatal
12663         call. Patch the function and argument operand of the CALL_EXPR
12664         tree argument.
12665         (patch_argument, java_complete_tree): New functions.
12666
12667 Mon Apr 20 18:26:57 1998  Per Bothner  <bothner@cygnus.com>
12668
12669         Recover from missing fields and methods (i.e. error instead of fatal).
12670         * decl.c, java-tree.h (TYPE_identifier_node):  New global constant.
12671         * expr.c (expand_invoke):  Recover from missing method.
12672         (expand_java_field_op):  Recover from missing field.
12673         Inline references to java.lang.{Integer,Char,...}.TYPE.
12674         * typeck.c (get_type_from_signature), java-tree.h:  New function.
12675         * class.c (add_method):  Use get_type_from_signature.
12676         (build_class_ref):  Handle a class that was not found.
12677         * typeck.c (convert):  Handle conversion to pointers (for convenience).
12678         * verify.c (verify_jvm_instructions):  Use get_type_from_signature
12679         instead of lookup_field to handle missing fields.
12680
12681         * jcf-parse.c (process_zip_dir):  Set java_source.
12682
12683 1998-04-20  Brendan Kehoe  <brendan@cygnus.com>
12684
12685         * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
12686
12687 Tue Apr 14 15:59:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12688
12689         * jcf-parse.c (load_class): Don't change input_filename before
12690         calling jcf_parse_source (but still do it before calling
12691         jcf_parse).
12692         (jcf_parse_source): Assign input_filename after having saved the
12693         parser context.
12694         * lex.c (java_init_lex): Chain a WFL node to the import on demand
12695         list. ctxp->modifier_ctx zeroed according to its new
12696         definition. ctxp->filename initialized. Removed
12697         JAVA_MODIFIER_CTX_UNMARK.
12698         (java_unget_unicode): Update the character based column position.
12699         (java_allocate_new_line): ref_count not used anymore. Always free
12700         ctxp->p_line. Initialize c_line->char_col to 0.
12701         (java_get_unicode): Update the character based column position.
12702         (java_lex): Use ctxp->elc to store current position in source
12703         file, at the beginning of the parsed token. Set modifier_ctx entry
12704         corresponding to the parse modifier to a WFL node. Return a WFL
12705         node when an identifier is parsed.
12706         (java_lex_error): Now uses ctxp->elc to store current position in
12707         source.
12708         (build_wfl_node, java_is_eol, java_get_line_col): New functions.
12709         * lex.h (build_wfl_node): New function definitions.
12710         (struct java_line): ref_count and next fields are gone. New field
12711         char_col.
12712         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
12713         JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
12714         (JAVA_COLUMN_DELTA): New macro.
12715         (java_lc): New typedef on new struct _java_lc.
12716         * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
12717         (parse_error_context, parse_warning_context): Changed prototypes.
12718         (java_get_line_col): Added as an available global function.
12719         (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
12720         (IC_DECL): Replaced by macro IC_TYPE
12721         (DEPEND_WFL): New macro.
12722         (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
12723         wrong modifier.
12724         (exit_java_complete_class): Removed a commented out statement.
12725         (struct parser_ctxt): Added comments on fields. modifier_ctx is
12726         now an array of tree nodes. Deleted fields line_list and
12727         e_line. New field elc, to replace e_line.
12728         * parse.y (array_type:): Build WFL node.
12729         (qualified_name:): Build a single WFL node out of two. Retain
12730         the location information of the first node in the resulting node.
12731         (package_declaration:): Use package name as a WFL node
12732         (single_type_import_declaration:): Use imported name as a WFL node.
12733         (type_import_on_demand_declaration:): Use root of the imported
12734         packages as a WFL node.
12735         (field_declaration:): Removed unused local variable cl.
12736         (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
12737         (yyerror): New static elc. Removed static error_line, error_pos.
12738         New local code_from_source. Save ctxp->elc into elc at the first
12739         pass. Call java_get_line_col to get a string of the line where
12740         the error occurred.
12741         (debug_line): Removed static function.
12742         (parse_error_context, parse_warning_context): Parameter cl is now
12743         a WFL node. Use its value to initialize ctxp->elc.
12744         (redefinition_error): Parameter cl is now a WFL node.
12745         (parse_add_interface): New parameter wfl. No longer call
12746         lookup_cl, use wfl instead.
12747         (check_class_interface_creation): Parameter cl is now a WFL node.
12748         (maybe_create_class_interface_decl): Likewise.
12749         (add_superinterfaces): New function.
12750         (create_interface): Removed local cl, node, super_decl,
12751         super_decl_type.  Function now uses id as a WFL node. Better
12752         warning/error report on obsolete or forbidden mix of
12753         modifiers. Now calls add_superinterfaces to register interfaces.
12754         (create_class): Removed local cl, node. Local variable id is used
12755         as a WFL node. Better error report on forbidden modifier
12756         mix. Uses add_superinterfaces to register interfaces.
12757         (find_field): Argument cl is now a WFL node. Now store the WFL
12758         node of a fields that needs to be checked for their
12759         initialization.
12760         (method_header): Local variable node non longer used. Local
12761         variable id replaces cl.
12762         (check_modifiers_consistency): Local variable cl is now a WFL
12763         node.
12764         (method_declarator): Local variable cl replaced by parameter id.
12765         (parser_qualified_name): Now uses parameter name as a WFL node.
12766         (parser_check_super_interface): New parameter wfl, for achieve
12767         greater accuracy during error reports.
12768         (parser_chain_incomplete_item): New parameter named location. Used,
12769         along the decl, to construct the incomplete item node.
12770         (java_complete_class): resolve_class now uses WFL node extracted
12771         from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
12772         where appropriate.
12773         (complete_method_decl): Unresolved function's argument types are WFL.
12774         (resolve_class): Parameter cl is now a WFL node.
12775         (resolve_and_layout): Likewise.
12776         (do_resolve_class): Likewise. Try first to use cl and then do the
12777         lookup on the decl when calling check_pkg_class_access.
12778         (complete_class_report_errors): Use IC_TYPE in place of
12779         TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
12780         instead of doing a lookup over the decl.
12781         (java_check_final): Use WFL info from field tree list.
12782         (lookup_cl): Rewritten and returns a statically defined WFL node.
12783         (lookup_modifier_cl): Now uses information from WFL nodes.
12784         (process_imports): Likewise.
12785         (read_import_dir): name and cl arguments replaced by a single WFL
12786         node. Function modified accordingly.
12787         (find_in_imports_on_demand): Now uses WFL node.
12788         (check_pkg_class_access): cl argument is now a WFL node.
12789         (declare_local_variables): Fixed to use WFL nodes.
12790         (resolve_expression_name): Likewise.
12791         (build_method_invocation_stmt): name_combo argument renamed
12792         wfl. Function modified to use WFL nodes.
12793         (build_invoke): cl used as a WFL node when calling build_expr_wfl.
12794         (lookup_method_invoke): cl is now a WFL node. Added missing
12795         IDENTIFIER_POINTER to class type decl name.
12796
12797 Tue Apr 14 15:23:29 1998  Dave Brolley  <brolley@cygnus.com>
12798
12799         * lang.c (init_parse): Now returns char* containing the filename.
12800
12801 Fri Apr 10 11:36:04 1998  Per Bothner  <bothner@cygnus.com>
12802
12803         * class.c (layout_class):  Mangle repeated arg types to match cc1plus.
12804
12805         * decl.c, java-tree.h (integer_four_node):  New INTEGER_CST node.
12806         * class.c (make_class_data):  If flag_assume_compiled, initial class
12807         state is CSTATE_PREPARED; make superclass and interfaces direct
12808         references, rather than constant pool indexes.
12809
12810 Thu Apr  9 16:10:56 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12811
12812         * parser.y: Include flags.h. Removed debug variable pl.
12813         (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
12814         (block:): Likewise.
12815         (labeled_statement_nsi:): Generate debug info when reducing
12816         expression_statement:.
12817         (check_pkg_class_access): get_access_flags_from_decl invokation
12818         fixed for new CLASS_* flags location.
12819         (source_end_java_method): Save/restore parser context when
12820         entering/leaving this routine. Restore lineno to its right value
12821         before calling expand_end_bindings.
12822         (build_method_invocation_stmt): build_invoke called with the
12823         current line information.
12824         (build_invoke): New argument cl. Wrap the function call around a
12825         wfl node.
12826         (refine_accessible_methods_list): Changed comment, removed
12827         unnecessary code.
12828         * parse.h: Fixed typo in comments.
12829         (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
12830         (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
12831         (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
12832         parser_ccb_indent.
12833         * lex.c (java_lex): Record the last closing curly bracket of a
12834         function.
12835         * jcf-parse.c (jcf_parse_source): Now calls
12836         java_check_methods. Clarified comment, fixed typo.
12837
12838 1998-04-09  Dave Brolley  <brolley@cygnus.com>
12839
12840         * lang.c (init_parse): Expose for non USE_CPPLIB builds.
12841         (finish_parse): Expose for non USE_CPPLIB builds.
12842
12843 Wed Apr  8 13:06:23 1998  Jeffrey A Law  (law@cygnus.com)
12844
12845         * lang.c (lang_print_xnode): New function.
12846
12847 Fri Apr  3 13:22:41 1998  Per Bothner  <bothner@cygnus.com>
12848
12849         * decl.c (class_dtable_decl), java-tree.h:  New tree node.
12850         * class.c (get_dispatch_vector, get_dispatch_table):  New functions
12851         used to build a class's dispatch table.
12852         (make_class_data):  Generate dispatch table if flag_assume_compiled.
12853         Set dtable of class object to address of class_dtable_decl.
12854
12855         * decl.c (int_decl_processing):  Make soft_badarrayindex_node
12856         be volatile and have side effects - generates better code.
12857
12858         * class.c, expr.c, parse.y:  CLASS_INTERFACE, CLASS_FINAL, etc:
12859         These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
12860
12861         * expr.c (expand_invoke):  If class is final, method is
12862         effectively final, so can call it directly.
12863
12864         * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE):  New macros.
12865
12866         * Makefile.in, Make-lang.in:  Add missing $(exeext)s.
12867
12868 Thu Mar 19 16:59:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12869
12870         * parse.y (build_method_invocation_stmt): Removed extra argument
12871         to build_invoke.
12872
12873 Mon Mar 16 17:25:19 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12874
12875         * expr.c (dtable_indent): Now static global.
12876         (expand_invoke): Now call invoke_build_dtable and
12877         build_invokevirtual.
12878         (invoke_build_dtable, build_invokevirtual): New functions.
12879         * jcf-io.c (find_class): Defer issuing a warning by setting
12880         jcf->outofsynch to 1.
12881         * jcf-parse.c (jcf_out_of_synch): New function.
12882         (load_class): Test this_jcf.outofsynch flag and call
12883         jcf_out_of_synch accordingly.
12884         * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
12885         comment indentation.
12886         * lex.c (java_get_unicode): Fixed code indentation.
12887         (java_lex): Create string literal. Fixed typo. Removed several
12888         premature obstack_free.
12889         * parse.h: New enums for name resolution and invocation mode.
12890         (struct qualification): New data structure.
12891         (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
12892         (do_resolve_class, build_method_invocation_stmt,
12893         breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
12894         debug_line, identical_subpath_p, invocation_mode,
12895         refine_accessible_methods_list, build_invoke,
12896         lookup_method_invoke): New functions declared.
12897         (build_invokevirtual, invoke_build_dtable, match_java_method,
12898         build_field_ref, jcf_out_of_synch): New references to external
12899         functions.
12900         (struct parse_ctxt): Removed artificial_constructor field.
12901         * parse.y: (array_type:): Type defined for this rule.
12902         (class_type:): Installed default rule for interface_type:.
12903         (array_type:): Now build Java array type.
12904         (qualified_name:): Now use obstack_grow0.
12905         (method_declaration:): Skip the artificial constructor added to
12906         the list, if any.
12907         (abstract_method_declaration:): Execute the code only during pass 1.
12908         (block:): Installed default rule in block_statements:.
12909         (block_statement:): Add the statement to the method during pass 2.
12910         (statement_expression): Installed default rule for
12911         method_invocation:.
12912         (argument_list:): Added code to build the argument list.
12913         (method_invocation:): Added call to create the method invocation
12914         node.
12915         (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
12916         (debug_line): New function for debug.
12917         (complete_class_decl): No longer do something during pass 1.
12918         (method_header): Use BUILD_PTR_FROM_NAME.
12919         (parser_qualified_classname): Use obstack_grow0. Removed bogus
12920         obstack_free.
12921         (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
12922         function's main comment.
12923         (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
12924         classes.
12925         (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
12926         (resolve_class): Now works with arrays.
12927         (do_resolve_class, resolve_and_layout): New functions.
12928         (java_check_regular_methods): Reverse method list before and after
12929         having processed it. No longer set ctxp->artificial_constructor.
12930         (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
12931         accordingly. Fixed typo in issued error message. Now use
12932         obstack_grow0.
12933         (find_in_imports_on_demand): Now use obstack_grow0.
12934         (declare_local_variables): Use BUILD_PTR_FROM_NAME.
12935         (source_end_java_method): Call expand_expr_stmt instead of
12936         expand_expr. Calls it before calling expand_function_end.
12937         (java_method_add_stmt): Do nothing if errors were found during
12938         parsing.
12939         (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
12940         (build_method_invocation_stmt, build_invoke, invocation_mode,
12941         lookup_method_invoke, refine_accessible_methods_list,
12942         qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
12943         New functions.
12944         * typeck.c (build_java_signature): Properly end method signature
12945         if return type skipped.
12946         (match_java_method): New function.
12947
12948 Mon Mar 16 10:40:47 1998  Per Bothner  <bothner@cygnus.com>
12949
12950         * jcf-io.c (find_classfile):  If USE_JCF_STDIO, fopen in binary mode.
12951
12952 Wed Feb 25 08:55:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
12953
12954         * expr.c (build_invoke_non_interface): New function.
12955         (methods_ident, ncode_ident): Now static globals.
12956         (expand_invoke): Use build_invoke_non_interface.
12957         * java-tree.h (struct lang_decl): New field function_decl_body.
12958         (DECL_FUNCTION_BODY): New macro.
12959         * jcf-parse.c (jcf_parse_source): Deeper check before setting
12960         CLASS_FROM_SOURCE_P.
12961         (parse_source_file): Fixed typos. Call java_layout_parsed_class
12962         before starting pass 2. Call to java_generate_parsed_class replaced
12963         by java_register_parsed_class.
12964         * lex.c: Fixed typo in header. Some line width related formating.
12965         * lex.h: Some line width related formating.
12966         * parse.h (source_end_java_method, resolve_expression_name,
12967         complete_class_decl, maybe_create_class_interface_decl,
12968         check_class_interface_creation): New static function declarations.
12969         (java_layout_parsed_class, java_method_add_stmt): New function
12970         declarations.
12971         (struct parser_ctxt): Field mark_class_generate removed. New
12972         fields class_list and artificial_constructor.
12973         * parse.y: Fixed typo in header.
12974         (class_declaration:): Call complete_class_decl when class body
12975         parsed.
12976         (method_declaration:): Call source_end_java_method in pass 2 when
12977         the method body is defined.
12978         (postfix_expression:): Do expression name resolution on sub-rule
12979         name during pass 2.
12980         (create_class, create_interface): Merged common pieces.
12981         (check_class_interface_creation, maybe_create_class_interface_decl):
12982         New functions.
12983         (complete_class_decl): New function.
12984         (register_fields): Fixed line width related typo.
12985         (method_header): Correctly skip first argument when fixing
12986         argument line. Changed the loop.
12987         (java_check_circular_reference): Now use ctxp->class_list.
12988         (java_complete_class): Removed start/stop marking.
12989         (java_check_regular_methods): Now takes a class decl as an
12990         argument.  Add default constructor if none were encountered.
12991         (java_check_methods): Now use ctxp->class_list. Changed call to
12992         java_check_regular_methods.
12993         (source_start_java_method): Set DECL_ARG_TYPE for each function
12994         arguments.
12995         (source_end_java_method, java_method_add_stmt): New functions.
12996         (java_generate_parsed_class): No longer exists.
12997         (java_layout_parsed_class, java_register_parsed_class): New functions.
12998         (resolve_expression_name): New function.
12999
13000 Thu Feb 12 11:54:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13001
13002         * jcf-parse.c: (parse_source_file): Check on errors after init lex.
13003         * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
13004         until pass initializations are done. Call read_import_dir with
13005         pass set to 0.
13006         * parse.h: (lookup_modifier_cl): New function declared.
13007         (INTERFACE_FIELD_MODIFIERS): New macro.
13008         (OBSOLETE_MODIFIER_WARNING): New macro.
13009         * parse.y: (register_fields): Class type and current field name in
13010         local variables. Check modifier(s) if adding field(s) to an interface.
13011         (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
13012         and report errors using the faulty modifier line context.
13013         (lookup_modifier_cl): New function.
13014         (read_import_dir): Detect and report default import processing
13015         failure.
13016
13017 1998-02-11  Brendan Kehoe  <brendan@cygnus.com>
13018
13019         Add a pair of -fassume-compiled/-fno-assume-compiled options.
13020         * class.c (is_compiled_class): Return 1 after making sure it
13021         qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
13022         * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
13023         * java-tree.h (flag_assume_compiled): Add decl.
13024         * lang.c (lang_f_options): Add the flag.
13025         (flag_assume_compiled): Add decl, default to 0.
13026
13027 Wed Feb 11 11:27:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13028
13029         * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
13030         (is_compiled_class): Likewise.
13031         (layout_class): Likewise.
13032         (layout_class): Detect and lay out classes defined in source code.
13033         (interface_of_p, add_interface_do, may_add_interface): New
13034         function.
13035         (add_interface): Now use add_interface_do.
13036         (add_method_1): New function.
13037         (add_method): Now use add_method_1.
13038         (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
13039         (complete_start_java_method): New function.
13040         (start_java_mehod): Now call complete_start_java_method.
13041         * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
13042         (expand_invoke): Likewise and fixed typo.
13043         *gjava.c: (print_super_field): Use new argument to find_class
13044         DO_CLASS_FILE.
13045         (main): Likewise.
13046         *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
13047         (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
13048         QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
13049         IDENTIFIER_NODE.
13050         (CLASS_COMPLETE_P): New flag on TYPE_DECL.
13051         (add_method_1, push_class): New prototypes.
13052         *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
13053         *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
13054         directory where the class was found.
13055         (find_class): New argument DO_CLASS_FILE. Function find_class
13056         modified accordingly.
13057         *jcf-parse.c: (fix_class_path): New function.
13058         (load_class): Use new VERBOSE argument. load_class now finds and
13059         loads/parses .class/.java files. Save read_state of current_jcf
13060         if necessary.
13061         (java_parser_abort_on_error): New macro.
13062         (jcf_parse_source, parse_source_file): New function.
13063         (jcf_parse): Fixed typo.
13064         (yyparse): Call parse_source_file () only.
13065         (process_zip_dir): Fixed typo, fix zdir->filename_length when
13066         writing the real class name back in the zip directory entry.
13067         (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
13068         (jcf_figure_file_type): Fixed bogus alloc and bcopy.
13069         *jcf.h: (typedef struct JCF): New fields java_source and zipd.
13070         (find_class): Prototype fixed.
13071         *lex.c: Added 1998 time stamp.
13072         Removed all static global variables, moved into the parser
13073         context data structure.. Now include unistd.h if SEEK_SET not
13074         defined.
13075         (java_init_lex): Rewritten.
13076         (java_sneak_unicode): Modified current unicode access in current line.
13077         (java_unget_unicode): Likewise.
13078         (java_allocate_new_line): New allocation management.
13079         (java_read_char): Modified access and storage of unget_utf8_value.
13080         New way of processing current unicode.
13081         (java_store_unicode, java_read_unicode): Fixed typo in declaration.
13082         (java_get_unicode): Now use the parser context.
13083         (java_lineterminator): Likewise.
13084         (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
13085         of the reentrant parser implementation. Function now use the
13086         parser context data structure and java_lval. Fixed production of
13087         the float and double constant "out of range" error message. Fixed
13088         obstack use. Return integer value when hitting a modifier. Now
13089         return type for TRUE, FALSE and other predefined types. Return
13090         identifier as a TREE_LIST list containing the current line context
13091         as the TREE_VALUE sub-node.
13092         (java_unicode_2_utf8): Fixed typo in declaration.
13093         (java_lex_error): Now use the parser context data structure.
13094         *lex.h: Added 1998 time stamp.
13095         (struct java_line): New fields ref_count and next.
13096         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
13097         JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
13098         (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
13099         *parse.h: Added 1998 time stamp.
13100         (java_parse_source_file): Renamed from parse_source_file.
13101         (YYERROR_NOW, YYNOT_TWICE): Fixed.
13102         (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
13103         INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
13104         JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
13105         THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
13106         END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
13107         CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
13108         (struct parser_ctxt): New data structure to keep the parser context.
13109         *parse.y: Added 1998 time stamp, got rid of static global variables.
13110         (java_error_count, ctxp): New global variables.
13111         (%union): New value field.
13112         (numeric_type, integral_type): Rules removed.
13113         (primitive_type): Rule defined to handle integral, float, double and
13114         boolean types.
13115         (qualified_name, package_declaration,
13116         single_type_import_declaration, type_import_on_demand_declaration,
13117         modifiers, class_declaration, super, interfaces,
13118         interface_type_list, class_body, field_declaration,
13119         field_declaration, variable_declarators, variable_declarator,
13120         variable_declarator_id, method_declaration, method_header,
13121         formal_parameter_list, formal_parameter, method_body, block,
13122         static, interface_declaration, extends_interfaces,
13123         abstract_method_declaration, local_variable_declarators): Rules now
13124         define actions.
13125         (force_error, do_warning): New global statics.
13126         (push_parser_context, parser_context_save_global,
13127         parser_context_restore_global, pop_parser_context): New functions.
13128         (yyerror): Now uses the global parser context. Fixed use of obstack.
13129         (parse_error, parse_error_context, parse_warning_context,
13130         java_accstring_lookup, redefinition_error, check_modifiers,
13131         parser_add_interface, create_interface, create_class, find_field,
13132         duplicate_declaration_error, register_fields, method_header,
13133         check_modifiers_consistency, check_abstract_method_header,
13134         method_declarator, parser_qualified_classname,
13135         parser_check_super_interface, parser_check_super,
13136         parser_chain_incomplete_item, java_check_circular_reference,
13137         layout_class_from_source, java_complete_class,
13138         complete_method_decl, resolve_class, complete_class_report_errors,
13139         java_check_final, check_method_redefinition,
13140         java_check_regular_methods, java_check_abstract_methods,
13141         java_check_methods, lookup_java_interface_method2,
13142         lookup_java_method2, lookup_cl, find_name_in_single_imports,
13143         process_imports, find_in_imports, read_import_entry,
13144         read_import_dir, find_in_imports_on_demand,
13145         check_pkg_class_access, not_builtin_p, declare_local_variables,
13146         source_start_java_method, java_generate_parsed_class): New
13147         functions.
13148         *typeck.c: (signature_include_return): New global variable.
13149         (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
13150         to add the function returned type in the signature.
13151
13152 1998-02-09  Brendan Kehoe  <brendan@cygnus.com>
13153
13154         * jcf-io.c (open_in_zip): Use strncmp and LEN.
13155
13156 Thu Jan 29 16:12:13 1998  Dave Brolley  <brolley@cygnus.com>
13157
13158         * Make-lang.in (java.info): Added.
13159         (java.install-info): Added
13160
13161 1998-01-27  Brendan Kehoe  <brendan@cygnus.com>
13162
13163         * Makefile.in (clean): Also remove java/parse.c.
13164
13165 1998-01-26  Brendan Kehoe  <brendan@cygnus.com>
13166
13167         Add a pair of -fbounds-check/-fno-bounds-check options.
13168         * lang.c (lang_decode_option): Add code to grok arguments.
13169         (flag_bounds_check): Add decl.
13170         (lang_f_options): New array w/ the option in it.
13171         * java-tree.h (flag_bounds_check): Add decl.
13172         * lang-options.h: New file.
13173         * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
13174         of a static macro value.
13175         (JAVA_ARRAY_EXCEPTION): Delete macro.
13176
13177 Fri Jan 23 14:19:47 1998  Per Bothner  <bothner@cygnus.com>
13178
13179         * typeck.c (build_java_array_type):  Fix two bugs in previous change.
13180         * expr.c (build_anewarray):  Add missing promote_type.
13181
13182 Thu Jan 22 17:43:45 1998  Per Bothner  <bothner@cygnus.com>
13183
13184         Add array types with known length to optimize bounds checking.
13185         * typeck.c (build_java_array_type):  Take length parameter.
13186         (java_array_type_length, build_prim_array_type):  New functions.
13187         * java-tree.h:  Update for new functions.
13188         * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
13189         * class.c:  Use build_prim_array_type.
13190         * expr.c (can_widen_reference_to):  Handle known-length array types.
13191         (verify_jvm_instructions):  Keep track of integer push instructions
13192         followed by newarray/anewarray, so we can build known-length arrays.
13193         (JAVA_ARRAY_DATA_OFFSET):  Replace by ...
13194         (java_array_data_offset):  New function.
13195         (build_java_array_length_access):  New function.  Optimize if constant.
13196         (build_java_arrayaccess):  Constant fold bounds check.
13197         (expand_java_newarray, expand_java_anewarray):  Replaced by ...
13198         (build_newarray, build_anewarray):  New functions.
13199         (ARRAY_NEW_NUM, ARRAY_NEW_PTR):  Use build_{a,}newarray.
13200         * verify.c (merge_types):  Handle known-lengh array types.
13201
13202 Mon Jan 19 13:09:25 1998  Per Bothner  <bothner@cygnus.com>
13203
13204         * expr.c (expand_byte_code):  Fix performace bug, which caused
13205         searching linenumber_table to be linear rather than constant.
13206
13207 Fri Dec 12 19:18:42 1997  Per Bothner  <bothner@cygnus.com>
13208
13209         * Makefile.in (BISON, BISONFLAGS):  Add missing macros.
13210
13211         * decl.c, java-tree.h (soft_fmod_node):  New global.
13212         * decl.c (init_decl_processing):  Define __builtin_fmod.
13213         * expr.c (build_java_binop):  Implement TRUNC_MOD_EXPR for REAL_TYPE
13214         using __builtin_fmod.
13215
13216 Thu Dec  4 13:22:59 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13217
13218         * keyword.h: New file, output of keyword.gperf as processed by
13219         gperf.
13220         * lex.c (java_lex_init): Initialize java_error_flag.
13221         * parse.c (YYERROR_NOW): Uses java_error_flag.
13222         * parse.y: New static java_error_flag. Useless definition of
13223         buffer_error gone.
13224         * parse.y (java_error): Portable error recovery using
13225         java_error_flag (not yet completely tuned).
13226
13227 1997-12-04  Brendan Kehoe  <brendan@lisa.cygnus.com>
13228
13229         * Makefile.in (parse.c): Use $(srcdir) for parse.y.
13230
13231 Wed Dec  3 18:37:42 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13232
13233         * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
13234         (parse.c, lex.c, keyword.h): New rules for Java source code
13235         front-end.
13236         * parse.c: Renamed into jcf-parse.c.
13237         * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
13238         * keyword.gperf: New file, Java keywords.
13239         * parse.y: New file, Java language grammar.
13240         * parse.h: New file, Java language grammar definitions.
13241         * lex.c: New file, Java language lexer.
13242         * lex.h: New file, Java language lexer definitions.
13243
13244 Wed Dec  3 17:00:17 1997  Per Bothner  <bothner@cygnus.com>
13245
13246         * decl.c (clinit_identifier_node), java-tree.h:  New global.
13247         * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P):  Removed.
13248         * verify.c (verify_jvm_instructions):  Inline use of removed macros.
13249         * expr.c (expand_java_field_op):  Check for invalid assignment
13250         to final field.
13251
13252         * jcf-reader.c (get_attribute):  Test for wrong attribute length.
13253
13254 Mon Oct 27 17:46:36 1997  Per Bothner  <bothner@cygnus.com>
13255
13256         * verify.c (verify_jvm_instructions):  When processing a handler,
13257         attempt to set the current_subr to the right value.
13258         (More complicated code combines Sep 17 and Oct 22 versions.)
13259
13260 Fri Oct 24 11:36:54 1997  Per Bothner  <bothner@cygnus.com>
13261
13262         * class.c (push_class):  Figure out (guess) name of source file.
13263         * parse.c  (set_source_filename):  Set DECL_SOURCE_FILE of class decl.
13264         (give_name_to_class):  Don't guess source name;  use DECL_SOURCE_FILE.
13265         (parse_class_file):  Change return type from int to void.
13266         Call debug_start_source_file/debug_end_source_file.
13267
13268         * expr.c (build_java_binop):  Fix masking 2nd operand.
13269         * decl.c (init_decl_processing):  Set sizetype first.
13270
13271 Wed Oct 22 19:39:05 1997  Per Bothner  <bothner@cygnus.com>
13272
13273         * verify.c (verify_jvm_instructions):  Don't set current_subr to NULL.
13274         (Revert Sep 17 change.)
13275
13276 Tue Oct 21 15:09:02 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13277
13278         * parse.c (process_zip_dir): Skip ZIP entries not bearing the
13279         .class extension in their name and fix thing so we don't process
13280         them parse_zip_file_entries().
13281         (parse_zip_file_entries): Cleaned unused local variables.
13282
13283 Mon Oct 20 14:52:42 1997  Per Bothner  <bothner@cygnus.com>
13284
13285         * expr.c (can_widen_reference_to):  Allows equal array element types.
13286         (expand_byte_code):  PRE_RET must expand OPERAND_VALUE (to get index).
13287         * jcf-dump.c (RET):  Get (and print) index.
13288
13289         * verify.c (verify_jvm_instructions case OPCODE_anewarray):
13290         Promote element type to POINTER_TYPE.
13291
13292 Mon Oct 20 13:40:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13293
13294         * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
13295         find_in_current_zip, jcf_figure_file_type): Moved from
13296         jcf-reader.c to parse.c.
13297         * zextract.c: (read_zip_archive): takes file_comment_length possible
13298         field into account.
13299
13300 Mon Oct 20 11:45:06 1997  Per Bothner  <bothner@cygnus.com>
13301
13302         * verify.c (verify_jvm_instructions):  Var can also be promoted to int.
13303
13304         * verify.c (merge_types):  Handle array types even better ...
13305
13306 Fri Oct 17 15:56:37 1997  Per Bothner  <bothner@cygnus.com>
13307
13308         * expr.c (java_stack_pop):  Fix use of NULL_TREE for TYPE_SECOND.
13309
13310         * java-tree.h (PUSH_FIELD):  Set DECL_ARTIFICIAL.
13311         * class.c (make_class_data):  Don't build fields_decl if no fields.
13312         When building fields_decl, skip if DECL_ARTIFICIAL.
13313
13314         * expr.c (java_stack_swap):  Update stack_type_map.
13315         * verify.c (merge_types):  Handle array types better.
13316
13317 Wed Oct 15 18:09:45 1997  Per Bothner  <bothner@cygnus.com>
13318
13319         * class.c (add_field):  Don't promote short integral fields to
13320         int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
13321         * expr.c (push_value):  Promote and convert short integral values.
13322
13323         * decl.c, java-tree.h (integer_two_node):  New constant node.
13324         * verify.c (merge_types):  Check for TYPE_RETURN_ADDR.
13325
13326 Wed Oct 15 17:04:50 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13327
13328         * class.c (append_gpp_mangled_type): Use function argument
13329         unpromoted type to generate mangled name.
13330
13331 Mon Oct 13 16:52:55 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13332
13333         * constants.c (build_constant_data_ref): Now uses current_class
13334         instead of main_class.
13335         (build_constants_constructor): Now uses current_class instead of
13336         main_class.
13337         * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
13338         of the global variable SeepZipFiles done here.
13339         * zextract.c (read_zip_archive): extra_field optional field taken
13340         into account while computing the position of the class file in the
13341         archive.
13342         * verify.c (verify_jvm_instructions): Use current_jcf to search
13343         the constant pool.
13344         * parse.c (load_class): First search for the class to load in the
13345         current zip file. Saves current_jcf (restored before returning
13346         from that function). Don't call JCF_FINISH in the class was found
13347         in the current ZIP file.
13348         (jcf_parse): If the class was found in the current ZIP file, save
13349         its tree_constant_pool (for later reuse).
13350         (parse_class_file): New function. Process each method defined in
13351         the current class and record the class as to be later registered.
13352         (yyparse): Rewritten. Figure the type of the current file and switch
13353         accordingly.
13354         * lang.c: New global variable current_jcf.
13355         (lang_init): Removed compiling_from_source test (done later, in
13356         yyparse). Removed call the jcf_parse ().
13357         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
13358         (typedef struct JCF): New fields seen_in_zip (to mark a class found
13359         in the current ZIP file) and zip_offset (offset to the class data in
13360         the current zip file).
13361         * jcf-reader.c: zipfile.h included.
13362         localToFile: New ZipFileCache static global variable
13363         (parse_zip_file_entries): New function. Browse the current ZIP
13364         file directory and process each class found.
13365         (process_zip_dir): New function. Register each class found in the
13366         ZIP file directory. The class aren't parsed but a valid JCF is
13367         link to each of them.
13368         (find_in_current_zip): New function. Search for a class in the
13369         current ZIP file directory. If found, prepare the class so that it
13370         can be loaded.
13371         (jcf_figure_file_type): New function. Examine the file structure
13372         to figure a class file, a ZIP file. If none of these categories are
13373         matched, a source file is assumed.
13374         * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
13375         SeenZipFile: New global variable.
13376         (open_in_zip): Use zipmember's length to accelerate the search for
13377         a member. If zipmember was NULL and zip file successfully read,
13378         return 0.
13379         * java-tree.h: New global variable current_jcf declared.  Added
13380         declaration for current_constant_pool_tags, current_constant_pool_data,
13381         current_constant_pool_length, current_constant_pool_data_ref.
13382         (struct lang_type): Augmented with two fields. struct JCF *jcf (to
13383         store the JCF of classes seen in a zip file) and tree *constant_pool
13384         (to save a loaded class constant pool). current_class declared here.
13385         * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
13386         retrieve method_ref_constant.
13387         (PUSHC): java_push_constant_from_pool now uses current_jcf.
13388         (OBJECT): get_class_constant now uses current_jcf.
13389         (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
13390         (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
13391         (expand_invoke): Now uses current_class instead of main_class
13392         (build_class_init): Now uses current_class instead of main_class
13393         * class.c: New static global variable registered_class.
13394         (register_class): New function.
13395         (emit_register_class): Modified to use registered_class instead of
13396         main_class
13397         (is_compiled_class): Now take into account class seen in the archive.
13398
13399 Mon Oct  6 12:03:23 1997  Per Bothner  <bothner@cygnus.com>
13400
13401         * except.h:  Renamed to: java-except.h.
13402         * parse.c, except.c, expr.c, verify.c:  Update #include accordingly.
13403         * except.c:  Add semi-working (commented out) implementation.
13404
13405         * expr.c (expand_iinc):  Add needed flush_quick_stack.
13406         * parse.c (set_source_filename):  New function.
13407         (give_name_to_class):  Set input_filename from package.classname.java.
13408
13409         * jcf-io.c (find_class):  Don't look first in ".".
13410
13411 Wed Oct  1 11:26:10 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13412
13413         * zextract.c (read_zip_archive): Now takes into account the
13414         extra_field field.
13415         * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
13416
13417 Sat Sep 20 12:44:28 1997  Per Bothner  <bothner@cygnus.com>
13418
13419         * constants.c, java-tree.h (build_internal_class_name):  New function.
13420         (alloc_class_constant):  Re-implement using build_internal_class_name.
13421         * class.c (make_class_data):  Likewise.
13422         * class.c (hashUtf8String):  Make hash algorithm match String.hashCode.
13423
13424 Wed Sep 17 13:15:23 1997  Per Bothner  <bothner@cygnus.com>
13425
13426         * verify.c (verify_jvm_instructions):  Temporarily set current_subr
13427         to NULL before pushing an exception handler target.
13428
13429         * expr.c (flush_quick_stack):  Save from low stack indexes to high.
13430         (java_stack_swap, java_stack_dup):  Re-write to be safe from
13431         clobbering registers.
13432         (build_class_init):  New function.
13433
13434 Wed Sep 17 11:02:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13435
13436         * typeck.c (build_java_array_type): Temporary use
13437         permanent_obstack to create the array 'length' field.
13438         * expr.c (lookup_label): Temporay use permanent_obstack to create
13439         label if not found.
13440         * class.c (push_super_field): Tempory use permanent_obstack.
13441
13442 Mon Sep 15 11:33:31 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13443
13444         * typeck.c (type_for_mode): Now handles double_type_node and
13445         float_type_node.
13446         * verify.c (verify_jvm_instructions): The instruction following
13447         the wide bytecode is checked. OPCODE_ret added to the list of
13448         wide.
13449
13450 Thu Sep 11 19:45:18 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13451
13452         * class.c (make_class): Temporary use permanent_obstack. Set the
13453         class CLASS_P field to 1.
13454         (push_class): Temporary use permanent_obstack.
13455         (set_super_info): Temporary use permanent_obstack.
13456         (add_method): Temporary use permanent_obstack, set
13457         METHOD_TRANSIENT().
13458         (add_field): Temporary use permanent_obstack. Sets
13459         FIELD_VOLATILE() and FIELD_TRANSIENT().
13460         (build_class_ref): Temporary use permanent_obstack if the class
13461         isn't compiled.
13462         (build_static_field_ref): Temporary use permanent_obstack when
13463         creating field's rtl.
13464         (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
13465         ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
13466         and fields. Function finalized, as far as flag handling.
13467         (push_class_static_dummy_field): Temporary use permanent_obstack.
13468         (emit_register_class): Force generation of class registration at
13469         -O3 or deeper.
13470         * decl.c (end_java_method): Call permanent_allocation() before
13471         returning.
13472         * expr.c (can_widen_reference_to): Added comment to interface
13473         handling, fixed typo.
13474         (lookup_field): Now uses CLASS_P() to correct FIXME
13475         (expand_invoke): Verification on public && !static &&
13476         !abstract moved into soft_lookupinterfacemethod (kaffe).
13477         Use Object class dtable if objectref is an array when expanding
13478         invokeinterface.
13479         (java_push_constant_from_pool): Temporary use permanent_obstack
13480         for CONSTANT_string
13481         * parse.c (get_ref_constant): Temporary use permanent_obstack to
13482         create constant references.
13483         (get_constant): Temporary use permanent_obstack to create constant.
13484         (load_class): Temporary use permanent_obstack to load class.
13485         (jcf_parse): Temporary use permanent_obstack to perform class
13486         layout.
13487         * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
13488         (build_java_signature): Temporary use permanent_obstack.
13489         * verify.c: (verify_jvm_instruction): removed unnecessary verification
13490         on ACC_SUPER flag.
13491         * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
13492         (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
13493         (CLASS_P): Defined
13494
13495 Thu Sep 11 11:57:32 1997  Per Bothner  <bothner@cygnus.com>
13496
13497         * class.c (append_gpp_mangled_type):  Fix typo.
13498         (emit_register_class):  Use main_class to get class object, rather
13499         than looking for no-longer-existing static decl starting with _CL.
13500         * typeck.c (parse_signature_type):  Promote array element type
13501         if it is a RECORD_TYPE.
13502
13503 Wed Sep 10 16:09:23 1997  Per Bothner  <bothner@cygnus.com>
13504
13505         * class.c (push_class_static_dummy_field):  New function.
13506         (mangle_static_field):  New. Do G++-style mangling of static fields.
13507         (layout_class):  Mandle static fields here, not in add_field.
13508         (build_class_ref):  The class object is now a dummy static field.
13509         * decl.c (find_local_variable):  Look for best, instead of first match.
13510         * expr.c (push_type):  Always promote_type, not just for RECORD_TYPE.
13511         (build_java_athrow):  Don't check here if exception is Throwable.
13512         * java-tree.h (TYPE_UNSET):  Renamed to TYPE_UNKNOWN.
13513         (TYPE_USED):  Removed.  No longer used ...
13514         * parse.c (jcf_parse):  Call push_class_static_dummy_field.
13515         * verify.c (push_pending_label):  New function.
13516         (push_pending_block):  Renamed to check_pending_block.
13517         (merge_types):  Remove unneeded suuport for TYPE_UNUSED.
13518         (verify_jvm_instructions):  Only reset prev_eh_ranges (to force
13519         re-checking possible handlers) after a store (less wasted work).
13520         Check for null handler (finally) before calling add_handler.
13521         Various changes to (finally?) correctly handle try/finally.
13522
13523 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
13524
13525         * class.c: Include stdio.h.
13526
13527 Thu Sep  4 21:30:55 1997  Per Bothner  <bothner@cygnus.com>
13528
13529         * expr.c (expand_invoke):  Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
13530         to make sure class is initialized before static/special invoke.
13531
13532         * verify.c (verify_jvm_instructions):  On a store instruction,
13533         call find_local_variable to force pre-allocation of decl and rtx.
13534         * decl.c (push_jvm_slot):  Set DECL_REGISTER on stack slots.
13535
13536 Wed Sep  3 16:13:23 1997  Per Bothner  <bothner@cygnus.com>
13537
13538         * class.c (build_class_ref):   Strip off "promoted_" if need be.
13539         (make_field_value): Call build_java_signature when needed.
13540         (layout_class):  Don't make_function_rtl if METHOD_ABSTRACT.
13541         * expr.c (build_java_athrow):  Don't push_value of exception.
13542         (build_java_binop):  Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
13543         match specification of [fd]cmp[lg] for NaNs.
13544         (expand_byte_code):  Add support for exception handler ranges.
13545         * except.c:  Add skeleton for EH code-generation.
13546         * verify.c (merge_types):  Treat all promoted integral types as equal.
13547         * constants.c (build_constants_constructor):  To force creation of
13548         current_constant_pool_data_ref, call build_constant_data_ref.
13549
13550         * javaop.def (lload):  Fix typo.
13551         * jcf-dump.c (main):  Clear filename to prevent possibly-bad free.
13552
13553 Tue Sep  2 17:37:25 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
13554
13555         * parse.c: Don't include function.h.
13556
13557 Wed Aug 27 18:33:04 1997  Per Bothner  <bothner@cygnus.com>
13558
13559         * except.[ch]:  New files.
13560         * Makefile.in (JAVA_OBJS):  Add except.o
13561         * expr.c:  Temporary warning about unimplemented exceptions.
13562         * verify.c:  Verify exception handlers.
13563
13564         * jcf-dump.c (disassemble_method):  Print exception table.
13565
13566 Wed Aug 27 13:26:58 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13567
13568         * expr.c (verify_jvm_instructions): Started a thorough
13569         verification of invoke* bytecodes.
13570         (expand_byte_code): flush quick stack if PC is the target of a
13571         branch.  and undef RET (conflicting with config/i386/i386.h).
13572         (expand_java_arrayload): Fixed bogus cast, when Boolean type is
13573         used.
13574         (expand_invoke): Now handles invokeinterface and do more
13575         verification according to the bytecode.
13576         (lookup_field): Don't try to load the class if processing
13577         dtable_type.
13578         (can_widen_reference_to): Now handles interfaces.
13579         * decl.c (init_decl_processing): New global variable
13580         soft_lookupinterfacemethod_node, declared in java-tree.h.
13581         Call set_super_info on string_type_node.
13582         * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
13583         defined.
13584         * class.c (set_super_info): Fills the CLASS_* flags according to
13585         access_flags.
13586         (get_access_flags_from_decl): Handles all class flags.
13587
13588 Tue Aug 26 18:54:34 1997  Per Bothner  <bothner@cygnus.com>
13589
13590         * class.c (add_method):  Zero out newly-allocated DECL_LANG_SPECIFIC.
13591         * parse.c (yyparse):  Check for abstract method, and missing code.
13592         * expr.c (expand_byte_code):  Change interface.
13593         * lang.c (put_decl_node):  Print promoted types prettier.
13594         * verify.c (verify_jvm_instruction):  Change interface.
13595         Partial support for scanning exception table.
13596         For load instructions, handle promoted integral types.
13597
13598 Thu Aug 21 13:48:01 1997  Per Bothner  <bothner@cygnus.com>
13599
13600         * verify.c:  New file, with contents moved from expr.c.
13601         * expr.c:  Bunch of stuff (mostly verification) moved to verify.c.
13602         * typeck.c (is_array_type_p):  Moved here from expr.c.
13603         * java-tree.h:  Add some now-needed function declarations.
13604         * Makefile.in (JAVA_OBJS): Added verify.o.
13605
13606 Wed Aug 20 14:34:34 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13607
13608         * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
13609         METHOD_ABSTRACT flag.
13610
13611         * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
13612         (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
13613         (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
13614
13615         * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
13616         variables.
13617         (start_java_method): Hook for SYNCHRONIZED methods.
13618
13619         * expr.c (build_java_jsr, build_java_ret): New functions
13620         (JSR,PRE): New macros
13621         (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
13622         (verify_jvm_instructions): tableswitch, lookupswitch,
13623         monitorenter, monitorexit, goto_w: verified.
13624         (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
13625         (build_java_monitor): New function.
13626         (MONITOR_OPERATION): Modified to call build_java_monitor()
13627         (verify_jvm_instructions): Started a thorough verification of
13628         invoke* bytecodes.
13629
13630 Tue Aug 19 13:35:49 1997  Per Bothner  <bothner@cygnus.com>
13631
13632         Support verification of jsr/ret subroutines (used for try/finally).
13633         * decl.c (return_address_type_node):  New type node.
13634         * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
13635         RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
13636         LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED):  New macros.
13637         (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
13638         TYPE_USED):  New macros for special types in type_map.
13639
13640         * java-tree.h (BCODE_JUMP_TARGET):  Renamed to BCODE_TARGET.
13641         (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET):  Replaced by
13642         BCODE_JUMP_TARGET.
13643         * expr.c (expand_byte_code):  Fix logic to warn of unused instructions.
13644
13645         * expr.c (can_widen_reference_to):  New function.
13646         (pop_type):  Use it.
13647         (merge_type_state):  Support handling start of subroutine.
13648         (push_pending_block):  Return char* error message, instead of calling
13649         fatal on an error.  Also handle subroutines.
13650         (verify_jvm_instructions):  Handle errors from push_poending_block.
13651         Support jsr and ret instructions.
13652
13653 Tue Aug 19 13:33:36 1997  Per Bothner  <bothner@cygnus.com>
13654
13655         * jcf-io.c (find_classfile):  Fix thinko.
13656         * jcf-dump.c:  Add CONVERT2 (to match changed javaop.def).
13657
13658 Tue Aug 12 20:14:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
13659
13660         * Makefile.in (BISON): Remove.
13661
13662 Thu Aug  7 23:08:24 1997  Per Bothner  <bothner@cygnus.com>
13663
13664         * Makefile.in:  Convert to autoconf.
13665         * config-lang.in (outputs):  Added java/Makefile.
13666
13667         * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
13668         Rename cc1java to jc1.
13669
13670         * lang.c (init_parse, finihs_parse):  New functions #ifdef USE_CPPLIB.
13671         * Makefile.in (INTERNAL_CFLAGS):  Add @extra_c_flags.
13672
13673         * class.c (class_depth):  Do load_class if needed.
13674
13675         Mostly better verification.
13676         * decl.c (pushdecl):  Set TYPE_STUB_DECL for a type.
13677         (init_decl_processing):  Change return type of soft_checkcast.
13678         * expr.c (expand_java_CHECKCAST):  Do push_value of the "casted" value.
13679         * lang.c (put_decl_string, put_decl_node, lang_printable_name,
13680         lang_print_error):  New functions.
13681         (lang_init):  Set global hook print_error_function to lang_print_error.
13682         * expr.c:  In the type_map ptr_type_node is only used for null now.
13683         (pop_type, merge_types):  Hence ptr_type_node matches any reference.
13684         (merge_types):  Dererence pointer to record types before comparing.
13685         (decode_newarray_type, merge_types):  On error just return NULL.
13686         (build_java_binop):  Add preliminary implementation (with warning)
13687         for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
13688         (lookup_label):  Set DECL_IGNORED_P (for dwarf2out).
13689         (expand_compare, expand_java_goto, expand_java_call):  Don't
13690         push_pending_block, since that only makes sense when verifying.
13691         (merge_type_state):  Different return codes.
13692         (push_pending_block):  A block may need to be verified more than once.
13693         (expand_byte_code):  Warn about unused code at code generation time.
13694         (verify_jvm_instruction):  Changed logic, since code may need to be
13695         re-verified if type-state has changed.  Also, better error handling.
13696         Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
13697         Improve newarray, anewarray, ?aload, athrow,
13698         * java-tree.h (LABEL_CHANGED):  New macro.
13699
13700 Tue Aug  5 12:21:27 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13701
13702         * decl.c (soft_athrow_node): New global variable initialized.
13703         * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
13704         * typeck.c (convert): Added support for REAL_TYPE.
13705         (convert_to_char): New function.
13706         (convert): Handle CHAR_TYPE.
13707         * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
13708         SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
13709         (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
13710         promoted type.
13711         (verify_jvm_instructions): Added break a the end of bogus unop: label.
13712         (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
13713         (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
13714         (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
13715         (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
13716         to Use The Right Things.
13717         (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
13718         compatible with INT. BOOLEAN is made equivalent to BYTE.
13719         (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
13720         OPCODE_ifnonnull): Now supported.
13721         (build_java_athrow): New function.
13722
13723 Mon Aug  4 15:46:45 1997  Per Bothner  <bothner@cygnus.com>
13724
13725         Rename method name <init> to match G++ (and fix mangling).
13726         * class.c (layout_class):  Replace method name of <init> by class name.
13727         (make_method_value):  Do inverse renaming of constructor from <init>.
13728         * java-tree.h (DECL_CONSTRUCTOR_P):  New macro.
13729         * typeck.c (lookup_java_constructor):  New function.
13730         * expr.c (expand_invoke):  If method_name is <init>, call
13731         lookup_java_constructor to find constructor.
13732
13733         * parse.c (get_constant):  Handle CONSTANT_Float and CONSTANT_Double.
13734
13735 Fri Aug  1 11:37:09 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
13736
13737         * parse.c (get_class_constant): Modified to handle array "classes"
13738         * typeck.c (set_local_type): Bug fixed when filling type_map[] with
13739         wide type.
13740         (convert): Modified to handle real type.
13741         * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
13742         soft_multianewarray, soft_newarray_node, soft_throw_node): New global
13743         variables declared.
13744         * decl.c (soft_badarrayindex_node, soft_anewarray_node,
13745         soft_multianewarray, soft_newarray_node, soft_throw_node): New
13746         global variables initialized.
13747         (find_local_variable): Handles the case of a pointer
13748         (end_java_method): Restore the use of one more scope
13749         * expr.c (build_java_arraynull_check, build_java_arrayaccess,
13750         build_java_array_length_access, expand_java_arrayload,
13751         expand_java_arraystore, expand_java_array_length,
13752         expand_java_multianewarray, expand_java_anewarray,
13753         build_java_check_indexed_type, is_array_type_p,
13754         build_java_throw_out_of_bound_exception): New functions.
13755         (STORE_INTERNAL): Now forces type of the decl to be type of the value.
13756         (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
13757         OPCODE_<t>aload): Implemented code for verification.
13758         (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
13759         ARRAY_NEW_MULTI): Macro defined.
13760         (CONVERT): Modified to invoke convert().
13761         (case OPCODE_aload2): Fixed index typo from 2 to 1.
13762
13763 Thu Jul 31 12:48:18 1997  Per Bothner  <bothner@cygnus.com>
13764
13765         * class.c (push_class):  Set DECL_ARTIFICIAL (for dbxout.c).
13766         (build_class_ref, is_compiled_class):  Handle pointer-to-record types.
13767         (make_class_data):  Field name needs '/' as package prefix.
13768         * expr.c (type_stack_dup, java_stack_dup):  Fix fencepost errors.
13769
13770 Fri Jul 25 11:44:21 1997  Per Bothner  <bothner@cygnus.com>
13771
13772         Implement debug information for local variables.
13773         * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
13774         DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
13775         DECL_LOCAL_SLOT_CHAIN):  New macros.
13776         (struct lang_decl_var):  New type.
13777         * parse.c (give_name_to_locals):  Move to decl.c.
13778         * decl.c (give_name_to_locals):  Re-written to Do The Right Thing.
13779         (start_java_method):  Re-write parameter handling.
13780         (pending_local_decls):  New global variable.
13781         (push_jvm_slot, maybe_pushlevels, maybe_poplevels):  New functions.
13782         (find_local_variable):  Accept pc so we can skips decls not in range.
13783         (struct binding_level):  Add end_pc field.
13784         * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
13785         (various):  Change so current pc gets passed to find_local_variable.
13786
13787         * decl.c (init_decl_processing):  Re-arrange fields in
13788         class_type_node and and method_type_node to match kaffe 0.9.1.
13789         * class.c (make_method_value, make_class_data):  Update
13790         initializations to match.
13791
13792 Wed Jul 16 17:17:50 1997  Per Bothner  <bothner@cygnus.com>
13793
13794         * class.c (unicode_mangling_length, emit_unicode_mangled_name,
13795         append_gpp_mangled_name, append_gpp_mangled_type):  New functions.
13796         (push_super_field):  New function.
13797         (make_class_data):  Handle inheritance of class static initializer.
13798         (layout_class):  New name mangling.
13799         * constants.c (build_constant_data_ref):  Init type of data array
13800         to a one-element array.
13801         (build_constants_constructor):  Set DECL_SIZE from complete array type.
13802         * decl.c:  Rename class_type, object_type etc to class_type_node,
13803         object_type_node etc.  Make former inherit from latter.
13804         * expr.c (expand_invoke):  Add cast of function address.
13805         * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE):  New.
13806         * parse.c (yyparse):  Don't call layout_class here.
13807         * typeck.c (build_java_array_type):  Set TYPE_ARRAY_ELEMENT.
13808
13809 Sat Jun 14 12:06:57 1997  Per Bothner  <bothner@cygnus.com>
13810
13811         * decl.c, class.c:  Update method type to match latest Kaffe snapshot.
13812         * constants.c (lookup_name_constant):  Renamed to alloc_name_constant.
13813         (alloc_class_constant):  New.
13814         * expr.c (expand_invoke):  Make sure method's class is initialized.
13815         * class.c (interits_from_p, emit_register_class):  New functions.
13816         * parse.c (yyparse):  Call emit_register_class.
13817
13818 Mon Jun  9 18:08:06 1997  Per Bothner  <bothner@cygnus.com>
13819
13820         * constants.c:  New file, to handle constant pool.
13821         * Makefile.in (JAVA_OBJS):  Add constants.o.
13822         * decl.c (init_decl_processing):  Update, fix, finish various structs.
13823         (pushdecl_top_level):  New.
13824         * parse.c (layout_class):  Moved to class.c.
13825         * expr.c (java_push_constant_from_pool):  New function.
13826         * class.c (build_class_ref):  Make work fully
13827         (make_class_data):  Emit super-class, constant pool, interface vector.
13828
13829 Tue Jun  3 10:14:31 1997  Per Bothner  <bothner@cygnus.com>
13830
13831         java-tree.h (DECL_SIGNATURE, BCODE_EMITTED):  Remove.
13832         (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P):  New.
13833         * class.c (class_depth):  New function.
13834         (lookup_named_class):  Replaced by new function lookup_class.
13835         * decl.c (object_type_node, string_type_node):  New.
13836         Remove various types that we no longer need.
13837         * expr.c (verify_jvm_instructions):  New separate verifier pass.
13838         (push_type, pop_type):  New functions for verifier.
13839         (type_stack_dup, pop_argument_types, merge_types):  Likewise.
13840         (expand_byte_code):  Simplify, since we assume already verified.
13841         (expand_invoke):  Now mostly works.
13842         * javaop.def:  Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
13843         * lang.c (main_class):  Move to parse.c.  Don't make_class yet.
13844         * parse.c:  Wait to allocate class object until we know its name.
13845         (layout_class):  Calculate DECL_VINDEX for each virtual method.
13846         * typeck.c (get_array_type):  Rename to ...
13847         (build_java_array_type):  ... and provide working implementation.
13848         (build_java_signature):  New function - build Java signature of type.
13849         (set_java_signature):  New function - cache signature with type.
13850         (lookup_java_method):  New function.
13851
13852 Tue May  6 22:08:24 1997  Per Bothner  <bothner@deneb.cygnus.com>
13853
13854         * class.c (ident_subst):  Take extra SUFFIX parameter.
13855         (add_field):  Set DECL_ASSEMBLER_NAME of static fields;  more.
13856         (set_constant_value, build_static_field_ref, is_compiled_class):  New.
13857         (build_class_ref):  Actually implement.
13858         * decl.c, java-tree.h:  Renamed some xx_type to xx_type_node.
13859         * decl.c (builtin_function):  New.
13860         (init_decl_processing):  Update for current Kaffe.  Declare some
13861         builtin Kaffe functions.
13862         * expr.c (build_address_of):  New.
13863         (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
13864         Renamed (from expand_java_new etc), and added working implementations.
13865         (build_field_ref):  Now also handle static fields.
13866         (expand_invoke):  Implement invokestatic, and start implement rest.
13867         * java-opcodes.h:  Use javaop.def to avoid duplicated list.
13868         * javaop.def:  Rename invokevirt -> invokevirtual.
13869         * lang.c (use_handles):  Removed.
13870         * parse.c:  Add support for ConstantValue attribute.
13871         Handle nested loading of a class.  (JPOOL_UTF):  New.
13872
13873 Tue Mar 11 20:11:05 1997  Per Bothner  <bothner@deneb.cygnus.com>
13874
13875         * expr.c (expand_java_pushc):  Support #ifndef REAL_ARITHMETIC case.
13876
13877 Thu Feb 27 14:24:29 1997  Per Bothner  <bothner@deneb.cygnus.com>
13878
13879         * Make-lang.in (java.install-man):  New empty rule.
13880         * typeck.c (set_local_type):  New function.
13881         * expr.c (STORE_INTERNAL):  Call find_local_variable,
13882         not find_stack_slot.  Call set_local_type.
13883
13884 Wed Feb 12 16:11:05 1997  Per Bothner  <bothner@kalessin.cygnus.com>
13885
13886         * java-tree.h:  Various new macros for constructing RECORD_TYPEs,
13887         and building RECORD_TYPE CONSTRUCTORs.
13888         Also support for creating Utf8Const objects from an INDETIFIER_NODE.
13889
13890         * lang.c (use_handles):  Change the default to 0.
13891         * decl.c:  Define and build class_type, field_type, utf8const_type.
13892         * class.c (make_class_data, make_field_value,
13893         get_access_flags_from_decl, build_class_ref, build_utf8_ref,
13894         hashUtf8String, strLengthUtf8, mangled_classname:
13895         Functions to build reflective data structures.
13896         * parse.c (yyparse):  Call make_class_data.
13897
13898         * jcf-io.c (open_class, find_classfile):  New functions.
13899         * jcf-dump.c:  Support reading classfile from explicitly-named
13900         class file (without CLASSPATH searching).
13901
13902 Thu Oct 24 14:10:16 1996  Per Bothner  <bothner@deneb.cygnus.com>
13903
13904         * jcf-reader.c:  Add parameter list to HANDLE_CONSTANT_Utf8.
13905         * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
13906         Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
13907         (get_constant):  Now trivial for CONSTANT_Utf8.
13908
13909         * jcf.h:  Make NEW_CPOOL the default.
13910         * jcf.h, jcf-reader.c, parse.c:  Remove support for !NEW_CPOOL.
13911
13912 Thu Oct 24 13:52:45 1996  Per Bothner  <bothner@deneb.cygnus.com>
13913
13914         New directory.