OSDN Git Service

In gcc/java:
[pf3gnuchains/gcc-fork.git] / gcc / java / ChangeLog
1 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
2
3         * class.c (make_class_data): Push initial value for "arrayclass".
4         * decl.c (init_decl_processing): Add new class field "arrayclass".
5
6 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
7
8         From patha@softlab.ericsson.se:
9         * parse.y (switch_label): Use build, not build1, to construct 
10         DEFAULT_EXPR.
11
12 2001-01-04  Neil Booth  <neil@daikokuya.demon.co.uk>
13
14         * lang.c (lang_decode_option): Change -MA to -MP.
15         * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
16         Update to new prototype; do quote targets.
17         (jcf_dependency_write): Update.
18
19 2000-12-22  Bryce McKinlay  <bryce@albatross.co.nz>
20
21         Shorten primitive array allocation path:
22         * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
23         to create new primitive arrays.
24         * expr.c (build_newarray): If generating native code, call 
25         soft_newarray_node with a reference to the primitive TYPE identifier
26         instead of type_value.
27         
28 2000-12-17  Bryce McKinlay  <bryce@albatross.co.nz>
29
30         Fix for PRs gcj/312 and gcj/253:
31         * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
32         dest if they arn't already.
33         * class.c (layout_class): Call maybe_layout_super_class on 
34         superinterfaces also, but only if compiling from bytecode.
35
36         Fix for PR gcj/373:
37         * parse.y (create_class): Set ACC_STATIC if class is declared in an
38         interface.
39
40 2000-12-15  Tom Tromey  <tromey@redhat.com>
41
42         * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
43         set.
44
45 2000-12-14  Andrew Haley  <aph@redhat.com>
46
47         * boehm.c (mark_reference_fields): Change test to correctly detect
48         bitmap overflow.
49
50 2000-12-15  Andreas Jaeger  <aj@suse.de>
51
52         * config-lang.in (lang_dirs): Added.
53
54 2000-12-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
55
56         * parse.y (end_artificial_method_body): Fixed undefined behavior.
57         Credits go to rth for finding it.
58
59 2000-12-13  Mike Stump  <mrs@wrs.com>
60
61         * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
62
63 2000-11-07  Tom Tromey  <tromey@cygnus.com>
64
65         * Make-lang.in (JAVA_LEX_C): Added chartables.h.
66         * lex.c (java_ignorable_control_p): Removed.
67         (java_letter_or_digit_p): Removed.
68         (java_start_char_p): New function.
69         (java_read_char): Return `int', not `unicode_t'.  Changed
70         callers.
71         (java_read_unicode): Likewise.
72         (java_read_unicode_collapsing_terminators): Likewise.
73         (java_get_unicode): Likewise.
74         (java_new_lexer): Initialize hit_eof.
75         (java_parse_end_comment): Take `int' argument.
76         (java_parse_doc_section): Likewise.
77         (java_parse_escape_sequence): Don't allow backlash-newline.
78         Return `int'.
79         * lex.h (JAVA_DIGIT_P): Removed.
80         (_JAVA_LETTER_OR_DIGIT_P): Removed.
81         (_JAVA_IDENTIFIER_IGNORABLE): Removed.
82         (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
83         (JAVA_PART_CHAR_P): New macro.
84         (UEOF): Now -1.
85         (JAVA_CHAR_ERROR): Now -2.
86         (java_lexer): New field `hit_eof'.
87         * chartables.h: New file.
88         * gen-table.pl: new file.
89
90 2000-11-20  Tom Tromey  <tromey@cygnus.com>
91             Alexandre Petit-Bianco  <apbianco@cygnus.com>
92
93         * parse.y (java_complete_lhs): Only allow compound assignment of
94         reference type if type is String.
95
96 2000-12-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
97
98         * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
99         jcf-path.c: Likewise.
100
101 2000-12-09  Anthony Green  <green@redhat.com>
102
103         * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
104         filestart and filename_length as int values.
105
106 2000-12-07  Mo DeJong  <mdejong@redhat.com>
107
108         * jcf-io.c (find_class): Correct the logic that tests to see if a
109         .java file is newer than its .class file. The compiler was
110         incorrectly printing a warning when file mod times were equal.
111
112 2000-12-07  Zack Weinberg  <zack@wolery.stanford.edu>
113
114         * jvgenmain.c: Use ISPRINT not isascii.
115
116 2000-12-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
117
118         * parse.y (end_artificial_method_body): Fixed typo.
119
120 2000-12-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
121
122         * parse.y (patch_method_invocation): Pick the correct enclosing
123         context when creating inner class instances.
124         Fixes gcj/332.
125
126 2000-11-26  Joseph S. Myers  <jsm28@cam.ac.uk>
127
128         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
129         Update copyright year to 2000.
130
131 2000-11-23  Anthony Green  <green@redhat.com>
132
133         * jcf-parse.c (init_jcf_parse): Register current_file_list root.
134         Move current_file_list out of yyparse and make it static.
135
136         * expr.c: Declare quick_stack and tree_list_free_list as static
137         (init_expr_processing): Register quick_stack and
138         tree_list_free_list roots.
139
140 2000-11-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
141
142         * parse.y (build_outer_field_access): New local `decl_ctx', use
143         it. Check for field's context and current class immediate outer
144         context inheritance.
145         (outer_field_access_p): Consider fields inherited from the last
146         enclosing context.
147         (build_access_to_thisn): Stop at the last enclosing context if
148         necessary.
149         Fixes gcj/367.
150
151 Thu Nov 23 02:19:14 2000  J"orn Rennecke <amylaar@redhat.com>
152
153         * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
154
155 2000-11-22  Bryce McKinlay  <bryce@albatross.co.nz>
156
157         * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
158         scratch buffer.
159
160 2000-11-20  Tom Tromey  <tromey@cygnus.com>
161
162         * jv-scan.c (help): Document --complexity.
163         (options): Added --complexity.
164         (flag_complexity): New global.
165         (main): Call `report'.
166         * parse-scan.y (complexity): New global.
167         (if_then_statement, if_then_else_statement,
168         if_then_else_statement_nsi, switch_block_statement_group,
169         while_expression, do_statement, for_begin, continue_statement,
170         throw_statement, catch_clause, finally, method_invocation,
171         conditional_and_expression, conditional_or_expression,
172         conditional_expression): Update complexity.
173         (reset_report): Reset complexity.
174         (report): New function.
175
176 2000-11-20  Tom Tromey  <tromey@cygnus.com>
177
178         * lex.c (yylex): Added STRICT_TK case.
179         * parse.y (STRICT_TK): Added.
180         * parse-scan.y (STRICT_TK): Added.
181         * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
182         `;'.  Use 4, not 3, with -k option.  Correctly rename resulting
183         file.
184         * keyword.h: Rebuilt.
185         * keyword.gperf (strictfp): Added.
186
187 2000-11-20  Tom Tromey  <tromey@cygnus.com>
188
189         * lex.c (yylex): Recognize floating point constants with leading
190         0.
191
192 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
193
194         * java-tree.h (cyclic_inheritance_report): Constify.
195         * parse.y (cyclic_inheritance_report): Likewise.
196
197 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
198
199         * parse.y (goal): Remove call to ggc_add_string_root.
200
201 2000-11-16  Zack Weinberg  <zack@wolery.stanford.edu>
202
203         * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
204         Create string in scratch buffer, then pass to build_string.
205
206 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
207
208         * parse.y (issue_warning_error_from_context): Add
209         ATTRIBUTE_PRINTF.
210
211 2000-11-11  Anthony Green  <green@redhat.com>
212
213         * jcf-parse.c (process_zip_dir): Add finput parameter.
214         (jcf_figure_file_type): Call process_zip_dir with appropriate
215         argument.
216
217 2000-11-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
218
219         * decl.c (copy_lang_decl): Use memcpy, not bcopy.
220         * jcf-parse.c (jcf_figure_file_type): Likewise.
221
222 2000-11-09  Joseph S. Myers  <jsm28@cam.ac.uk>
223
224         * parse.y (create_new_parser_context): Use memset () instead of
225         bzero ().
226
227 2000-11-08  Tom Tromey  <tromey@cygnus.com>
228
229         * gjavah.c (process_file): Only include gcj/cni.h when generating
230         CNI stubs.
231
232 2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>
233
234         * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
235         (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
236         instead of bzero ().
237
238 2000-11-05  Tom Tromey  <tromey@cygnus.com>
239
240         * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
241         * lex.c (IS_ZERO): New define.
242         (java_perform_atof): Error on floating point underflow.
243
244 2000-11-04  Tom Tromey  <tromey@cygnus.com>
245
246         * lex.c (java_parse_escape_sequence): Only read two octal
247         characters if the first one is greater than 3.  Don't allow
248         "octal" numbers to include the digits 8 or 9.
249
250 2000-11-05  Joseph S. Myers  <jsm28@cam.ac.uk>
251
252         * Make-lang.in (java.distdir): Remove.
253
254 2000-11-03  Tom Tromey  <tromey@cygnus.com>
255
256         * Make-lang.in (java.dvi): New target.
257         Partial fix for PR other/567.
258
259         * lang-options.h: Mention -Wout-of-date.
260         * jcf-dump.c (flag_newer): New global.
261         * gjavah.c (flag_newer): New global.
262         * jcf-io.c (find_class): Only warn when flag_newer set.
263         * lang.c (flag_newer): New global.
264         (struct string_option): New declaration.
265         (lang_W_options): New global.
266         (process_option_with_no): New function.
267         (lang_decode_option): Use it.
268
269         * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
270         * gjavah.c (cxx_keyword_subst): Handle any number of trailing
271         `$'.
272
273         * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
274         (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
275         * lex.c (java_read_unicode): Removed `term_context' argument.
276         Recognize any number of `u' in `\u'.
277         (java_read_unicode_collapsing_terminators): New function.
278         (java_get_unicode): Use it.
279         (java_lineterminator): Removed.
280         (yylex): Produce error if character literal is newline or single
281         quote.  Return if eof found in middle of `//' comment.  EOF in
282         `//' comment is only an error if pedantic.
283         (java_ignorable_control_p): New function.
284         (java_parse_end_comment): Return if eof found in middle of
285         comment.
286         Include flags.h.
287         * jv-scan.c (pedantic): New global.
288
289 2000-10-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
290
291         * parse.y (outer_field_access_p): Inherited fields aren't
292         consider outer fields.
293         (maybe_build_thisn_access_method): Use
294         PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
295         (resolve_expression_name): Trigger an error if a static field
296         is being accessed as an outer field.
297
298 2000-10-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
299
300         * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
301         Fixes gcj/365.
302
303 2000-10-27  Zack Weinberg  <zack@wolery.stanford.edu>
304
305         * Make-lang.in: Move all build rules here from Makefile.in,
306         adapt to new context.  Wrap all rules that change the current
307         directory in parentheses.  Expunge all references to $(P).
308         When one command depends on another and they're run all at
309         once, use && to separate them, not ;.  Add OUTPUT_OPTION to
310         all object-file generation rules.  Delete obsolete variables.
311
312         * Makefile.in: Delete.
313         * config-lang.in: Delete outputs= line.
314
315 2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
316
317         * parse.y (patch_method_invocation): NULLify this_arg when already
318         inserted.
319         (maybe_use_access_method): Handle call to methods unrelated to the
320         current class. Fixed comment.
321         Fixes gcj/361.
322
323 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
324
325        * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
326        scope.
327
328 2000-10-24  Tom Tromey  <tromey@cygnus.com>
329
330         * lex.c (java_new_lexer): Initialize new fields.  Work around
331         broken iconv() implementations.
332         (java_read_char): Swap bytes if required.  Use fallback decoder if
333         required.
334         (byteswap_init, need_byteswap): New globals.
335         (java_destroy_lexer): Only close iconv handle if it is in use.
336         * lex.h (java_lexer): New fields read_anything, byte_swap,
337         use_fallback.
338         Made out_buffer unsigned.
339
340 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
341
342         * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
343         where an enclosing context can be set on the jdep.
344         (do_resolve_class): Fixed identation.
345
346 2000-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
347
348         * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
349
350         * jcf-reader.c (peek_attribute, skip_attribute): Only define
351         when requested.
352
353         * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
354
355         * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
356
357 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
358
359         * jcf-write.c (OP1): Update `last_bc'.
360         (struct jcf_block): Fixed indentation and typo in comments.  New
361         field `last_bc'.
362         (generate_bytecode_insns): Insert `nop' if `jsr' immediately
363         follows `monitorenter'.
364         * parse.y (patch_synchronized_statement): New local `tmp'. Call
365         `patch_string'.
366         Fixes gcj/232.
367
368 2000-10-16  Tom Tromey  <tromey@cygnus.com>
369
370         * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
371         * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
372         * lang-options.h: Added -MA, -MT, -MF..
373         * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
374         (DEPEND_TARGET_SET): New macro.
375         (DEPEND_FILE_ALREADY_SET): Likewise.
376         (init_parse): Handle new flags.
377         * jcf.h (jcf_dependency_print_dummies): Declare.
378         * Make-lang.in (s-java): Added mkdeps.o.
379         * Makefile.in (BACKEND): Added mkdeps.o.
380         (../gcjh$(exeext)): Added mkdeps.o.
381         (../jcf-dump$(exeext)): Added mkdeps.o.
382         * jcf-depend.c: Include mkdeps.h.
383         (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
384         add_entry): Removed.
385         (jcf_dependency_reset): Rewrote.
386         (dependencies): New global.
387         (jcf_dependency_set_target): Rewrote.
388         (jcf_dependency_add_target): Likewise.
389         (jcf_dependency_add_file): Likewise.
390         (munge): Removed.
391         (print_ents): Removed.
392         (jcf_dependency_write): Rewrote.
393         (print_dummies): New global.
394         (jcf_dependency_print_dummies): New function
395         (jcf_dependency_write): Call deps_dummy_targets if required.
396
397 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
398
399         * gjavah.c (add_class_decl): Removed unused variables `tname',
400         `tlen' and `name_index'.
401         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
402         * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
403         in `wfl_operator' with value.
404         (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
405         (jcf_figure_file_type): Fixed identation.
406         * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
407         * parse.y (analyze_clinit_body): New function.
408         (static_initializer:): Reset `current_static_block'.
409         (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
410         `wfl_operator' with new value.
411         (lookup_cl): Use EXPR_WFL_FILENAME.
412         (maybe_yank_clinit): Handle bogus <clinit> bodies, call
413         analyze_clinit_body.
414         (build_outer_field_access): Access to this$<n> built from
415         current_class, not its outer context.
416         (build_access_to_thisn): Fixed leading comment. Tidied things up.
417         (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
418         (patch_method_invocation): Use `is_static_flag' when already
419         initialized.
420         (patch_newarray): Removed assignment in ternary operator.
421
422 2000-10-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
423
424         * except.c (free_eh_ranges): Don't free `whole_range'.
425
426 2000-10-15  Anthony Green  <green@redhat.com>
427
428         * decl.c (init_decl_processing): Call init_class_processing before
429         anything else.
430
431 2000-10-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
432
433         * check-init.c (check_init): Fixed leading comment. Use
434         LOCAL_FINAL_P.
435         * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
436         (give_name_to_locals): Likewise.
437         (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
438         fields in lang_decl_var.
439         * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
440         DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
441         (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
442         (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
443         DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
444         (LOCAL_FINAL): Rewritten.
445         (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
446         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
447         (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
448         `init_final' fields.
449         (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
450         `final_uid', `final_liic', `final_ierr' and `local_final' fields.
451         (TYPE_HAS_FINAL_VARIABLE): New macro.
452         (struct lang_type): Added `afv' field.
453         * parse.y (check_static_final_variable_assignment_flag): New function.
454         (reset_static_final_variable_assignment_flag): Likewise.
455         (check_final_variable_local_assignment_flag): Likewise.
456         (reset_final_variable_local_assignment_flag): Likewise.
457         (check_final_variable_indirect_assignment): Likewise.
458         (check_final_variable_global_assignment_flag): Likewise.
459         (add_inner_class_fields): Use LOCAL_FINAL_P.
460         (register_fields): Handle local finals and final variables.
461         (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
462         (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
463         (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
464         on local finals.
465         (java_complete_expand_methods): Loop to set
466         TYPE_HAS_FINAL_VARIABLE. Call
467         `reset_final_variable_local_assignment_flag' and
468         `check_final_variable_local_assignment_flag' accordingly before
469         and after constructor expansion. Call
470         `reset_static_final_variable_assignment_flag'
471         before expanding <clinit> and after call
472         `check_static_final_variable_assignment_flag' if the
473         current_class isn't an interface. After all methods have been
474         expanded, call `check_final_variable_global_assignment_flag' and
475         `check_static_final_variable_assignment_flag' if the current class
476         is an interface.
477         (maybe_yank_clinit): Fixed typo in comment.
478         (build_outer_field_access_methods): Removed old sanity check. Use
479         FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
480         Don't create access methods for finals.
481         (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
482         (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
483         existing DECL_INIT has been processed.
484         (java_complete_lhs): Likewise.
485         (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
486         Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
487         logic.
488         (patch_assignment): Use LOCAL_FINAL_P.
489         (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
490         DECL_INITIAL is nullified.
491         Fixes gcj/163.
492
493 2000-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
494
495         * Make-lang.in (parse.c, parse-scan.c): Create atomically.
496
497         * Makefile.in (parse.c, parse-scan.c): Likewise.
498
499 2000-10-12  Mark Mitchell  <mark@codesourcery.com>
500
501         * class.c (temporary_obstack): Remove.
502         (make_class): Don't mess with obstascks.
503         (push_class): Likewise.
504         (set_super_info): Likewise.
505         (add_method_1): Likewise.
506         (add_method): Likewise.
507         (add_field): Likewise.
508         (build_utf8_ref): Likewise.
509         (build_class_ref): Likewise.
510         (build_static_field_ref): Likewise.
511         (finish_class): Likewise.
512         (push_super_field): Likewise.
513         (layout_class): Likewise.
514         (layout_class_methods): Likewise.
515         (init_class_processing): Likewise.
516         * constants.c (get_tag_node): Likewise.
517         (build_constant_data_ref): Likewise.
518         * decl.c (ggc_p): Remove.
519         (copy_lang_decl): Use ggc_alloc.
520         (complete_start_java_method): Don't mess with obstacks.
521         (start_java_method): Likewise.
522         (end_java_method): Likewise.
523         * except.c (link_handler): Use xmalloc.
524         (free_eh_ranges): New function.
525         (method_init_exceptions): Use it.
526         (add_handler): Use xmalloc.
527         (expand_start_java_handler): Don't mess with obstacks.
528         (prepare_eh_table_type): Likewise.
529         (expand_end_java_handler): Likewise.
530         * expr.c (push_value): Likewise.
531         (create_label_decl): Likewise.
532         (build_jni_stub): Likewise.
533         (java_lang_expand_expr): Likewise.
534         (note_instructions): Use xrealloc.
535         (java_push_constant_from_pool): Don't mess with obstacks.
536         (process_jvm_instruction): Likewise.
537         * java-tree.h (cyclic_inheritance_report): Remove duplicate
538         declaration.
539         * jcf-parse.c (get_constant): Don't mess with obstacks.
540         (read_class): Likewise.
541         (jcf_parse): Likewise.
542         * lex.c (expresion_obstack): Remove.
543         (java_lex): Don't use obstack_free.
544         * parse.h (exit_java_complete_class): Don't mess with obstacks.
545         (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
546         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
547         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
548         * parse.y (gaol): Add more GC roots.
549         (add_inner_class_fields): Adjust calls to MANGLE_* macros.
550         (lookup_field_wrapper): Likewise.
551         (obtain_incomplete_type): Don't mess with obstacks.
552         (build_alias_initializer_paramter_list): Adjust calls to MANGLE_*
553         macros.
554         (craft_constructor): Don't mess with obstacks.
555         (safe_layout_class): Likewise.
556         (java_complete_class): Likewise.
557         (source_end_java_method): Likewise.
558         (build_outer_field_access_methods): Likewise.
559         (build_outer_method_access_method): Likewise.
560         (maybe_build_thisn_access_method): Likewise.
561         (build_dot_class_method_invocation): Likewise.
562         (java_complete_tree): Likewise.
563         (java_complete_lhs): Likewise.
564         (do_merge_string_cste): Likewise.
565         (patch_string_cst): Likewise.
566         (array_constructor_check_entry): Likewise.
567         * typeck.c (build_java_array_type): Likewise.
568         (parse_signature_string): Likewise.
569         (build_java_signature): Likewise.
570
571 2000-10-12  Tom Tromey  <tromey@cygnus.com>
572
573         Fix for PR gcj/356:
574         * gjavah.c (add_class_decl): Don't special-case inner classes.
575         (add_namelet): Likewise.
576
577 2000-10-11  Rodney Brown  <RodneyBrown@mynd.com>
578
579         * java-tree.h: Constify current_encoding.
580         * lang.c: Constify current_encoding.
581
582 2000-10-10  Jeff Sturm  <jeff.sturm@appnet.com>
583
584         * jvgenmain.c (class_mangling_suffix): Omit `.'.
585         (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
586
587 2000-10-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
588
589         * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
590         patch. Fixes gcj/340.
591
592 2000-10-10  Tom Tromey  <tromey@cygnus.com>
593
594         * lex.c (java_new_lexer): Initialize out_first and out_last
595         fields.
596         * lex.h (java_lexer): Added out_buffer, out_first, out_last.
597
598 2000-10-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
599
600         * parse.y (pop_current_osb): New function.
601         (array_type:): Use `dims:', changed actions
602         accordingly. Suggested by Anthony Green.
603         (array_creation_expression:): Used pop_current_osb.
604         (cast_expression:): Likewise.
605         (search_applicable_method_list): Fixed indentation.
606
607 2000-10-08  Anthony Green  <green@redhat.com>
608
609         * parse.y (array_type_literal): Remove production.
610         (type_literals): Refer to array_type, not array_type_literal.
611
612 2000-10-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
613
614         Patch contributed by Corey Minyard.
615         * decl.c (check_local_named_variable): New function.
616         (tree check_local_unnamed_variable): Likewise.
617         (find_local_variable): Splitted. Call check_local_{un}named_variable.
618
619 2000-10-07  Anthony Green  <green@redhat.com>
620
621         * class.c (layout_class): Handle case where superclass can't be
622         layed out yet.
623
624 2000-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
625
626         * Makefile.in (keyword.h): Refer to GNU FTP site for updated
627         gperf.
628
629 2000-10-05  Tom Tromey  <tromey@cygnus.com>
630
631         * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
632         * jvgenmain.c (class_mangling_prefix): Removed.
633         (class_mangling_suffix): New global.
634         (main): Use it.
635         * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
636         `$'.
637         (print_method_info): Handle overrides for static and final
638         methods.
639         (process_file): Generate declaration for class object field.
640         * class.c (cxx_keywords): New array.
641         (utf8_cmp): New function.
642         (cxx_keyword_p): New function.
643         (layout_class_method): Mangle C++ keywords by appending `$'.
644         (mangle_field): New function.
645         (mangle_class_field): Use mangle_field.  Mangle class name as
646         `class$'.
647         (mangle_static_field): Use mangle_field.
648
649 Tue Oct  3 13:44:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
650
651         * decl.c (find_local_variable): Removed uncessary type check and
652         fixed range check typo. From Corey Minyard.
653
654 Wed Sep 13 16:06:52 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
655
656         * decl.c (give_name_to_locals): New local `code_offset'. Call
657         `maybe_adjust_start_pc'.
658         * expr.c (note_instructions): New function.
659         (expand_byte_code): Don't collect insn starts here.
660         (peek_opcode_at_pc): New function.
661         (maybe_adjust_start_pc): Likewise.
662         * java-tree.h (maybe_adjust_start_pc): Declare.
663         (note_instructions): Likewise.
664         * jcf-parse.c (parse_class_file): Call `note_instructions'.
665
666 Wed Sep 13 11:50:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
667
668         * parse.y (field_access:): Fixed indentation.
669         (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
670
671 2000-09-07  Tom Tromey  <tromey@cygnus.com>
672
673         Fix for PR gcj/307:
674         * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
675         JPRIMITIVE_TYPE_P, for arithmetic operators.
676         (patch_method_invocation): Indentation fix.
677         (try_builtin_assignconv): Handle boolean specially.  Fixed typo.
678         (valid_builtin_assignconv_identity_widening_p): Handle boolean.
679         (do_unary_numeric_promotion): Cleaned up code.
680         (valid_cast_to_p): Handle boolean correctly.
681
682 2000-09-27  Tom Tromey  <tromey@cygnus.com>
683
684         * lex.c (java_read_unicode): Reset bs_count when finished with
685         `\u' sequence.
686
687 2000-10-01  Mark Mitchell  <mark@codesourcery.com>
688
689         Convert to GC.
690         * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
691         * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
692         (typeck.o): Depend on ggc.h.
693         * class.c (add_method_1): Use GC functions for allocation.
694         (init_class_processing): Register roots.
695         * decl.c (ggc_p): Set to 1.
696         (pending_local_decls): Make it static.
697         (push_jvm_slot): Use GC functions for allocation.
698         (init_decl_processing): Register roots.
699         (give_name_to_locals): Use GC functions for allocation.
700         (lang_mark_tree): New function.
701         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
702         functions for allocation.
703         * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
704         * lex.c (java_lex): Use build_string, rather than replicating it
705         inline.
706         * parse.y (goal): Add more roots.
707         (mark_parser_ctxt): New function.
708         * typeck.c: Include ggc.h.
709
710 2000-09-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
711
712         * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
713         contains something else than MODIFY_EXPR.
714
715 2000-09-23  Mark Mitchell  <mark@codesourcery.com>
716
717         * Make-lang.in (JAVA_SRCS): Include java-tree.h.
718         * Makefile.in (parse.o): Depend on ggc.h.
719         (class.o): Likewise.
720         (constants.o): Likewise.
721         (decl.o): Likewise.
722         (expr.o): Likewise.
723         (jcf-parse.o): Likewise.
724         (jcf-write.o): Likewise.
725         (mangle.o): Likewise.
726         * class.c: Include ggc.h.
727         (build_static_field_ref): Register GC roots.
728         (layout_class): Likewise.
729         (init_class_processing): Likewise.
730         * constants.c: Include ggc.h.
731         (current_constant_pool_data_ref): Remove.
732         (tag_nodes): Move it to ...
733         (get_tag_node): ... here.  Register GC roots.
734         * decl.c: Include ggc.h.  Remove many global tree definitions.
735         (throw_node): Define.
736         (java_global_trees): Likewise.
737         (predef_filenames): Make the size a constant.
738         (init_decl_processing): Adjust accordingly.
739         (init_decl_processing): Call init_jcf_parse.  Register GC roots.
740         * expr.c: Include ggc.h.
741         (init_expr_processing): Register GC roots.
742         (build_invokeinterface): Likewise.
743         * java-tree.h: Replace extern tree declarations with macros.
744         (java_global_trees): New variable.
745         (java_tree_index): New enumeration.
746         (init_jcf_parse): Declare.
747         * jcf-parse.c: Include ggc.h.
748         (current_class): Remove declaration.
749         (main_class): Likewise.
750         (all_class_list): Likewise.
751         (predefined_filename_p): Adjust for constant size of
752         predef_filenames.
753         (init_jcf_parse): New function.
754         * jcf-write.c: Include ggc.h.
755         (generate_classfile): Register GC roots.
756         (append_synthetic_attribute): Likewise.
757         (append_innerclass_attribute_entry): Likewise.
758         * lang.c: Include ggc.h.
759         (lang_print_error): Register GC roots.
760         * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
761         with macros.
762         * parse.y: Include ggc.h.
763         (wfl_operator): Remove.
764         (goal): Register GC roots.
765         (java_pop_parser_context): Adjust for new field names.
766         (java_parser_context_save_global): Likewse.
767         (java_parser_context_restore_global): Likewise.
768         (java_parser_context_suspend): Likewise.
769         (java_parser_context_resume): Likewise.
770         (verify_constructor_circularity): Register GC roots.
771         (lookup_cl): Likewise.
772         (java_reorder_fields): Likewise.
773         (build_current_this): Likewise.
774         (class_in_current_package): Likewise.
775         (argument_types_convertible): Likewise.
776         (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
777
778 2000-09-14  Tom Tromey  <tromey@cygnus.com>
779
780         * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
781
782 2000-09-13  Tom Tromey  <tromey@cygnus.com>
783
784         * jcf-parse.c: Include <locale.h>.
785         * jv-scan.c: Include <locale.h>.
786
787 2000-09-12  Tom Tromey  <tromey@cygnus.com>
788
789         * expr.c (pop_type_0): Return `Object' if trying to merge two
790         interface types.
791         * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
792         interface types; `Object' is always a valid supertype.
793
794 2000-09-12  Tom Tromey  <tromey@cygnus.com>
795
796         Fix for PR gcj/33:
797         * jv-scan.c (help): Document --encoding.
798         (options): Added `encoding' entry.
799         (OPT_ENCODING): New define.
800         (main): Handle --encoding.
801         Include <langinfo.h> if nl_langinfo exists.
802         * lang-options.h: Document --classpath, --CLASSPATH, --main, and
803         --encoding.
804         * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
805         (parse_source_file): Correctly call java_init_lex.  Added `finput'
806         argument.  Use nl_langinfo to determine default encoding.
807         * java-tree.h (current_encoding): Declare.
808         * parse.y (java_parser_context_restore_global): Don't restore
809         `finput'.
810         (java_parser_context_save_global): Don't set `finput' field.
811         (java_pop_parser_context): Don't restore `finput'.  Free old lexer
812         if required.
813         * lang.c (current_encoding): New global.
814         (lang_decode_option): Recognize `-fencoding='.
815         (finish_parse): Don't close finput.
816         * parse.h (struct parser_ctxt): Removed `finput' and
817         `unget_utf8_value' fields.  Added `lexer' field.
818         (java_init_lex): Fixed declaration.
819         * lex.c (java_new_lexer): New function.
820         (java_destroy_lexer): Likewise.
821         (java_read_char): Added `lex' argument.  Handle iconv case.
822         (java_read_unicode): Added `lex' argument.  Count backslashes in
823         lexer structure.
824         (java_init_lex): Added `finput' and `encoding' arguments.  Set
825         `lexer' field in ctxp.
826         (BAD_UTF8_VALUE): Removed.
827         (java_lex): Handle seeing UEOF in the middle of a string literal.
828         * lex.h: Include <iconv.h> if HAVE_ICONV defined.
829         (java_lexer): New structure.
830         (UNGETC): Removed.
831         (GETC): Removed.
832         (DEFAULT_ENCODING): New define.
833         (java_destroy_lexer): Declare.
834
835 2000-09-12  Tom Tromey  <tromey@cygnus.com>
836
837         Fix for PR gcj/343:
838         * lex.c (java_init_lex): Initialize java_io_serializable.
839         * parse.y (java_io_serializable): New global.
840         (valid_ref_assignconv_cast_p): An array can be cast to
841         serializable.
842
843 2000-09-10  Zack Weinberg  <zack@wolery.cumb.org>
844
845         * decl.c, expr.c: Include defaults.h if not already included.
846         Don't define the *_TYPE_SIZE macros.
847
848 2000-09-09  Geoffrey Keating  <geoffk@cygnus.com>
849
850         * typeck.c (build_java_array_type): Correct first parameter
851         in ADJUST_FIELD_ALIGN invocation.
852
853 2000-09-06  Tom Tromey  <tromey@cygnus.com>
854
855         * lang-specs.h: Also recognize `-femit-class-files'.
856
857 2000-09-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
858
859         * verify.c (merge_types): Load the types to merge if necessary.
860
861 2000-09-02  Anthony Green  <green@redhat.com>
862
863         * jcf-io.c: Include zlib.h.
864         (open_in_zip): Read compressed class file archives.
865         * zipfile.h (ZipDirectory): Add uncompressed_size and
866         compression_method fields.
867         * zextract.c (read_zip_archive): Collect file compression info.
868
869 2000-08-15  Bryce McKinlay  <bryce@albatross.co.nz>
870
871         * parse.y (do_resolve_class): Also explore superclasses of
872         intermediate enclosing contexts when searching for inner classes.
873
874 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
875
876         * parse.y (variable_declarator_id:): Better error message.
877         (expression_statement:): Use YYNOT_TWICE.
878         (cast_expression:): Likewise.
879         (assignment:): Likewise.
880
881 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
882
883         * parse.y (do_merge_string_cste): New locals. Create new
884         STRING_CSTs each time, use memcpy. Fixes gcj/311.
885
886 2000-08-07  Hans Boehm  <boehm@acm.org>
887
888         * boehm.c (mark_reference_fields): Set marking bits for all words in
889         a multiple-word record.
890         (get_boehm_type_descriptor): Use the procedure marking descriptor for
891         java.lang.Class.
892
893 2000-08-31  Mike Stump  <mrs@wrs.com>
894
895         * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
896         jcf-dump$(exeext)): Make parallel safe.
897
898 2000-08-29  Zack Weinberg  <zack@wolery.cumb.org>
899
900         * jcf-parse.c (set_source_filename): Constify a char *.
901         * jcf-write.c (append_innerclasses_attribute,
902         make_class_file_name): Constify a char *.  Don't recycle a
903         variable for an unrelated purpose.
904         * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
905         (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
906
907 2000-08-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
908
909         * expr.c (can_widen_reference_to): Fixed indentation.
910         * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
911         * parse.y: `finit$' replaces `$finit$' in comments.
912         (try_builtin_assignconv): Fixed leading comment.
913
914 2000-08-25  Greg McGary  <greg@mcgary.org>
915
916         * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
917
918 2000-08-24  Greg McGary  <greg@mcgary.org>
919
920         * lang.c (lang_decode_option): Use ARRAY_SIZE.
921         * parse.y (BINOP_LOOKUP): Likewise.
922
923 2000-08-22  Andrew Haley  <aph@cygnus.com>
924
925         * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
926         sign extending. Fixes gcj/321.
927         * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
928         combining to make a jlong. Fixes gcj/321.
929
930 2000-08-21  Nix  <nix@esperi.demon.co.uk>
931
932         * lang-specs.h: Do not process -o or run the assembler if
933         -fsyntax-only.
934
935 2000-08-16  Andrew Haley  <aph@cygnus.com>
936
937         * typeck.c (build_java_array_type): Rewrite code to do array
938         alignment.  Take into account back-end macros when aligning array
939         data.  Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
940         user to set alignment. Fixes gcj/252 and 160.
941
942 2000-08-09  Tom Tromey  <tromey@cygnus.com>
943
944         * parse.y (check_abstract_method_definitions): Now return `int'.
945         Check implemented interfaces.  Fixes PR gcj/305.
946
947         * parse.y (patch_switch_statement): Disallow `long' in switch
948         expressions.  Fixes PR gcj/310.
949
950 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
951
952         * decl.c (finit_leg_identifier_node): New global.
953         (init_decl_processing): Use `finit$' to initialize
954         finit_identifier_node. Use `$finit$' to initialize
955         finit_leg_identifier_node.
956         * expr.c (expand_java_field_op): Use ID_FINIT_P.
957         * java-tree.h (finit_identifier_node): Changed attached comment.
958         (finit_leg_identifier_node): New declaration.
959         (ID_FINIT_P): Take finit_identifier_node and
960         finit_leg_identifier_node into account. This is a backward
961         compatibility hack.
962
963 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
964
965         * jcf-write.c (generate_bytecode_conditional): Re-installed lost
966         Jan 6 2000 patch.
967         (generate_bytecode_insns): Check `nargs' before emitting it.
968         * verify.c (merge_type_state): Fixed typo.
969         * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
970         generate_bytecode_{conditional,insns}.
971
972 Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
973
974         * check-init.c (check_init): Add case for BIT_FIELD_REF (required
975         for -pg builds).
976
977 2000-08-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
978
979         * class.c (maybe_layout_super_class): Fixed indentation.
980         * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
981         (java_check_methods): New function declaration.
982         * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
983         instead of `str_ptr'.
984         * jcf-write.c (generate_bytecode_insns): Emit number the of args
985         of a `invokeinterface' at the right time.
986         * parse.h (WFL_STRIP_BRACKET): New macro.
987         (SET_TYPE_FOR_RESOLUTION): Use it.
988         * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
989         (check_class_interface_creation): Don't check for cross package
990         innerclass name clashes.
991         (method_header): Behave properly if MDECL is `error_mark_node'.
992         (method_declarator): Return `error_mark_node' if bogus current
993         class.
994         (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
995         (resolve_and_layout): New local `decl_type', set and used. Call
996         java_check_methods.
997         (java_check_methods): New method.
998         (java_layout_classes): Use it.
999         (resolve_qualified_expression_name): No EH check necessary in
1000         access$<n>.
1001         (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
1002         `case' statement.
1003         (patch_assignment): Set DECL_INITIAL on integral final local.
1004
1005 2000-08-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1006
1007         * java-tree.h (flag_extraneous_semicolon): New extern.
1008         * lang-options.h: (-Wextraneous-semicolon): New option.
1009         * lang.c (flag_redundant): Fixed typo in leading comment.
1010         (flag_extraneous_semicolon): New global.
1011         (lang_decode_option): Set `flag_extraneous_semicolon' when
1012         -Wall. Decode `-Wextraneous-semicolon'.
1013         * parse.y (type_declaration:): Removed `SC_TK' hack, added
1014         `empty_statement' rule.
1015         (class_body_declaration): Likewise.
1016         (method_body:): Accept `;' as a method body.
1017         (static_initializer:): Removed `SC_TK' hack.
1018         (constructor_block_end:): Likewise.
1019         (empty_statement:): Report deprecated empty declaration. Fixes
1020         gcj/295
1021
1022 2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1023
1024         * parse.y (build_dot_class_method_invocation): Changed parameter
1025         name to `type'. Build signature from `type' and convert it to a
1026         STRING_CST if it's an array.
1027         (patch_incomplete_class_ref): `build_dot_class_method_invocation'
1028         to use `ref_type' directly.
1029
1030 Sun Aug  6 00:47:24 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
1031
1032         * lang-options.h: Added a comma after the last element to avoid
1033         syntax errors when other languages define additional options.
1034
1035 2000-08-04  Zack Weinberg  <zack@wolery.cumb.org>
1036
1037         * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
1038         * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
1039         (jc1): Link with $(BACKEND).
1040         (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
1041
1042 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
1043
1044         * jvspec.c: Adjust type of second argument to
1045         lang_specific_driver, and update code as necessary.
1046
1047         * class.c (build_dtable_decl): Initialize dummy.
1048
1049 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1050
1051         * parse.y (maybe_yank_clinit): When generating bytecode: non empty
1052         method bodies not to rule out discarding `<clinit>'; don't use
1053         <clinit> to initialize static fields with constant initializers.
1054
1055 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1056
1057         * gjavah.c (print_method_info): Added `synth' parameter. Skip
1058         synthetic methods.
1059         (method_synthetic): New global.
1060         (HANDLE_METHOD): Recognize synthetic method and tell
1061         `print_method_info' about it.
1062         (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
1063         processing a synthetic method.
1064         * jcf-reader.c (skip_attribute): New function.
1065         ( skip_attribute): Likewise.
1066
1067 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1068
1069         * parse.y (build_outer_field_access): Fixed comments.
1070         (fix_constructors): Emit the initialization of this$<n> before
1071         calling $finit$.
1072         (resolve_qualified_expression_name): Build an access to `decl' if
1073         necessary.
1074
1075 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1076
1077         * parse-scan.y (curent_class): Non longer const.
1078         (inner_qualifier, inner_qualifier_length): Deleted.
1079         (current_class_length): New global.
1080         (bracket_count): Fixed typo in leading comment.
1081         (anonymous_count): New global.
1082         (class_instance_creation_expression:): Handle anonymous classes.
1083         (anonymous_class_creation:): New rule.
1084         (push_class_context): Rewritten.
1085         (pop_class_context): Likewise.
1086         (INNER_QUALIFIER): Macro deleted.
1087         (report_class_declaration): call `push_class_context' when
1088         entering the function. `fprintf' format modified not to use
1089         INNER_QUALIFIER.
1090         (report_class_declaration): Assign `package_name' and
1091         `current_class' to NULL separatly.
1092
1093 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1094
1095         * expr.c (build_invokeinterface): Call layout_class_methods on
1096         target interface.
1097
1098 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1099             Anthony Green  <green@cygnus.com>
1100             Alexandre Petit-Bianco  <apbianco@cygnus.com>
1101
1102         * class.c (make_class_data): Create vtable for abstract classes.
1103         (get_dispatch_table): Changed to cope with abstract classes.
1104
1105 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1106
1107         * parse.y (patch_method_invocation): Don't reverse the argument
1108         list when dealing with anonymous class constructors. Fixed typo in
1109         comment.
1110
1111 2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1112
1113         * parse.y (build_alias_initializer_parameter_list): Reverse
1114         crafted list when building aliases for anonymous class
1115         constructors.
1116
1117 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1118
1119         * parse.y (jdep_resolve_class): Don't bother checking potential
1120         innerclass access if `decl' is NULL.
1121         (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
1122         WFL.
1123
1124 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1125
1126         * parse.c: Remove (again.)
1127
1128 2000-07-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1129
1130         * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
1131         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
1132         outside the `if' statement, alias to innerclass removed, `decl'
1133         used to mark the class complete.
1134
1135 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1136
1137         * parse.y (simple_name:): Fixed typo in error message.
1138
1139 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1140
1141         * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
1142         or its first operand can be error marks.
1143
1144 2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1145
1146         * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
1147         * parse.y (method_header): Likewise.
1148
1149 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1150
1151         * parse.y (process_imports): Consider that one might be trying to
1152         import an innerclass. Fixes gcj/254
1153
1154 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1155
1156         * parse.y (find_as_inner_class): Handle the case where the
1157         enclosing context of an innerclass has been loaded as bytecode.
1158
1159 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1160
1161         * parse.y (simple_name:): Reject `$' in type names.
1162         (resolve_type_during_patch): Use `type' as a second
1163         argument to resolve_no_layout. Fixes gcj/257.
1164
1165 2000-07-18  Bryce McKinlay  <bryce@albatross.co.nz>
1166
1167         * parse.y (find_most_specific_methods_list): Select the only
1168         non-abstract method even if max has been set.
1169         Fixes gcj/285, gcj/298.
1170
1171 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
1172
1173         * lang-specs.h: Added %(jc1) to java compiler options.
1174
1175 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
1176
1177         * .cvsignore: New file.
1178
1179 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1180
1181         * parse.y (not_accessible_p): Access granted to innerclasses
1182         (indirectly) extending the reference type. Fixes gcj/249.
1183
1184 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1185
1186         * parse.y (patch_method_invocation): Fixed comment.
1187         (maybe_use_access_method): Build this$<n>s to the context of the
1188         target method, or a type that extends it. Fixes gcj/242.
1189
1190 2000-07-13  Mark Mitchell  <mark@codesourcery.com>
1191
1192         * parse.c: Remove.
1193
1194 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1195
1196         * parse.y (fold_constant_for_init): Avoid bullish conversion.
1197
1198 2000-07-13  Tom Tromey  <tromey@cygnus.com>
1199
1200         * lang-specs.h: Added %{I*}.
1201
1202 2000-07-13  Zack Weinberg  <zack@wolery.cumb.org>
1203
1204         * lang-specs.h: Use the new named specs.  Remove unnecessary braces.
1205
1206 2000-07-12  Mark Mitchell  <mark@codesourcery.com>
1207
1208         * parse-scan.c: Remove.
1209
1210 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1211
1212         * class.c (set_super_info): Handled protected inner classes.
1213         (common_enclosing_context_p): Bail early if arguments aren't both
1214         inner classes.
1215         (get_access_flags_from_decl): Handle private and protected inner
1216         classes.
1217         * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
1218         (CLASS_PROTECTED): Likewise.
1219         (struct lang_type): New bitfield `poic'.
1220         * parse.y (jdep_resolve_class): Call check_inner_class_access on
1221         inner classes only.
1222         (check_inner_class_access): Renamed arguments, added
1223         comments. Handles protected inner classes (fixes gcj/225)
1224         (not_accessible_p): Fixed comments. Avoid handling inner classes.
1225
1226 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1227
1228         * parse.y (resolve_qualified_expression_name): Verify qualified
1229         access to `this'. Fixes gcj/239.
1230
1231 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1232
1233         * jcf-write.c (generate_classfile): Don't install ConstantValue
1234         for null pointers.
1235
1236 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1237
1238         * parse.y (resolve_qualified_expression_name): Handle inner class
1239         access. Fixes gcj/256.
1240
1241 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1242
1243         * jcf-write.c (generate_classfile): Properly install the
1244         ConstantValue attribute and the initial value constant pool index
1245         on string constants.
1246         * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
1247         class files.
1248
1249 2000-07-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1250
1251         * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
1252         construct.
1253         * parse.y (find_as_inner_class): Fixed typo.
1254         (do_resolve_class): Explore enclosing contexts when searching for
1255         innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
1256         (check_inner_class_access): Check `decl' which can be null in case
1257         of previous errors.
1258
1259 2000-07-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1260
1261         * java-tree.h (java_debug_context): Declared `extern'.
1262         (safe_layout_class): Likewise.
1263         * parse.y (resolve_field_access): Field must be `static' in order
1264         to be replaced by its initial value. Added comments.
1265         (find_applicable_accessible_methods_list): Fixed typo.
1266         (find_most_specific_methods_list): Methods found in innerclasses
1267         take over methods founds in the enclosing contexts.
1268         (java_complete_tree): Loosen restrictions on the type of DECLs
1269         that can be replaced by their initialization values.
1270         (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
1271
1272 2000-07-05  Tom Tromey  <tromey@cygnus.com>
1273
1274         * Make-lang.in (PARSE_DIR): New macro.
1275         (PARSE_RELDIR): Likewise.
1276         (PARSE_C): Likewise.
1277         (PARSE_SCAN_C): Likewise.
1278         ($(PARSE_C)): New target.
1279         ($(PARSE_SCAN_C)): Likewise.
1280         (SET_BISON): New macro.
1281         (BISONFLAGS): Likewise.
1282         (JAVABISONFLAGS): Likewise.
1283
1284 2000-07-02  Bryce McKinlay  <bryce@albatross.co.nz>
1285
1286         * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
1287         argument on the first pass for CNI as well as JNI.
1288         (print_method_info): Set up method name on the first pass only.
1289
1290 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1291
1292         * parse.y (parser_qualified_classname): Removed parameter
1293         `is_static'.
1294         (create_interface): Removed first passed parameter to
1295         parser_qualified_classname.
1296         (create_class): Likewise. Don't install alias on static
1297         innerclasses. Fixes gcj/275.
1298
1299 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1300
1301         * parse.y (maybe_generate_pre_expand_clinit): Don't build a
1302         debugable statement with empty_stmt_node. Fixes gcj/272
1303
1304 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1305
1306         * expr.c (build_instanceof): Layout type after it's loaded. Fixes
1307         gcj/271.
1308
1309 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1310
1311         * jcf-write.c (push_long_const): Appropriately cast short negative
1312         constant to jword.
1313
1314 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1315
1316         * parse.y (verify_constructor_super): Use loop variable
1317         `m_arg_type' initialized with `mdecl_arg_type'.
1318
1319 2000-06-29  Tom Tromey  <tromey@cygnus.com>
1320
1321         * parse.y (resolve_field_access): Handle case where `type_found'
1322         is NULL.
1323
1324 2000-06-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1325
1326         * expr.c (lookup_field): The same field can be found through two
1327         different interface. Don't declare it ambiguous in that case.
1328
1329 2000-06-27  Tom Tromey  <tromey@cygnus.com>
1330
1331         * lex.c (java_lineterminator): Don't recognize \r after \n.  If \r
1332         follows \r, then unget it at a lower level.
1333
1334 2000-06-26  Tom Tromey  <tromey@cygnus.com>
1335
1336         * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
1337         java_complete_tree.
1338
1339 2000-06-25  Tom Tromey  <tromey@cygnus.com>
1340
1341         * parse.y (for_statement): Wrap expression in a WFL if it is a
1342         constant.  For PR gcj/268.
1343
1344 2000-06-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1345
1346         * parse.y (do_resolve_class): Minor optimiztion in the package
1347         list search. Removed unecessary test and return statement.
1348         (valid_ref_assignconv_cast_p): Order of arguments to
1349         enclosing_context_p fixed.
1350
1351 2000-06-24  Tom Tromey  <tromey@cygnus.com>
1352
1353         * expr.c (lookup_field): Print error and return error_mark_node if
1354         field reference is ambiguous.
1355
1356         * parse.y (check_abstract_method_definitions): Also check if
1357         `other_method' is abstract.
1358
1359 2000-06-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1360
1361         * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
1362         classes.
1363         * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
1364         (struct lang_type): New field `pic'.
1365         (CLASS_PRIVATE): New macro.
1366         * parse.y (check_inner_class_access): New function.
1367         (jdep_resolve_class): Call it.
1368
1369 2000-06-23  Tom Tromey  <tromey@cygnus.com>
1370
1371         * parse.y (patch_incomplete_class_ref): Initialize the returned
1372         class.  For PR gcj/260.
1373
1374 2000-06-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1375
1376         * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
1377
1378 2000-06-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1379
1380         * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
1381         Java specific checks.
1382         * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
1383         screened by DECL_P.
1384         * java-tree.def (CASE_EXPR): Marked 'e'.
1385         (DEFAULT_EXPR): Likewise.
1386         * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
1387         screened by DECL_P.
1388         * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
1389         Java specific checks.
1390         (generate_bytecode_insns): Test try_block for BLOCK before using
1391         BLOCK_EXPR_BODY.
1392         * parse.y (build_wfl_wrap): Added `location' argument. Set
1393         EXPR_WFL_LINECOL accordingly.
1394         (dim_expr:): Wrap constants with WFLs.
1395         (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
1396         (resolve_package): Check for `stmt' not being a BLOCK before
1397         building a debuggable statement with it.
1398         (make_qualified_primary): Added extra parameter to build_wfl_wrap
1399         invocation.
1400         (resolve_field_access): Make sure `decl' is a DECL before treating
1401         it as such.
1402         (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
1403         IDENTIFIER_NODE before treating it as such.
1404         (patch_new_array_init): Make sure `elt' is a TREE_LIST before
1405         treating it as such.
1406         (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
1407         to be applied only on non array types.
1408
1409 2000-06-16  Per Bothner  <per@bothner.com>
1410
1411         * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN):  Don't
1412         define in terms of DECL_RESULT, as that fails when --enable-checking.
1413
1414 2000-06-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1415
1416         * jcf-write.c (CHECK_PUT): Add static prototype.  Make pointer
1417         types the same in comparison.
1418         (CHECK_OP): Add static prototype.
1419
1420 2000-06-13  Jakub Jelinek  <jakub@redhat.com>
1421
1422         * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
1423         * parse.y (java_complete_class): Set DECL_USER_ALIGN.
1424         * parse.c: Rebuilt.
1425
1426 2000-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1427
1428         * decl.c (create_primitive_vtable): Prototype.
1429
1430         * jcf-write.c (generate_bytecode_insns): Initialize variable
1431         `saved_context'.
1432
1433         * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
1434
1435 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
1436
1437         * parse.y (find_applicable_accessible_methods_list): Use a hashtable
1438         to track searched classes, and do not search the same class more than
1439         once. Call find_applicable_accessible_methods_list on immediate
1440         superclass, instead of search_applicable_method_list on all ancestors.
1441         Fix for PR gcj/238.
1442
1443 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
1444
1445         * parse.y (register_fields): Permit static fields in inner classes
1446         if they are final. Fix for PR gcj/255.
1447
1448 2000-06-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1449
1450         * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
1451         * parse.y (find_in_imports): Returned type changed to void,
1452         leading comment fixed.
1453         (register_package): New function.
1454         (qualify_and_find): Likewise.
1455         (package_declaration:): Use `register_package'.
1456         (single_type_import_declaration:): Removed local variable
1457         `node'. Added missing `;' for consistency.
1458         (type_import_on_demand_declaration:): Use `chainon' to link new
1459         entries.
1460         (lookup_field_wrapper): Lookup local variables defined in outer
1461         contexts first.
1462         (java_complete_class): Don't reverse the list of imported on demand.
1463         (do_resolve_class): Reorganized. Removed local variable
1464         `original_name'. Call `qualify_and_find' with the current package
1465         name, invoke `find_in_imports_on_demand' right after. Call
1466         `qualify_and_find' with the packages we've seen so far. Fixed
1467         operations numbering in comments.
1468         (java_expand_class): Don't reverse `package_list'.
1469         (find_most_specific_methods_list): New local variables `abstract'
1470         and `candidates'. Use them to pick the right method.
1471
1472 Tue Jun  6 11:39:05 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
1473
1474         * parse.y (check_modifiers_consistency): Don't subtract out
1475         `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
1476
1477 2000-06-04  Philipp Thomas  <pthomas@suse.de>
1478
1479         * Makefile.in (INTLLIBS): New.
1480         (LIBS): Add above.
1481         (DEPLIBS): Ditto.
1482
1483 Fri Jun  2 16:48:55 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1484
1485         * class.c (get_dispatch_table): Build the vtable dummy entry list
1486         element with a null purpose. Fixed leading comment.
1487         (build_dtable_decl): Build an accurate dtable type when appropriate
1488         and use it.
1489
1490 2000-06-02  Richard Henderson  <rth@cygnus.com>
1491
1492         * lang.c (lang_get_alias_set): New.
1493
1494 2000-05-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1495
1496         * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
1497         before using it as the accessed field.
1498
1499 2000-05-31  Tom Tromey  <tromey@cygnus.com>
1500
1501         * java-tree.h (boolean_array_vtable, byte_array_vtable,
1502         char_array_vtable, short_array_vtable, int_array_vtable,
1503         long_array_vtable, float_array_vtable, double_array_vtable):
1504         Declare.
1505         * expr.c (get_primitive_array_vtable): New function.
1506         (create_primitive_vtable): New function.
1507         (java_lang_expand_expr): Enable code to statically generate
1508         arrays.
1509         * decl.c (init_decl_processing): Create primitive vtables.
1510         (boolean_array_vtable, byte_array_vtable, char_array_vtable,
1511         short_array_vtable, int_array_vtable, long_array_vtable,
1512         float_array_vtable, double_array_vtable): Define.
1513
1514 2000-05-26  Zack Weinberg  <zack@wolery.cumb.org>
1515
1516         * java/parse.y (find_applicable_accessible_methods_list):
1517         Don't add an uninitialized value to the list.
1518
1519 2000-05-25  Tom Tromey  <tromey@cygnus.com>
1520
1521         * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
1522         when trying to see if field's class should be initialized.  Always
1523         initialize field's declaring class, not qualified class.
1524         For PR gcj/162.
1525
1526         * parse.y (array_constructor_check_entry): Pass `wfl_value', not
1527         `wfl_operator', to maybe_build_primttype_type_ref.
1528         Fixes PR gcj/235.
1529
1530 2000-05-23  Bryce McKinlay  <bryce@albatross.co.nz>
1531
1532        * parse.y (patch_method_invocation): Don't try to lookup methods
1533        in primitive types.
1534
1535 2000-05-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1536
1537         * parse.y (resolve_field_access): Call the appropriate <clinit>
1538         before accessing the length of a static array. Craft a decl for
1539         the field while its time. Fixes PR gcj/129.
1540
1541 2000-05-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1542
1543         * parse.y (resolve_package): Correctly set `*next' (was off by
1544         one.)
1545         (resolve_qualified_expression_name): Fixed comment.
1546
1547 Thu Apr 27 17:47:34 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1548
1549         * jcf-parse.c (jcf_parse_source): Reset current_class and
1550         current_function_decl to NULL before parsing a new file.
1551
1552 Thu Apr 27 17:25:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1553
1554         * parse.y (block_end:): If the collected block doesn't feature a
1555         statement, insert an empty statement.
1556
1557 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1558
1559         * parse.y (maybe_yank_clinit): New function.
1560         (maybe_generate_pre_expand_clinit): Always link <clinit> at the
1561         end of the list of methods belonging to a class.
1562         (java_complete_expand_method): Check whether <clinit> is really
1563         necessary and expand it accordingly.
1564
1565 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1566
1567         * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
1568         processed by the method's switch statement.
1569
1570 2000-05-19  Tom Tromey  <tromey@cygnus.com>
1571
1572         * java-tree.h: Added init state enum.
1573         * decl.c (emit_init_test_initialization): Initialize class
1574         initialization check variable by looking at class' state.
1575
1576 2000-05-19  Tom Tromey  <tromey@cygnus.com>
1577
1578         * java-tree.h (build_instanceof): Declare.
1579         (build_get_class): Declare.
1580         * parse.y (patch_binop): Use build_instanceof.
1581         * expr.c (build_instanceof): New function.  If class is final,
1582         don't make a function call.
1583         (expand_java_INSTANCEOF): Use it.
1584         (build_get_class): New function.
1585
1586 2000-05-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
1587
1588         * jcf-write.c (generate_classfile): Scan the source_file for
1589         slashes with the right pointer variable.
1590
1591 Wed May 17 17:27:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
1592
1593         * lang.c (lang_decode_option): Update -Wunused flags by calling
1594         set_Wunused.
1595         * decl.c (poplevel): Replace warn_unused with warn_unused_label.
1596
1597 2000-05-09  Zack Weinberg  <zack@wolery.cumb.org>
1598
1599         * check_init.c (check_init): Constify local char *.
1600         * class.c (push_class): Constify local char *.
1601         * java_tree.h: Update prototypes.
1602         * jcf-io.c (open_class): Constify filename parameter and
1603         return value.
1604         (find_class): Remove redundant string copy.  Cast return from
1605         open_class.
1606         * jcf-parse.c (read_class, parse_class_file, yyparse):
1607         Constify local char *.
1608         * jcf-write.c (generate_bytecode_insns, generate_classfile):
1609         Constify local char *.
1610         * jcf.h (JCF): Constify filename and classname.
1611         (JCF_FINISH): Cast args to FREE to char * when appropriate.
1612         * lang.c (init_parse): Constify parameter and return value.
1613         * lex.c (java_get_line_col): Constify filename parameter.
1614         * parse.h: Constify parser_ctxt.filename.  Update prototypes.
1615         * parse.y (java_parser_context_suspend,
1616         issue_warning_error_from_context, safe_layout_class): Constify
1617         local char *.
1618         * parse.c: Regenerate.
1619
1620 2000-05-08  Tom Tromey  <tromey@cygnus.com>
1621
1622         * expr.c (build_jni_stub): Cache the result of
1623         _Jv_LookupJNIMethod.
1624
1625 2000-05-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1626
1627         * decl.c (predef_filenames_size): Now 7.
1628         (predef_filenames): New seventh entry.
1629
1630 2000-05-04  Tom Tromey  <tromey@cygnus.com>
1631
1632         * boehm.c (mark_reference_fields): Don't mark RawData fields.
1633         Keep track of when we've seen a reference field after a
1634         non-reference field.
1635         (get_boehm_type_descriptor): Handle case where we see
1636         non-reference fields but no trailing reference field.
1637         * decl.c (rawdata_ptr_type_node): Define.
1638         (init_decl_processing): Initialize rawdata_ptr_type_node.
1639         * java-tree.h (rawdata_ptr_type_node): Declare.
1640
1641 2000-05-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1642
1643         * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
1644         specifiers in calls to fprintf.
1645
1646 2000-05-03  Andrew Haley  <aph@cygnus.com>
1647
1648         * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
1649
1650         * javaop.h (WORD_TO_INT): New function.
1651         (IMMEDIATE_s4): Use WORD_TO_INT.
1652         * jcf.h (JPOOL_INT): Ditto.
1653
1654         * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
1655         separator.
1656
1657 2000-04-19  Tom Tromey  <tromey@cygnus.com>
1658
1659         * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
1660         on native function.
1661         * jcf-parse.c (parse_class_file): Call build_jni_stub for native
1662         JNI methods.
1663         * expr.c (build_jni_stub): New function.
1664         * lang-specs.h: -fjni and -femit-class-file are incompatible.
1665         * parse.c: Rebuilt.
1666         * parse.y (java_complete_expand_methods): Expand a native method
1667         and call build_jni_stub if -fjni given.
1668         * lang-options.h: Document -fjni.
1669         * lang.c (flag_jni): New global.
1670         (lang_f_options): Added `jni' entry.
1671         * java-tree.h (soft_lookupjnimethod_node,
1672         soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
1673         Declare.
1674         (flag_jni): Declare.
1675         (build_jni_stub): Declare.
1676         (struct lang_decl): Added `native' flag.
1677         (METHOD_NATIVE): Redefined to use `native' field of lang specific
1678         structure.
1679         * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
1680         soft_jnipopsystemframe_node): New globals.
1681         (init_decl_processing): Set them.  _Jv_InitClass only takes one
1682         argument.
1683
1684         * java-tree.def: Put into `C' mode.
1685
1686 2000-04-27  Tom Tromey  <tromey@cygnus.com>
1687
1688         Fix for PR gcj/2:
1689         * expr.c (expand_invoke): Generate check to see if object pointer
1690         is null in nonvirtual invocation case.
1691         * java-tree.h (soft_nullpointer_node): Declare.
1692         * decl.c (soft_nullpointer_node): New global.
1693         (init_decl_processing): Initialize soft_nullpointer_node.
1694         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
1695         or `private' methods.
1696         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
1697
1698 Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1699
1700         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
1701         from <clinit>
1702
1703 2000-04-26  Tom Tromey  <tromey@cygnus.com>
1704
1705         * zextract.c (find_zip_file_start): New function.
1706         (read_zip_archive): Use it.
1707
1708 2000-04-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1709
1710         * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
1711
1712 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1713
1714         * class.c (common_enclosing_context_p): New function.
1715         * java-tree.h (common_enclosing_context_p): Added prototype.
1716         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
1717         classes sharing an outer context with the current instance.
1718         * parse.y (build_access_to_thisn): Fixed leading comment.
1719         (verify_constructor_super): New local `supper_inner'. Skip
1720         enclosing context argument in the case of inner class constructors.
1721         (patch_method_invocation): Insert proper context as second
1722         parameter to pure inner class constructor super invocations.
1723
1724 Mon Apr 24 14:59:36 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1725
1726         * parse.y (end_class_declaration): Reset the interface number
1727         counter.
1728
1729 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1730
1731         * parse.y (source_start_java_method): Deleted unecessary code.
1732         (patch_method_invocation): Fixed comment.
1733
1734 2000-04-24  Robert Lipe <robertlipe@usa.net>
1735
1736         * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
1737
1738 2000-04-23  Tom Tromey  <tromey@cygnus.com>
1739
1740         * boehm.c (mark_reference_fields): Use int_byte_position.
1741
1742 2000-04-22  Tom Tromey  <tromey@cygnus.com>
1743
1744         * boehm.c (mark_reference_fields): Only call byte_position on
1745         non-static fields.
1746
1747 2000-04-22  Tom Tromey  <tromey@cygnus.com>
1748
1749         * boehm.c (mark_reference_fields): Added `last_view_index'
1750         argument.  Use DECL_FIELD_OFFSET to determine field's offset.
1751
1752 Thu Apr 20 17:41:28 2000  Mo DeJong  <mdejong@cygnus.com>
1753
1754         * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
1755         * parse.y (check_class_interface_creation): Fixed comments. Select
1756         permitted modifiers for (inner) interfaces. Changed error message
1757         to report rejected modifiers used with local classes.
1758
1759 2000-04-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1760
1761         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
1762         of directly inherited type considered in scope.
1763         * parse.y (do_resolve_class): Search inherited classes for inner
1764         classes.
1765
1766 2000-04-20  Tom Tromey  <tromey@cygnus.com>
1767
1768         * parse.y (not_accessible_p): Use member's class, not current
1769         class, when doing inheritance check for protected reference.
1770         Fixes PR gcj/124.
1771
1772 Thu Apr 20 18:20:58 2000  Jason Schroeder  <shrode@subnature.com>
1773
1774         * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
1775
1776 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1777
1778         * parse.y (lookup_field_wrapper): Search for final local aliases.
1779         (resolve_expression_name): Let lookup_field_wrapper search for
1780         final local aliases. Force the value of `name' if one is found.
1781         (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
1782         an expression name. Fixed comments.
1783
1784 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1785
1786         * parse.y (yyerror): `msg' can be null, don't use it in that case.
1787
1788 2000-04-19  Tom Tromey  <tromey@cygnus.com>
1789
1790         * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
1791
1792 2000-04-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1793
1794         * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
1795
1796 2000-04-18  Tom Tromey  <tromey@cygnus.com>
1797
1798         PR gcj/211:
1799         * gjavah.c (utf8_cmp): Changed return value.
1800         (cxx_keyword_subst): Handle all C++ keywords.  Allocate new return
1801         result.
1802         (cxx_keywords): New global.
1803         (get_field_name): Handle new result of cxx_keyword_subst.
1804         (print_method_info): Likewise.
1805
1806 2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
1807
1808         * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
1809         with a newline, for CNI.
1810         (print_stub_or_jni): Print a space or newline before method name for
1811         CNI as well as JNI.
1812         (print_cxx_classname): Don't write leading "::" in CNI stub method.
1813         (process_file): Include gcj/cni.h if generating CNI stubs.
1814
1815 2000-04-16  Tom Tromey  <tromey@cygnus.com>
1816
1817         * gjavah.c (decompile_method): Use print_field_name.
1818         Fixes PR gcj/205.
1819
1820 2000-04-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1821
1822         * parse.y (java_expand_classes): Reverse the package list once.
1823         (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
1824         reduction.
1825         (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
1826         the `==' and `!=' operators.
1827
1828 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1829
1830         * jcf-write.c (generate_bytecode_insns): At invokation time,
1831         always relate an interface method to the type of its selector.
1832
1833 2000-04-05  Tom Tromey  <tromey@cygnus.com>
1834
1835         Fix for PR gcj/2:
1836         * expr.c (expand_invoke): Generate check to see if object pointer
1837         is null in nonvirtual invocation case.
1838         * java-tree.h (soft_nullpointer_node): Declare.
1839         * decl.c (soft_nullpointer_node): New global.
1840         (init_decl_processing): Initialize soft_nullpointer_node.
1841         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
1842         or `private' methods.
1843         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
1844
1845 2000-04-05  Tom Tromey  <tromey@cygnus.com>
1846
1847         Fix for PR gcj/140:
1848         * parse.y (check_final_assignment): Recognize assignments to the
1849         `length' field of an array when generating class files.
1850
1851 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1852
1853         * class.c (decl_hash): Prototype removed.
1854         (decl_compare): Likewise.
1855
1856 2000-04-05  Tom Tromey  <tromey@cygnus.com>
1857
1858         * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
1859         * parse.y (check_modifiers_consistency): Check for final/volatile
1860         clash.  Fixes PR gcj/164.
1861
1862 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1863
1864         * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
1865         made global.
1866         (java_hash_compare_tree_node): Renamed from `decl_compare, made
1867         global.
1868         (add_method_1): Use `java_hash_hash_tree_node' and
1869         `java_hash_compare_tree_node'.
1870         * java-tree.h: (java_hash_hash_tree_node): Prototyped.
1871         (java_hash_compare_tree_node): Likewise.
1872         * parse.y (find_applicable_accessible_methods_list): Create,
1873         delete and use a hash table to remember already searched interfaces.
1874
1875 2000-04-03  Matt Welsh  <mdw@cs.berkeley.edu>
1876
1877         * jcf-depend.c (add_entry): Fixed bug where list was always replaced
1878         with latest entry.
1879
1880 2000-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1881
1882         * boehm.c (mark_reference_fields, set_bit): Prototype.
1883         (set_bit): Un-ANSI-fy definition.
1884
1885         * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
1886         Prototype.
1887
1888         * decl.c (emit_init_test_initialization): Likewise.
1889
1890         * gjavah.c (jni_print_char): Likewise.
1891
1892         * parse.y (create_new_parser_context): Likewise.
1893
1894 Thu Mar 30 15:26:56 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1895
1896         * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
1897         patch missing hunk. Fixed indentation.
1898
1899 2000-03-30  Tom Tromey  <tromey@cygnus.com>
1900
1901         * gjavah.c (D_NAN_MASK): Only define as word-reversed when
1902         HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
1903
1904 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1905
1906         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
1907         when negative *before* using it as an array index.
1908         * ChangeLog: Fixed typo.
1909
1910 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1911
1912         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
1913         to 0 when it reaches -1.
1914
1915 2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1916
1917         * jcf-parse.c (get_constant): Properly cast `num' during the
1918         invocation of `add_double'.
1919         * jcf-write.c (push_long_const): Properly cast `lo' before
1920         comparing it to short bounds.
1921         * parse-scan.y (interface_declaration:): Rule re-arrange so that
1922         `interface_body:' is reduced after the current interface is
1923         pushed.
1924
1925 2000-03-26  Tom Tromey  <tromey@cygnus.com>
1926
1927         * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
1928         Java-specific `-f' option.
1929
1930 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1931
1932         * decl.c (init_decl_processing): Only call initialize_sizetypes once.
1933         Adjust order of making types.
1934         Make bitsize_*_node values.
1935
1936 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1937
1938         * class.c (make_field_value): Use byte_position.
1939         * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
1940         (java_array_data_offset): Likewise.
1941         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
1942         bzero call.
1943
1944 2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1945
1946         * parse.y (check_abstract_method_definitions): New local
1947         `end_type_reached'. Make sure we also consider `end_type'.
1948         (java_check_abstract_method_definitions): Make sure we eventually
1949         consider `java.lang.Object'.
1950         (maybe_use_access_method): Don't use access method if not in the
1951         context of a pure inner class or if the method's context is right.
1952         (find_applicable_accessible_methods_list): New static flag
1953         `object_done'. Don't search abstract classes as interfaces. Fixed
1954         indentation. Fixed the `java.lang.Object' only search. Search
1955         class interface(s) first, then fully search enclosing contexts.
1956         (find_most_specific_methods_list): Pick the closest candidate when
1957         they're all abstract.
1958
1959 Mon Mar 20 08:58:51 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1960
1961         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
1962         properly initialize `finished_label'. Don't emit gotos for empty
1963         try statements.
1964
1965 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
1966
1967         * except.c (emit_handlers): Clear catch_clauses_last.
1968
1969 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1970
1971         * parse.y (check_method_types_complete): New function.
1972         (create_class): Reset anonymous class counter only when seeing an
1973         non inner classe.
1974         (java_complete_class): JDEP_METHOD: Don't recompute signature
1975         if incomplete.
1976
1977 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1978
1979         * class.c (build_static_ref): Fixed indentation in comment.
1980         * java-tree.def (TRY_EXPR): Fixed typo in name.
1981         (CLASS_LITERAL): Likewise.
1982         * java-tree.h: (TYPE_DOT_CLASS): New macro.
1983         (struct lang_type): New field `dot_class'.
1984         * jcf-write.c (generate_bytecode_insns): Fixed error message.
1985         (generate_classfile): Method `class$' is synthetic.
1986         * parse.y (build_do_class_method): New function.
1987         (build_dot_class_method_invocation): Likewise.
1988         (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
1989         (resolve_qualified_expression_name): Handle CLASS_LITERAL.
1990         (qualify_ambiguous_name): Likewise.
1991         (patch_incomplete_class_ref): Invoke synthetic method if necessary.
1992         (build_try_statement): Fixed leading comment.
1993
1994 Fri Mar 17 08:09:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1995
1996         * class.c (make_field_value): Properly handle sizes.
1997         (get_dispatch_vector): Use tree_low_cst and host_integerp.
1998         (layout_class_method): Count using trees.
1999         * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
2000         * expr.c (java_array_data_offset): Use int_bit_position.
2001         (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
2002         (build_invokevirtual): Use tree_low_cst and do computations with trees.
2003
2004 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2005
2006         * lang.c (flag_hash_synchronization): New global.
2007         (lang_f_options): Added `hash-synchronization'.
2008         * lang-options.h: Mention -fhash-synchronization.
2009         * java-tree.h (flag_hash_synchronization): Declare.
2010         * expr.c (java_lang_expand_expr): Only push `sync_info' value when
2011         hash table synchronization is disabled.
2012         * decl.c (init_decl_processing): Only push `sync_info' value when
2013         hash table synchronization is disabled.
2014         * class.c (make_class_data): Only push `sync_info' field when hash
2015         table synchronization is disabled.  Removed dead code.
2016
2017 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2018
2019         * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
2020
2021 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2022
2023         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
2024         classes.
2025         * parse.y (patch_method_invocation): Handle anonymous classes
2026         creation in static context.
2027
2028 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2029
2030         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
2031         * parse.y (resolve_qualified_expression_name): Use it.
2032         (patch_method_invocation): Likewise.
2033
2034 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2035
2036         * parse.y (register_incomplete_type): JDEP_ENCLOSING set
2037         depending on the type of dependency which dictates what the
2038         current class is.
2039         (unresolved_type_p): Resolved types limited to the current class.
2040
2041 2000-03-15  Tom Tromey  <tromey@cygnus.com>
2042
2043         * decl.c (init_decl_processing): Set type of `sync_info' to be
2044         pointer to Object.
2045
2046         * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
2047         Correctly compute bit number for current slot.  Zero `high' and
2048         `low' in DS_LENGTH case.  Don't skip inherited fields.  Use
2049         mark_reference_fields.
2050         (mark_reference_fields): New function.
2051
2052 Tue Mar 14 17:15:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2053
2054         * parse.y (register_incomplete_type): Fixed initialization of
2055         JDEP_ENCLOSING.
2056
2057 2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2058
2059         * parse-scan.y (inner_qualifier, inner_qualifier_length): New
2060         static globals.
2061         (push_class_context, pop_class_context): New function.
2062         (class_body:): Call pop_class_context.
2063         (interface_body:): Likewise.
2064         (INNER_QUALIFIER): New macro.
2065         (report_class_declaration): Changed output format and use
2066         INNER_QUALIFIER. Call push_class_context.
2067
2068 2000-02-14  Andrew Haley  <aph@cygnus.com>
2069
2070         * check-init.c (check_init): Add new cases for unary and binary
2071         tree nodes.
2072
2073 2000-03-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2074
2075         * parse.y (resolve_package): Set `next' once a type name has been
2076         progressively discovered.
2077         (resolve_qualified_expression_name): Propagate resolution only if
2078         there are remaining qualifiers. Take into account `q' might have
2079         been cleared after re-qualification.
2080         * parse.y (patch_method_invocation): New local `resolved'.
2081         Section dealing with qualified expression rewritten to use
2082         resolve_field_access.
2083
2084 Mon Mar 13 12:21:13 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2085
2086         * parse.h (PUSH_CPC): Fixed indentation.
2087         (DEBUG_CPC): New macro.
2088         (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
2089         SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
2090         * parse.y (class_body_declaration:): Use
2091         SET_CPC_INSTANCE_INITIALIZER_STMT.
2092         (method_declaration:): Check for null current_function_decl.
2093         (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
2094         (java_parser_context_pop_initialized_field): Better handling of
2095         empty lists.
2096         (maybe_make_nested_class_name): Mark nested class name as
2097         qualified when necessary.
2098         (end_class_declaration): Don't call java_parse_context_resume when
2099         one or more error occured.
2100         (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
2101         (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
2102         SET_CPC_INITIALIZER_STMT.
2103         (method_header): Check for inner classes declaring static methods.
2104         (resolve_qualified_expression_name): Handle situation where `this'
2105         is implied.
2106
2107 Mon Mar 13 11:36:51 2000  Hans Boehm <boehm@acm.org>
2108
2109         * typeck.c (build_prim_array_type): Correctly set the high word too.
2110
2111 2000-03-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2112
2113         * parse.y (java_complete_expand_methods): Leave <clinit> out of
2114         ordinary methods.
2115         (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
2116         list of methods for interfaces.
2117
2118 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2119
2120         * parse.y (qualify_ambiguous_name): Properly handle expressions
2121         using `null'.
2122
2123 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2124
2125         * parse.y (check_final_assignment): Extended to process
2126         COMPOUND_EXPR.
2127         (patch_assignment): Have check_final_assignment called only once.
2128
2129 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2130
2131         * java-tree.h (IS_INIT_CHECKED): New flag.
2132         * check-init.c (check_init): Test and set IS_INIT_CHECKED.
2133         * parse.y (patch_string): Call force_evaluation_order on the
2134         completed string concatenation tree.
2135         * expr.c (force_evaluation_order): Call force_evaluation_order on
2136         function's arguments too.
2137
2138 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2139
2140         * decl.c (emit_init_test_initialization): Mark KEY as unused.
2141         * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
2142         (build_anewarray): Likewise.
2143         * parse.y (patch_newarray): Likewise.
2144         * parse.c: Regenerated.
2145
2146 2000-03-06  Bryce McKinlay  <bryce@albatross.co.nz>
2147
2148         * decl.c (init_decl_processing): Added new class fields `depth',
2149         `ancestors', and `idt' to class_type_node. Use
2150         _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
2151         * class.c (make_class_data): Push initial values for new fields.
2152         * java-tree.h: Updated prototype for `build_invokeinterface'.
2153         * expr.c (build_invokeinterface): Changed parameters to accept
2154         `method' tree. Calculate index of `method' in its declaring
2155         interface. Build call to _Jv_LookupInterfaceMethodIdx.
2156         (expand_invoke): Call `build_invokeinterface' with new parameters.
2157         * parse.y (patch_invoke): Call `build_invokeinterface' with new
2158         parameters.
2159
2160 2000-03-06  Bryce McKinlay <bryce@albatross.co.nz>
2161
2162         * typeck.c (lookup_do): Search superinterfaces first
2163         when looking up an interface method. From Godmar Back
2164         <gback@cs.utah.edu>
2165
2166 2000-03-06  Tom Tromey  <tromey@cygnus.com>
2167
2168         * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
2169
2170 2000-03-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2171
2172         * java-tree.h (lookup_argument_method2): Declared.
2173         (safe_layout_class): Prototype moved from parse.h.
2174         * parse.h (safe_layout_class): Prototype moved to java-tree.h.
2175         * parse.y (java_check_regular_methods): Local `super_class' gone.
2176         Call lookup_argument_method2 instead of lookup_argument_method.
2177         Perform modifier match for methods found declared in implemented
2178         interfaces. Fixed indentation problem. Overriding/hiding error
2179         report to take place only for methods found in classes.
2180         * typeck.c (lookup_argument_method): Changed leading
2181         comment. Re-written by calling lookup_do.
2182         (lookup_argument_method2): New function.
2183         (lookup_java_method): Re-written by calling lookup_do.
2184         (lookup_do): New function.
2185
2186 Thu Mar  2 15:18:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2187
2188         * check-init.c (check_init): Removed dead code. Handle (blank)
2189         final variables.
2190         * parse.y (declare_local_variables): New local `final_p', set it
2191         and use it to initialize LOCAL_FINAL.
2192         (check_final_assignment): Only check FIELD_DECLs.
2193
2194 2000-02-17  Tom Tromey  <tromey@cygnus.com>
2195
2196         * Makefile.in (JAVA_OBJS): Added boehm.o.
2197         (boehm.o): New target.
2198         * Make-lang.in (JAVA_SRCS): Added boehm.c.
2199         * java-tree.h (flag_use_boehm_gc): Declare.
2200         (get_boehm_type_descriptor): Declare.
2201         * lang.c (lang_f_options): Added `use-boehm-gc'.
2202         (flag_use_boehm_gc): New global.
2203         * lang-options.h: Added -fuse-boehm-gc.
2204         * boehm.c: New file.
2205         * class.c (get_dispatch_table): If class uses a Boehm type
2206         descriptor, put it in the vtable.
2207         (make_class_data): Removed dead code.
2208
2209 2000-03-03  Per Bothner  <per@bothner.com>
2210
2211         * decl.c (init_decl_processing):  Initialize sizetype properly.
2212
2213 2000-03-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2214
2215         * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
2216         (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
2217         * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
2218         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
2219         (jcf_parse): New local `current'. Load innerclasses seen in outer
2220         context being processed.
2221         * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
2222         * jcf-write.c (append_innerclasses_attribute): New function.
2223         (append_innerclasses_attribute_entry): Likewise.
2224         (get_access_flags): Handle static classes. Set anonymous and local
2225         classes to be private.
2226         (generate_classfile): Attribute count adjusted. Call
2227         append_innerclasses_attribute.
2228         * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
2229         PURE_INNER_CLASS_TYPE_P.
2230         * parse.y (parser_qualified_classname): New parameter `is_static',
2231         produce non qualified name accordingly.
2232         (block_statement:): Set LOCAL_CLASS_P when declaring local class.
2233         (create_interface): Added argument to parser_qualified_classname.
2234         (create_class): Added argument to parser_qualified_classname. Setup
2235         alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
2236         (add_inner_class_fields): Fixed indentation.
2237         (method_declarator): Use PURE_INNER_CLASS_DECP_P.
2238         (method_declarator): Fixed typo in comment.
2239         (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
2240         (build_current_thisn): Likewise.
2241         (patch_method_invocation): Likewise.
2242
2243 2000-03-01  Martin von Loewis  <loewis@informatik.hu-berlin.de>
2244
2245         * decl.c (current_function_decl): Move to toplev.c.
2246
2247 Mon Feb 28 08:20:42 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2248
2249         * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
2250         (DECL_BIT_INDEX): Use underlying representation.
2251         * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
2252
2253 Sun Feb 27 16:40:33 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2254
2255         * expr.c (build_java_ret): Pass proper type to size_binop.
2256
2257 2000-02-25  Anthony Green  <green@cygnus.com>
2258
2259         * expr.c (build_class_init): Mark the decl to be ignored by
2260         check_init.
2261         * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
2262         * check-init.c: Move DECL_BIT_INDEX to java-tree.h
2263         * class.c (init_test_hash_newfunc): New function.
2264         (decl_hash): New function.
2265         (decl_compare): New function.
2266         * decl.c (emit_init_test_initialization): New function.
2267         (complete_start_java_method): Traverse the init test hashtable,
2268         calling emit_init_test_initialization.
2269         (always_initialize_class_p): Define.
2270         * expr.c (build_class_init): Use initialization tests when
2271         emitting class initialization code.
2272         (always_initialize_class_p): Declare.
2273         * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
2274         1.
2275         * java-tree.h: Include hash.h.
2276         (DECL_FUNCTION_INIT_TEST_TABLE): Define.
2277         (struct lang_decl): Add init_test_table field.
2278         (init_test_hash_entry): Define.
2279
2280 Fri Feb 25 18:41:31 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2281
2282         * gjavah.c (main): Avoid using `argi' to report unimplemented
2283         options.
2284
2285 Fri Feb 25 18:47:25 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2286
2287         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
2288         initialize locals to avoid warnings. Local `exception_type' moved
2289         into if statement.
2290
2291 Fri Feb 25 18:00:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2292
2293         * parse.y (resolve_expression_name): Use `orig' as a second
2294         argument to resolve_field_access.
2295         (resolve_field_access): Removed unecessary code when dealing with
2296         static fields.
2297
2298 Wed Feb 23 17:41:50 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2299
2300         * class.c (push_super_field): Don't push the field twice.
2301         * jcf-parse.c (parse_source_file): Call java_reorder_fields.
2302         * parse.h (java_reorder_fields): Prototyped.
2303         * parse.y (java_reorder_fields): New function.
2304         (java_layout_class): Simplified not to worry about re-ordering.
2305
2306 2000-02-23  Tom Tromey  <tromey@cygnus.com>
2307
2308         * gjavah.c (print_name): In JNI case, correctly quote string.
2309         (print_method_info): Don't handle overrides in JNI mode.
2310
2311 2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2312
2313         * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
2314         value type set to `boolean_type_node'.
2315
2316 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
2317
2318         * jcf-dump.c (main): Test for correct condition after
2319         output file creation.
2320
2321 2000-02-19  Anthony Green  <green@cygnus.com>
2322
2323         * jcf-depend.c (add_entry): Fix test for first list entry.
2324
2325 Sat Feb 19 18:43:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2326
2327         * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
2328         * constants.c (build_constants_constructor): Likewise.
2329
2330 2000-02-19  Anthony Green  <green@cygnus.com>
2331
2332         * jcf-depend.c (add_entry): Add entries to the end of the list.
2333
2334 Wed Nov 03 02:16:00 PST 1999  Pekka Nikander  <pekka.nikander@hut.fi>
2335
2336         * decl.c (INT_TYPE_SIZE): Define if necessary.
2337         (expand_java_return): Handle the case of a native integer smaller
2338         than a JVM integer.
2339
2340 2000-02-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
2341
2342         * gjavah.c (help): Use GCCBUGURL.
2343         * jv-scan.c (help): Likewise.
2344         * jcf-dump.c (help): Likewise.
2345
2346 Thu Feb 17 14:30:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2347
2348         * jcf-write.c (generate_bytecode_insns): Don't generate empty
2349         `finally' clauses.
2350
2351 Thu Feb 17 13:20:58 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2352
2353         * jcf-parse.c (load_class): Call `fatal' if no file containing
2354         the target class are found.
2355
2356 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
2357
2358         * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
2359         lex.c, lex.h, and PARSE_H to...
2360         (parse.o, parse-scan.o): ...here, respectively.
2361
2362         * lex.c: Split out code that may trigger SIGFPE from yylex()
2363         to its own function.
2364         * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
2365
2366 2000-02-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2367
2368         * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
2369
2370 2000-02-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2371
2372         * parse.y (outer_field_access_p): Stop in time when outer contexts
2373         are exhausted.
2374         (resolve_qualified_expression_name): Properly qualify *everything*
2375         after a package.type to be resoled as expression names.
2376         (find_applicable_accessible_methods_list): Save/restore `class' to
2377         isolate it from a possible outer context search.
2378
2379 2000-02-15  Tom Tromey  <tromey@cygnus.com>
2380
2381         * gjavah.c (jni_print_char): New function.
2382         (print_full_cxx_name): Use it.
2383         (decode_signature_piece): Likewise.
2384         (print_cxx_classname): Likewise.
2385
2386 2000-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2387
2388         * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
2389         version.o.
2390         (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
2391
2392         * gjavah.c: Include version.h.
2393
2394         * jcf-dump.c: Likewise.
2395
2396         * jv-scan.c: Likewise.
2397
2398 Sat Feb 12 04:34:04 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2399
2400         * parse.y (outer_field_access_fix): First parameter now a tree
2401         node. Check for assignement to final. First argument to
2402         build_outer_field_access_fix modified to accomodate prototype.
2403         (build_outer_field_access): Don't check for assignment to final
2404         here.
2405         (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
2406         possibly returned by outer_field_access_fix. Changed
2407         outer_field_access_fix's first argument.
2408         (check_final_assignment): $finit$'s context is OK.
2409         (patch_unaryop): Use node instead of its line/column value when
2410         calling outer_field_access_fix.
2411
2412 Fri Feb 11 17:38:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2413
2414         * parse.y (interface_declaration:): No longer tagged
2415         <node>. Re-installed default action.
2416         (class_member_declaration:): Handle inner interfaces.
2417         (interface_member_declaration): Handle inner interfaces and
2418         classes.
2419         (create_interface): Push error if one seen. Suspend parsing
2420         context when processing an inner interface.
2421         (register_fields): Inner class static field limitations not to
2422         apply to inner interfaces.
2423
2424 Thu Feb 10 22:07:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2425
2426         * jcf-parse.c (load_class): Update `java_error_count' when a
2427         class' file can't be found.
2428         (parse.y): Avoid (byte)code generation when errors seen.
2429
2430 Thu Feb 10 20:10:43 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2431
2432         * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
2433         decodes a valid node.
2434         (patch_binop): Handle TRUNC_DIV_EXPR.
2435
2436 Thu Feb 10 16:04:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2437
2438         * parse.y (resolve_package): New local `acc'. Try to progressively
2439         build and guess a package and type name.
2440
2441 Thu Feb 10 12:52:09 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2442
2443         * parse.y (find_applicable_accessible_methods_list): Load and
2444         layout the search class if necessary.
2445         (java_complete_tree): Keep to original type of the folded initial
2446         value.
2447
2448 2000-02-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2449
2450         * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
2451         Generate error message if circularity is detected. New static
2452         local `list'.
2453         * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro.  *
2454         * jcf-write.c (generate_bytecode_insns): Very simply handle
2455         SAVE_EXPR.
2456         * parse.y (java_check_circular_reference): Use
2457         `cyclic_inheritance_report' during report, if necessary.
2458         (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
2459         walking NEW_ARRAY_INIT twice.
2460
2461 2000-02-09  Tom Tromey  <tromey@cygnus.com>
2462
2463         * parse.y (check_class_interface_creation): Allow inner classes to
2464         be `private' or `protected', check modifiers' consistency. Prevent
2465         block local classes from bearing any modifiers.
2466
2467 2000-02-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2468
2469         * except.c (check_start_handlers): Re-add prototype lost in last
2470         patch.
2471         (maybe_start_try): Remove excess argument to `check_start_handlers'.
2472
2473 2000-02-09  Andrew Haley  <aph@cygnus.com>
2474
2475         * decl.c (clear_binding_level): Remove excess initializer.
2476         (maybe_poplevels): Remove unused variable.
2477         (force_poplevels): Ditto.
2478         (struct binding_level): Add comment.
2479
2480 2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2481
2482         * jcf-write.c (generate_classfile): Don't consider
2483         pre-initialization with reference value (use <clinit> instead.)
2484         * parse.y (java_fix_constructors): No generated constructor for
2485         interfaces.
2486         (build_outer_field_access): Removed debug message.
2487         (outer_field_expanded_access_p): Adapted to bytecode generation.
2488         (build_outer_field_access_method): Use fix_method_argument_names.
2489         (build_outer_method_access_method): Fixed indentation. Added
2490         comment. Handle access method generation for static and also void
2491         methods.
2492         (build_access_to_thisn): Inserted debug message.
2493         (maybe_build_thisn_access_method): Use fix_method_argument_names.
2494         (resolve_qualified_expression_name): Fixed comment.
2495         (not_accessible_p): Adapted to bytecode generation. Added comment.
2496         (patch_method_invocation): Added comment.
2497         (maybe_use_access_method): Fixed leading comment. Handle static
2498         methods.
2499         (java_complete_lhs): Don't shortcut handling of initialized upon
2500         declaration String type static fields when generating bytecode.
2501         (patch_unaryop): Handle outer field access when generating
2502         bytecode.
2503
2504 Thu Feb  3 20:23:19 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2505
2506         * java-tree.h (FIELD_THISN): New macro.
2507         * jcf-write.c (append_synthetic_attribute): New function.
2508         (generate_classfile): Set "Synthetic" attribute on this$<n>,
2509         val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
2510         * parse.y (add_inner_class_fields): Set FIELD_THISN for created
2511         this$<n> fields.
2512         (build_outer_field_access): Turned on access functions usage and
2513         generation when compiling to bytecode.
2514         (maybe_use_access_method): Likewise.
2515
2516 2000-01-25  Andrew Haley  <aph@cygnus.com>
2517
2518         * java-except.h (struct eh_range): Add `expanded' field.
2519         (maybe_start_try): Add end_pc arg.
2520         (maybe_end_try): Ditto.
2521         * java-tree.h (force_poplevels): new function.
2522         * expr.c (expand_byte_code): Don't call maybe_start_try or
2523         maybe_end_try.
2524         * except.c (add_handler): Reset expanded.
2525         (expand_start_java_handler): Set expanded.
2526         (check_start_handlers): Don't expand a start handler that's
2527         already been expanded.
2528         (maybe_start_try): Add end_pc arg.  Only expand a handler which
2529         ends after end_pc.
2530         (expand_end_java_handler): call force_poplevels.
2531         (force_poplevels): new function.
2532         * decl.c (binding_level): Add start_pc of binding level.
2533         (maybe_pushlevels): Call maybe_start_try when pushing binding
2534         levels.
2535         (maybe_poplevels): Call maybe_end_try when popping binding levels.
2536         (LARGEST_PC): Define.
2537         (clear_binding_level): Use LARGEST_PC.
2538
2539         * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
2540         * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
2541         (binding_depth, is_class_level, current_pc): new variables.
2542         (struct binding_level): ditto.
2543         (indent): new function.
2544         (push_jvm_slot): add debugging info.
2545         (maybe_pushlevels): ditto.
2546         (maybe_poplevels): ditto.
2547         (pushlevel): ditto.
2548         (poplevel): ditto.
2549         (start_java_method): ditto.
2550         (give_name_to_locals): comment only.
2551         * except.c (binding_depth, is_class_level, current_pc):
2552         new variables.
2553         (expand_start_java_handler): add debugging info.
2554         (expand_end_java_handler): ditto.
2555
2556 2000-02-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2557
2558         * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
2559         (print_name_for_stub_or_jni, process_file): Constify a char*.
2560
2561 2000-02-03  Tom Tromey  <tromey@cygnus.com>
2562
2563         * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
2564
2565 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
2566
2567         * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
2568         assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
2569         defined to be 1.
2570
2571 Wed Feb  2 18:43:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2572
2573         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
2574         * java-tree.h (TYPE_II_STMT_LIST): New macro.
2575         (struct lang_type): New field `ii_block'.
2576         * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
2577         CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
2578         * parse.h (struct parser_ctxt): New field `instance_initializers'.
2579         (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
2580         CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
2581         CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
2582         macros.
2583         * parse.y (add_instance_initializer): New function.
2584         (in_instance_initializer): New static global.
2585         (class_body_declaration:): Link instance initializer block.
2586         (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
2587         (array_creation_expression:): Remove unused local.
2588         (java_parser_context_push_initialized_field): Fixed leading
2589         comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
2590         CPC_INSTANCE_INITIALIZER_LIST.
2591         (java_parser_context_pop_initialized_field): Likewise.
2592         (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
2593         (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
2594         CPC_INITIALIZER_STMT.
2595         (fix_constructors): New local `class_type'. Use it. Call
2596         add_instance_initializer.
2597         (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
2598         (patch_return): Forbid return in instance initializers.
2599         (patch_throw_statement): Enforce exception handling in the context
2600         of instance initializers.
2601
2602 2000-02-03  Tom Tromey  <tromey@cygnus.com>
2603
2604         * Make-lang.in (java.mostlyclean): Remove executables in
2605         `mostlyclean'.
2606
2607 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
2608
2609         * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
2610         HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
2611         (java_float_finite): Convert to use union Word from javaop.h.
2612         (java_double_finite): Convert to use union DWord from javaop.h.
2613
2614 2000-02-02  Tom Tromey  <tromey@cygnus.com>
2615
2616         * gjavah.c (options): Added `jni' entry.
2617         (help): Document -jni.
2618         (flag_jni): New global.
2619         (process_file): Handle JNI output.  Don't print text from
2620         -prepend, -add, etc, when generating stubs.  Only remove `.class'
2621         suffix if it actually exists.
2622         (main): Create a `.c' file when run with `--jni --stubs'.  Create
2623         correct output file name with `--jni'.
2624         (print_include): Mangle header name differently in JNI case.
2625         (HANDLE_METHOD): In JNI mode, call print_method_info to generate
2626         method list.
2627         (print_method_info): Handle JNI case.  Put signature info into
2628         method name.  Handle case when STREAM is NULL.
2629         (print_name_for_stub_or_jni): New function.
2630         (print_stub_or_jni): Renamed from `print_stub'.  Handle JNI.
2631         (print_cxx_classname): Handle JNI.
2632         (print_full_cxx_name): Likewise.
2633         (decode_signature_piece): Likewise.
2634         (overloaded_jni_method_exists_p): New function.
2635         (struct method_name): Added `signature' and `sig_length' fields.
2636         (HANDLE_END_FIELD): Do nothing in JNI mode.
2637
2638 2000-02-02  Tom Tromey  <tromey@cygnus.com>
2639
2640         * jv-scan.c: Include version.c, <getopt.h>.
2641         (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
2642         (options): New array.
2643         (usage): New function.
2644         (version): New function.
2645         (main): Use getopt_long to parse command line.
2646         * jcf-dump.c: Include version.c, <getopt.h>.
2647         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
2648         OPT_JAVAP): New macros.
2649         (options): New array.
2650         (usage): Return `void'.  Changed message.
2651         (help): New function.
2652         (version): New function.
2653         (main): Use getopt_long_only to parse command line.
2654         * gjavah.c: Include <getopt.h>.
2655         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
2656         OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
2657         OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
2658         (options): New array.
2659         (java_no_argument): Removed.
2660         (help): Updated with missing options.
2661         (main): Use getopt_long_only to parse command line.
2662         (usage): Changed message.
2663
2664 Tue Feb  1 22:23:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2665
2666         * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
2667         * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
2668         ANONYMOUS_ARRAY_INITIALIZER): New access macros.
2669         * parse.y (array_creation_expression:): Handle anonymous arrays.
2670         (build_array_from_name): Don't set `ret_name' if null.
2671         (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
2672         (qualify_ambiguous_name): Likewise.
2673         (java_complete_expand_class): Likewise.
2674
2675 Tue Feb  1 14:59:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2676
2677         * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
2678         * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
2679         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
2680         (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
2681         (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
2682         AIPL_FUNCTION_COMPLETED_INVOCATION.
2683         (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
2684         AIPL_FUNCTION_INVOCATION_READY.
2685         (AIPL_FUNCTION_DECLARATION): New enum entry.
2686         * parse.y (reorder_static_initialized): New function.
2687         (java_parser_context_pop_initialized_field): Use it.
2688         (add_inner_class_fields): Use
2689         MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
2690         augmented. Install marker after last alias initializer, if any.
2691         (generate_finit): Fixed typo. Don't try to retain only the used
2692         fields.
2693         (method_header): Compute and set DECL_FUNCTION_NAP.
2694         (method_declarator): Fixed comment. Insert alias initializer in
2695         parameter list.
2696         (build_alias_initializer_parameter_list): Fixed leading
2697         comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
2698         replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
2699         (java_complete_expand_class): Code to retain only used aliases
2700         removed.
2701         (java_complete_expand_methods): New local `first_decl'. Generate
2702         $finit$ first, then expand the constructors, regular methods and
2703         <clinit>.
2704         (java_complete_expand_method): Don't report error on missing
2705         return statement if previously detected bogus.
2706         (fix_constructors): Don't patch constructor parameters list.
2707         (patch_method_invocation): Use new AIPL enum values. Reverse
2708         alias initializer list for anonymous classes.
2709
2710 2000-01-30  Anthony Green  <green@redhat.com>
2711
2712         * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
2713         determine how many stack slots to pop.
2714
2715 2000-01-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2716
2717         * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
2718         error handling/recovery.
2719         * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
2720
2721 Fri Jan 28 20:10:57 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2722
2723         * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
2724         FIELD_LOCAL_ALIAS_USED): New macros.
2725         (DECL_FUNCTION_NAP): New macro.
2726         (struct lang_decl): New field `nap'.
2727         (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
2728         (struct lang_type): New fields `finit_stmt_list' and
2729         `clinit_stmt_list'.
2730         (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
2731         * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
2732         (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
2733         UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
2734         (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
2735         AIPL_FUNCTION_INVOCATION_READY): New enum fields.
2736         (BUILD_THROW): Macro line separator re-indented.
2737         * parse.y (end_class_declaration): New function.
2738         (maybe_generate_pre_expand_clinit): New name for
2739         java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
2740         pre-expand static fields.
2741         (maybe_generate_clinit): Function deleted.
2742         (check_for_static_method_reference): Prototype's parameter list
2743         indented.
2744         (generate_finit): New name for maybe_generate_finit. Changed
2745         leading comment. Function rewritten to use
2746         TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
2747         (build_alias_initializer_parameter_list): New function.
2748         (java_parser_context_pop_initialized_field): Likewise.
2749         (add_inner_class_fields): Likewise.
2750         (type_declaration:): Call end_class_declaration.
2751         (class_member_declaration:): Likewise.
2752         (formal_parameter_list:): Fixed typos.
2753         (formal_parameter:): Use ARG_FINAL_P to mark created tree list
2754         element. Improved error handling.
2755         (block_statement:): Call end_class_declaration.
2756         (anonymous_class_creation:): Likewise.
2757         (create_anonymous_class): Fixed comments.
2758         (create_class): Call add_inner_class_fields.
2759         (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
2760         (method_header): Use MARK_FINAL_PARMS.
2761         (finish_method_declaration): Use UNMARK_FINAL_PARMS.
2762         (method_declarator): Propagate final argument flag.
2763         (craft_constructor): New local `artificial'. Call
2764         build_alias_initializer_parameter_list. Use
2765         CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
2766         (source_start_java_method): Mark parm decls with LOCAL_FINAL if
2767         necessary.
2768         (complete_expand_class): Get rid of unused outer context local
2769         alias fields.
2770         (java_complete_expand_methods): Fixed leading
2771         comment. Generate/pre-expand <clinit> first. Changed method
2772         expansion order to regular, $finit$, constructors, <clinit>.
2773         (java_complete_expand_method): Set current_function_decl.
2774         (fix_constructors): Fix constructor parameter list to account for
2775         outer context local alias initializers.
2776         (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
2777         (resolve_expression_name): Lookup outer context local aliases. New
2778         local `access', use it.
2779         (patch_method_invocation): Patch inner class ctor invocation with
2780         outer context local aliases initialization values. $finit$
2781         invocation patching now includes things generated with
2782         build_alias_initializer_parameter_list.
2783         (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
2784         (build_super_invocation): Likewise.
2785         (patch_assignment): Changed comment.
2786
2787 2000-01-27  Andrew Haley  <aph@cygnus.com>
2788
2789         * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
2790         (emit_if): Ditto.
2791         (emit_jsr): Ditto.
2792
2793 2000-01-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2794
2795         * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
2796         concatenation.
2797         (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
2798
2799         * parse.y (register_fields): Don't pass a format specifier to
2800         OBSOLETE_MODIFIER_WARNING.
2801         (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
2802         instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
2803         specifier.
2804         (check_modifiers): Change function into a macro.
2805         (check_class_interface_creation): Pass a literal format string.
2806
2807 2000-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2808
2809         * buffer.h: PROTO -> PARAMS.
2810         * check-init.c: Likewise.
2811         * class.c: Likewise.
2812         * constants.c: Likewise.
2813         * convert.h: Likewise.
2814         * decl.c: Likewise.
2815         * except.c: Likewise.
2816         * expr.c: Likewise.
2817         * gjavah.c: Likewise.
2818         * java-except.h: Likewise.
2819         * java-tree.h: Likewise.
2820         * jcf-depend.c: Likewise.
2821         * jcf-dump.c: Likewise.
2822         * jcf-parse.c: Likewise.
2823         * jcf-path.c: Likewise.
2824         * jcf-reader.c: Likewise.
2825         * jcf-write.c: Likewise.
2826         * jcf.h: Likewise.
2827         * jv-scan.c: Likewise.
2828         * jvgenmain.c: Likewise.
2829         * jvspec.c: Likewise.
2830         * lang.c: Likewise.
2831         * lex.c: Likewise.
2832         * lex.h: Likewise.
2833         * parse-scan.y: Likewise.
2834         * parse.h: Likewise.
2835         * parse.y: Likewise.
2836         * typeck.c: Likewise.
2837         * verify.c: Likewise.
2838         * xref.c: Likewise.
2839         * xref.h: Likewise.
2840         * zextract.c: Likewise.
2841         * zipfile.h: Likewise.
2842
2843 2000-01-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2844
2845         * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
2846         (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
2847         * constants.c (build_constant_data_ref): Check for cached
2848         current_constant_pool_data_ref. Cache current_constant_pool_data_ref
2849         in TYPE_CPOOL_DATE_REF.
2850         * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
2851         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
2852         (struct lang_type): New fields `cpool' and `cpool_data_ref'.
2853         (LOCAL_FINAL): New macro.
2854         * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
2855         constant pool -- don't try to reuse.
2856         (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
2857         TYPE_LANG_SPECIFIC.
2858         (find_in_current_zip): Use TYPE_JCF.
2859         * parse.h (java_check_final): Prototype removed.
2860         * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
2861         (maybe_create_class_interface_decl,
2862         check_class_interface_creation): Likewise.
2863         (java_expand_finals): Function removed.
2864         (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
2865         (block_statement:): Fixed comment.
2866         (anonymous_class_creation:): Likewise.
2867         (check_class_interface_creation): Reversed Jan 12, 2000 extra
2868         argument patch.
2869         (check_class_interface_creation): Loosened error report on (inner)
2870         public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
2871         (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
2872         (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
2873         argument patch.
2874         (create_interface): Likewise.
2875         (anonymous_class_counter): New static global.
2876         (create_anonymous_class): Reversed Jan 12, 2000 extra argument
2877         patch. Fixed comments.
2878         (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
2879         anonymous_class_counter when declaring a toplevel class.
2880         (craft_constructor): Fixed constructor name when handling
2881         anonymous classes. Anonymous class constructors to feature hidden
2882         this$<n> parameter.
2883         (java_fix_constructors): Added comment.
2884         (java_check_final): Function removed.
2885         (java_complete_expand_methods): Fixed comment. Don't generate
2886         class data, save its outgoing constant pool instead.
2887         (verify_constructor_super): Skip anonymous class constructor
2888         hidden this$<n> parameter.
2889         (java_expand_classes): New local `saved_ctxp'. Removed call to
2890         java_expand_finals and java_check_final. Expand anonymous class
2891         constructors. Generate class data.
2892         (build_super_invocation): Skip anonymous class hidden this$<n>
2893         parameter.
2894         * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
2895         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
2896         (set_java_signature): Likewise.
2897
2898 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
2899
2900         * gjavah.c: Delete ACC_VISIBILITY define.
2901         * jcf.h: Add ACC_VISIBILITY define.
2902         * parse.y: final: rule tagged <value>.
2903         (java_check_regular_methods): Use ACC_VISIBILITY define for
2904         default package access check.
2905         (local_variable_declaration_statement): Use final: rule.
2906
2907 Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
2908
2909         * parse.y (format_parameter:): Use final: rule instead of modifiers:.
2910         (final:): New rule.
2911
2912 2000-01-17  Tom Tromey  <tromey@cygnus.com>
2913
2914         * gjavah.c (print_field_info): Allow non-static final fields.
2915
2916 Fri Jan 14 18:03:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2917
2918         * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
2919         * parse.y (patch_anonymous_class): New function.
2920         (create_anonymous_class): Register incomplete type when the
2921         class/interface to extends/implement isn't known yet.
2922         (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
2923         (verify_constructor_super): Tuned error message.
2924
2925 Fri Jan 14 00:14:24 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2926
2927         * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
2928         (ANONYMOUS_CLASS_P): New macro.
2929         (TYPE_SIGNATURE, TYPE_JCF): New macros.
2930         (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
2931         * parse.y (create_class): Added leading argument.
2932         (maybe_create_class_interface_decl,
2933         check_class_interface_creation): Likewise.
2934         (craft_constructor): New function.
2935         (verify_constructor_super): Added argument in prototype.
2936         (class_declaration:): Inserted leading argument.
2937         (for_begin:): Use FOR_LOOP_P.
2938         (anonymous_class_creation): Create WFL of the anonymous class to
2939         instantiate. Call build_new_invocation. Added comments.
2940         (check_class_interface_creation): Handle parameter `anonymous' in
2941         verbose mode class creation announce.
2942         (link_nested_class_to_enclosing): Exclude anonymous classes.
2943         (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
2944         anonymous class, even though they appear to have an enclosing
2945         context.
2946         (create_interface): Pass extra argument to
2947         check_class_interface_creation.
2948         (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
2949         (create_class): Call check_class_interface_creation and
2950         maybe_create_class_interface_decl with extra new argument. Don't
2951         add private this$<n> to anonymous classes.
2952         (method_declarator): Insert hidden this$<n> to anonymous class
2953         constructors.
2954         (java_fix_constructors): Deleted code creating default
2955         constructor. Call craft_constructor instead.
2956         (java_check_regular_methods): Set `saw_constructor' to 1 for
2957         anonymous classes.
2958         (fix_constructors): Pass extra argument to verify_constructor_super.
2959         (verify_constructor_super): New local `sdecl', use it. Search for
2960         matching constructor (possibly featuring arguments) in super
2961         class.
2962         (lookup_method_invoke): Craft constructor according to arguments
2963         list when dealing with anonymous class constructors.
2964         (build_super_invocation): Pass arguments to anonymous class super
2965         constructors.
2966         (search_loop): Use FOR_LOOP_P.
2967         (labeled_block_contains_loop_p): Likewise.
2968
2969 Wed Jan 12 00:38:47 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2970
2971         * class.c (set_super_info): Set CLASS_STATIC when appropriate.
2972         (enclosing_context_p): New function.
2973         (get_access_flags_from_decl): Handle CLASS_STATIC.
2974         (maybe_layout_super_class): Extra first argument passed to
2975         do_resolve_class.
2976         (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
2977         ID_INIT_P.
2978         * decl.c (access0_identifier_node): New global.
2979         (init_decl_processing): access0_identifier_node initialized.
2980         (pushdecl): Set DECL_CONTEXT only on non type decls.
2981         * expr.c (lookup_field): Lookup inner class fields in enclosing
2982         contexts.
2983         (expand_invoke): Use ID_INIT_P.
2984         (expand_java_field_op): Use DECL_CLINIT_P.
2985         * java-tree.def (CLASS_LITERAL): New tree code.
2986         * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
2987         DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
2988         (struct lang_decl): New field `inner_access'.
2989         (enclosing_context_p): Prototyped.
2990         (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
2991         ID_CLINIT_P): New macros.
2992         (CLASS_STATIC): New macro.
2993         (CLASS_ACCESS0_GENERATED_P): New macro.
2994         (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
2995         TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
2996         INNER_CLASS_P): New macros.
2997         (DECL_INNER_CLASS_LIST): New macro.
2998         * jcf-parse.c (yyparse): Avoid the use of ANSI string
2999         concatenation.
3000         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3001         the shift value to int. Fixed typo in comment.
3002         * lex.c (inst_id, wpv_id): Initialize.
3003         * mangle.c (unicode_mangling_length): Take `$' into account.
3004         * parse.h (DRECOVER, RECOVER): Terminate properly.
3005         (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
3006         (typedef struct _jdep): New field `enclosing'.
3007         (JDEP_ENCLOSING): New macro.
3008         (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
3009         (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
3010         (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
3011         GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
3012         GET_ENCLOSING_CPC_CONTEXT): New macros.
3013         (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
3014         (do_resolve_class): Added extra argument in prototype.
3015         * parse.y (resolve_class): Added extra argument in prototype.
3016         (maybe_create_class_interface_decl): Likewise.
3017         (maybe_use_access_method, build_wfl_wrap): New functions.
3018         (java_complete_expand_classes, java_complete_expand_class):
3019         Likewise.
3020         (java_parser_context_push_initialized_field,
3021         java_parser_context_suspend, java_parser_context_resume):
3022         Likewise.
3023         (maybe_make_nested_class_name, make_nested_class_name,
3024         set_nested_class_simple_name_value,
3025         link_nested_class_to_enclosing, find_as_inner_class,
3026         find_as_inner_class_do, check_inner_class_redefinition,
3027         build_thisn_assign, build_current_thisn, build_access_to_thisn,
3028         maybe_build_thisn_access_method, build_outer_field_access,
3029         build_outer_field_access_methods, build_outer_field_access_expr,
3030         build_outer_method_access_method, build_new_access_id,
3031         build_outer_field_access_method, outer_field_access_p,
3032         outer_field_expanded_access_p, outer_field_access_fix,
3033         build_incomplete_class_ref, patch_incomplete_class_ref,
3034         create_anonymous_class): Likewise.
3035         (inst_id, wpv_id): New static global variables.
3036         (synchronized:): New rule, tagged <node>.
3037         (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
3038         rules.
3039         (anonymous_class_creation:): New rule, tagged <node>.
3040         (NEW_TK): Tagged <node>.
3041         (type_literals, array_type_literal): New rules, tagged <node>.
3042         (class_declaration:): Removed action when reducing by class_body:
3043         (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
3044         using GET_CPC in sub-rules.
3045         (class_member_declaration): Handle inner classes.
3046         (method_declaration): When reducing method_header:, reset
3047         current_function_decl when appropriate.
3048         (method_declarator:): Set the number of formal parameter to 0 for
3049         method declared without arguments.
3050         (constructor_declarator:): Likewise.
3051         (static_initializer:): List of elements kept in a list.
3052         (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
3053         use of the keyword `static' for type declarations.
3054         (block_statement:): Handle inner class declarations.
3055         (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
3056         type qualified `this'.
3057         (class_instance_creation_expression): Use anonymous_class_creation:
3058         to handle inner class instances creation. Handle qualified `new'.
3059         (something_dot_new): Added appropriate actions.
3060         (create_new_parser_context): New function.
3061         (java_push_parser_context, java_parser_context_save_global,
3062         java_parser_context_suspend): Use create_new_parser_context.
3063         (check_modifiers): Changed leading comment.
3064         (check_class_interface_creation): Handle interclasses.
3065         (add_superinterfaces): Fixed comment.
3066         (create_interface): Build qualified name from the raw_name instead
3067         of its matching WFL. Push the initialized fields list. raw_name added
3068         as an extra argument to maybe_create_class_interface_decl.
3069         (create_class): Build qualified name from the raw_name instead of
3070         its matching WFL. Removed assignment to current_parsed_class_un.
3071         Call PUSH_ERROR before returning an error. Suspend the current
3072         parser context when processing an inner class. Push the
3073         initialized fields list. raw_name added as an extra argument to
3074         maybe_create_class_interface_decl. Add the private this$<n>
3075         field.
3076         (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
3077         (register_fields): Get the class type from GET_CPC and handle
3078         previous errors.  Added code to handle the creation of static
3079         fields in inner classes. Initialized fields initialization
3080         statements kept in a list of lists.
3081         (maybe_generate_finit): Initialized fields initialization
3082         statements kept in a list of lists. Use GET_CPC.
3083         (maybe_generate_clinit): Likewise.
3084         (method_header): Use GET_CPC and GET_CPC_UN.
3085         (parser_qualified_classname): Handle inner classes.
3086         (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
3087         (java_fix_constructors): Hide pointer to enclosing context
3088         instance in constructor list when dealing with inner classes.
3089         (jdep_resolve_class): Call resolve_class with extra first argument
3090         JDEP_ENCLOSING.
3091         (resolve_class): Add enclosing context as a first extra argument
3092         to do_resolve_class.
3093         (do_resolve_class): Call find_as_inner_class. Handle WFLs
3094         properly.
3095         (resolve_no_layout): Extra argument added to resolve_class
3096         invocation.
3097         (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
3098         (java_get_real_method_name): Use GET_CPC_UN.
3099         (check_abstract_method_definitions): Use DECL_CLINIT_P.
3100         (java_check_abstract_methods): Handle static method declared in
3101         inner classes by an error.
3102         (java_check_regular_methods): Use DECL_CLINIT_P.
3103         (source_start_java_method): Also set DECL_MAX_LOCALS.
3104         (create_artificial_method): Call java_parser_context_save_global
3105         and java_parser_context_restore_global instead of saving/restoring
3106         the context by hand.
3107         (expand_start_java_method): Improved verbose mode message.
3108         (java_complete_expand_methods): Fixed leading comment. Use
3109         DECL_CLINIT_P.
3110         (fix_constructors): Added assignment to this$<n> if necessary.
3111         (java_expand_classes): Call java_complete_expand_classes instead
3112         of java_complete_expand_methods.
3113         (make_qualified_primary): Simplified.
3114         (merge_qualified_name): Optimized for missing left or right parts.
3115         (resolve_expression_name): Handle access to outer class fields from
3116         interclasses.
3117         (resolve_qualified_expression_name): New macro
3118         RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
3119         classes. Report error on non appropriate qualification of
3120         `new'. Handle qualified `this'.
3121         (not_accessible_p): Allow access to outer class private fields from
3122         inner classes.
3123         (patch_method_invocation): Handle method invocations through
3124         access methods and inner class constructor invocations.
3125         (find_applicable_accessible_methods_list): Search enclosing
3126         contexts of an inner class.
3127         (search_applicable_methods_list): Fixed typo.
3128         (argument_types_convertible): Handle inner class constructors'
3129         hidden outer context reference argument.
3130         (qualify_ambiguous_name): Handle qualified `this'.
3131         (java_complete_lhs): Handle use of field accessed through
3132         artificial access methods in various cases of assignments. Handle
3133         CLASS_LITERAL node.
3134         (check_final_assignment): Use DECL_CLINIT_P.
3135         (valid_ref_assignconv_cast_p): Handle the destination being an
3136         enclosing context of the source.
3137         (patch_unaryop): Handle use of field accessed through artificial
3138         access methods.
3139         (patch_return): Use DECL_CLINIT_P.
3140         (patch_throw_statement): Use DECL_CLINIT_P.
3141         (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
3142         * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
3143         ID_INIT_P.
3144
3145 2000-01-16  Anthony Green  <green@cygnus.com>
3146
3147         * parse.y (build_string_concatenation): Only use
3148         StringBuffer(String) shortcut if String arg is constant.
3149
3150 Wed Jan 12 20:20:11 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3151
3152         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3153         the shift value to int. Fixed typo in comment.
3154
3155 2000-01-11  Mumit Khan  <khan@xraylith.wisc.edu>
3156
3157         * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
3158         * jcf-write.c: Likewise.
3159         * parse.y: Likewise.
3160         * parse.c: Regenerate.
3161
3162 2000-01-09  Anthony Green  <green@cygnus.com>
3163
3164         * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
3165         bytecodes in the correct order.
3166
3167 2000-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3168
3169         * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
3170
3171 Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>
3172
3173         * expr.c (java_lang_expand_expr): Switch to permanent obstack
3174         before building constant array decl.
3175
3176 Thu Jan  6 00:54:10 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3177
3178         * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
3179         method invocation and typo in conditional expression.
3180         (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
3181         the appropriate NOTE_POP.
3182         * parse.y (patch_binop): Shift value mask to feature the right
3183         type.
3184
3185 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3186
3187         * class.c (assume_compiled, assume_compiled_node): Add static
3188         prototype.
3189         (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
3190
3191         * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
3192
3193         * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
3194
3195         * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
3196         to `__modifier' to avoid stringifying it.
3197
3198         * parse.y (verify_constructor_circularity): Don't call a variadic
3199         function with a non-literal format string.
3200         (java_check_abstract_methods): Move unreachable code inside
3201         `continue' statement.
3202         (lookup_method_invoke): Call xstrdup, not strdup.
3203
3204         * expr.c (expand_java_field_op): Avoid the use of ANSI string
3205         concatenation.
3206
3207         * jcf-parse.c (yyparse): Likewise.
3208
3209         * jv-scan.c (main): Likewise.
3210
3211 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3212
3213         * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
3214         ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
3215         ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
3216         concatenation.
3217
3218         * parse.y (synchronized, variable_redefinition_error,
3219         check_class_interface_creation, create_interface, create_class,
3220         method_header, finish_method_declaration,
3221         check_modifiers_consistency, method_declarator,
3222         complete_class_report_errors, check_abstract_method_definitions,
3223         java_check_regular_methods, check_throws_clauses,
3224         java_check_abstract_methods, read_import_dir,
3225         check_pkg_class_access, declare_local_variables, fix_constructors,
3226         cut_identifier_in_qualified, resolve_expression_name,
3227         resolve_qualified_expression_name, patch_method_invocation,
3228         java_complete_lhs, patch_assignment, try_builtin_assignconv,
3229         patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
3230         patch_exit_expr, patch_exit_expr, patch_switch_statement,
3231         patch_try_statement, patch_synchronized_statement,
3232         patch_throw_statement, check_thrown_exceptions,
3233         patch_conditional_expr): Likewise.
3234
3235 Fri Dec 24 00:25:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3236
3237         * Makefile.in (LIBDEPS): Added gcc's errors.o
3238         (../jcf-dump$(exeext):): Link with gcc's errors.o
3239         (../gcjh$(exeext):): Likewise.
3240         * expr.c (expand_java_NEW): Layout the entire target type instead of
3241         laying out its methods only.
3242         (lookup_field): Layout the class after having loaded it.
3243         * java-tree.h (java_debug_context): Declared.
3244         * jcf-io.c (toplev.h): Included.
3245         (find_class): Removed assignment to jcf's outofsynch
3246         field. Force source file to be read if newer than its matching
3247         class file. Tweaked debug messages.
3248         * jcf-parse.c (jcf_out_of_synch): Deleted.
3249         (read_class): Call to jcf_out_of_synch removed.
3250         * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
3251         (jcf_out_of_synch): Prototype deleted.
3252         * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
3253         `deprecated' and `class_err': integer turned into bit fields.
3254         New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
3255         * parse.y (package_list): New global.
3256         (package_declaration:): Record newly parsed package name.
3257         (extra_ctxp_pushed_p): Static global deleted.
3258         (java_parser_context_save_global): Create buffer context for the
3259         purpose of saving globals, if necessary.
3260         (java_parser_context_restore_global): Pop context pushed for the
3261         purpose of saving globals, if necessary.
3262         (java_debug_context_do): New prototype and function.
3263         (java_debug_context): Likewise.
3264         (do_resolve_class): Use already parsed package names to qualify
3265         and lookup class candidate.
3266         (java_pre_expand_clinit): Removed unnecessary local variable.
3267
3268 1999-12-17  Tom Tromey  <tromey@cygnus.com>
3269
3270         * gjavah.c (decode_signature_piece): Print "::" in JArray<>.  This
3271         fixes PR gcj/119.
3272         (process_file): Use `\n\' at end of each line in string.
3273
3274 Thu Dec 16 00:09:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3275
3276         * expr.c (expand_invoke): Layout the loaded class before
3277         attempting to use it.
3278         (expand_java_field_op): Allow final field assignments to take
3279         place in $finit$.
3280         * typeck.c (convert): Return error_mark_node if expr is null.
3281
3282 1999-12-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3283
3284         * class.c (class_depth): Return -1 if the class doesn't load
3285         properly.
3286         * expr.c (can_widen_reference_to): Check for errors during depth
3287         computation and return 0 accordingly.
3288         * jcf-parse.c (parse_source_file): Call java_fix_constructors to
3289         create default constructors and add an other error check.
3290         * parse.h (java_fix_constructors): Prototyped.
3291         * parse.y (java_pre_expand_clinit): Likewise.
3292         (build_super_invocation): Re-prototyped to feature one argument.
3293         (java_check_circular_reference): Directly use `current'.
3294         (java_fix_constructors): New function.
3295         (java_check_regular_methods): Don't create default constructors
3296         here, but abort if none were found.
3297         (java_complete_expand_methods): Pre-process <clinit> calling
3298         java_pre_expand_clinit.
3299         (java_pre_expand_clinit): New function.
3300         (fix_constructors): build_super_invocation invoked with the
3301         current method declaration as an argument.
3302         (build_super_invocation): Use the context of the processed method
3303         decl argument instead of current_class.
3304         * typeck.c (lookup_java_method): Take WFLs in method names into
3305         account.
3306
3307 Tue Dec 14 14:20:16 1999  Per Bothner  <per@bothner.com>
3308
3309         * class.c (make_class_data): flag_keep_inline_functions to keep
3310         private methods in the method array.
3311
3312 1999-12-15  Anthony Green  <green@cygnus.com>
3313
3314         * check-init.c (check_init): Take into account both types of
3315         `throw's when checking for uninitialized variables.
3316
3317 Fri Dec 10 21:53:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3318
3319         * parse.y (java_complete_lhs): Force convertion of array
3320         dimensions to int_type_node, that's what runtime's ABI expects.
3321
3322 Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3323
3324         * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
3325         operand of a WFL, until the Java front-end gets fixed with regard
3326         to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
3327
3328 1999-12-10  Andrew Haley  <aph@cygnus.com>
3329
3330         * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
3331         decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
3332         expr.c (build_java_athrow): Add support for sjlj-exceptions.
3333         java-tree.h: Ditto.
3334         jcf-write.c: Ditto.
3335
3336 Wed Dec  8 15:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3337
3338         * expr.c (java_lang_expand_expr): Switch to permanent obstack
3339         before calling expand_eh_region_start and expand_start_all_catch.
3340         * except.c (expand_start_java_handler): Switch to permanent
3341         obstack before calling expand_eh_region_start.
3342         (expand_end_java_handler): Switch to permanent obstack before
3343         calling expand_start_all_catch.
3344
3345 1999-12-5  Anthony Green  <green@cygnus.com>
3346
3347         * decl.c (init_decl_processing): Mark throw_node as a noreturn
3348         function with side effects.
3349         (init_decl_processing): Mark all memory allocating DECLs with
3350         DECL_IS_MALLOC.
3351
3352 Wed Dec  1 04:25:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3353
3354         * except.c (expand_end_java_handler): Call
3355         expand_resume_after_catch and end_catch_handler.
3356
3357 Tue Nov 30 12:36:15 1999  Anthony Green  <green@cygnus.com>
3358
3359         * verify.c (verify_jvm_instructions): Create new return label
3360         chain if non existant (don't rely on the verified state of the jsr
3361         target.)
3362
3363 Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3364
3365         * jcf-write.c (generate_bytecode_insns): Fixed indentation for
3366         COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
3367
3368         * parse.y (patch_assignment): Removed bogus final class test on
3369         lhs when checking on whether to emit an ArrayStoreException runtime
3370         check.
3371         * expr.c (expand_java_arraystore): Likewise.
3372
3373 1999-11-28 Anthony Green <green@cygnus.com>
3374
3375         * decl.c (find_local_variable): Reuse single slot decls when
3376           appropriate.
3377
3378 Wed Nov 24 17:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3379
3380         * jcf-parse.c (saw_java_source): Global variable removed.
3381         (read_class): Don't use `saw_java_source'. Added extra braces.
3382         (yyparse): Code setting `saw_java_source' removed.
3383
3384 1999-11-24  Mark Mitchell  <mark@codesourcery.com>
3385
3386         * except.c (emit_handlers): Zero catch_clauses after emitting them.
3387
3388 Tue Nov 23 17:29:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3389
3390         * verify.c (merge_type_state): Non verified subroutines being
3391         considered more than once to trigger passive type merge.
3392
3393 Tue Nov 23 10:55:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3394
3395         * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
3396         in case of error. Error message tuned.
3397
3398 1999-11-21  Anthony Green  <green@cygnus.com>
3399
3400         * constants.c (find_methodref_index): Unwrap method names before
3401         inserting them in the constant pool.
3402
3403         * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
3404
3405         * class.c (assume_compiled_node): New typedef.
3406         (assume_compiled_tree): New static data.
3407         (find_assume_compiled_node): New function.
3408         (add_assume_compiled): New function.
3409         (assume_compiled): New function.
3410         * class.c (make_class_data): Use assume_compiled.
3411         (is_compiled_class): Use assume_compiled.
3412
3413         * java-tree.h (add_assume_compiled): Declare.
3414
3415         * lang.c (lang_decode_option): Parse new options.
3416
3417 Wed Nov 17 21:09:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3418
3419         * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
3420         int_type_node: that's what `_Jv_AllocObject' expects.
3421
3422 Thu Nov 11 01:57:14 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3423
3424         * parse.y (lookup_method_invoke): Use lang_printable_name to
3425         reliably build the type name during error report. Fixes PR gcj/97.
3426
3427 1999-11-09  Tom Tromey  <tromey@cygnus.com>
3428
3429         * jcf-path.c: Include <sys/stat.h>.
3430         (jcf_path_init): Search for libjava.zip.  Fixes PR gcj/84.
3431         (DIR_UP): New macro.
3432
3433 Tue Nov  9 12:12:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3434
3435         * parse.y (source_end_java_method): Resume permanent allocation,
3436         reversing Apr 27 1998 patch.
3437         (patch_string_cst): Pop obstacks after having pushed the permanent
3438         ones.
3439
3440 1999-11-05  Tom Tromey  <tromey@cygnus.com>
3441
3442         * class.c (finish_class): Emit inlined methods if any native
3443         methods exist in the class.  Fixes PR gcj/85.
3444
3445 Thu Nov  4 16:27:01 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3446
3447         * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
3448         (qualify_ambiguous_name): Likewise.
3449
3450 Wed Nov  3 15:20:02 MST 1999  Godmar Back <gback@cs.utah.edu>
3451
3452         * typeck.c: (lookup_java_method):  search all inherited
3453         interfaces when looking up interface method.
3454
3455 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3456
3457         * parse.y (method_header:): Issue error message for rule `type
3458         error'.
3459         (synchronized:): Error report when not using synchronized.
3460
3461 Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3462
3463         * parse.y (resolve_qualified_expression_name): Prevent `this' from
3464         being used before the superclass constructor has been called.
3465         (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
3466         instead of `CALL_THIS_CONSTRUCTOR_P'.
3467
3468 Sat Oct 30 21:35:13 1999  Todd T. Fries <todd@lighthouse.fries.net>
3469
3470         * check-init.c: Fix typo in comment.
3471
3472 Fri Oct 29 14:35:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3473
3474         * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
3475         and final method.
3476
3477 Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3478
3479         * parse.y (expression_statement:): Call function to report
3480         improper invocation of a constructor.
3481         (parse_ctor_invocation_error): New function.
3482
3483 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
3484
3485         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
3486         remember_end_note.
3487
3488 1999-10-21  Tom Tromey  <tromey@cygnus.com>
3489
3490         * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
3491         in generated `main'.
3492
3493 Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3494
3495         * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
3496         (qualify_ambiguous_name): Likewise.
3497
3498 Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3499
3500         * parse.y (java_complete_tree): fold_constant_for_init to work on
3501         permanent_obstack.
3502         (java_complete_lhs): Likewise.
3503         (array_constructor_check_entry): Complete an initializer element
3504         on permanent_obstack.
3505
3506 1999-10-19  Tom Tromey  <tromey@cygnus.com>
3507
3508         * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
3509         From Mike Moreton <mike@pillim.demon.co.uk>.
3510
3511 1999-10-15  Greg McGary  <gkm@gnu.org>
3512
3513         * java-tree.h (flag_bounds_check): Remove extern decl.
3514         * lang.c (flag_bounds_check): Remove global variable.
3515         (lang_f_options): Remove "bounds-check" entry.
3516         (lang_init_options): Default flag_bounds_check to "on".
3517
3518 1999-10-14  Tom Tromey  <tromey@cygnus.com>
3519
3520         * jvgenmain.c (usage): New function.
3521         (main): Use it.  Also, handle `-D' options.
3522         * jvspec.c (lang_specific_driver): Recognize -D.
3523         (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
3524
3525         * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
3526
3527 1999-10-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3528
3529         * jcf-dump.c (print_constant, disassemble_method): Don't call a
3530         variadic function with a non-literal format string.
3531
3532         * parse-scan.y (report_main_declaration): Likewise.
3533
3534         * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
3535
3536         * parse.y (read_import_dir, patch_assignment, patch_binop,
3537         patch_array_ref): Likewise.
3538
3539         * typeck.c (build_java_array_type): Likewise.
3540
3541         * verify.c (verify_jvm_instructions): Likewise.
3542
3543 Tue Oct 12 22:28:10 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3544
3545         * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
3546
3547 1999-10-07  Anthony Green  <green@cygnus.com>
3548
3549         * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
3550         where CHECK_PUT may fail for valid reasons.
3551
3552         * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
3553         UNSAFE_PUTN): New macros.
3554
3555 1999-10-04  Tom Tromey  <tromey@cygnus.com>
3556
3557         * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
3558         well.  Fixes Java PR gcj/59.
3559         * parse-scan.y (yyerror): Report errors.
3560
3561 Fri Sep 24 12:23:05 1999  Glenn Chambers  <GChambers@provsol.com>
3562
3563         * decl.c (insert_block): Remove unconditional `abort'.
3564
3565 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
3566
3567         * decl.c (builtin_function): No longer static.  New arg CLASS.  Arg
3568         FUNCTION_CODE now of type int.  All callers changed.
3569         Set the builtin's DECL_BUILT_IN_CLASS.
3570
3571 1999-09-23  Tom Tromey  <tromey@cygnus.com>
3572
3573         * jvspec.c (lang_specific_driver): Don't read spec file if
3574         -fsyntax-only given.
3575
3576 1999-09-22  Tom Tromey  <tromey@cygnus.com>
3577
3578         * lang-specs.h: Added `%(jc1)' to the jc1 spec.
3579
3580         * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
3581         (WORDS_TO_LONG): Likewise.
3582         (WORDS_TO_DOUBLE): Likewise.
3583
3584 Tue Sep 14 16:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3585
3586         * jcf-write.c (RELOCATION_VALUE_0): New macro.
3587         (RELOCATION_VALUE_1): Likewise.
3588         (emit_iinc, emit_reloc, push_constant1, push_constant2,
3589         push_in_const, push_long_const): Prototyped.
3590         (push_constant1): Argument `index' is of type HOST_WIDE_INT.
3591         (push_constant2): Likewise.
3592         (push_int_const): Cast find_constant1's integer arguments to `jword'.
3593         (find_constant_wide): Cast find_constant2's integer arguments to
3594         `jword'.
3595         (find_constant_index): Cast find_constant2's and find_constant2's
3596         integer arguments to `jword'.
3597         (emit_pop): Argument `value' is of type HOST_WIDE_INT.
3598         (emit_switch_reloc): Use RELOCATION_VALUE_0.
3599         (emit_if): Use RELOCATION_VALUE_1.
3600         (emit_goto): Likewise.
3601         (emit_jsr): Likewise.
3602         (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
3603         argument to push_long_const to HOST_WIDE_INT.
3604
3605 1999-09-15  Andreas Schwab  <schwab@suse.de>
3606
3607         * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
3608
3609 1999-09-20  Nick Clifton  <nickc@cygnus.com>
3610
3611         * lang.c (lang_decode_option): Extend comment.
3612
3613 Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3614
3615         * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
3616         instead of fndecl.
3617
3618 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3619
3620         * gjavah.c (get_field_name, print_method_info, print_include,
3621         add_namelet): Use xmalloc, not malloc.
3622
3623         * jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
3624         (munge): Use xrealloc, not realloc, trust xrealloc to handle a
3625         NULL pointer.
3626
3627         * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
3628
3629         * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
3630
3631         * jcf-path.c (add_entry): Likewise.
3632
3633         * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
3634
3635         * jv-scan.c (xmalloc): Remove definition.
3636
3637         * jvgenmain.c (xmalloc): Likewise.
3638
3639         * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
3640
3641         * lex.c (java_store_unicode): Use xrealloc, not realloc.
3642
3643         * parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
3644         concat, not xmalloc/sprintf.
3645         (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
3646         (xstrdup): Remove definition.
3647
3648         * parse.y (duplicate_declaration_error_p,
3649         constructor_circularity_msg, verify_constructor_circularity,
3650         check_abstract_method_definitions, java_check_regular_methods,
3651         java_check_abstract_methods, patch_method_invocation,
3652         check_for_static_method_reference, patch_assignment, patch_binop,
3653         patch_cast, array_constructor_check_entry, patch_return,
3654         patch_conditional_expr): Use xstrdup, not strdup.
3655
3656         * zextract.c (ALLOC): Use xmalloc, not malloc.
3657
3658 Sun Sep 12 23:30:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3659
3660         * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
3661
3662         * jvspec.c: Include gcc.h.  Don't include gansidecl.h.
3663         (do_spec, lang_specific_pre_link, lang_specific_driver,
3664         input_filename, input_filename_length): Don't declare.
3665         (main_class_name, jvgenmain_spec, lang_specific_driver):
3666         Constify a char*.
3667         (lang_specific_driver): All calls to the function pointer
3668         parameter now explicitly call `fatal'.
3669
3670 Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3671
3672         * parse.y (find_applicable_accessible_methods_list): Search
3673         abstract classes as interfaces.
3674
3675 Thu Sep  9 17:33:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3676
3677         * class.c (finish_class): We're now outside a valid method
3678         declaration. Tell the rest of gcc so.
3679
3680 1999-09-08  Bruce Korb  autogen@linuxbox.com
3681
3682         * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
3683
3684 1999-09-07  Tom Tromey  <tromey@cygnus.com>
3685
3686         * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
3687         java-array.h.
3688         (decode_signature_piece): Don't emit "::" in JArray<>.
3689         (print_namelet): Only print trailing `;' when printing a class.
3690
3691 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
3692
3693         * java-tree.h: Delete declarations for all tree nodes now moved to
3694         global_trees.
3695         * decl.c: Delete their definitions.
3696
3697 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
3698
3699         * Make-lang.in (jc1): Depend on ggc-callbacks.o.
3700         * Makefile.in (OBJS): Add ggc-callbacks.o.
3701         (OBJDEPS): Likewise.
3702
3703 1999-09-03  Tom Tromey  <tromey@cygnus.com>
3704
3705         * parse.y (strip_out_static_field_access_decl): Return operand if
3706         it satisfies JDECL_P.
3707
3708 1999-09-02  Tom Tromey  <tromey@cygnus.com>
3709
3710         * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
3711         Handle nested arrays, like `[[I'.
3712
3713 1999-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3714
3715         * class.c (finish_class): Remove unused parameter, all callers
3716         changed.
3717
3718         * expr.c (build_java_athrow): Change return type to void.
3719         (java_lang_expand_expr): Make sure each case in switch returns a
3720         value.
3721
3722         * java-tree.h (finish_class): Fix prototype to take void args.
3723
3724         * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
3725         (main): Issue return from main, not exit.
3726
3727         * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
3728
3729         * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
3730
3731         * jv-scan.c (main): Issue return from main, not exit.
3732
3733         * parse.y (check_abstract_method_definitions,
3734         java_check_abstract_method_definitions): Add static prototypes.
3735         (java_complete_expand_methods): Fix call to `finish_class'.
3736
3737         * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
3738         and `prevpc'.
3739
3740 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3741
3742         * lang.c (language_string): Constify.
3743
3744 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3745
3746         * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
3747         Remove hacks for stuff which comes from libiberty.
3748
3749         * Make-lang.in: Likewise.
3750
3751 Mon Aug 30 16:41:41 1999  Hans-Peter Nilsson  <hp@axis.se>
3752
3753         * Makefile.in (xref.o): Depend on xref.c explicitly.
3754
3755 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3756
3757         * java-tree.h (lang_printable_name): Constify a char*.
3758
3759         * lang.c (lang_printable_name): Likewise.
3760
3761 Fri Aug 27 23:31:57 1999  Jeffrey A Law  (law@cygnus.com)
3762
3763         * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
3764         comments in C code.
3765
3766 1999-08-26  Tom Tromey  <tromey@cygnus.com>
3767
3768         * gjavah.c (print_cxx_classname): Print "::" before qualified
3769         name.
3770
3771 Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3772
3773         * parse.y (lookup_cl): Changed leading comment. Now does its best
3774         to set the column number.
3775         (qualify_ambiguous_name): Take WFL wrappers into account.
3776
3777 Wed Aug 25 15:37:15 1999  Gregg Townsend  <gmt@cs.arizona.edu>
3778
3779         * verify.c (verify_jvm_instructions): Don't check instruction
3780         validity beyond end of method.
3781
3782 1999-08-25  Tom Tromey  <tromey@cygnus.com>
3783
3784         * jvspec.c (lang_specific_driver): Correctly handle --help again.
3785
3786 1999-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3787
3788         * gjavah.c (print_name, print_base_classname, utf8_cmp,
3789         cxx_keyword_subst, generate_access, name_is_method_p,
3790         get_field_name, print_field_name, super_class_name, print_include,
3791         decode_signature_piece, print_class_decls, usage, help,
3792         java_no_argument, version, add_namelet, print_namelet): Add static
3793         prototype.
3794         (print_base_classname, utf8_cmp, cxx_keyword_subst,
3795         name_is_method_p): Constify a char*.
3796         (get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
3797         Provide a final else clause in an if-else-if.
3798         (print_field_info): Add missing final arg in function call to
3799         `print_field_name'.
3800         (print_method_info, decompile_method, decode_signature_piece,
3801         print_c_decl, print_full_cxx_name, print_stub,
3802         print_mangled_classname, super_class_name, print_include,
3803         add_namelet, add_class_decl, print_class_decls, process_file,
3804         help): Constify a char*.
3805
3806         * jcf-write.c (jcf_handler, push_constant1, push_constant2,
3807         push_int_const, find_constant_wide, find_constant_index,
3808         push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
3809         emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
3810         emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
3811         emit_if, emit_goto, emit_jsr, call_cleanups,
3812         make_class_file_name): Add static prototypes.
3813         (generate_bytecode_return, generate_bytecode_insns): Pass a
3814         NULL_PTR, not a NULL_TREE.
3815
3816         * jv-scan.c: Include "jcf.h".
3817         (main): Declare using DEFUN macro.
3818
3819         * jvspec.c (find_spec_file, lang_specific_pre_link,
3820         lang_specific_driver): Add prototypes.
3821         (find_spec_file): Constify a char*.
3822
3823         * keyword.gperf (hash, java_keyword): Add prototypes.
3824
3825         * lang.c (lang_print_error): Add static prototype.
3826         (lang_init): Prefer memcpy over bcopy to avoid casts.
3827
3828         * lex.c (yylex): Add static prototype.
3829
3830         * parse-scan.y: Include "lex.c" earlier.
3831
3832         * parse.h: Remove redundant declaration for `yylex'.
3833
3834         * parse.y (java_decl_equiv, binop_compound_p, search_loop,
3835         labeled_block_contains_loop_p): Add static prototypes.
3836         (not_accessible_p): Make static to match prototype.
3837
3838         * verify.c (start_pc_cmp): Don't needlessly cast away const.
3839
3840 Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3841
3842         * parse.y (check_method_redefinition): Changed leading comment.
3843         (check_abstract_method_definitions): New function.
3844         (java_check_abstract_method_definitions): New function.
3845         (java_check_regular_methods): Call it.
3846         (verify_constructor_super): Fixed indentation.
3847         (lookup_method_invoke): Likewise.
3848
3849 Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3850
3851         * parse.y (method_header): Return a null pointer if the current
3852         class node is null.
3853         (finish_method_declaration): Return if the current function decl
3854         is null.
3855         (source_start_java_method): Likewise.
3856         (java_method_add_stmt): Likewise.
3857
3858 Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3859
3860         * class.c (emit_register_class): Removed unnecessary call to
3861         start_sequence.
3862         * parse.y (labeled_block_contains_loop_p): Removed unused local
3863         variable.
3864
3865 Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3866
3867         * parse.y (java_refold): Added prototype.
3868
3869 Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3870
3871         * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
3872         (java_stabilize_reference): Removed unnecessary `else'.
3873         (java_complete_lhs): Set flag to remember boolean. Call
3874         java_refold. Added comments.
3875         (java_decl_equiv): New function.
3876         (binop_compound_p): Likewise.
3877         (java_refold): Likewise.
3878         (patch_unaryop): Striped static field access assigned to decl and
3879         op. Changed promotion scheme for ++/-- operators.
3880         (search_loop): New function.
3881         (labeled_block_contains_loop_p): Likewise.
3882         (patch_loop_statement): Call labeled_block_contains_loop_p. Added
3883         comment.
3884         (patch_bc_statement): Call search_loop. Fixed comment.
3885
3886 1999-08-14  Anthony Green  <green@cygnus.com>
3887
3888         * expr.c (java_lang_expand_expr): Mark static array data as
3889         referenced.
3890
3891 Tue Aug 10 00:28:31 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
3892
3893         * jvgenmain.c (main): NUL-terminate name_obstack.
3894
3895 1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3896
3897         * check-init.c (check_bool2_init, done_alternative): Add static
3898         prototypes.
3899
3900         * class.c (add_interface_do, maybe_layout_super_class): Likewise.
3901         (add_method, build_utf8_ref, build_class_ref,
3902         append_gpp_mangled_type, layout_class_method): Constify a char*.
3903
3904         * decl.c (push_promoted_type, make_binding_level): Add static
3905         prototypes.
3906         (push_promoted_type, pushdecl): Constify a char*.
3907
3908         * except.c (find_handler_in_range, link_handler,
3909         check_start_handlers): Add static prototypes.
3910
3911         * expr.c (process_jvm_instruction): Constify a char*.
3912
3913         * gjavah.c (main): Constify a char*.
3914
3915         * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
3916         Constify a char*.
3917
3918         * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
3919         static prototypes.
3920         (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
3921         munge, print_ents): Constify a char*.
3922
3923         * jcf-dump.c (disassemble_method): Constify a char*.
3924         (print_constant_pool, print_exception_table): Add static prototypes.
3925         (print_constant, print_exception_table, main, disassemble_method):
3926         Constify a char*.
3927
3928         * jcf-io.c (find_classfile, find_class): Likewise.
3929
3930         * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
3931         (set_source_filename, predefined_filename_p): Add static prototypes.
3932         (set_source_filename, get_constant, get_class_constant,
3933         find_in_current_zip): Constify a char*.
3934
3935         * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
3936         static prototypes.
3937         (add_entry, add_path, jcf_path_classpath_arg,
3938         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
3939
3940         * jcf-reader.c (get_attribute, jcf_parse_preamble,
3941         jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
3942         jcf_parse_one_method, jcf_parse_methods,
3943         jcf_parse_final_attributes): Add static prototypes.
3944         (get_attribute): Constify a char*.
3945
3946         * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
3947         jcf_dependency_add_target, jcf_path_classpath_arg,
3948         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
3949
3950         * jv-scan.c (main): Constify a char*.
3951         (gcc_obstack_init): Add prototype arguments.
3952
3953         * jvgenmain.c (gcc_obstack_init): Likewise.
3954         (main): Constify a char*.
3955
3956         * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
3957         static prototypes.
3958         (put_decl_string, lang_print_error): Constify a char*.
3959         (lang_init): Remove redundant extern prototype.
3960
3961         * mangle.c (emit_unicode_mangled_name): Constify a char*.
3962
3963         * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
3964         Add static prototypes.
3965         (get_type_from_signature): Constify a char*.
3966
3967         * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
3968         Add static prototypes.
3969         (start_pc_cmp): Prefer PTR over GENERIC_PTR.
3970         (verify_jvm_instructions): Constify a char*.
3971
3972         * xref.c (xref_flag_value): Likewise.
3973
3974         * xref.h (xref_flag_value): Likewise.
3975
3976         * zextract.c (makeword, makelong): Add static prototypes.
3977         (makeword, makelong): Constify a uch*.
3978
3979 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3980
3981         * lang.c (java_dummy_print): Constify a char*.
3982         (lang_print_error): Likewise.
3983         (lang_init): Remove redundant prototype for `print_error_function'.
3984         (lang_init_source): Likewise.
3985         (lang_identify): Constify a char*.
3986
3987 1999-08-09  Tom Tromey  <tromey@cygnus.com>
3988
3989         * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
3990         (WORDS_TO_LONG): Likewise.
3991         (WORDS_TO_DOUBLE): Likewise.
3992
3993 1999-08-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3994
3995         * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
3996
3997         * expr.c (java_stack_pop, java_array_data_offset,
3998         build_java_throw_out_of_bounds_exception, case_identity,
3999         build_java_check_indexed_type): Add static prototypes.
4000         (linenumber_table, expand_invoke, expand_java_field_op,
4001         build_primtype_type_ref, expand_byte_code): Constify a char*.
4002
4003         * java-tree.h (build_primtype_type_ref, linenumber_table):
4004         Constify a char*.
4005         (java_lang_expand_expr): Add prototype.
4006
4007         * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
4008         `java_lang_expand_expr'.
4009
4010         * lex.c (java_lex_error): Constify a char*.
4011         (java_get_unicode, java_read_char, java_allocate_new_line,
4012         java_unget_unicode, java_sneak_unicode): Prototype.
4013
4014         * parse-scan.y (current_class, package_name, method_declarator,
4015         report_class_declaration, yyerror): Constify a char*.
4016
4017         * parse.h (java_report_errors): Prototype.
4018         (yyerror): Constify a char*.
4019
4020         * parse.y (classitf_redefinition_error, check_modifiers,
4021         parse_jdk1_1_error, lookup_package_type,
4022         lookup_package_type_and_set_next, get_printable_method_name,
4023         purify_type_name): Constify a char*.
4024         (build_super_invocation, maybe_generate_finit,
4025         verify_constructor_super, parser_add_interface,
4026         add_superinterfaces, jdep_resolve_class, note_possible_classname,
4027         java_complete_expand_methods, java_expand_finals,
4028         cut_identifier_in_qualified, java_stabilize_reference,
4029         do_unary_numeric_promotion, operator_string, do_merge_string_cste,
4030         merge_string_cste): Prototype.
4031         (single_type_import_declaration, yyerror,
4032         variable_redefinition_error, build_array_from_name,
4033         build_unresolved_array_type, check_class_interface_creation,
4034         resolve_class, complete_class_report_errors,
4035         note_possible_classname, read_import_dir,
4036         find_in_imports_on_demand, resolve_package, fix_constructors,
4037         check_deprecation, lookup_method_invoke,
4038         maybe_build_primttype_type_ref, array_constructor_check_entry):
4039         Constify a char*.
4040         (java_complete_expand_methods, java_expand_finals): Make static.
4041         (convert_narrow): Remove static prototype.
4042
4043 Tue Aug  3 20:21:20 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
4044
4045         * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
4046
4047 1999-08-02  Richard Henderson  <rth@cygnus.com>
4048
4049         * decl.c: Include defaults.h instead of expr.h.
4050         * parse.y: Likewise.
4051
4052 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
4053
4054         * java/decl.c (start_java_method): Change all uses of
4055         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
4056         Ensure expr.h is included.
4057         * java/expr.c (pop_arguments): Ditto.
4058         * java/parse.y (expand_start_java_method): Ditto.
4059
4060 1999-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4061
4062         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4063
4064 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
4065
4066         * decl.c: Include "function.h".
4067         * except.c: Likewise.
4068         * parse.y: Likewise.
4069         * Makefile.in: Update dependencies.
4070
4071 1999-07-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4072
4073         * expr.c (build_java_soft_divmod): Provide a default case in switch.
4074         (java_lang_expand_expr): Mark parameters `target', `tmode' and
4075         `modifier' with ATTRIBUTE_UNUSED.
4076
4077         * gjavah.c (process_file): Add braces around ambiguous `else'.
4078
4079         * jcf-dump.c (print_access_flags, localvar_free): Change return
4080         type to void.
4081
4082         * parse.y (java_complete_expand_method): Initialize variable
4083         `exception_copy'.
4084         (resolve_qualified_expression_name): Likewise for `field_decl'.
4085         (patch_method_invocation): Likewise for `class_to_search'.
4086         (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
4087         (patch_assignment): Likewise for `lhs_type'.
4088
4089         * verify.c (verify_jvm_instructions): Remove unused variable
4090         `caller'.
4091
4092 1999-07-25  Richard Henderson  <rth@cygnus.com>
4093
4094         * decl.c (va_list_type_node): New.
4095
4096 1999-07-25  Anthony Green  <green@cygnus.com>
4097
4098         * gjavah.c (print_stub): New function.
4099         (METHOD_IS_NATIVE): New macro.
4100         (print_mangled_classname): Make static.
4101         (HANDLE_END_FIELD): Don't emit fields during stub generation.
4102         (process_file): Perform stub generation.
4103         (HANDLE_METHOD): Don't emit class decls during stub
4104         generation.
4105         (HANDLE_END_METHOD): Take into account stub generation.
4106         (print_method_info): Handle stub generation.
4107         (print_stub): New function.
4108         (print_cxx_classname): Make signature consistant with others.
4109         (help): Describe -stubs option.
4110         (main): Create stub file.
4111         (version): Use version.c.
4112         (print_full_cxx_name): New function.
4113         (print_c_decl): Use print_full_cxx_name.
4114
4115 Thu Jul 22 12:41:12 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4116
4117         * check-init.c (check_init): Handle MAX_EXPR.
4118
4119 1999-07-15  Andrew Haley  <aph@cygnus.com>
4120
4121         * lang.c (flag_use_divide_subroutine): New variable.
4122         * typeck.c: (convert_ieee_real_to_integer): Bounds check
4123         fp-to-integer conversion.
4124         (convert): Call convert_ieee_real_to_integer when flag_fast_math
4125         is not set.
4126
4127         * expr.c (build_java_soft_divmod): New function.
4128         (build_java_binop): Call build_java_soft_divmod if
4129         flag_use_divide_subroutine is set.
4130         * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4131         soft_lrem_node: new builtin functions.
4132         (init_decl_processing) Initialize the new builtins.
4133         * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4134         soft_lrem_node: new builtin functions.
4135         (build_java_soft_divmod): New function.
4136         * parse.y: Call build_java_soft_divmod if
4137         flag_use_divide_subroutine is set.
4138         * parse.c: Rebuilt.
4139
4140         * jvspec.c (lang_specific_driver): Always allow an extra arg (for
4141         a --specs= arg) even if not linking.
4142         * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
4143         -fuse-divide-subroutine
4144
4145 Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4146
4147         * parse.y (resolve_and_layout): Check methods only once.
4148         (resolve_qualified_expression_name): Verify thrown exceptions
4149         compatibility.
4150         (check_thrown_exceptions): Reject exceptions thrown in
4151         initializer. Error message tuned.
4152
4153 1999-07-14  Andrew Haley  <aph@cygnus.com>
4154
4155         * expr.c (expand_expr): Do not return the last statement in a
4156         block as the block's value.
4157
4158 Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4159
4160         * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
4161         CALL_EXPR, to avoid order of evaluation changes.
4162
4163 Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4164
4165         * parse.y (qualify_ambiguous_name): Do not use
4166         IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
4167
4168 Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4169
4170         * check-init.c (check_init): Handle MAX_EXPR.
4171         * expr.c (force_evaluation_order): Force method call arguments to
4172         be evaluated in left-to-right order.
4173         * parse.y (qualify_ambiguous_name): Loop again to qualify
4174         NEW_ARRAY_EXPR properly.
4175
4176 Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4177
4178         * parse.y (patch_invoke): Resolve unresolved invoked method
4179         returned type.
4180         (qualify_ambiguous_name): STRING_CST to qualify expression for
4181         type name resolution.
4182
4183 1999-06-24  Andrew Haley  <aph@cygnus.com>
4184
4185         * class.c (finish_class): Whenever a deferred method is
4186         output, rescan the list of methods to see if a new candidate for
4187         output can be found.
4188
4189 1999-06-28  Tom Tromey  <tromey@cygnus.com>
4190
4191         * jvspec.c (lang_specific_driver): Recognize --help.
4192
4193 Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4194
4195         * parse.y (resolve_package): Fixed bogus return statement.
4196         (patch_method_invocation): Resolve method invocation beginning with
4197         a package name qualifier.
4198
4199 1999-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4200
4201         * Make-lang.in (java.stage1): Depend on stage1-start.
4202         (java.stage2): Likewise for stage2-start.
4203         (java.stage3): Likewise for stage3-start.
4204         (java.stage4): Likewise for stage4-start.
4205
4206 Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4207
4208         * parse.y (java_complete_lhs): When doing cross referencing, don't
4209         try to keep file location on a WFL expanded as a CALL_EXPR.
4210
4211 Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4212
4213         * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
4214         compiling to class file a void method with an empty method body.
4215         As a side effect, the bytecode backend will generate the
4216         appropriate `return' instruction.
4217
4218 Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4219
4220         * parse.y (lookup_package_type_and_set_next): New function prototype.
4221         (resolve_package): Search current and imported packages.
4222         (lookup_package_type_and_set_next): New function.
4223
4224 1999-06-22  Andrew Haley  <aph@cygnus.com>
4225
4226         * verify.c (verify_jvm_instructions): Check for pending blocks
4227         before invalid PC test and opcode switch, not after.
4228
4229 1999-06-21  Andrew Haley  <aph@cygnus.com>
4230
4231         * except.c (find_handler_in_range): The upper limit for exception
4232         ranges is exclusive, not inclusive: (start <= pc < end).
4233         (link_handler): find child pointer which points to outer by
4234         searching sibling list: previous code incorrectly assumed that
4235         outer->outer->first_child must point to outer.
4236         * verify.c (verify_jvm_instructions): FIXME added to code for
4237         `athrow'.
4238         (verify_jvm_instructions): Do not assume that the last block
4239         processed in a subroutine is a block which ends with a `ret'
4240         instruction.  With some control flows it is possible that the last
4241         block ends with an `athrow'.
4242
4243 Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4244
4245         * parse.y (qualify_ambiguous_name): Reorganized the post
4246         evaluation of non WFL leading expression nodes.
4247
4248 Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4249
4250         * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
4251         CONVERT_EXPR.
4252
4253 Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4254
4255         * parse.y (qualify_ambiguous_name): Handle qualified expression
4256         beginning with a STRING_CST.
4257
4258 Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4259
4260         * parse.y (register_fields): Set DECL_INITIAL on both
4261         pre-initialized static and public fields.
4262         (resolve_field_access): Static field access expressions to always
4263         use pointer types.
4264         (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
4265         qualification. CONVERT_EXPR to be resolved as an expression name.
4266         (java_complete_lhs): Identify and access qualified final
4267         initialized field in switch statement case expression.
4268         (fold_constant_for_init): Pre-initialized field decl constant to
4269         be folded.
4270
4271 Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4272
4273         * parse.y (note_possible_classname): Mark returned node with
4274         QUALIFIED_P only if the original class name contained a '/'.
4275
4276 Sat Jun  5 11:46:59 1999  Anthony Green  <green@cygnus.com>
4277
4278         * Make-lang.in (gcjh): More parallel build fixes.
4279
4280 1999-06-03  Mike Stump  <mrs@wrs.com>
4281
4282         * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
4283
4284 Wed Jun  2 10:44:38 1999  Anthony Green  <green@cygnus.com>
4285
4286         * except.c (link_handler): Chain exception handlers in order.
4287
4288 Wed Jun  2 10:41:24 1999  Anthony Green  <green@cygnus.com>
4289
4290         * expr.c (expand_byte_code): Fill unreachable bytecode regions
4291         with nops and process as usual in order to always set correct EH
4292         ranges.  Emit detailed warnings about unreachable bytecodes.
4293
4294 Wed Jun  2 10:35:13 1999  Anthony Green  <green@cygnus.com>
4295
4296         * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
4297         constant.
4298
4299 Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4300
4301         * parse.y (lookup_field_wrapper): Unified returned value to NULL
4302           or the searched field decl.
4303
4304 Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4305
4306         * parse.y (fold_constant_for_init): Convert numerical constant
4307         values to the type of the assigned field.
4308
4309 Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4310
4311         * expr.c (lookup_field): Relaxed the test on class loading error
4312         detection.
4313         * parse.y (fold_constant_for_init): Enabeled old code.
4314
4315 Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4316
4317         * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
4318         decide the validity of the cast of a java.lang.Cloneable reference
4319         to an array.
4320         (patch_conditional_expr): Fixed first argument passed to
4321         binary_numeric_promotion.
4322
4323 Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4324
4325         * parse.y (qualify_ambiguous_name): Take into account that a
4326         CONVERT_EXPR might specify a type as a WFL.
4327
4328 Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4329
4330         * parse.y (patch_assignment): Save the rhs before using it as an
4331         argument to _Jv_CheckArrayStore.
4332
4333 Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4334
4335         * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
4336
4337 Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4338
4339         * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
4340         floating point litteral only when the exponent indicator has been
4341         parsed.
4342
4343 Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4344
4345         * parse.y (formal_parameter:): Construct argument tree list
4346         element even if a yet unsupported final parameter was encountered.
4347
4348 Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4349
4350         * parse.y (finish_method_declaration): Issue errors for native or
4351         abstract methods declared with a method body, as well as for non
4352         native or non abstract methods with no method body.
4353
4354 1999-05-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4355
4356         * class.c (build_utf8_ref): Initialize variable `field'.
4357
4358         * decl.c (init_decl_processing): Initialize variable `field'.
4359
4360         * expr.c (build_known_method_ref): Mark parameters `method_type',
4361         `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
4362         (process_jvm_instruction): Likewise for parameter `length'.
4363
4364         * jvspec.c (lang_specific_driver): Mark variables `saw_math',
4365         `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
4366         ATTRIBUTE_UNUSED.
4367
4368         * parse.y (maybe_generate_clinit): Remove unused variable
4369         `has_non_primitive_fields'.
4370         (find_in_imports_on_demand): Initialize variables `node_to_use'
4371         and `cl'.
4372         (patch_binop): Likewise for variable `prom_type'.
4373         (patch_unaryop): Likewise for variable `prom_type'.
4374
4375         * verify.c (verify_jvm_instructions): Likewise for variable `last'.
4376
4377         * xref.c (xref_table): Add missing initializer.
4378
4379 1999-05-14  Tom Tromey  <tromey@cygnus.com>
4380
4381         * java-except.h (struct eh_range): Removed unused `next' member.
4382         * verify.c (verify_jvm_instructions): Call check_nested_ranges
4383         after adding all exception handlers.  Sort exception ranges in
4384         order of start PC.
4385         (struct pc_index): New structure.
4386         (start_pc_cmp): New function.
4387         * except.c (add_handler): Return `void'.  Don't call link_handler;
4388         instead construct an ordinary linked list and do range
4389         coalescing.
4390         (check_nested_ranges): New function.
4391         (link_handler): Changed interface to allow merging of eh_ranges.
4392         Split overlapping ranges.  Return `void'.
4393
4394 Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4395
4396         * parse.y (constructor_block_end:): New rule, tagged <node>.
4397         (constructor_body:): Use `constructor_block_end' instead of
4398         `block_end'.
4399
4400 Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4401
4402         * parse.y (statement_nsi:): Pop `for' statement block.
4403         (java_complete_lhs): Labeled blocks containing no statement are
4404         marked as completing normally.
4405
4406 Fri May 14 12:31:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4407
4408         * xref.c (xref_set_current_fp): New function, defined.
4409         * xref.h (xref_set_current_fp): New function, prototyped.
4410
4411 Fri May 14 11:57:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4412
4413         * check-init.c (check_init): Take into account that
4414         LABELED_BLOCK_STMT can be empty.
4415
4416 Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4417
4418         * parse.y (java_check_regular_methods): Warning check on not
4419         overriding methods with default access in other packages does not
4420         apply to `<clinit>'.
4421         (java_complete_lhs): If block body is an empty_stmt_node, replace
4422         it by NULL_TREE. This prevents gcc from generating an irrelevant
4423         warning.
4424
4425 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4426
4427         * check-init.c (check_init): Removed code accepting to see things
4428         falling through default:, when doing xrefs.
4429         * java-tree.h (do_not_fold): New global variable, declared.
4430         * parse.y (do_not_fold): New global variable, defined.
4431         (java_complete_expand_method): Set `do_not_fold' to the value of
4432         `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
4433         and reinstall them after them have been purged; do not check for
4434         initializations; do not issue missing return errors.
4435         (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
4436         when doing xrefs.
4437         (patch_binop): Skip the fold part when doing xrefs.
4438         (build_string_concatenation): Skip the concatenation part when
4439         doing xrefs.
4440         (patch_synchronized_statement): Do not generate a try-finally when
4441         doing xrefs.
4442         (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
4443         and keep the location where the throw was seen.
4444         * typeck.c (convert): When `do_not_fold' is set, do not attempt
4445         any treatment on the converted node an simply return a NOP_EXPR of
4446         the targeted type.
4447         * xref.c (xref_get_data): New function, defined.
4448         * xref.h (xref_get_data): New function, declared.
4449         (XREF_GET_DATA): Use xref_get_data.
4450
4451 1999-05-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4452
4453         * gjavah.c (print_include): Cast the result of `strlen' to int
4454         when comparing against a signed value.
4455         (add_namelet): Likewise.
4456
4457 1999-05-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4458
4459         * expr.c (expand_invoke): Mark parameter `nargs' with
4460         ATTRIBUTE_UNUSED.
4461         (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
4462
4463         * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
4464         ATTRIBUTE_UNUSED.
4465
4466         * jcf-reader.c (get_attribute): Cast a value to long
4467         when comparing against a signed expression.  Likewise.
4468
4469         * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
4470         HOST_BITS_PER_CHAR.
4471
4472 1999-05-11  Andrew Haley  <aph@cygnus.com>
4473
4474         * parse.y (source_end_java_method): If the current method contains
4475         any exception handlers, force asynchronous_exceptions: this is
4476         necessary because signal handlers in libjava may throw exceptions.
4477         * decl.c (end_java_method): Ditto.
4478
4479 1999-05-11  Tom Tromey  <tromey@cygnus.com>
4480
4481         * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
4482         flags.
4483         * jvspec.c (THREAD_NAME): Removed.
4484         (GC_NAME): Likewise.
4485         (MATHLIB): Likewise.
4486         (WITHLIBC): Likewise.
4487         (GCLIB): Likewise.
4488         (THREADLIB): Likewise.
4489         (MATH_LIBRARY): Likewise.
4490         (lang_specific_driver): Don't add `-l' options to command line.
4491         Instead, add a single --specs option.  Recognize `-L' options and
4492         use them to search for spec file.
4493         (find_spec_file): New function.
4494         (SPEC_FILE): New define.
4495
4496 Tue May 11 11:46:36 1999  Dave Brolley  <brolley@cygnus.com>
4497
4498         * lang-options.h: -MD, -MMD, -M and -MM not needed here for
4499         cpplib-enabled build.
4500
4501 1999-05-05  Per Bothner  <bothner@cygnus.com>
4502
4503         * class.c (make_field_value):  DECL_INITIAL may be a string literal;
4504         temporarily zero it while calling rest_of_decl_compilation.
4505
4506         * java-tree.h (string_ptr_type_node):  Add declaration.
4507         * decl.c:  Define and initialize string_ptr_type_node.
4508         * parse.y (patch_string_cst):  Use string_ptr_type_node.
4509
4510         * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
4511         * parse.y (for_statement):  Now unconditionally exit_block.
4512         (finish_labeled_statement):  No longer exit_block if for-loop.
4513         (patch_loop_statement):  Check harder if the loop is already labeled.
4514
4515         * parse.y (patch_initialized_static_field):  Removed function.
4516         (maybe_generate_clinit):  Removed special handling for interfaces.
4517         (java_complete_expand_methods):  Do a preliminary java_complete_tree
4518         on <clinit> to determine if it can be removed.
4519         (java_complete_expand_method):  Remove special handling for <clinit>.
4520         (java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
4521         optimize if we get back empty_stmt_node.
4522         For MODIFY_EXPR, re-do checking of static initializers.
4523         (fold_constant_for_init):  Don't return immediate if VAR_DECL.
4524         For VAR_DECL, pass correct context.
4525
4526         * verify.c (verify_jvm_instructions):  Better error messages.
4527
4528 1999-05-03  Tom Tromey  <tromey@cygnus.com>
4529
4530         * parse-scan.y (interface_declaration): Call
4531         report_class_declaration for interfaces.
4532
4533 1999-04-30 20:54 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
4534
4535         * Makefile.in: Remove -v from bison command lines.
4536
4537 Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4538
4539         * check-init.c (check_init): Exclude a case of error when doing
4540         xrefs.
4541         * class.c (layout_class_method): Don't generate the error message
4542         twice when compiling from source.
4543         * lang-options.h: Added `-Wredundant-modifers' and
4544         `-Wunusupported-jdk11' flags and help text.
4545         * lang.c (lang_decode_option): Added support for
4546         `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
4547         flag_static_local_jdk11 and flag_redundant set accordingly.
4548         * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
4549         * parse.h (EXPR_WFL_ADD_COL): New macro.
4550         (DECL_END_SOURCE_LINE): Likewise.
4551         (DECL_INHERITED_SOURCE_LINE): Likewise.
4552         * parse.y (static_ref_err): New function, prototyped.
4553         (CCB_TK): Now tagged <operator>.
4554         (class_body:): Remember the location of the closing '}' of a class
4555         definition when doing xrefs.
4556         (block:): Likewise.
4557         (block_end:): Likewise.
4558         (create_class): Remember the location of the inherited class
4559         identifier when doing xrefs.
4560         (register_fields): Added test on first operand of `init' before
4561         testing it TREE_CODE.
4562         (method_header): Store the location of the class identifier in the
4563         class decl when doing xrefs.
4564         (finish_method_declaration): Don't combine first/last method line
4565         when doing xref.
4566         (java_check_regular_methods): Warning check on not overriding
4567         methods with default access on other packages move before check on
4568         static methods. Initialization of `aflags' also moved up.
4569         (resolve_expression_name): Call static_ref_err to report the error.
4570         (static_ref_err): New function, implemented.
4571         (resolve_field_access): Returned simplified static field access
4572         when doing xrefs.
4573         (resolve_qualified_expression_name): Check for illegal use of
4574         static fields in a non static context. Call static_ref_err to
4575         report error in various places.
4576         (java_complete_tree): Do not fold initialized static fields when
4577         doing xrefs.
4578         (java_complete_lhs): Likewise.
4579
4580 1999-04-29  Anthony Green  <green@cygnus.com>
4581
4582         * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
4583         create internal labels.
4584         (lookup_label): Ditto.
4585
4586 Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4587
4588         * class.c (layout_class_method): Generate <clinit>'s rtl for
4589         interfaces.
4590         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
4591         for interfaces' <clinit>.
4592         * expr.c (lookup_field): Search for fields in interfaces.
4593         (expand_invoke): Fixed indentation.
4594         (expand_java_field_op): Likewise. Use IS_CLINIT.
4595         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
4596         (IS_CLINIT): New macro.
4597         * parse.y (type_declaration:): Call maybe_generate_clinit after an
4598         interface was parsed.
4599         (maybe_generate_clinit): Don't generate if the current class is an
4600         interface with only fields of primitive types.
4601         (reset_method_name): Use IS_CLINIT.
4602         (java_complete_expand_method): Expand <clinit> when it exists for
4603         interfaces. Use IS_CLINIT.
4604         (resolve_expression_name): Use DECL_CONTEXT instead of
4605         current_class to build static field references.
4606         (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
4607         ARRAY_REF when doing xreferencing.
4608         (check_final_assignment): Fixed typo in leading comment. Use
4609         IS_CLINIT.
4610         (patch_array_ref): Don't fully expand array references when
4611         xreferencing.
4612         (patch_return): Use IS_CLINIT.
4613         (patch_throw_statement): Likewise.
4614
4615 1999-04-22  Tom Tromey  <tromey@cygnus.com>
4616
4617         * Make-lang.in (JAVA_SRCS): Added check-init.c.
4618
4619 Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4620
4621         * decl.c (predef_filenames, predef_filenames_size): New globals
4622         (init_decl_processing): predef_filenames and predef_filenames_size
4623         initialized.
4624         * java-tree.h (predef_filenames, predef_filenames_size): Declared
4625         extern.
4626         * jcf-parse.c (predefined_filename_p): New function.
4627         (yyparse): Check that files on the command line are specified only
4628         once and issue a warning otherwise.
4629         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
4630         * parse.y (source_end_java_method): Nullify NOP method bodies, to
4631         avoid a gcc warning with -W -Wall turned on.
4632         (java_expand_classes): Abort if errors were encountered.
4633         (java_complete_lhs): If the cross reference flag is set, wrap
4634         field DECL node around a WFL when resolving expression name.
4635
4636 Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4637
4638         * lang.c (lang_decode_option): Fixed returned value when parsing
4639         `-fxref=...' and `-Wall'.
4640         * parse.y (source_end_java_method): Do not generate code when
4641         flag_emit_xref is set.
4642         (resolve_expression_name): Do not build static field access when
4643         flag_emit_xref is set.
4644         (resolve_field_access): No special treatment on `length' when
4645         flag_emit_xref is set. Do not build qualified static field access
4646         when flag_emit_xref is set.
4647         (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
4648         when flag_emit_xref is set.
4649         (patch_assignment): Do not generate array store runtime check when
4650         flag_emit_xref is set.
4651         * xref.c (xref_flag_value): Fixed function declaration
4652         indentation.
4653         (xset_set_data): New function.
4654         * xref.h (xref_set_data): Added prototype for new function.
4655         (typedef struct xref_flag_table): New field data.
4656         (XREF_GET_DATA): New macro.
4657
4658 1999-04-19  Tom Tromey  <tromey@cygnus.com>
4659
4660         * xref.h (enum): Removed trailing comma.
4661
4662         * parse.y (resolve_qualified_expression_name): Added missing
4663         `break'.
4664
4665 Thu Apr 15 13:08:03 1999  Anthony Green  <green@cygnus.com>
4666
4667         * gjavah.c: New prototypes for java_float_finite and
4668         java_double_finite.
4669
4670 Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4671
4672         * parse.y (patch_unaryop): Fixed ++/-- operator check on array
4673         references.
4674
4675 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
4676
4677         * Makefile.in (TREE_H): Add tree-check.h.
4678         (RTL_H): Add genrtl.h.
4679
4680 Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4681
4682         * parse.y (patch_assignment): Added ArrayStoreException runtime
4683         check.
4684
4685 1999-04-06  Per Bothner  <bothner@cygnus.com>
4686
4687         * expr.c (pop_type_0):  New function.
4688         (pop_type):  Use pop_type_0.
4689         * java-tree.h (pop_type_0):  New declaration.
4690         * verify.c (verify_jvm_instructions):  Check return instructions.
4691
4692         * parse.y (patch_binop):  Don't fold if non-constant and emiting
4693         class files.
4694
4695 Mon Apr  5 16:06:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4696
4697         * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
4698
4699         * gjavah.c: Include math.h earlier.  Include tree.h/java-tree.h.
4700         (main_jcf): Don't define.
4701         (process_file): Don't set `main_jcf'.
4702
4703         * java-tree.h (main_jcf): Don't declare.
4704
4705         * jcf-parse.c (main_jcf): Add static definition.
4706
4707         * lang.c (main_jcf): Don't define.
4708
4709 Mon Apr  5 15:43:51 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4710
4711         * class.c (add_method_1): Cast the argument of `bzero' to PTR.
4712
4713         * decl.c (copy_lang_decl): Likewise for `bcopy'.
4714
4715         * jcf-depend.c: Include "config.h", not <config.h>.
4716
4717         * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
4718         `bcopy' to PTR.
4719
4720         * jcf-path.c: Include "config.h", not <config.h>.
4721
4722         * lex.c: Don't include various system header files.
4723         (java_init_lex): Cast the argument of `bzero' to PTR
4724
4725         * parse-scan.y (java_push_parser_context): Likewise.
4726
4727         * parse.y (java_push_parser_context): Likewise.
4728         (patch_bc_statement): Match format specifier to variable argument.
4729
4730         * xref.c: Don't include <stdio.h>.
4731
4732 Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4733
4734         * parse.y (struct parser_ctxt *ctxp): Now global.
4735         (declare_local_variables): Use WFL compound value for the
4736         declaration source line value, when doing cross-referencing.
4737
4738 1999-03-31  Tom Tromey  <tromey@cygnus.com>
4739
4740         * gjavah.c (print_field_info): Allow constants of other types.
4741         (print_include): Generate include when new name is proper prefix
4742         of already printed name.
4743         (add_namelet): Likewise.
4744         (cxx_keyword_subst): New function.
4745         (print_method_info): Use it.
4746         (print_field_name): New function.
4747         (get_field_name): New function.
4748         (print_field_info): Use get_field_name and print_field_name.
4749
4750 Wed Mar 31 11:00:32 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4751
4752         * Makefile.in (keyword.h): Generate using gperf language 'C', not
4753         'KR-C', so gperf uses the `const' keyword on strings.
4754
4755         * keyword.gperf (java_keyword): Const-ify a char*.
4756
4757 Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4758
4759         * parse.y (patch_bc_statement): Fixed identation and a bogus
4760         `printf' format.
4761
4762 Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4763
4764         * parse.y (patch_assignment): Allow static variables in other
4765         classes to be assigned.
4766
4767 Sun Mar 28 22:12:10 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4768
4769         * class.c (maybe_add_interface): Remove unused variable
4770         `interface_binfo'.
4771         (make_class_data): Use = for assignment, not ==.  Likewise.
4772         (emit_register_classes): Remove unused variable `decl'.
4773
4774         * lex.c: Fix comment so as not to contain an embedded `/*'.
4775
4776         * verify.c (verify_jvm_instructions): Remove unused variable
4777         `self_type'.
4778
4779 Sat Mar 27 15:49:18 1999  Per Bothner  <bothner@cygnus.com>
4780
4781         * parse.y (complete_loop_body):  Rename to finish_loop_body.
4782         (complete_labeled_statement):  Rename to finish_labeled_statement.
4783         (complete_for_loop):  Rename to finish_for_loop.
4784         (complete_method_declaration):  Rename to finish_method_declaration.
4785
4786         * java-tree.h (continue_identifier_node):  New global node.
4787         * decl.c:  Define and initialize continue_identifier_node.
4788         * parse.y (generate_labeled_block):  Remove - no longer needed.
4789         (build_loop_body):  Use continue_identifier_node for continue block.
4790         (finish_labeled_statement):  Also do pop_labeled_block actions.
4791         (java_complete_lhs):  POP_LOOP even if error.
4792         (build_labeled_block):  Special handling for continue_identifier_node.
4793         (patch_loop_statement):  Re-organize.
4794         (patch_bc_statement):  Re-write.
4795
4796 Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4797
4798         * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
4799         using a WFL compound value.
4800         * parse.y (xref.h): Include.
4801         (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
4802         WFL compound value.
4803         (register_fields): Set WFL compound value to lineno if doing
4804         xrefs.
4805         (java_complete_expand_method): Call expand_xref if flag_emit_xref
4806         is set.
4807         * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
4808         * xref.h (expand_xref): Prototype renamed from xref_generate.
4809
4810 Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4811
4812         * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
4813         (GET_CURRENT_BLOCK): New macro.
4814         * parse.y (current_static_block): New global variable.
4815         (method_body:): Define action.
4816         (complete_method_declaration): Set current_function_decl to NULL
4817         when work on the current method is done.
4818         (declare_local_variables): Use GET_CURRENT_BLOCK.
4819         (java_method_add_stmt): Likewise.
4820         (java_complete_expand_method): Disable the use of `this' when
4821         expanding <clinit>.
4822         (enter_a_block): If no current method exist, use
4823         current_static_block to link static initializer blocks.
4824         (exit_block): Rewritten to use current_static_block when no current
4825         method decl exists.
4826         (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
4827         (patch_return): Forbid the use of `return' in static initializers.
4828         (patch_throw_statement): Fixed indentation. Issue specific error
4829         for uncaught thrown checked exception in static initializer
4830         blocks. Removed FIXME.
4831
4832 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
4833
4834         * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
4835         Link gcj from gcc.o.
4836
4837 Tue Mar 23 10:48:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4838
4839         * parse.y (find_applicable_accessible_methods_list): When dealing
4840         with interface: ensure that a given interface or java.lang.Object
4841         are searched only once.
4842
4843 Tue Mar 23 10:05:27 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4844
4845         * gjavah.c (print_c_decl): Remove unused argument `flags'.
4846
4847         * jcf-dump.c (print_access_flags): Add braces around if-else.
4848
4849         * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
4850         COMBINE_INPUTS.
4851
4852         * lex.c (build_wfl_node): Add static prototype.
4853
4854         * lex.h (build_wfl_node): Remove static prototype.
4855
4856         * parse.y: Include lex.c early enough to declare everything needed.
4857         Ensure calls to `build_wfl_node' pass the proper arguments.
4858         (create_class): Remove unused variable `super_decl'.
4859         (get_printable_method_name): Initialize variable `name'.
4860
4861 Mon Mar 22 20:14:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4862
4863         * Changelog: Fixed 1999-03-22 typos.
4864         * lang.c (lang_decode_option): Fixed typo in error string in the
4865         XARG section.
4866
4867 1999-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4868
4869         * Makefile.in (JAVA_OBJS): Added entry xref.o.
4870         (xref.o): New rule.
4871         * java-tree.h (flag_emit_xref): Declared extern.
4872         * lang.c (xref.h): Included.
4873         (flag_emit_xref): New global variable.
4874         (lang_decode_option): Added support for -fxref.
4875         * xref.c: Created.
4876         * xref.h: Likewise.
4877
4878 1999-03-21  Manfred Hollstein  <manfred@s-direktnet.de>
4879
4880         * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
4881         linked with.
4882
4883 Sun Mar 21 08:30:30 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4884
4885         * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
4886         $(srcdir)/../system.h and $(JAVA_TREE_H).
4887         (jcf-io.o): Depend on $(JAVA_TREE_H).
4888         (mangle.o): Likewise.
4889
4890         * check-init.c (check_cond_init): Add static prototype.
4891
4892         * class.c (build_java_method_type, hashUtf8String,
4893         make_field_value, get_dispatch_vector, get_dispatch_table,
4894         append_gpp_mangled_type, mangle_static_field): Likewise.
4895         (strLengthUtf8): Hide unused definition.
4896         (hashUtf8String): Const-ify.
4897         (make_field_value): Un-ANSI-fy.
4898
4899         * constants.c: Move inclusion of jcf.h above java-tree.h.
4900         (set_constant_entry, find_class_or_string_constant,
4901         find_name_and_type_constant, get_tag_node,
4902         build_constant_data_ref): Add static prototype.
4903
4904         * decl.c (push_jvm_slot, builtin_function,
4905         lookup_name_current_level): Likewise.
4906         (builtin_function): Const-ify.
4907
4908         * except.c (expand_start_java_handler, expand_end_java_handler):
4909         Add static prototype.
4910
4911         * expr.c (flush_quick_stack, push_value, pop_value,
4912         java_stack_swap, java_stack_dup, build_java_athrow,
4913         build_java_jsr, build_java_ret, expand_java_multianewarray,
4914         expand_java_arraystore, expand_java_arrayload,
4915         expand_java_array_length, build_java_monitor, expand_java_pushc,
4916         expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
4917         expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
4918         expand_compare, expand_test, expand_cond, expand_java_goto,
4919         expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
4920         expand_java_field_op, java_push_constant_from_pool): Likewise.
4921
4922         (decode_newarray_type, expand_iinc): Un-ANSI-fy.
4923         (build_java_arraynull_check): Mark parameters `node' and `type'
4924         with ATTRIBUTE_UNUSED.
4925         (note_label): Likewise for parameter `current_pc'.
4926         (expand_java_call, expand_java_ret): Hide unused definition.
4927
4928         * java-tree.h (make_class, build_constants_constructor,
4929         java_set_exception_lang_code, pop_labeled_block, emit_handlers,
4930         init_outgoing_cpool, register_class, emit_register_classes,
4931         java_layout_seen_class_methods): Prototype.
4932         (unicode_mangling_length): Const-ify.
4933         (append_gpp_mangled_name, append_gpp_mangled_classtype,
4934         emit_unicode_mangled_name, format_int, format_uint,
4935         jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
4936         jcf_print_utf8_replace, open_class): Prototype.
4937
4938         * jcf-dump.c: Include "config.h", not <config.h>.  Don't include
4939         <stdio.h>.  Include tree.h/java-tree.h.
4940         (utf8_equal_string usage, process_class): Add static prototype.
4941         (open_class): Don't prototype this here.
4942         (utf8_equal_string): Match arguments to format specifiers.
4943         (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
4944         TABLE_SWITCH, disassemble_method): Likewise.
4945
4946         * jcf-io.c: Include tree.h/java-tree.h.
4947         (open_class, find_classfile, jcf_print_utf8,
4948         jcf_print_utf8_replace): Const-ify.
4949
4950         * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
4951         parse_class_file): Add static prototype.
4952         (find_in_current_zip): Match definition to existing static
4953         prototype.
4954
4955         * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
4956         (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
4957         finish_jcf_block, define_jcf_label, get_jcf_label_here,
4958         put_linenumber, localvar_alloc, localvar_free, get_access_flags,
4959         write_chunks, adjust_typed_op, generate_bytecode_conditional,
4960         generate_bytecode_return, perform_relocations, init_jcf_state,
4961         init_jcf_method, release_jcf_state, generate_classfile):
4962         Add static prototype.
4963         (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
4964         (make_class_file_name): Const-ify.
4965
4966         * jcf.h (find_classfile): Const-ify.
4967
4968         * jv-scan.c (reset_report): Remove prototype.
4969
4970         * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
4971         (error): Rewrite to allow varargs.
4972
4973         * lang.c (lang_f_options): Const-ify.
4974
4975         * lex.c (java_parse_escape_sequence): Add static prototype.
4976         (java_allocate_new_line): Match definition to existing static
4977         prototype.
4978
4979         * mangle.c Include tree.h/java-tree.h.
4980         (unicode_mangling_length, emit_unicode_mangled_name,
4981         append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
4982
4983         * parse.h (jdep_code): Remove trailing comma in enumeration.
4984         (java_get_line_col): Move prototype outside of !JC1_LITE test.
4985         (reset_report): Add prototype.
4986
4987         * verify.c (push_pending_label, merge_types): Add static
4988         prototypes.
4989
4990         * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
4991
4992 1999-03-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4993
4994         * parse.y (find_applicable_accessible_methods_list): Extend the
4995         search to superinterfaces when relevant.
4996         (search_applicable_methods_list): New function.
4997
4998 1999-03-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4999
5000         * class.c (unmangle_classname): Implemented stricter testing
5001         before setting the QUALIFIED_P flag on an identifier.
5002
5003 Tue Mar 16 15:15:41 1999  Per Bothner  <bothner@cygnus.com>
5004
5005         * parse.y (java_complete_lhs):  Call force_evaluation_order
5006         after patch_newarray.
5007         (patch_binop):  Don't call fold if there are side effects.
5008
5009 1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5010
5011         * parse.y (java_stabilize_reference): Use save_expr instead of
5012         building a SAVE_EXPR node.
5013         (java_complete_lhs): Patch the resulting string of the `+='
5014         operator (if necessary) and complete the RHS after having built
5015         the cast.
5016
5017 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
5018
5019         * class.c (make_class):  Don't set CLASS_P here (because
5020         this function is also called by build_java_array_type).
5021         (push_class):  Set CLASS_P here instead.
5022         * parse.h (TYPE_CLASS_P):  Check for TYPE_ARRAY_P is redundant.
5023
5024         * jcf-dump.c (print_access_flags):  Take extra parameter to indicate
5025         context.  If the context is class, perfer "super" over "synchronized".
5026         * jcf-write.c (generate_classfile):  Don't add ACC_SUPER if interface.
5027
5028         * parse.y (create_class):  Don't call parser_check_super here;
5029         it is not robust.  Always wait until later.
5030
5031         * parse.y (method_header):  For interfaces, set ACC_ABSTRACT (to
5032         match what JDK 1.2 does), but don't set ACC_PUBLIC.
5033
5034 Sat Mar 13 18:16:34 1999  Per Bothner  <bothner@cygnus.com>
5035
5036         * lex.c (java_read_char):  UNGET invalid non-initial utf8 character.
5037         * lex.h (UNGETC):  Change misleading macro.
5038
5039 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5040
5041         * parse.y (java_stabilize_reference): Return NODE when patching a
5042         COMPOUND_EXPR.
5043         (java_complete_lhs): Put parenthesis around truth values.
5044
5045 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5046
5047         * class.c (layout_class_method): Don't make rtl for interface
5048         methods.
5049         * parse.h (GET_TYPE_NAME): New macro.
5050         * parse.y (if_then_statement:): Fixed indentation.
5051         (if_then_else_statement:): Likewise.
5052         (for_statement:): Fixed spacing.
5053         (try_statement:): Fixed indentation.
5054         (create_interface): Don't force interfaces to be abstract.
5055         (method_header): Abstract methods are OK in interfaces.
5056         (declare_local_variables): Fixed typo in comment.
5057         (java_complete_expand_method): Fixed indentation.
5058         (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
5059         non accessible fields.
5060         (java_stabilize_reference): New function.
5061         (java_complete_lhs): Fixed indentation. Use
5062         java_stabilize_reference in compound assignement. Insert the
5063         cast. If not processing `+' fix string constants before processing
5064         binop.
5065
5066 Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5067
5068         * constants.c (find_class_or_string_constant): Cast variable `j'
5069         to a `jword' when comparing against one.
5070
5071         * expr.c (java_lang_expand_expr): Remove unused variables
5072         `has_finally_p' and `op0'.
5073
5074         * gjavah.c (print_field_info): Cast a value to jint when comparing
5075         against one.  Likewise for a jlong.
5076         (add_namelet): Likewise cast a `sizeof' to an int when comparing
5077         against a signed quantity.
5078
5079         * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
5080         (print_signature): Don't needlessly dereference variable `str'
5081
5082         * jcf-reader.c (get_attribute): Mark variables `max_stack' and
5083         `max_locals' with ATTRIBUTE_UNUSED.
5084         (jcf_parse_class): Likewise for variable `index'.
5085
5086         * parse.h (reverse_jdep_list): Remove static prototype.
5087
5088         * parse.y (build_jump_to_finally): Remove prototype and definition.
5089         (reverse_jdep_list): Add static prototype.
5090
5091         * typeck.c (convert_ieee_real_to_integer): Remove unused variables
5092         `assignment' and `expr_decl'.
5093
5094         * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
5095
5096 1999-03-12  Andrew Haley  <aph@cygnus.com>
5097
5098         * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
5099         we'll need a directory separator and a null character.
5100
5101 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
5102
5103         * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
5104
5105   Tue Mar  9 11:52:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5106
5107         * parse.y (method_header): Don't set ACC_ABSTRACT flags on
5108         interfaces.
5109
5110 Fri Mar  5 15:17:29 1999  Per Bothner  <bothner@cygnus.com>
5111
5112         * lex.c (java_parse_end_comment):  Take extra parameter (next char).
5113
5114         * class.c (build_utf8_ref):  Fix possible name class/ambiguity.
5115
5116         * class.c (layout_class_method):  A static method in a base class
5117         is never overridden, so treat it like it doesn't exist.
5118         However, do complain about private non-static method overriding
5119         public static method.
5120
5121         * parse.y:  Don't set unused INITIALIZED_P flag.
5122         * java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
5123
5124         * parse.y (find_expr_with_wfl):  Optimize tail-calls.
5125         (build_array_from_name):  Re-order &index[string] to &string[index].
5126
5127         * parse.y (java_complete_lhs):  Don't call patch_assignment if rhs is
5128         error_mark (it might catch more errors, but it is more likely to lose).
5129
5130 Sat Mar  6 11:17:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5131
5132         * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
5133         (parse-scan.o): Depend on toplev.h.
5134
5135         * class.c (make_method_value): Add prototype.  Make it static.
5136         Remove unused second argument, caller changed.
5137
5138         * expr.c (java_lang_expand_expr): Remove unused variable
5139         `return_label'.
5140
5141         * java-tree.h: Don't prototype find_in_current_zip.
5142         Add prototypes for verify_constant_pool, start_java_method,
5143         end_java_method, give_name_to_locals, expand_byte_code,
5144         open_in_zip, set_constant_value, find_constant1, find_constant2,
5145         find_utf8_constant, find_string_constant, find_class_constant,
5146         find_fieldref_index, find_methodref_index, write_constant_pool,
5147         count_constant_pool_bytes and encode_newarray_type.
5148
5149         * jcf-dump.c: Remove unused variable `LONG_temp'.
5150
5151         * jcf-parse.c: Include parse.h.
5152         (jcf_parse_source): Remove unused parameter, all callers changed.
5153         (jcf_figure_file_type): Add static prototype.
5154         (find_in_current_zip): Likewise.  Also remove unused parameter,
5155         all callers changed.
5156         (read_class): Initialize variable `saved_pos'.
5157
5158         * jcf-reader.c (jcf_parse_preamble): Mark variables
5159         `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
5160
5161         * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
5162         (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
5163         (java_parse_doc_section): Initialize variable `seen_star'.
5164         (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
5165         (java_lex_error): Mark parameters `msg' and `forward' with
5166         ATTRIBUTE_UNUSED.
5167         (java_get_line_col): Mark parameters `filename' and `line' with
5168         ATTRIBUTE_UNUSED.
5169
5170         * parse-scan.y: Include toplev.h.
5171         (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
5172
5173         * parse.h: use `struct JCF', not plain `JCF'.
5174         (java_parser_context_save_global, java_expand_classes
5175         java_parser_context_restore_global, java_parse): Add prototypes.
5176
5177         * typeck.c (convert_ieee_real_to_integer): Remove unused variable
5178         `node'.
5179
5180 Wed Feb 24 16:13:59 1999  Per Bothner  <bothner@deneb.cygnus.com>
5181
5182         *  check-init.c (check_init):  COPYN takes word count, not bit count.
5183
5184 Fri Feb 26 14:06:21 1999  Per Bothner  <bothner@cygnus.com>
5185
5186         * typeck.c (convert_ieee_real_to_integer):  Use save_expr instead of
5187         explicit build_decl.  (Avoids crash in reload when optimizing.)
5188
5189 Thu Feb 25 21:05:04 1999  Per Bothner  <bothner@cygnus.com>
5190
5191         * decl.c (complete_start_java_method):  Handle synchronized method
5192         even when compiling from bytecode.
5193
5194 1999-02-26  Tom Tromey  <tromey@cygnus.com>
5195
5196         * gjavah.c (add_class_decl): Only generate `#include' if outer
5197         class is not the name of the class we are processing.  Correctly
5198         append `.h' in #include.
5199         (process_file): Clean up newlines around generated `#include's.
5200         (decode_signature_piece): Correctly handle inner classes.
5201         (struct include): New structure.
5202         (all_includes): New global.
5203         (print_include): New function.
5204         (add_class_decl): Use it.
5205         (process_file): Likewise.
5206         (add_class_decl): Generate include for java-array.h if array
5207         seen.
5208         (process_file): Don't generate java-array.h include.
5209
5210         * gjavah.c (add_namelet): Check for standard package names here.
5211         (add_class_decl): Don't check for standard package names here.
5212
5213 1999-02-25  Tom Tromey  <tromey@cygnus.com>
5214
5215         * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
5216         When reading a zip file, only use strncmp if both strings are
5217         bigger than the buffer length.  Initialize `k' when looping
5218         through zip file.
5219
5220 1999-02-24  Tom Tromey  <tromey@cygnus.com>
5221
5222         * gjavah.c (struct namelet): New structure.
5223         (add_namelet): New function.
5224         (print_namelet): New function.
5225         (print_class_decls): Use add_namelet and print_namelet to generate
5226         namespaces and not classes.
5227         (method_printed): New global.
5228         (HANDLE_END_METHOD): Examine method_printed.
5229         (print_method_info): Set method_printed when required.  Print
5230         error if function to be ignored is marked virtual.  Handle $finit$
5231         method.
5232         (METHOD_IS_FINAL): New macro.
5233         (print_field_info): Use it.
5234         (HANDLE_METHOD): Clear method_printed.
5235         (method_pass): New global.
5236         (HANDLE_END_FIELD): Call add_class_decl on the first pass.
5237         (process_file): Do two passes over both fields and methods.
5238         (HANDLE_METHOD): Examine method_pass.
5239         (root): New global.
5240         (add_class_decl): New function.
5241         (print_class_decls): Don't scan over entire constant pool.
5242
5243 1999-02-23  Tom Tromey  <tromey@cygnus.com>
5244
5245         * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
5246         disable linking in that case.
5247
5248 1999-02-20  Tom Tromey  <tromey@cygnus.com>
5249
5250         * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
5251         not 0x1f.
5252
5253 Sun Feb 21 14:56:11 1999  Per Bothner  <bothner@cygnus.com>
5254
5255         * decl.c (build_result_decl), java-tree.h:  New method.
5256         (complete_start_java_method):  Handle synchronized methods.
5257         Don't build DECL_RESULT here.  (Ordering dependency problem.)
5258         (start_java_method):  Call build_result_decl here instead  ...
5259         * parse.y (java_complete_expand_method):  ... and here.
5260         (expand_start_java_method): Don't call complete_start_java_method here.
5261         (java_complete_expand_method):  Call it here instead.
5262         * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
5263         * java-tree.h:  ... here.
5264
5265         * expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
5266         * parse.y (java_complete_lhs):  Don't call force_evaluation_order
5267         for ARRAY_REF - it doesn't work when array bounds are checked.
5268         (patch_array_ref):  Handle it here instead.
5269
5270         * jcf-write.c (generate_classfile):  Emit "Exceptions" attribute.
5271
5272 Fri Feb 19 15:35:01 1999  Per Bothner  <bothner@cygnus.com>
5273
5274         Force left-to-right evaluation of binary operations etc.
5275         * expr.c (force_evaluation_order), java-tree.h:  New function.
5276         * parse.y (java_complete_lhs):  Pass binary operations, procedure
5277         calls, and ARRAY_REFs to force_evaluation_order.
5278         (various):  Set TREE_SIDE_EFFECTS more carefully.
5279
5280         Tolerate random (non-UTF8) encoding in comments without complaining.
5281         * lex.c (java_read_char):  Return 0xFFFE if bad UTF8 encoding.
5282         (java_is_eol):  Handle '\r' followed by '\n' instead of vice versa.
5283
5284         * parse.y (resolve_qualified_expression_name):  Handle error_mark.
5285         (java_complete_node case EXPR_WITH_FILE_LOCATION):  Likewise.
5286
5287         * parse.y (java_complete_lhs):  Ignore an empty statement in a
5288         COMPOUND_EXPR.  Don't complain about empty statement after return.
5289
5290 Fri Feb 19 13:00:56 1999  Per Bothner  <bothner@cygnus.com>
5291
5292         * parse.y (obtain_incomplete_type):  Don't wrap unknown types
5293         in TREE_LIST - just chain the POINTER_TYPEs together.
5294         (resolve_class):  If type already resolved, return decl.
5295         After resolving, update TREE_TYPE(class_type), and name (if array).
5296         * parse.h (do_resolve_class), parse.y:  Make non-static.
5297         * class.c (maybe_layout_super_class):  Take this_class argument.
5298         Do do_resolve_class if necessary.
5299         (layout_class, layout_class_methods): Adjust calls appropriately.
5300         * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
5301         JDEP_RESOLVED_P):  Redefined for new TREE_LIST-less convention.
5302         * typeck.c (build_java_array_type):  Don't call layout_class.
5303
5304 Wed Feb 17 15:47:20 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5305
5306         * parse.y (check_pkg_class_access): Allow private class access
5307         within the same package.
5308         (strip_out_static_field_access_decl): New function.
5309         (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
5310         operator argument before testing its nature.
5311
5312 Wed Feb  3 12:38:43 1999  Per Bothner  <bothner@cygnus.com>
5313
5314         * java-tree.def (FINALLY_EXPR):  Removed.  (Now uses TRY_FINALLY_EXPR.)
5315         (TRY_EXPR):  Simplify - it no longer has a finally clause.
5316         * check-init.c (check_init):  Handle TRY_FINALLY_EXPR.
5317         Simpler handling of TRY_EXPR, which no longer has a finally clause.
5318         * expr.c (java_lang_expand_expr):  Likewise.
5319         * java-tree.h (CATCH_EXPR_GET_EXPR):  Removed - no longer needed.
5320         * parse.h (java_get_catch_block), parse.y:  Removed - no longer needed.
5321         * parse.y (java_complete_lhs):  Add support for TRY_FIANLLY_EXPR.
5322         (build_try_statement):  Remove finally parameter and handling.
5323         (build_try_finally_statement):  New function.
5324         (patch_try_statement):   No longer need to support finally clause.
5325         (try_statement):  Update grammar action rules.
5326         * jcf-write.c (generate_bytecode_insns):  Handle TRY_FINALLY_EXPR.
5327         Simpler handling of TRY_EXPR, which no longer has a finally clause.
5328
5329 1998-11-26  Andrew Haley  <aph@viagra.cygnus.co.uk>
5330
5331         * jcf-parse.c (get_constant): Add braces around computation of 'd'
5332         when REAL_ARITHMETIC is not defined.  [Oct 26 fix got overwritten -PB]
5333
5334 1999-02-17  Andrew Haley  <aph@cygnus.com>
5335
5336         * class.c (build_utf8_ref): Back out broken patch which was
5337         intended to to output signatures using '.' as a separator.
5338
5339         * class.c (make_class_data): Output signatures using '.' as a
5340         separator, rather than '/'.
5341         (mangled_classname): Likewise.
5342         (make_field_value): Likewise.
5343         (make_method_value): Likewise.
5344         * constants.c (alloc_class_constant): Likewise.
5345         * expr.c (build_invokeinterface): Likewise.
5346
5347 Thu Feb 11 21:25:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5348
5349         * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
5350         of an ancient workaround.
5351
5352 Wed Feb 10 23:27:33 1999  Jeffrey A Law  (law@cygnus.com)
5353
5354         * jvspec.c (xmalloc): Kill the prototype.  It does not belong
5355         here anymore.
5356
5357 1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5358
5359         * lex.c (yylex): Encode \0 as UTF8.
5360
5361 1999-02-10  Tom Tromey  <tromey@cygnus.com>
5362
5363         * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
5364         * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
5365         (libgcj_zip): Renamed.
5366         * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
5367         LIBJAVA_ZIP_FILE.
5368         (jcf_path_init): Use LIBGCJ_ZIP_FILE.
5369
5370         * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
5371         (GC_NAME): Renamed -lgc to -lgcjgc.
5372
5373 Tue Feb  9 19:31:09 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5374
5375         * lex.c (java_lang_cloneable): Initialize.
5376         * parse.y (java_lang_cloneable): New static variable.
5377         (qualify_ambiguous_name): Take CONVERT_EXPR into account when
5378         doing one more qualification round.
5379         (valid_ref_assignconv_cast_p): Reject null source or
5380         destination. Allow an array to be cast into java.lang.Cloneable.
5381         (patch_cast): Swapped two first arguments to first call to
5382         valid_ref_assignconv_cast_p.
5383
5384 Mon Feb  8 11:50:50 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5385
5386         * parse.h: DECL_P renamed JDECL_P.
5387         * parse.y: DECL_P replaced by JDECL_P.
5388         (build_array_from_name): Always use pointer's type.
5389         (patch_bc_statement): Extra code to search continue target in a
5390         for loop. Fixed comments. Continue target is current loop when
5391         unlabeled.
5392
5393 1999-02-05  Andrew Haley  <aph@cygnus.com>
5394
5395         * class.c (make_class_data): The superclass of an interface should
5396         be null, not class Object.
5397
5398         * lex.c (java_lex): Sign extend hex literals.
5399
5400 1999-02-04  Andrew Haley  <aph@cygnus.com>
5401
5402         * class.c (build_utf8_ref): Output signatures using '.' as a
5403         separator, rather than '/'.
5404         (make_class_data): Likewise.
5405
5406 Wed Feb  3 22:50:17 1999  Marc Espie <Marc.Espie@liafa.jussieu.fr>
5407
5408         * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
5409         mkstemp.o.  Get them from libiberty now.
5410
5411 Tue Feb  2 19:49:12 1999  Jeffrey A Law  (law@cygnus.com)
5412
5413         * jcf-io.c: Do not include sys/stat.h or sys/wait.h
5414
5415 Tue Feb  2 20:04:50 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5416
5417         * jvspec.c (xmalloc): Fix the prototype to match the one obtained
5418         from libiberty.h
5419
5420 Tue Feb  2 10:39:47 1999  Per Bothner  <bothner@cygnus.com>
5421
5422         Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
5423         * jcf-write.c (generate_bytecode_return):  New function.
5424         (generate_bytecode_insns):  Use it, for RETURN_EXPR.
5425
5426         * jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
5427         generate special [fd]const_[01] instructions.
5428
5429         * jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
5430
5431         * verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
5432         handling OPCODE_lookupswitch or OPCODE_tableswitch.
5433
5434 Mon Feb  1 20:44:47 1999  Per Bothner  <bothner@cygnus.com>
5435
5436         * parse.y (patch_method_invocation):  Handle calling static methods,
5437         even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
5438
5439         * parse.y (java_complete_lhs):  Don't complain about unreachable
5440         exit condition in a do-while statement.
5441
5442 Fri Jan 29 18:19:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5443
5444         * lex.c (java_read_char): Fixed utf8 decoding.
5445         (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
5446         range.
5447         * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
5448         comments. Local variable `all_primitive' is gone. Broadened
5449         acceptance of `0' to floating point targets. `long' can now be
5450         widened to `double' or `float'.
5451         (valid_method_invocation_conversion_p): Added leading
5452         comment. Fixed tabulation.
5453         (build_string_concatenation): Optimize out left or right empty
5454         string constants.
5455
5456 Thu Jan 28 18:51:26 1999  Per Bothner  <bothner@cygnus.com>
5457
5458         * jcf-write.c (localvar_alloc):  Only emit entry for
5459         LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
5460         (generate_bytecode_insns):  Only call put_linenumber if
5461         debug_info_level > DINFO_LEVEL_NONE.
5462         * jvspec.c (lang_specific_driver):  If no -O* or -g* option
5463         is specified, add -g1 (for compatibility wih javac).
5464
5465 Thu Jan 28 09:17:51 1999  Hans-Peter Nilsson  <hp@axis.se>
5466
5467         * java/Makefile.in: Add missing dependencies for jcf-dump.o,
5468         gjavah.o, check-init.o, jv-scan.o
5469
5470 Mon Feb  1 09:50:48 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5471
5472         * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
5473
5474         * gjavah.c: Include config.h and system.h.
5475
5476         * javaop.h (inline): Don't define, its handled by system.h.
5477         (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
5478         from `inline' to `static inline'.
5479
5480         * jcf.h (inline): Don't define, its handled by system.h.
5481
5482         * lex.c (inline): Likewise.
5483
5484 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
5485
5486         * lang-specs.h: Map -Qn to -fno-ident.
5487
5488 Fri Jan 29 16:51:56 1999  Richard Henderson  <rth@cygnus.com>
5489
5490         * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
5491
5492 1999-01-29  Tom Tromey  <tromey@cygnus.com>
5493
5494         * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
5495         then cast it to Object before calling `append' method.
5496
5497 Thu Jan 28 14:45:39 1999  Per Bothner  <bothner@cygnus.com>
5498
5499         * check-init.c (check_bool2_init, check_bool_init, check_init):
5500         Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
5501         * jcf-write.c (generate_bytecode_insns):  Likewise.
5502
5503 Thu Jan 28 11:50:11 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5504
5505         * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
5506         * parse.y (patch_cast): Allow a boolean to be cast into a
5507         boolean.
5508
5509 Wed Jan 27 10:19:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5510
5511         * parse.y: (class_declaration:): Fixed indentation.
5512         (class_member_declaration:): Extra `;' after field declaration now
5513         accepted.
5514         (interface_declaration:): Removed debug messages in error reports.
5515         (patch_binop): Nodes created and returned inherit the orignal
5516         node's COMPOUND_ASSIGN_P flag value.
5517         (patch_cast): Fix cast from char to floating point.
5518
5519 Mon Jan 25 17:39:19 1999  Andrew Haley  <aph@cygnus.com>
5520
5521         * except.c, java-except.h (expand_resume_after_catch): new
5522         function.
5523         * expr.c (java_lang_expand_expr): call expand_resume_after_catch
5524         to branch back to main flow of control after a catch block.
5525
5526 Sat Jan 23 23:02:43 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5527
5528         * Makefile.in (parse.o): Depend on $(CONFIG_H) and
5529         $(srcdir)/../system.h.
5530         (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
5531         (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
5532         (jcf-write.o): Likewise.
5533         (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5534         (mangle.o): Depend on $(srcdir)/../toplev.h.
5535         (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5536         (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5537
5538         * class.c: Include output.h and parse.h.
5539         (mangled_classname): Add the `const' keyword to a char*.
5540         (find_named_method): Hide unused function definition.
5541         (build_utf8_ref): Change type of variable `c' to unsigned char.
5542         Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
5543         (build_class_ref): Add the `const' keyword to a char*.
5544         (layout_class_method): Remove unused variable `buf'.
5545
5546         * decl.c (find_local_variable): Remove unused variable `rtl'.
5547         (pushdecl): Likewise for variables `different_binding_level' and
5548         `oldglobal'.
5549         (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
5550         (maybe_build_cleanup): Likewise for parameter `decl'.
5551
5552         * except.c (expand_start_java_handler): Mark parameter `range'
5553         with ATTRIBUTE_UNUSED.
5554
5555         * expr.c: Include except.h.
5556         (pop_type): Remove unused variable `i'.
5557         (pop_value): Likewise for variables `n_words' and `i'.
5558         (expand_java_arrayload): Likewise for variable `convert'.
5559         (java_lang_expand_expr): Likewise for variables `op0', `type',
5560         `mode', `unsignedp', `node' and `elements'.
5561         (expand_byte_code): Likewise for variables `prev_eh_ranges' and
5562         `eh_ranges'.
5563         (process_jvm_instruction): Add a `const' qualifier to a char*.
5564
5565         * gjavah.c (output_directory): Add the `const' keyword to a char*.
5566         (temp_directory): Likewise.
5567         (print_c_decl): Likewise.
5568         (print_method_info): Likewise.
5569         (decode_signature_piece): Likewise.
5570         (print_mangled_classname): Likewise.
5571
5572         * java-except.h: Provide prototypes for maybe_start_try,
5573         maybe_end_try and add_handler.
5574
5575         * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
5576         (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
5577         (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
5578         init_expr_processing, push_super_field, init_class_processing,
5579         can_widen_reference_to, class_depth, verify_jvm_instructions,
5580         maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
5581         set_local_type, merge_type_state, push_type, load_type_state,
5582         add_interface, find_in_current_zip, append_gpp_mangled_classtype,
5583         emit_unicode_mangled_name): Add prototypes.
5584
5585         * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
5586         (print_signature_type): Use ISDIGIT, not isdigit.
5587         (print_signature): Remove unused variable `j'.
5588
5589         * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
5590         int when comparing against one.
5591
5592         * jcf-parse.c: Include toplev.h.
5593
5594         * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
5595         (localvar_free): Remove unused variable `i'.
5596         (generate_bytecode_conditional): Likewise for variable `kind'.
5597
5598         * jv-scan.c: Include config.h and system.h.  Remove redundant
5599         OS header and gansidecl.h includes.
5600         (warning): Add the `const' keyword to a char*.  Also add
5601         ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
5602         __STDC__, when determining whether to use ANSI-isms.
5603         (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
5604         (xmalloc): Don't redundantly prototype here.
5605         (main): Remove unused parameter `envp'.  Also fix the arguments
5606         passed to function `fatal' to match the format specifier.
5607
5608         * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
5609
5610         * mangle.c: Include toplev.h.
5611         (emit_unicode_mangled_name): Declare parameter `len'.
5612
5613         * parse.y (parse_warning_context): Add the `const' keyword to a
5614         char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
5615         `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
5616         (issue_warning_error_from_context): Add the `const' keyword to
5617         a char*.
5618         (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
5619         not `__STDC__' for whether to use ANSI-isms.
5620
5621         * typeck.c (incomplete_type_error): Mark parameters `value' and
5622         `type' with ATTRIBUTE_UNUSED.
5623         (parse_signature_type): Use ISDIGIT, not isdigit.
5624
5625         * verify.c (check_pending_block): Add the `const' keyword to a char*.
5626         (verify_jvm_instructions): Likewise.  Remove unused variables
5627         `field_name' and `default_val'.
5628
5629         * zextract.c: Include config.h and system.h.  Remove redundant
5630         OS header includes.
5631
5632         * zipfile.h: Prototype `read_zip_archive'.
5633
5634 Thu Jan 21 16:00:06 1999  Andrew Haley  <aph@cygnus.com>
5635
5636         * typeck.c (convert): Allow conversions to void type: some
5637         optimizations in gcc do this.
5638
5639 Thu Jan 21 15:21:49 1999  Andrew Haley  <aph@cygnus.com>
5640
5641         * typeck.c (convert_ieee_real_to_integer): New function.
5642         (convert): When not using fast-math and using hardware fp, convert
5643         an IEEE NaN to zero.
5644
5645 1999-01-18  Andrew Haley  <aph@cygnus.com>
5646
5647         * parse.y (patch_binop): Do a type conversion from signed to
5648         unsigned and then back to signed when a ">>>" is found.
5649
5650 Sun Jan 17 22:34:22 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5651
5652         * java-tree.h: (check_for_initialization): Added prototype.
5653         * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
5654         * parse.y (do_resolve_class): Removed unused locals.
5655         (read_import_dir): Likewise.
5656         (resolve_qualified_expression_name): Array creation
5657         expressions are valid primary expressions.
5658         (qualify_ambiguous_name): Likewise.
5659         (patch_synchronized_statement): Removed unused local.
5660
5661 Sun Jan 17 21:55:42 1999  Jeffrey A Law  (law@cygnus.com)
5662
5663         * Makefile.in (zextract.o): Add dependencies.
5664
5665         * Makefile.in: Do not put ^Ls at the start of a line.
5666
5667 Fri Jan 15 20:16:20 1999  Per Bothner  <bothner@cygnus.com>
5668
5669         * expr.c (process_jvm_instruction):  Coerce to correct Throwable
5670         sub-type the result of the call that gets the exception value.
5671
5672         * parse.y (java_complete_expand_methods):  If flags_syntax_only,
5673         don't call finish_class.
5674
5675         * parse.y (java_check_regular_methods):  If METHOD_PRIVATE,
5676         clear found before continuing.
5677
5678         * verify.c (verify_jvm_instructions):  On an array load, allow
5679         and handle top of stack to be TYPE_NULL.
5680
5681         * gjavah.c (generate_access):  Translate Java package private or
5682         protected access to C++ public, but with a comment.
5683
5684 1999-01-13  Andrew Haley  <aph@cygnus.com>
5685
5686         * expr.c (generate_name): Name prefix changed to avoid clashes
5687         with assembler temp labels.
5688
5689         * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
5690         MODIFY_EXPR.  Without this, code for the assignement may not be
5691         generated at all and the synchronized statement will read an
5692         uninitialized variable.
5693
5694 Wed Jan 13 01:24:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5695
5696         * class.c (maybe_layout_super_class): Fixed returned value.
5697         * lex.c: Added 1999 to the copyright.
5698         (java_init_lex): Initialize java_lang_imported.
5699         * lex.h: Added 1999 to the copyright.
5700         * parse.h: Added 1999 to the copyright.
5701         (REGISTER_IMPORT): Fixed typo in trailing macro.
5702         (CURRENT_OSB): New macro.
5703         (struct parser_ctxt): New fields osb_depth, osb_limit.
5704         * parse.y (java_lang_id): New global variable.
5705         (type_import_on_demand_declaration): Don't import java.lang.* twice.
5706         (array_creation_expression:): Use CURRENT_OSB.
5707         (dims:): Uses a stack to keep track of array dimensions.
5708         (cast_expression:): Use CURRENT_OSB.
5709         (find_expr_with_wfl): Return NULL if node found doesn't meet the
5710         conditions.
5711         (register_fields): Fixed typos in comment.
5712         (check_method_redefinition): Fixed comment indentation.
5713         (java_check_regular_methods): Set saved found wfl to NULL after
5714         having reinstalled it in the previously found DECL_NAME.
5715
5716 Sun Jan 10 13:36:14 1999  Richard Henderson  <rth@cygnus.com>
5717
5718         * gjavah.c (java_float_finite): Use a union to do type punning.
5719         (java_double_finite): Likewise.
5720
5721 Sat Jan  9 11:25:00 1999  Per Bothner  <bothner@cygnus.com>
5722
5723         * parse.y (build_new_array_init):  Don't set EXPR_WFL_LINECOL
5724         on CONSTRUCTOR (since that trashes TREE_CST_RTL).
5725         (patch_new_array_init):  Clear TREE_CONSTANT also if INDIRECT_REF.
5726         (register_fields):  Set TREE_STATIC on NEW_ARRAY_INIT, not on
5727         CONSTRUCTOR (which causes expand_expr to call output_constant_def).
5728         * expr.c (java_lang_expand_expr):  Check TREE_STATIC of NEW_ARRAY_INIT.
5729
5730 Fri Jan  8 15:48:03 1999  Per Bothner  <bothner@cygnus.com>
5731
5732         * check-init.c (check_init):  If compiling to native, we don't
5733         see THROW_EXPR.  Instead, look for a call to throw_node (_Jv_Throw).
5734
5735 1999-01-08  Tom Tromey  <tromey@cygnus.com>
5736
5737         * parse-scan.y (variable_declarator_id): Set or increment
5738         bracket_count.
5739         (bracket_count): New global.
5740         (formal_parameter): Handle case where bracket pairs trail variable
5741         declarator id.
5742
5743 1999-01-07  Andrew Haley  <aph@viagra.cygnus.co.uk>
5744
5745         * jcf-parse.c (yyparse): variable len changed from a char to an
5746         int to prevent overflow.
5747
5748 Wed Jan  6 17:19:46 1999  Per Bothner  <bothner@cygnus.com>
5749
5750         * java-tree.h:  Declare read_class.
5751         * jcf-parse.c (read_class):  New function.
5752         (load_class):  Now just call read_class.
5753
5754         * java-tree.h (java_parse_abort_on_error):  Only return if new errors.
5755         * jcf-parse.c (parse_source_file):  Declare save_error_count,
5756         which is needed by java_parse_abort_on_error macro,
5757         * parse.y (java_layout_classes, java_expand_classes):  Likewise.
5758
5759         * parse.y (register_fields):  Set TREE_STATIC flag of NEW_ARRAY_INIT
5760         constructor, if initializing a static field.
5761         (patch_new_array_init):  Set TREE_CONSTANT if it is.
5762         * expr.c (java_lang_expand_expr):  For a static array constructor
5763         of primitive elements, allocate the array itself statically.
5764         Disabled until we can set the vtable field statically.
5765
5766         * check-init.c:  New file.  Checks for definite assignment.
5767         * Makefile.in (JAVA_OBJS):  Add check-init.o.
5768         * parse.y (java_complete_expand_method): Call check_for_initialization.
5769         * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY):  Moved to java-tree.h.
5770
5771 Wed Jan  6 14:53:10 1999  Graham <grahams@rcp.co.uk>
5772
5773         * parse.y : include system.h instead of including
5774         standard headers directly with the exception of <dirent.h>.
5775
5776 Wed Jan  6 16:20:06 1999  Per Bothner  <bothner@cygnus.com>
5777
5778         * lex.h:  Moved static function declarations to lex.c,
5779         to shut up some -Wall warnings.
5780         * lex.c:  Static function declarations moved here.
5781         * jcf-dump.c:  Small fixes to shut up -Wall warnings.
5782
5783 Tue Jan  5 22:15:40 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5784
5785         * Make-lang.in ($(GCJ).o): Depend on prefix.h.
5786
5787 Tue Dec 22 11:25:19 1998  Per Bothner  <bothner@cygnus.com>
5788
5789         * expr.c (process_jvm_instruction):  Do load_type_state after JSR.
5790         * verify.c (verify_jvm_instructions):  Fix off-by-one error.
5791
5792         * jcf-write.c (CHECK_PUT):  Add (void) cast to avoid -Wall warnings.
5793         (localvar_alloc):  Change return type to void,
5794         (emit_unop):  Remove unused variable size.
5795
5796         * jcf-write.c (struct jcf_block):  Add new union.
5797         (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC):  New macros.
5798         (call_cleanups):  New functions.
5799         (struct jcf_partial):  New fields num_finalizers and return_value_decl.
5800         (generate_bytecode_insns):  Support CLEANUP_POINT_EXPR and
5801         WITH_CLEANUP_EXPR.  Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
5802         * lang.c (lang_init):  Call using_eh_for_cleanups.
5803         * parse.y (java_complete_lhs):  For SYNCHRONIZED_EXPR, defer
5804         completing operands to patch_synchronized_statement.
5805         Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
5806         (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
5807         WITH_CLEANUP_EXPR instead of TRY_EXPR.
5808
5809 Sun Dec 20 16:15:44 1998  John F. Carr  <jfc@mit.edu>
5810
5811         * Make-lang.in: Comment out control-Ls; they upset some makes.
5812
5813 1998-12-18  Tom Tromey  <tromey@cygnus.com>
5814
5815         * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
5816         consistently.
5817
5818 1998-12-17  Tom Tromey  <tromey@cygnus.com>
5819
5820         * parse.y (DIR_SEPARATOR): New define.
5821         (check_class_interface_creation): Use it.
5822
5823         * parse-scan.y (report_main_declaration): Recognize
5824         `java.lang.String' in argument to main.
5825
5826 Wed Dec 16 16:18:59 1998  Per Bothner  <bothner@cygnus.com>
5827
5828         * parse.y (create_interface):  Remove bogus test.
5829
5830 Wed Dec 16 14:42:19 1998  Per Bothner  <bothner@cygnus.com>
5831
5832         * jcf-parse.c (get_constant):  Set TREE_TYPE for string constants.
5833         (HANDLE_CONSTANTVALUE):  If flag_emit_class_files, call get_constant.
5834
5835 1998-12-16  Tom Tromey  <tromey@cygnus.com>
5836
5837         * parse-scan.y (qualified_name): Use correct sprintf format.
5838
5839 1998-12-15  Tom Tromey  <tromey@cygnus.com>
5840
5841         * gjavah.c (print_field_info): Changed how most negative number is
5842         printed.
5843
5844 Mon Dec 14 18:49:29 1998  Per Bothner  <bothner@cygnus.com>
5845
5846         * parse.y (fold_constant_for_init):  New function.
5847         (resolve_expression_name):  Don't replace static final
5848         constant-initialized fields by its value.
5849         (java_complete_lhs):  New.  Same as java_complete_tree, except does
5850         not replace static final constant-initialized fields by their values.
5851         (register_fields):  If there is an initializer, set DECL_INITIAL and
5852         MODIFY_EXPR_FROM_INITIALIZATION_P.
5853         (java_complete_tree):  For MODIFY_EXPR, use java_complete_lhs for lhs.
5854         Only call patch_initialized_static_field if
5855         MODIFY_EXPR_FROM_INITIALIZATION_P.
5856         (patch_initialized_static_field):  If not valid constant, clear
5857         DECL_INITIAL.
5858
5859         * parse.y (lookup_field_wrapper):  Fix thinko.
5860
5861         * parse.y (java_complete_tree):  In EXPR_WITH_FILE_LOCATION,
5862         set and restore global lineno.
5863
5864 1998-12-14  Tom Tromey  <tromey@cygnus.com>
5865
5866         * gjavah.c (print_field_info): If value to print is the smallest
5867         value of its size, then print as hex to avoid later warnings from
5868         C++ compiler.
5869
5870 1998-12-14  Tom Tromey  <tromey@cygnus.com>
5871
5872         * gjavah.c (decompile_method): Decompile `return null'.
5873         (process_file): Generate `#pragma interface'.
5874         (method_declared): New global.
5875         (print_method_info): Set it.
5876         (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
5877         (print_method_info): Handle abstract methods.
5878
5879 Sun Dec 13 17:31:40 1998  Per Bothner  <bothner@cygnus.com>
5880
5881         * parse.y (patch_method_invocation):  If class_decl is null
5882         (e.g. an array type), use original type.
5883
5884         * parse.y (check_thrown_exceptions):  Temporary hack to suppress
5885         errors about uncaught exception from clone (of array, specifically).
5886
5887 1998-12-13  Tom Tromey  <tromey@cygnus.com>
5888
5889         * gjavah.c (decompile_method): Handle all types of `return'
5890         opcode.  Decompile `return this' and `return'.
5891         (method_access): New global.
5892         (print_method_info): Set it.
5893         (decompile_method): Don't decompile a synchronized method.
5894
5895 1998-12-13  Tom Tromey  <tromey@cygnus.com>
5896
5897         * jcf-reader.c (jcf_parse_one_method): Recognize
5898         HANDLE_END_METHOD.
5899         * gjavah.c (HANDLE_END_METHOD): New macro.
5900         (HANDLE_CODE_ATTRIBUTE): New macro.
5901         (decompile_method): New function.
5902         (print_method_info): Don't print `;\n' at end of function decl.
5903         Include java-opcodes.h.
5904         (decompiled): New global.
5905
5906 Sat Dec 12 20:13:19 1998  Per Bothner  <bothner@cygnus.com>
5907
5908         * class.c (build_class_ref):  Handle PRIMTYPE.class if
5909         flag_emit_class_files.
5910         * expr.c (expand_java_field_op):  Don't optimize java.lang.XXX.TYPE
5911         if flag_emit_class_files.
5912         * parse.y (java_complete_tree):  Pre-liminary support for
5913         COMPONENT_REF - only to handle PRIMCLASS.TYPE.
5914
5915         * parse.y (patch_synchronized_statement):   Don't call monitorexit
5916         unless block CAN_COMPLETE_NORMALLY.  Propagate that flag properly.
5917
5918         * java-tree.h (DECL_LOCAL_STATIC_VALUE):  Removed - no longer used.
5919
5920         * zipfile.h (opendir_in_zip):  New declaration.
5921         * jcf-io.c (saw_java_source):  Moved to jcf-parse.c.
5922         (opendir_in_zip):  New function, using code from open_in_zip.
5923         (open_in_zip):  Call opendir_in_zip.
5924         (find_class):  Remove no-longer-used do_class_file parameter,
5925         but add source_ok parameter.  Change logic so if we find a .java file,
5926         we don't look for .class in later classpath emtries.
5927         * jcf-parse.c (load_class):  Pass saw_java_source to find_class.
5928         (jcf_figure_file_type):  Only call open_in_zip if correct magic number.
5929         * gjavah.c: Update call to find_class.
5930         * jcf-dump.c:  Likewise.
5931
5932         * jcf-write.c (put_linenumber):  Handle duplicate line numbers.
5933         (generate_bytecode_insns):  For EXPR_WITH_FILE_LOCATION, do
5934         nothing if body is empty_stmt_node.
5935         Various little fixes so SP gets correctly adjusted.
5936         For NEW_ARRAY_INIT, handle IGNORE_TARGET.
5937         For CALL_EXPR, test if static first.
5938         (generate_classfile):  Ignore fields that are DECL_ARTIFICIAL,
5939         such as the ones we create for Object and Class.
5940         Set and restore current_function_decl.
5941         * parse.y:  Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
5942         (note_possible_classname):  New function.
5943         (read_import_entry):  Removed.  Merged with read_import_dir.
5944         (read_import_dir):  Don't call find_class - that only gives us
5945         the first classpath entry having the needed package.
5946         Use the struct buffer data structure from buffer.h.
5947         (read_import_dir, find_in_imports_on_demand):  The remembered
5948         class names now use '.' (not '/') as package separator.
5949
5950         * parse.y (java_complete_expand_methods):  Call write_classfile
5951         here, and not in java_expand_classes (which only gets first class).
5952
5953 Sat Dec 12 19:46:04 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5954
5955         * parse.y (<type_declaration>):  Do maybe_generate_clinit last.
5956         (register_fields):  If a static fields has an initializer, just
5957         chain it on ctxp->static_initialized, and handle later.
5958         (java_complete_expand_methods):  Force <clinit> first.
5959         (resolve_expression_name, resolve_field_access):  Just get DECL_INITIAL
5960         - it's already been completed.
5961         (patch_initialized_static_field):  New function.
5962         (java_complete_field):  Call it.
5963
5964 Sat Dec 12 19:21:11 1998  Per Bothner  <bothner@cygnus.com>
5965
5966         * expr.c (encode_newarray_type, build_new_array):  New functions.
5967         * java-tree.h:  Declare build_new_array.
5968         * jcf-write.c (patch_newarray):  Use build_new_array.
5969
5970         * expr.c (java_lang_expand_exp):  Support NEW_ARRAY_INIT.
5971         * jcf-write.c (generate_bytecode_insns):  Support NEW_ARRAY_INIT.
5972
5973         * parse.y (patch_new_array_init):  Re-organize.
5974         Now is passed the actual array (pointer) type of the value.
5975         Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
5976         (patch_array_constructor):  Removed - merged into patch_new_array_init.
5977         (java_complete_tree):  Update patch_new_array_init.
5978
5979         * jcf-write.c (find_constant_index):  New function.
5980         (generate_bytecode_insns):  Use find_constant_index.
5981         (generate_classfile):  Use find_constant_index for ConstantValue.
5982
5983 1998-12-11  Tom Tromey  <tromey@cygnus.com>
5984
5985         * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
5986         * decl.c (init_decl_processing): Renamed dtable -> vtable.
5987         * class.c (make_class_data): Renamed dtable -> vtable, and
5988         dtable_method_count -> vtable_method_count.
5989
5990 Thu Dec 10 20:00:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5991
5992         * decl.c (long_zero_node, float_zero_node, double_zero_node): New
5993         global variables, initialized.
5994         * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
5995         Declared new global variables.
5996         * lex.c (java_lex): Return long_zero_node, float_zero_node,
5997         double_zero_node, integer_zero_node upon direct matching.
5998         * parse.y (purify_type_name): Added function prototype.
5999         (duplicate_declaration_error_p): Consider new_type as potentially
6000         being a incomplete type. Use purify_type_name on type string.
6001         (method_header): saved_type: unused variable removed. Don't figure
6002         return type if method name is invalid.
6003         (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
6004         processed by patch_unaryop.
6005         (patch_unaryop): Fixed typo in comment. Re-convert pre/post
6006         increment/decrement node into its original type after binary
6007         numeric promotion on its operands.
6008
6009 Thu Dec 10 11:02:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6010
6011         * parse.y (array_initializer:): Array init operand is NULL_TREE
6012         instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
6013         now an error. Fixed indentation problems.
6014         (patch_string): Handle error_mark_node as an argument.
6015         (patch_new_array_init): Fixed indentation problems.
6016         (array_constructor_check_entry): Removed check on null wfl_value.
6017         Return an error if wfl_value's walk returns an error.
6018
6019 Wed Dec  9 15:37:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6020
6021         * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
6022         * lex.c (java_lex): Remember column position before advancing one
6023         token. Retain location information on OCB_TK.
6024         * lex.h (typedef struct java_lc): Added new field.
6025         * parse.h (GET_SKIP_TYPE): New macro.
6026         (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
6027         * parse.y (build_new_array_init, patch_new_array_init,
6028         patch_array_constructor, maybe_build_array_element_wfl,
6029         array_constructor_check_entry): New function prototypes.
6030         (switch_block:): Tagged <node>.
6031         (OCB_TK): Tagged <operator>.
6032         (array_initializer:): Installed actions.
6033         (variable_initializer): Build location information on element if
6034         necessary.
6035         (switch_statement:): Fixed indentation typo.
6036         (switch_block:): Redefined default action.
6037         (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
6038         (patch_assignment): Removed duplicate code.
6039         (maybe_build_array_element_wfl, build_new_array_init,
6040         patch_new_array_init, patch_array_constructor,
6041         array_constructor_check_entry): New functions.
6042
6043 Mon Dec  7 15:13:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6044
6045         * parse.y (array_initializer): Tagged <node>.
6046         (variable_initializer:): Use default rule.
6047         (array_initializer:): Defined actions.
6048         (variable_initializers:): Likewise.
6049         (resolve_qualified_expression_name): Use DECL_CONTEXT to build
6050         non-static field accesses.
6051         (patch_invoke): Fixed indentation typo.
6052         (java_complete_tree): Likewise.
6053         (build_labeled_block): Changed leading comment. Generate an error
6054         in case of duplicate loop labels.
6055         (patch_conditional_expr): Patch results of string concatenation
6056         operations.
6057
6058 Sun Dec  6 13:45:00 1998  Per Bothner  <bothner@cygnus.com>
6059
6060         * constants.c (find_methodref_index):  When the class is an interface,
6061         generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
6062
6063         * decl.c (finit_identifier_node):  Use "$finit$", rather than
6064         "<finit>" (which Sun's verifier rejects).
6065         * parse.y (maybe_generate_finit):  Leave out meaningless final flag.
6066         (generate_field_initialization_code):  Removed.
6067         (fix_constructors)  Don't add call to $finit$ here (wrong order).
6068         (patch_method_invocation):  Add $finit$ call here.
6069
6070         * java-tree.h (CALL_USING_SUPER):  New macro.
6071         * parse.y (patch_invoke):  Remove im local variable.
6072         (patch_method_invocation, patch_invoke):  Don't pass super parameter.
6073         (patch_invoke):  Use CALL_USING_SUPER instead of from_super parameter.
6074         (resolve_qualified_expression_name):  Maybe set CALL_USING_SUPER.
6075
6076         * jcf-write.c (get_access_flags):  Fix typo ACC_PUBLIC -> ACC_FINAL.
6077
6078         * parse.y (java_complete_tree):  Don't complain about unreachable
6079         statement if it is empty_stmt_node.
6080
6081         * jcf-write.c (find_constant_wide):  New function.
6082         (push_long_const):  Use find_constant_wide.
6083
6084         * jcf-write.c (generate_bytecode_insn):  Fix bug in switch handling.
6085         (generate_bytecode_insn):  Use correct dup variant for MODIFY_EXPR.
6086         Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
6087         Emit invokeinterface when calling an interface method.
6088         Emit invokespecial also when calling super or private methods.
6089
6090         * jcf-write.c (generate_classfile):  Emit ConstantValue attributes.
6091
6092 Sun Dec  6 13:21:18 1998  Per Bothner  <bothner@cygnus.com>
6093
6094         * jcf-dump.c (INVOKE):  If invokeinterface, print number of args.
6095
6096 Thu Dec  3 17:11:12 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6097
6098         * java-tree.h (java_layout_seen_class_methods): New function
6099         prototype.
6100         (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
6101         * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
6102         * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
6103         * parse.y (method_declarator:): Defined action.
6104         (issue_warning_error_from_context): input_filename saved, set to
6105         the appropriate value and restored after java_error is called.
6106         (build_unresolved_array_type): Fixed comment.
6107         (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
6108         (method_header): Deal with return type the same way type are
6109         handled for fields and method's parameters and local variables
6110         types are handled.
6111         (check_method_redefinition): Removed extra CR.
6112         (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
6113         (java_layout_seen_class_methods): New function.
6114         (java_layout_classes): Call java_layout_seen_class_methods.
6115
6116 Thu Dec  3 15:56:50 1998  Per Bothner  <bothner@cygnus.com>
6117
6118         * parse,y (patch_synchronized_statement):  Set CAN_COMPLETE_NORMALLY.
6119
6120 Thu Dec  3 15:08:30 1998  Per Bothner  <bothner@cygnus.com>
6121
6122         * jcf-dump.c (main):  Fix error message.
6123         * jcf-path.c (add_entry):  Style fix.
6124
6125 Wed Dec  2 15:52:25 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6126
6127         * class.c (layout_class_method): Call build_java_argument_signature
6128         on constructors too.
6129         * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
6130         (patch_method_invocation): Define a primary when resolving an
6131         expression name. Augmented comment on code checking illegal `this'
6132         usage. Loosened it test by accepting NEW_CLASS_EXPR.
6133
6134 Tue Dec  1 13:53:24 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6135
6136         * class.c (layout_class_method): Don't report error on non-static
6137         overriding static if the method is private.
6138         * java-tree.h (finish_class): Prototype added.
6139         * lex.c (java_get_line_col): Handle col argument -2 value.
6140         * parse.h: All static method declarations moved to parse.y.
6141         * parse.y: Now contains all static method declarations previously
6142         found in parse.h.
6143         (find_expr_with_wfl, missing_return_error,
6144         unreachable_stmt_error): New functions.
6145         (java_get_real_method_name): Identify constructors bearing class
6146         names in source code compiled classes only.
6147         (java_complete_expand_methods): Call missing_return_error.
6148         (invocation_mode): Private methods invoked as static methods.
6149         (java_complete_tree): Call unreachable_stmt_error.
6150
6151 1998-12-01  Tom Tromey  <tromey@cygnus.com>
6152
6153         * Makefile.in (+target): Removed.
6154         (+xmake_file): Likewise.
6155         (+tmake_file): Likewise.
6156         (.NOEXPORT): Removed duplicate.
6157
6158 Fri Nov 27 13:20:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6159
6160         * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
6161
6162         * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
6163
6164         * jvgenmain.c: Remove the xmalloc prototype, we get it from
6165         libiberty.h.  Provide an xmalloc definition.
6166
6167         * jvspec.c: Remove the xmalloc prototype.
6168
6169         * parse-scan.y: Include config.h and system.h.  Don't include
6170         OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
6171         Provide an xstrdup definition.
6172
6173 Thu Nov 26 22:03:58 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
6174
6175         * jcf-path.c (add_entry): Recognize ".jar" too.
6176         * lang-specs.h: Likewise.
6177
6178 Thu Nov 26 12:44:07 1998  Per Bothner  <bothner@cygnus.com>
6179
6180         * jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
6181         soft_monitorenter_node, soft_monitorexit_node, throw_node.
6182
6183         * jcf-write.c (generate_bytecode_insns):
6184         Handle pre/post-increment/decrement of long.
6185
6186         * jcf-write.c (generate_bytecode_insns):
6187         Handle missing exception handler (finally for synchronized).
6188
6189 Wed Nov 25 09:47:15 1998  Per Bothner  <bothner@cygnus.com>
6190
6191         * java-tree.h (end_params_node):  Declare global.
6192         * decl.c (end_params_node):  New global.
6193         (init_decl_processing, start_java_method):  Use end_params_node for
6194         end of list of parameter types.  Follows correct gcc conventions.
6195         * expr.c (pop_argument_types, pop_arguments):  Likewise.
6196         * lang.c (put_decl_node):  Likewise.
6197         * typeck.c (various places):  Likewise.
6198         * class.y (various places):  Likewise.
6199         * parse.y (various places):  Likewise.
6200
6201         * parse.y (java_complete_tree):  Move CAN_COMPLETE_NORMALLY.
6202         (build_jump_to_finally):  Add missing CAN_COMPLETE_NORMALLY.
6203
6204         * class.c:  Add #include flags.h, remove no-longer needed declaration.
6205
6206         * class.c (layout_class_method):  Remove commented-out code, re-format.
6207         Don't add vtable entry (or index) for private methods.
6208         * expr.c (expand_invoke):  A private method is implicitly final.
6209         * class.c (make_class_data):  If inlining or optimizing,
6210         skip private methods.
6211
6212         * class.c (finish_class):  New function.  Calls existing methods,
6213         but alls emits deferred inline functions.
6214         * jcf-parse.c (parse_class_file):  Call finish_class.
6215         * parse.y (java_complete_expand_methods):  Likewise.
6216
6217         * expr.c (build_java_binop):  Explicit default, to silence -Wall.
6218
6219         * expr.c (CHECK_PC_IN_RANGE):  Add void cast to kill warnings.
6220
6221 Wed Nov 25 00:50:58 1998  Marc Espie <espie@quatramaran.ens.fr>
6222
6223         * jcf-write.c (generate_bytecode_conditional): Fix typo.
6224
6225 Tue Nov 24 17:06:38 1998  Per Bothner  <bothner@cygnus.com>
6226
6227         * (generate_classfile): Always write class access flag with
6228         ACC_SUPER set.
6229
6230 Tue Nov 24 16:34:33 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6231
6232         * class.c (maybe_layout_super_class): New function.
6233         (layout_class): Reorganized. Loop on class methods dispatched into
6234         a new function. Call maybe_layout_super_class.
6235         (layout_class_methods, layout_class_method): New functions.
6236         * expr.c (expand_java_NEW): Call layout_class_methods on loaded
6237         class.
6238         (expand_invoke): Likewise.
6239         * java-tree.h (all_class_list): New global variable declared.
6240         (layout_class_methods, layout_class_method): New function
6241         prototypes.
6242         (LAYOUT_SEEN_CLASS_METHODS): New macro.
6243         * jcf-parse.c (all_class_list): New global variable.
6244         (load_class): Extended what class_or_name can be. Use parser
6245         context mechanism to save globals before calling jcf_parse.
6246         (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
6247         is set on the file name.
6248         (jcf_parse): Layout class methods when Object is loaded, otherwise
6249         record class in all_class_list for delayed method layout.
6250         (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
6251         * lang.c (put_decl_node): Decode <init> into the decl context
6252         class name.
6253         * lex.c (java_allocate_new_line): Use xmalloc.
6254         * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
6255         pointers, not TREE_LIST elements.
6256         (struct parser_ctxt): Fixed comment indentations, added comments
6257         and reordered some fields.
6258         (java_check_methods): Function prototype removed.
6259         * parse.y (java_push_parser_context): Use xmalloc.
6260         (java_parser_context_restore_global): Pop extra pushed ctxp only
6261         when there's nothing next.
6262         (maybe_create_class_interface_decl): Fixed comment, add new
6263         created class decl to all_class_list.
6264         (method_header): Use GET_REAL_TYPE on argument's types.
6265         (method_declarator): Use GET_REAL_TYPE, change type to the real
6266         type in TREE_LIST dependency node. Build argument list with the
6267         real type.
6268         (create_jdep_list): Use xmalloc. Removed allocation error message.
6269         (obtain_incomplete_type): Fixed leading comment. Broadened
6270         incoming argument meaning.
6271         (register_incomplete_type): Use xmalloc. Removed allocation error
6272         message.
6273         (safe_layout_class): Fixed leading comment.
6274         (jdep_resolve_class): Reversed if statement condition and switch
6275         if and else bodies.
6276         (resolve_and_layout): Fixed leading comment. Broadened incoming
6277         argument meaning.
6278         (complete_class_report_errors): New local variable name, for
6279         clarity. purify_type_name used for all error cases.
6280         (java_get_real_method_name): Stricter check on constructors.
6281         (java_check_regular_methods): Reverse methods list only if not
6282         already laid out. Layout artificial constructor.
6283         (java_check_methods): Deleted.
6284         (source_start_java_method): Obtain incomplete type for patchable
6285         method arguments.
6286         (java_layout_classes): Fixed leading comment. Use
6287         LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
6288         statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
6289         before returning. Fixed comments.
6290         (java_expand_classes): Check for errors up front.
6291         (patch_method_invocation): Class to search is resolved and laid
6292         out.
6293
6294 Tue Nov 24 12:57:13 1998  Per Bothner  <bothner@cygnus.com>
6295
6296         * expr.c (java_lang_expand_expr):  Add missing emit_queue.
6297
6298         * javaop.h (int8):  Removed - not used.
6299         (jbyte):  Redefine portably with correct signedness.
6300
6301         * jcf-write.c (generate_bytecode_insns):  Don't free sw_state.cases.
6302
6303         * jcf-write.c (generate_bytecode_insns):  Fix typo
6304         OPCODE_getstatic to OPCODE_getfield.
6305
6306         * java-tree.def (CASE_EXPR, DEFAULT_EXPR):  Kind is 'x', not '1'.
6307         * parse.y (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR,
6308         set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
6309
6310 Thu Nov 19 11:16:55 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6311
6312         * jcf-parse.c (jcf_parse_source): Function returned type is
6313         void. Added prototype.
6314         (jcf_parse): Function returned type is void.
6315         (yyparse): Remove call to fclose on the last parsed file.
6316
6317         * java-tree.h (jcf_parse): Changed jcf_parse prototype.
6318
6319 Wed Nov 18 23:54:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6320
6321         * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
6322         (layout_class): Cope with methods featuring WFL in decl names.
6323         * decl.c (unqualified_object_id_node): New global variable,
6324         initialized.
6325         (build_decl_no_layout): Removed.
6326         * expr.c (build_primtype_type_ref): Handle Double.
6327         (java_lang_expand_expr): Fixed indentations.
6328         * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
6329         (flag_wall, flag_redundant, flag_not_overriding,
6330         flag_static_local_jdk1_1, unqualified_object_id_node): Global
6331         variable declarations.
6332         (build_decl_no_layout): Removed prototype.
6333         (java_get_real_method_name): Added prototype.
6334         (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
6335         (java_parse_abort_on_error): Macro now just returns.
6336         * jcf-parse.c (jcf_parse_source): Check fclose returned
6337         value. Call emit_register_classes if java_report_errors returns
6338         zero.
6339         * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
6340         flag_static_local_jdk1_1): New integer flags.
6341         (lang_decode_option): New flags set here.
6342         * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
6343         (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
6344         the flag_redundant variable.
6345         (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
6346         when parsing java.lang.Object class.
6347         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
6348         NULL_TREE to build.
6349         (resolve_qualified_expression_name): Fixed indentation.
6350         (patch_array_ref): Changed prototype.
6351         (not_initialized_as_it_should_p): Prototype removed.
6352         (java_report_errors): Added function prototype.
6353         * parse.y (formal_parameter:): Changed error message for not yet
6354         supported final parameters.
6355         (class_type_list:): Set both PURPOSE and VALUE of created
6356         TREE_LIST to be class_type.
6357         (primary_no_new_array:): Handle class literals on primitive types.
6358         (parse_warning_context): Reinstalled correct force_error and
6359         do_warning flags setups.
6360         (java_report_errors): Changed prototype. Return java_error_count
6361         value.
6362         (variable_redefinition_error): Consider treating variable type as
6363         a fake pointer.
6364         (create_interface): Warn about redundant abstract modifier if
6365         flag_redundant is set. Changed error message.
6366         (lookup_field_wrapper): Save/restore globals before/after looking
6367         up field.
6368         (duplicate_declaration_error_p): Consider treating declaration
6369         type as a fake pointer.
6370         (register_fields): Extract real type from dependency node. Check
6371         for duplicate field declaration after type adjustment. Use
6372         DECL_INITIAL to store static final initialized values.
6373         (method_header): Extract real function type from dependency node.
6374         (check_abstract_method_header): Use GET_METHOD_NAME.
6375         (obtain_incomplete_type): Layout fake pointer type.
6376         (safe_layout_class): Don't try to check for methods before layout.
6377         (java_complete_class): Don't check for correct throws clause
6378         elements inheritance here.
6379         (resolve_and_layout): Broadened name parameter meaning.
6380         (reset_method_name): Use GET_METHOD_NAME.
6381         (java_get_real_method_name): New function.
6382         (java_check_regular_methods): Don't check methods in
6383         java.lang.Object.  Verify lineage of throws clause elements. Use
6384         flag_no_overriding in warning report.
6385         (check_throws_clauses): Don't check if class was from
6386         bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
6387         (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
6388         (declare_local_variables): Use flag_static_local_jdk1_1 to report
6389         warning on unsupported final local variables. Use build_decl
6390         instead of build_decl_no_layout. Get real local variable type from
6391         dependency node.
6392         (source_start_java_method): Get real parameter type from
6393         dependency node. Call build_decl instead of build_decl_no_layout.
6394         (java_layout_classes): Reverse tree and layout type and class as
6395         required. Mark class as loaded when done.
6396         (resolve_field_access): Fixed indentation. Restricted condition
6397         leading to static field access code generation. Set field_type
6398         decl's TREE_TYPE if QUAL_DECL_TYPE not available.
6399         (resolve_qualified_expression_name): Initialize type_found to
6400         null. Handle static field resolved during qualification. Fixed
6401         layout on non primitive field decl types.
6402         (not_accessible_p): Fixed typo in comment.
6403         (patch_method_invocation): Resolve and layout class to search from
6404         type.
6405         (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
6406         layout non primitive type, if necessary. Make method node only to
6407         report errors.
6408         (find_applicable_accessible_methods_list): Consider WFL'ed method
6409         decl names. Fixed indentation.
6410         (argument_types_convertible): Resolve and layout target type if
6411         necessary.
6412         (java_complete_tree): Fixed indentation problems. Rewrote
6413         CALL_EXPR thrown exceptions check. Re-installed further processing
6414         of the assignment in certain cases.
6415         (patch_assignment): Call maybe_build_primttype_type_ref to perform
6416         inlining on class literals.
6417         (valid_builtin_assignconv_identity_widening_p): Cope with constant
6418         0 literal.
6419         (valid_method_invocation_conversion_p): Likewise.
6420         (patch_string): Temporary disable forbidden use of `this' in
6421         explicit constructor invocations when doing string concatenation
6422         within their scope.
6423         (patch_unaryop): Added comment. Reinstalled code to disable
6424         further check on assignment operation with cast expression RHS.
6425         (patch_switch_statement): Fixed indentation.
6426         (build_try_statement): Call build_decl instead of
6427         build_decl_no_layout.
6428         (patch_synchronized_statement): Likewise.
6429         (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
6430         IS_UNCHECKED_EXPRESSION_P.
6431         (check_thrown_exceptions_do): Changed leading comment. Resolve and
6432         layout argument exception type.
6433         (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
6434         of IS_UNCHECKED_EXPRESSION_P.
6435
6436 Wed Nov 18 14:21:48 1998  Anthony Green  <green@cygnus.com>
6437
6438         * jcf-parse.c (yyparse): Open class file in binary mode.
6439
6440 Sun Nov 15 17:14:17 1998  Per Bothner  <bothner@cygnus.com>
6441
6442         * jvgenmain.c:  Need to #include "gansidecl.h" (to get PROTO).
6443
6444         * jcf-write.c (perform_relocations):  Move check out one loop.
6445
6446 Sun Nov 15 15:09:56 1998  Anthony Green  <green@hoser.cygnus.com>
6447
6448         * Make-lang.in: Fix reference to srcdir.
6449         * jv-scan.c: Add missing xmalloc prototype.
6450         * jvgenmain.c: Ditto.
6451
6452 Sun Nov 15 14:36:29 1998  Per Bothner  <bothner@cygnus.com>
6453
6454         * decl.c (error_mark_node), java-tree.h:  New global.
6455         * parse.y:  Use empty_stmt_node instead of size_zero_node.
6456         (build_if_else_statement):  If missing else, use empty_stmt_node.
6457
6458         * parse.y (not_initialized_as_it_should_p):  Removed, with its callers.
6459         (java_complete_expand_method):  Complain if return is missing.
6460         (java_check_regular_methods):  Comment out incorrect error check.
6461         (not_accessible_p):  Fix incorrect handling of protected methods.
6462         (patch_method_invocation):  Pass correct context to not_accessible_p.
6463         (find_applicable_accessible_methods_list):  Likewise.
6464         (qualify_ambiguous_name):  If ARRAY_REF, it's an expression name.
6465         (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR, set
6466         TREE_TYPE (to void_type_node);  otherwise expand_expr crashes.
6467         (patch_if_else_statement):  Fix setting of CAN_COMPLETE_NORMALLY.
6468
6469         * jcf-write.c (CHECK_OP, CHECK_PUT):  Add some error checking.
6470         (push_int_const):  Remove reundant NOTE_PUSH.
6471         (generate_bytecode_insns - case STRING_CST):  Do NOTE_PUSH.
6472         (- case SWITCH_EXPR):  Fix code generation bug.
6473         (- case PREDECREMENT_EXPR etc):  Remove redundant NOTE_PUSH.
6474         (generate_classfile):  More robust for abstract methods.
6475
6476 Sun Nov 15 13:52:39 1998  Anthony Green  <green@cygnus.com>
6477
6478         * Makefile.in: jv-scan and jvgenmain all require libiberty.
6479         * Make-lang.in: Ditto.
6480
6481         * jv-scan.c: Remove xmalloc and xstrdup definitions.
6482         * jvgenmain: Ditto.
6483
6484 Sun Nov 15 14:10:56 1998  Per Bothner  <bothner@cygnus.com>
6485
6486         * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
6487
6488         * jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.
6489
6490 Sat Nov 14 17:19:18 1998  Per Bothner  <bothner@cygnus.com>
6491
6492         Allow uses of interface types to verify.  This is not really
6493         type-safe, but it matches what Sun does, and is OK as long as
6494         there are appropriate run-time checks.
6495         * verify.c (merge_types):  If merging two interface types,
6496         just set the result to java.lang.Object.
6497         * expr.c (pop_type):  Any interface is matches by java.lang.Object.
6498
6499 1998-11-13  Tom Tromey  <tromey@cygnus.com>
6500
6501         * gjavah.c (main): Handle --output-class-directory argument.
6502         * jvspec.c (lang_specific_driver): Translate `-d' into
6503         -foutput-class-dir.
6504         * jcf.h (jcf_write_base_directory): Declare.
6505         * lang.c (lang_decode_option): Recognize -foutput-class-dir.
6506         * lang-options.h: Mention -foutput-class-dir.
6507         * jcf-write.c (jcf_write_base_directory): New global.
6508         (make_class_file_name): Put generated .class file into `-d'
6509         directory, or into source directory if -d not given.  Function now
6510         static.
6511         (write_classfile): Free class file name.  Handle case where class
6512         file name is NULL.
6513         (DIR_SEPARATOR): New macro.
6514         Include <sys/stat.h>
6515
6516         * Makefile.in (prefix): New macro.
6517
6518 Thu Nov 12 14:15:07 1998  Per Bothner  <bothner@cygnus.com>
6519
6520         * parse.y (patch_invoke):  Do less if flag_emit_class_files.
6521         * expr.c (build_known_method_ref):  Don't check flag_emit_class_files
6522         here (done in patch_invoke instead).
6523         (case_identity):  Moved here from parse.y.
6524
6525         * java-tree.h (CAN_COMPLETE_NORMALLY):  New macro.
6526         * parse.y (java_complete_tree etc):  Maybe set CAN_COMPLETE_NORMALLY.
6527         * parse.y (java_complete_tree):  Re-order COMPOUND_EXPR in BLOCK
6528         so they can be efficiently scanned without recursion.
6529         Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
6530         * expr.c (java_lang_expand_expr):  Expand statements of COMPOUND_EXPR
6531         in BLOCK iteratively, rather than recursively.
6532
6533         * parse.y (do_unary_numeric_promotion):  New function.
6534         (patch_unaryop, patch_binop, patch_array_ref):  Use it.
6535
6536         * parse.y (patch_newarray):  Various fixes.
6537
6538         Re-do handling of switch statements (for proper block scoping).
6539         * parse.y:  Add just a single block for the enture switch block,
6540         but don't create any "case blocks".
6541         (group_of_labels):  Rmeoved unneeded non-terminal.
6542         CASE_EXPR and DEFAULT_EXPR are added to current block.
6543         * expr.c (java_lang_expand_expr):  Inline SWITCH_EXPR here.
6544         Now also need to handle CASE_EXPR and DEFAULT_EXPR.
6545         * java-tree.h (SWITCH_HAS_DEFAULT):  New macro.
6546         * parse.y (wfl_operator, print_int_node): Make non-static.
6547         (java_complete_tree):  CASE_EXPR and DEFAULT_EXPR are now processed
6548         as part of recursive scan of block.
6549         (java_expand_switch ):  Removed - inlined into java_lang_expand_expr.
6550         (patch_switch_statement):  Most tests move dinto java_complete_tree.
6551
6552         * parse.y:  Make various production be non-typed (void).
6553         * parse.y (parse_error):  Merged into issue_warning_error_from_context.
6554         * parse.y (add_stmt_to_compound):  Don't create/change extra node.
6555         (patch_method_invocation_stmt):  Renamed to patch_method_invocation.
6556
6557         * jcf-write.c (struct jcf_handler):  New type.
6558         (struct jcf_switch_state):  New type.
6559         (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC):  New relocation kinds.
6560         (alloc_handler, emit_unop, emit_reloc):  New functions.
6561         (adjust_typed_op):  Add extra parameter ("max type" offset).
6562         (emit_switch_reloc, emit_case-reloc):  New function.
6563         (generate_bytecode_conditional):  Handle REAL_TYPE comparisons.
6564         (generate_bytecode_insns):  Support REAL_CST, switch statements,
6565         exception handling, method calls, object/array creation, and more.
6566
6567         * class.c:  Remove some unused variables.
6568         * constants.c (find_string_constant):  New function.
6569         (count_constant_pool_bytes):  Fix to correctly handle wide constants.
6570         * decl.c (complete_start_java_method):  Don't _Jv_InitClass
6571         if flag_emit_class_files.
6572
6573 1998-11-12  Tom Tromey  <tromey@cygnus.com>
6574
6575         * jcf-io.c (find_class): Added explanatory comment.
6576
6577         * jcf-path.c (add_entry): Look for `.zip' at end of filename.  Add
6578         trailing slash to `.zip' entries.
6579
6580         * jvspec.c (lang_specific_driver): Correctly handle case where
6581         GC_NAME not defined.
6582
6583 1998-11-11  Tom Tromey  <tromey@cygnus.com>
6584
6585         * jvspec.c (GC_NAME): New define.
6586         (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
6587         if required.
6588         * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
6589
6590 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
6591
6592         * jcf-dump.c (TABLE_SWITCH):  Fix typos.
6593
6594 1998-11-11  Tom Tromey  <tromey@cygnus.com>
6595
6596         * jcf-dump.c (main): Correctly recognize `--'-style long options.
6597
6598 Tue Nov 10 12:34:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6599
6600         * class.c (is_compiled_class): Call safe_layout_class for class
6601         compiled from source.
6602         * conver.h (convert_to_integer, convert_to_real,
6603         convert_to_pointer): Added prototypes.
6604         * decl.c (init_decl_processing): Non longer push the decls of
6605         `methodtable', `constants', `Class', `Field', `dispatchTable'
6606         `jexception' and `Method'.
6607         * expr.c (build_invokeinterface): New function.
6608         (expand_invoke): static variable CLASS_IDENT now in
6609         build_invokeinterface. Use build_invokeinterface.
6610         (expand_java_field_op): Moved code to inline
6611         java.lang.PRIMTYPE.TYPE into a function.
6612         (build_primtype_type_ref): New function.
6613         * java-tree.def (INSTANCEOF_EXPR): New tree code.
6614         * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
6615         FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
6616         (DECL_CONSTRUCTOR_P): Fixed typo in comment.
6617         (DECL_LOCAL_STATIC_VALUE): New macro.
6618         (build_invokeinterface, build_primtype_type_ref): New function
6619         prototypes.
6620         (java_parse_abort_on_error): Macro rewritten.
6621         * jcf-parse.c (current_method): Add comment to declaration.
6622         (parse_zip_file_entries, process_zip_dir, void parse_source_file):
6623         Function prototypes fixed.
6624         (jcf_parse_source): push/pop parser context. save/restore global.
6625         (parse_source_file): Fixed leading comment. Now take a
6626         IDENTIFIER_NODE as an argument. Doesn't check methods, layout
6627         classes and pop the parser context anymore.
6628         (yyparse): Push parser context, save globals, parse the source
6629         file, restore globals and pop the parser context when processing a
6630         source file.
6631         * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
6632         * lex.c (java_parse_doc_section): New function.
6633         (java_lex): Call java_parse_doc_section when appropriate. Build an
6634         operator around INSTANCEOF_TK.
6635         * lex.h (java_lineterminator, java_sprint_unicode,
6636         java_unicode_2_utf8, java_lex_error, java_store_unicode):
6637         Prototypes rewritten.
6638         (java_parse_escape_sequence, java_letter_or_digit_p,
6639         java_parse_doc_section, java_parse_end_comment, java_get_unicode,
6640         java_read_unicode, java_store_unicode, java_read_char,
6641         java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
6642         Added function prototypes.
6643         * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
6644         define.
6645         (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
6646         New macros
6647         (struct parser_ctxt): New fields: deprecated,
6648         current_parsed_class_un, gclass_list.
6649         (fix_method_argument_names, issue_warning_error_from_context,
6650         resolve_package, lookup_package_type): New function prototypes.
6651         (resolve_expression_name): Fixed function prototype.
6652         (find_applicable_accessible_methods_list): Fixed indentation, added
6653         extra argument in prototype.
6654         (check_final_assignment, build_null_of_type, check_deprecation,
6655         check_method_redefinition, reset_method_name,
6656         java_check_regular_methods, java_check_abstract_methods,
6657         maybe_build_primttype_type_ref): New function prototype.
6658         * parse.y (conver.h): Include.
6659         (INSTANCEOF_TK): Tagged <operator>.
6660         (single_type_import_declaration): Use REGISTER_IMPORT macro.
6661         (relational_expression:): Build binop for instanceof.
6662         (java_push_parser_context): Remember ctxp->gclass_list across
6663         contexts.
6664         (java_pop_parser_context): Simply return if no context
6665         exists. Remember gclass_list across contexts.
6666         (issue_warning_error_from_context): New function.
6667         (parse_error_context): Don't setup ctxp->elc here. Call
6668         issue_warning_error_from_context instead.
6669         (parse_warning_context): Likewise.
6670         (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
6671         setup. Link new class/interface to ctxp->gclass_list.
6672         (add_superinterfaces): Register interface as incomplete if not
6673         loaded.
6674         (create_class): Remember class unqualified name in
6675         ctxp->current_parsed_class_un. Check class deprecation.
6676         (register_fields): Check field deprecation. Remember static final
6677         field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
6678         processing INIT.
6679         (method_header): New local variable ORIG_ARG. Use unqualified
6680         current class name for check on constructor errors. Promote return
6681         type if of record type. Argument list fix moved in
6682         fix_method_argument_names, called here. Check method deprecation.
6683         (fix_method_argument_names): New function.
6684         (method_declarator): Promote record typed arguments.
6685         (safe_layout_class): Check class methods before layout.
6686         (java_complete_class): Compute field layout when patched.
6687         (do_resolve_class): Try to load class after having it renamed
6688         after the package name.
6689         (get_printable_method_name): Use DECL_CONTEXT.
6690         (reset_method_name): New function.
6691         (check_method_redefinition): Use reset_method_name.
6692         (java_check_regular_methods): New local variable
6693         SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
6694         names for error report. Check for compile-time error when method
6695         found has default (package) access.
6696         (java_check_abstract_methods): Now takes an interface DECL node as
6697         an argument. Also reinstall real name on unchecked
6698         overriding/hiding methods for error report.
6699         (java_check_methods): Fixed leading comment. Get classes to verify
6700         from ctxp->gclass_list. Use CHECK_METHODS macro and set
6701         CLASS_METHOD_CHECKED_P on class verification.
6702         (lookup_java_method2): Get real method name if necessary.
6703         (find_in_imports): Don't check package class access here.
6704         (resolve_package, lookup_package_type): New functions.
6705         (java_layout_classes): Fixed leading comment. Take classes to be
6706         laid out from ctxp->gclass_list.
6707         (java_complete_expand_methods): Don't expand native and abstract
6708         methods.
6709         (java_expand_classes): New function.
6710         (resolve_expression_name): Use additional argument ORIG.  Retrieve
6711         values of static final field of primitive types.
6712         (resolve_field_access): Handles static final field of promotive
6713         type.
6714         (resolve_qualified_expression_name): Handle STRING_CST as
6715         primaries and package name resolution. Check deprecation on found
6716         decls. Set where_found and type_found on non static field resolved
6717         during qualification. Layout non primitive field decl types.
6718         (check_deprecation): New function.
6719         (maybe_access_field): Simplified.
6720         (patch_method_invocation_stmt): Local variable CLASS_TYPE
6721         removed. Reverse method's argument when primary is a type. Don't
6722         use CLASS_TYPE to report problems, use IDENTIFIER_WFL
6723         instead. Include abstract class in the list of class searchable
6724         for constructors. Use DECL_CONTEXT of found method for access
6725         checks. Check method deprecation.
6726         (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
6727         converting arguments. Handle INVOKE_INTERFACE.
6728         (lookup_method_invoke): Search constructor using existing
6729         infrastructure (don't rely on lookup_java_constructor anymore).
6730         (find_applicable_accessible_methods_list): Extra argument flag
6731         LC. Now include constructor in the search.
6732         (qualify_ambiguous_name): Conditional expression are primaries.
6733         (not_initialized_as_it_should_p): static final are always
6734         initialized.
6735         (java_complete_tree): Pass extra NULL argument to
6736         resolve_expression_name. Stricter test to carry on patching
6737         assignments. New case for INSTANCEOF_EXPR.
6738         (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
6739         (check_final_assignment, maybe_build_primttype_type_ref): New
6740         functions.
6741         (patch_assignment): Detect resolved static finals and carry normal
6742         assignment error check on them. Inline PRIMTYPE.TYPE read access.
6743         (try_builtin_assignconv): Access constant 0 on all primitive
6744         types.
6745         (valid_builtin_assignconv_identity_widening_p): Accept identical
6746         types. Accept all promoted type on int type.
6747         (valid_ref_assignconv_cast_p): Accept a null pointer to be
6748         assigned to a reference.
6749         (valid_method_invocation_conversion_p): Accept to check null
6750         pointers.
6751         (build_binop): Merge declaration and initialization of local
6752         variable BINOP.
6753         (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
6754         numeric types. Improved validity test for qualify operators on
6755         references.
6756         (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
6757         and PREINCREMENT_EXPR. Also detect resolved static finals of a
6758         primitive type and issue the appropriate error message.
6759         (resolve_type_during_patch): Mark class loaded when resolved.
6760         (patch_cast): Allow null to be cased to reference types.
6761         (build_null_of_type): New function.
6762         (patch_array_ref): Handle array on references correctly.
6763         (patch_return): Removed unused local variable MODIFY. Force
6764         boolean to be returned as integers. Allows null to be returned by
6765         a function returning a reference.
6766         * typeck.c (convert_to_integer, convert_to_real,
6767         convert_to_pointer): Prototypes moved to convert.h
6768         (lookup_argument_method): Use method real name, if necessary.
6769
6770 1998-10-30  Tom Tromey  <tromey@cygnus.com>
6771
6772         * class.c (build_class_ref): Changed name of primitive classes to
6773         start with `_Jv_'.
6774
6775         * class.c (make_class_data): Renamed fields: nmethods to
6776         method_count, method_count to dtable_method_count.  Always set
6777         `state' field to 0.
6778         * decl.c (init_decl_processing): Likewise.
6779
6780 Wed Oct 28 08:03:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6781
6782         * class.c (layout_class): Don't mangle <finit>, produce
6783         __finit<class> instead. Don't verify artificial methods.
6784         * decl.c (finit_identifier_node): New declared global.
6785         (init_decl_processing): finit_identifier_node initialized.
6786         * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
6787         * java-tree.h (finit_identifier_node): Declared as extern.
6788         (struct lang_decl): New field called_constructor.
6789         (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
6790         (CLASS_HAS_FINIT_P): New macro.
6791         (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
6792         explicit constructor invocation.
6793         (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
6794         CALL_SUPER_CONSTRUCTOR_P): New macros.
6795         (write_classfile): Added prototype.
6796         * jcf-parse.c (jcf_parse_source): Parse and remember for
6797         generation if the file was seen on the command line.
6798         (parse_source_file): Don't write the class file here.
6799         (yyparse): Loop on files rewritten. Set current_jcf.
6800         (parse_zip_file_entries): Parse class file only if it was found.
6801         * lang.c (init_parse): Don't open command line provided filename
6802         here.
6803         (lang_parse): Don't set main_jcf anymore.
6804         * parse.h (ABSTRAC_CHECK): Capitalized arguments.
6805         (JCONSTRUCTOR_CHECK): New macro.
6806         (JBSC_TYPE_P): New macro.
6807         (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
6808         (COMPLETE_CHECK_OP_2): New macro.
6809         (struct parse_ctxt): New field explicit_constructor_p.
6810         (check_class_interface_creation): Fixed prototype indentation.
6811         (patch_method_invocation_stmt): Prototype reflects added argument.
6812         (patch_invoke): Likewise.
6813         (complete_method_declaration, build_super_invocation,
6814         verify_constructor_circularity,
6815         build_this_super_qualified_invocation, get_printable_method_name,
6816         patch_conditional_expr, maybe_generate_finit, fix_constructors,
6817         verify_constructor_super, create_artificial_method,
6818         start_artificial_method_body, end_artificial_method_body,
6819         generate_field_initialization_code): New function prototypes.
6820         * parse.y: Fixed leading comment
6821         (constructor_header:, constructor_body:, block_end:): Rules tagged
6822         <node>.
6823         (type_declaration:): Call maybe_generate_finit.
6824         (method_declaration:): Action for method_body: placed in new
6825         function complete_method_declaration, called here.
6826         (constructor_declaration:): Defined actions. Removed leading
6827         FIXME.
6828         (constructor_header:): New rule with action.
6829         (constructor_body:): Rule rewritten using block_begin: and
6830         block_end:. Defined actions.
6831         (constructor_declarator:, explicit_constructor_invocation:):
6832         Defined actions.
6833         (block:): Use new rules block_begin: block_end:.
6834         (block_begin:, block_end:): New rules and actions.
6835         (block_statements:): Fixed error message for explicit
6836         constructors.
6837         (method_invocation:): Call build_this_super_qualified_invocation
6838         if primary is `this' or `super' was seen.
6839         (conditional_expression:): Action defined.
6840         (extra_ctxp_pushed_p): New static global flag.
6841         (java_parser_context_save_global): Create parser context if
6842         necessary. Use extra_ctxp_pushed_p to remember it.
6843         (java_parser_context_restore_global): Pop extra parser context if
6844         one exists.
6845         (build_array_from_name): Array on primitive types are marked
6846         loaded.
6847         (register_fields): Restore new name in field initializer
6848         expression if type was altered. Non static fields initialized upon
6849         declaration marked initialized.
6850         (maybe_generate_finit): New function.
6851         (maybe_generate_clinit): Use create_artificial_method,
6852         start_artificial_method_body, end_artificial_method_body. Generate
6853         debug info for enclosed initialization statements.
6854         (method_header): Fixed leading comment. Check constructor
6855         flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
6856         accordingly.
6857         (complete_method_declaration, constructor_circularity_msg,
6858         verify_constructor_circularity): New functions.
6859         (get_printable_method_name): New function.
6860         (check_method_redefinition): Don't rename <finit> methods. Fix
6861         declared constructor names. Error message for
6862         constructors modified.
6863         (java_check_regular_methods): Local variable seen_constructor
6864         renamed saw_constructor. Skip verification on constructors. Create
6865         default constructor with create_artificial_method.
6866         (java_check_methods): Removed unnecessary empty line.
6867         (create_artificial_method, start_artificial_method_body,
6868         end_artificial_method_body): New functions.
6869         (java_layout_classes): Changed leading comment. Reverse fields
6870         list if necessary. Always layout java.lang.Object if being
6871         defined.
6872         (java_complete_expand_methods): Verify constructor circularity.
6873         (java_complete_expand_method): Call fix_constructor on
6874         constructors.  Local variable no_ac_found removed. Restore
6875         bindings if method body expansion failed.
6876         (fix_constructors, verify_constructor_super,
6877         generate_field_initialization_code): New function.
6878         (java_expand_classes): Fixed leading comment. Write class file
6879         here.
6880         (resolve_expression_name): Check for illegal instance variable
6881         usage within the argument scope of an explicit constructor
6882         invocation.
6883         (resolve_qualified_expression_name): Pass extra from_super flag
6884         when invoking patch_method_invocation_stmt. New case for
6885         conditional expression when used as a primary. Check for error
6886         when acquiring super.
6887         (patch_method_invocation_stmt): Added extra argument super. New
6888         local variable is_static_flag. Set class_to_search according to
6889         the nature of the constructor invocation. Don't add `this'
6890         argument when expanding NEW_CLASS_EXPR. Check for illegal method
6891         invocation within the argument scope of explicit constructor
6892         invocation. Set is_static according to is_static_flag. Provide
6893         extra `super' argument to patch_invoke invocation.
6894         (patch_invoke): New argument from_super. Loop on arguments
6895         indentation fixed. Pass from_super to invocation_mode. New switch
6896         case INVOKE_SUPER. Fixed error message in switch default case.
6897         Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
6898         value.
6899         (invocation_mode): Return INVOKE_SUPER mode when appropriate.
6900         (lookup_method_invoke): Fixed prototypes in candidates list. Error
6901         message takes constructors into account.
6902         (find_applicable_accessible_methods_list): Fixed indentation.
6903         (qualify_ambiguous_name): Take explicit constructor invocation
6904         into account. Deal with a conditional expression as a primary to
6905         a method call.
6906         (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
6907         case. Added extra argument to patch_method_invocation_stmt.
6908         Register calls made to explicit constructor `this'. Don't call
6909         save_expr in ARRAY_REF case when emitting class files. Check for
6910         illegal use of this when expanding explicit constructor invocation
6911         arguments.
6912         (complete_function_arguments): Set and reset parser context
6913         explicit_constructor_p field value when appropriate.
6914         (build_super_invocation, build_this_super_qualified_invocation):
6915         New functions.
6916         (patch_assignment): Fixed typo.
6917         (patch_unaryop): Check on final fields occurs only when a decl
6918         exits.
6919         (patch_return): Take constructors into account.
6920         (patch_conditional_expr): New function.
6921         * typeck.c (build_java_signature): Removed unnecessary empty line.
6922
6923 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
6924
6925         * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
6926
6927 1998-10-28  Tom Tromey  <tromey@cygnus.com>
6928
6929         * decl.c (init_decl_processing): Renamed fields.
6930         * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
6931         interface_len, msize fields.
6932
6933         * class.c (make_class_data): Removed subclass_head and
6934         subclass_next fields.
6935         * decl.c (init_decl_processing): Removed subclass_head and
6936         subclass_next fields.
6937
6938 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
6939
6940         * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
6941         * mangle.c (emit_unicode_mangled_name): Similarly.
6942
6943 Mon Oct 26 12:17:23 1998  Nick Clifton  <nickc@cygnus.com>
6944
6945         * jcf-parse.c (get_constant): Place braces around code to compute
6946         'd' when REAL_ARITHMETIC is not defined.
6947
6948 Sun Oct 25 14:58:05 1998  H.J. Lu  (hjl@gnu.org)
6949
6950         * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
6951         dependency.
6952
6953 1998-10-23  Tom Tromey  <tromey@cygnus.com>
6954
6955         * lang-specs.h: `.zip' files are input to jc1.
6956
6957 Thu Oct 22 23:01:54 1998  Per Bothner  <bothner@cygnus.com>
6958
6959         * jvspecs.c:  Add (but don't enable) support for combining multiple
6960         .class and .java input filenames to a single jc1 invocation.
6961         Add support for -C flag (copile to .class files).
6962         Translate -classpath and -CLASSPATH arguments.
6963         * lang-specs.h:  Don't set %2 spec.
6964
6965 1998-10-22  Tom Tromey  <tromey@cygnus.com>
6966
6967         * jcf-path.c (add_entry): Don't add trailing separator if entry is
6968         a .zip file.
6969         (add_path): Don't add trailing separator to non-empty path
6970         elements.
6971
6972         * lang.c (lang_decode_option): Check for -fclasspath and
6973         -fCLASSPATH before examining other `-f' options.
6974
6975         * java-tree.h (finalize_identifier_node): Don't declare.
6976         * class.c (make_class_data): Don't push "final" field.
6977         * decl.c (init_decl_processing): Don't push "final" field.
6978         (finalize_identifier_node): Removed.
6979         (init_decl_processing): Don't set finalize_identifier_node.
6980
6981         * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
6982
6983 Sun Oct 11 10:31:52 1998  Anthony Green  <green@cygnus.com>
6984
6985         * Make-lang.in (java): Depend on jcf-dump and jv-scan.
6986         (JV_SCAN_SOURCES): New macro.
6987         (JCF_DUMP_SOURCES): Likewise.
6988         (jcf-dump$(exeext)): New target.
6989         (jv-scan$(exeext)): New target.
6990
6991 1998-10-22  Tom Tromey  <tromey@cygnus.com>
6992
6993         * Makefile.in (LEX): Removed.
6994         (LEXFLAGS): Likewise.
6995         (SET_BISON): New macro.
6996         (BISON): Removed.
6997         ($(PARSE_C)): Use SET_BISON.  Run bison from srcdir to avoid
6998         spurious diffs in parse.c.
6999         ($(PARSE_SCAN_C)): Likewise.
7000         (PARSE_DIR): New macro.
7001         (PARSE_C): Use it.
7002         (PARSE_SCAN_C): Likewise.
7003         (PARSE_RELDIR): New macro.
7004
7005         * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
7006
7007         * jcf-io.c (find_class): Use saw_java_source to determine when to
7008         look for `.java' file.
7009         * jcf-parse.c (saw_java_source): New global.
7010         (yyparse): Set it if `.java' file seen.
7011
7012         * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
7013         (GCJH_SOURCES): Likewise.
7014         * Makefile.in (datadir): New macro.
7015         (libjava_zip): Likewise.
7016         (JAVA_OBJS): Added jcf-path.o.
7017         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
7018         (../gcjh$(exeext)): Likewise.
7019         (jcf-path.o): New target.
7020         * java-tree.h (fix_classpath): Removed decl.
7021         * jcf-parse.c (fix_classpath): Removed.
7022         (load_class): Don't call fix_classpath.
7023         * parse.y (read_import_dir): Don't call fix_classpath.
7024         * lex.h: Don't mention classpath.
7025         * lex.c (java_init_lex): Don't initialize classpath.
7026         * jcf-io.c (classpath): Removed global.
7027         (find_class): Use jcf_path iteration functions.  Correctly search
7028         class path for .java file.
7029         (open_in_zip): New argument `is_system'.
7030         * jcf-dump.c (main): Call jcf_path_init.  Recognize all new
7031         classpath-related options.
7032         * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
7033         and -I.
7034         (lang_init): Call jcf_path_init.
7035         * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
7036         * lang-specs.h: Handle -I.  Minor cleanup to -M options.
7037         Correctly put braces around second string in each entry.
7038         * gjavah.c (main): Call jcf_path_init.  Recognize all the new
7039         classpath-related options.
7040         (help): Updated for new options.
7041         * jcf.h: Declare functions from jcf-path.c.  Don't mention
7042         `classpath' global.
7043         * jcf-path.c: New file.
7044
7045         * jcf-depend.c: Include jcf.h.
7046
7047         * jcf-write.c (localvar_alloc): Returns `void'.
7048         (localvar_free): Removed unused variable.
7049
7050         * lang.c (OBJECT_SUFFIX): Define if not already defined.
7051         (init_parse): Use OBJECT_SUFFIX, not ".o".
7052
7053 Wed Oct 21 07:54:11 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7054
7055         * class.c (emit_register_classes): Renamed from
7056         emit_register_class.
7057         * java-tree.h (emit_register_classes): Prototype renamed from
7058         emit_register_class.
7059         * jcf-parse.c (yyparse): Call emit_register_classes once before
7060         returning.
7061         * parse.y (java_expand_classes): No longer register classes.
7062
7063 Tue Oct 20 09:15:38 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7064
7065         * class.c (is_compiled_class): New local variable
7066         seen_in_zip. Identify classes found in currently compiled source
7067         file(s).
7068         * decl.c (complete_start_java_method): Fixed typo.
7069         * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
7070         HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
7071         (CLASS_P): Moved around.
7072         (java_parse_abort_on_error): Macro moved from jcf-parse.c
7073         * jcf-parse.c (java_parse_abort_on_error): Macro moved to
7074         java-parse.h
7075         (jcf_parse_source): Changed leading comment. Removed unnecessary
7076         fclose and CLASS_FROM_SOURCE_P marking.
7077         (parse_source_file): New local variables remember_for_generation
7078         and filename. Mark parsed file name identifier node. Removed block
7079         executed when parse_only was null. Set remember_for_generation.
7080         Use it as an argument to java_pop_parser_context.
7081         (yyparse): New local variables several_files, list, next node and
7082         current_file_list. Split ampersand separated file names into
7083         current_file_list. Iterate through the list and parse accordingly.
7084         * parse.h (java_pop_parser_context): New function prototype.
7085         * parse.y (ctxp_for_generation): New static global variable.
7086         (java_pop_parser_context): New argument generate. Link popped ctxp
7087         to ctxp_for_generation list accordingly.
7088         (java_complete_expand_methods): Fixed indentation.
7089         (java_expand_classes): New function.
7090
7091 Sat Oct 17 11:25:21 1998  Per Bothner  <bothner@cygnus.com>
7092
7093         * Makefile.in:  Link with libiberty.a instead of memmove.o.
7094
7095 Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7096
7097         * lex.c (setjmp.h): No longer included.
7098         * lex.h (setjmp.h): Included.
7099         * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
7100         (duplicate_declaration_error_p): Renamed from
7101         duplicate_declaration_error.
7102         (build_array_from_name): New function prototype.
7103         * parse.y (setjmp.h): No longer included.
7104         (variable_declarator_id): Define action.
7105         (build_array_from_name): New function.
7106         (duplicate_declaration_error_p): Renamed from
7107         duplicate_declaration_error.  Fixed leading comment.
7108         (register_fields): Main `for' loop reorganized. Uses
7109         SET_TYPE_FOR_RESOLUTION and build_array_from_name.
7110         (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
7111         build_array_from_name.
7112         (resolve_class): Set CLASS_LOADED_P on newly build array dimension
7113         types.
7114         (read_import_dir): Don't try to skip `.' and `..'.
7115         (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
7116         build_array_from_name. Main `for' loop reorganized.
7117         (resolve_qualified_expression_name): When building access to a
7118         field, use the type where the field was found, not its own type.
7119         (maybe_access_field): Use field DECL_CONTEXT if the type where the
7120         field was found is null.
7121         (qualify_ambiguous_name): Sweep through all successive array
7122         dimensions.
7123
7124 Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7125
7126         * java-tree.h (pop_labeled_block, lang_printable_name,
7127         maybe_add_interface, set_super_info, get_access_flags_from_decl,
7128         interface_of_p, inherits_from_p, fix_classpath,
7129         complete_start_java_method, emit_handlers, init_outgoing_cpool,
7130         make_class_data, register_class, alloc_name_constant): New
7131         function prototypes.
7132         * lang.c (lang_decode_option): Set argc argument unused. Fixed
7133         indentation. Added cast to remove warning.
7134         (lang_printable_name): Set v argument unused.
7135         (lang_print_error): Added argument to lang_printable_name call.
7136         (java_dummy_print, print_lang_decl, print_lang_type,
7137         print_lang_identifier, lang_print_xnode): All argument marked
7138         unused.
7139         * lex.c (java_unget_unicode): Removed unnecessary argument.
7140         (java_allocate_new_line): Unused local variable is gone.
7141         (java_read_char): Added parenthesis in expressions to remove
7142         warnings.  Added final return statement.
7143         (java_read_unicode): Added parenthesis in expression to remove
7144         warning.
7145         (java_parse_end_comment): Fixed java_unget_unicode invocation.
7146         (java_parse_escape_sequence): Likewise.
7147         (java_lex): Unused local variables are gone. Fixed
7148         java_unget_unicode invocation.
7149         * lex.h (set_float_handler): Prototype added when JC1_LITE not
7150         defined.
7151         * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
7152         lang_printable_name invocation in macro.
7153         (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
7154         Likewise.
7155         (duplicate_declaration_error): Suppressed unused argument in
7156         prototype.
7157         (identical_subpath_p): Function declaration is gone.
7158         (patch_invoke): Suppressed unused argument in prototype.
7159         (patch_cast, build_labeled_block, check_thrown_exceptions):
7160         Likewise.
7161         * parse.y (setjmp.h): Included
7162         (toplev.h): Likewise.
7163         (field_declaration:): Suppressed unused local
7164         (label_decl:): Fixed build_labeled_block invocation.
7165         (java_pop_parser_context): Put extra parenthesis around assignment
7166         in if.
7167         (yyerror): Suppressed unused local variables.
7168         (variable_redefinition_error): Fixed lang_printable_name
7169         invocation.
7170         (create_interface): Suppressed unused local variables.
7171         (create_class): Likewise.
7172         (duplicate_declaration_error): Suppressed unused argument. Fixed
7173         lang_printable_name invocation.
7174         (register_fields): Suppressed unused local variable. Fixed
7175         duplicate_declaration_error invocation.
7176         (method_header): Suppressed unused local variable.
7177         (method_declarator, parser_check_super): Likewise.
7178         (java_complete_class): Suppressed unused local variable. Fixed
7179         fatal error message.
7180         (complete_class_report_errors): Added default: in switch.
7181         (java_check_regular_methods): Fixed lang_printable_name
7182         invocations.
7183         (check_throws_clauses): Likewise.
7184         (java_check_abstract_methods): Suppressed unused local
7185         variable. Fixed lang_printable_name invocation.
7186         (read_import_entry): Added supplemental return statement.
7187         (read_import_dir): Suppressed unused local variables.
7188         (check_pkg_class_access, declare_local_variables): Likewise.
7189         (source_start_java_method): Suppressed unused extern variable
7190         declarations
7191         (expand_start_java_method): Suppressed unused extern and local
7192         variable declarations.
7193         (java_complete_expand_methods): Likewise.
7194         (java_complete_expand_method): Suppressed unused local variables.
7195         (make_qualified_name): Likewise.
7196         (resolve_qualified_expression_name): Added default: in
7197         switch. Fixed lang_printable_name invocation.
7198         (class_instance_creation_expression): Added parenthesis around
7199         expressions.
7200         (patch_method_invocation_stmt): Fixed lang_printable_name and
7201         patch_invoke invocations.
7202         (check_for_static_method_reference): Fixed lang_printable_name
7203         invocation.
7204         (patch_invoke): Suppressed unused arguments and local variables.
7205         (lookup_method_invoke): Suppressed unused local variables.
7206         (qualify_ambiguous_name): Added default: in switch.
7207         (identical_subpath_p): Function removed.
7208         (patch_assignment): Suppressed unused local variables. Suppressed
7209         unnecessary if statement. Fixed lang_printable_name invocations.
7210         (try_builtin_assignconv): Fixed lang_printable_name invocations.
7211         (valid_ref_assignconv_cast_p): Parenthesis around
7212         expression. Suppressed unused local variables.
7213         (build_binop): Suppressed unused local variables. fixed
7214         lang_printable_name invocations.
7215         (string_constant_concatenation): Suppressed unused local
7216         variables.
7217         (patch_unaryop): Fixed lang_printable_name invocation.
7218         (patch_cast): Suppressed unnecessary argument. Fixed
7219         lang_printable_name invocation.
7220         (patch_array_ref): Fixed lang_printable_name invocation.
7221         (patch_newarray, patch_return, patch_if_else_statement): Likewise.
7222         (build_labeled_block): Suppressed unused argument.
7223         (generate_labeled_block): Fixed build_labeled_block invocation.
7224         (build_loop_body): Suppressed unused local variables.
7225         (patch_loop_statement): Likewise.
7226         (patch_exit): Fixed lang_printable_name invocation.
7227         (patch_switch_statement): Likewise.
7228         (case_identity): First argument marked unused.
7229         (patch_try_statement): Fixed lang_printable_name invocations.
7230         (patch_synchronized_statement, patch_throw_statement): Likewise.
7231         (check_thrown_exceptions): Fixed check_thrown_exceptions and
7232         lang_printable_name invocations.
7233         (check_thrown_exceptions_do): Suppressed unused argument.
7234
7235 1998-10-14  Tom Tromey  <tromey@cygnus.com>
7236
7237         * jcf-write.c (write_classfile): Add output class file as target.
7238         * lang-options.h: Added -MD, -MMD, -M, and -MM.
7239         * jcf.h: Added declarations for dependency-tracking functions.
7240         * lang-specs.h: Handle -M, -MM, MD, and -MMD.
7241         * lang.c (lang_decode_option): Recognize -MD and -MMD.
7242         (finish_parse): Call jcf_dependency_write.
7243         (dependency_tracking): New global.
7244         (DEPEND_SET_FILE): New define.
7245         (DEPEND_ENABLE): New define.
7246         (init_parse): Enable dependency tracking if required.
7247         Include "flags.h".
7248         * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
7249         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
7250         (../gcjh$(exeext)): Likewise.
7251         (jcf-depend.o): New target.
7252         * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
7253         (GCJH_SOURCES): Likewise.
7254         * jcf-io.c (open_class): Call jcf_dependency_add_file.  Added
7255         dep_name argument.
7256         (find_classfile): Added dep_name argument.
7257         (find_class): Compute name of dependency.
7258         (open_in_zip): Call jcf_dependency_add_file.
7259         * gjavah.c (output_file): No longer global.
7260         (usage): Don't mention "gjavah".
7261         (help): Likewise.
7262         (java_no_argument): Likewise.
7263         (version): Likewise.
7264         (main): Recognize and handle -M family of options.
7265         (print_mangled_classname): Return is void.
7266         (process_file): Handle case where output is suppressed.
7267         (HANDLE_END_FIELD): Likewise.
7268         (HANDLE_METHOD): Likewise.
7269         * jcf-depend.c: New file.
7270
7271 Tue Oct 13 23:34:12 1998  Jeffrey A Law  (law@cygnus.com)
7272
7273         * java-tree.def: Add missing newline at EOF.
7274
7275 1998-10-13  Tom Tromey  <tromey@cygnus.com>
7276
7277         * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
7278         (main): Likewise.  Exit with SUCCESS_EXIT_CODE at end of
7279         function.
7280         Include <config.h> and "system.h".
7281         (disassemble_method): Undefine RET to avoid clash with
7282         config/i386/i386.h.
7283
7284 Tue Oct 13 03:50:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7285
7286         * decl.c (runtime_exception_type_node, error_exception_type_node):
7287         New global variables.
7288         (init_decl_processing): Initialized.
7289         * expr.c (java_lang_expand_expr): Set caught exception type to
7290         null if catch handler argument doesn't exit.
7291         * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
7292         tree codes.
7293         * java-tree.h (runtime_exception_type_node,
7294         error_exception_type_node): Global variables declared.
7295         (DECL_FUNCTION_THROWS): New macro.
7296         (DECL_FUNCTION_BODY): Modified comment.
7297         (DECL_SPECIFIC_COUNT): Likewise.
7298         (struct lang_decl): New field throws_list.
7299         (IS_UNCHECKED_EXPRESSION_P): New macro.
7300         * lex.c (java_lex): Generate location information for THROW_TK.
7301         * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
7302         EXCEPTIONS_P): New macros.
7303         (enum jdep_code): New value JDEP_EXCEPTION.
7304         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
7305         BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
7306         PATCH_METHOD_RETURN_ERROR): New macros.
7307         (patch_method_invocation_stmt): Added new argument to prototype.
7308         (patch_synchronized_statement, patch_throw_statement,
7309         check_thrown_exceptions, check_thrown_exceptions_do,
7310         purge_unchecked_exceptions, check_throws_clauses): New function
7311         prototypes.
7312         * parse.y Fixed typo in keyword section.
7313         (throw:): Rule tagged <node>.
7314         (THROW_TK): Keyword tagged <operator>.
7315         (method_header:): Last argument to call to method_header passed
7316         from throws: rule.
7317         (throws:, class_type_list:, throw_statement:,
7318         synchronized_statement:, synchronized:): Defined actions.
7319         (method_header): New local variable current. Register exceptions
7320         from throws clause.
7321         (java_complete_tree): Complete and verify exceptions from throws
7322         clause.
7323         (complete_class_report_errors): Error message on exceptions not
7324         found
7325         (java_check_regular_methods): Fixed typo. Shortcut on private
7326         overriding methods. Changed error message on method
7327         redefinition. Check for throws clause compatibility.
7328         (check_throws_clauses): New function.
7329         (java_check_abstract_methods): Use DECL_NAME for wfl or current
7330         method. Changed error message on method redefinition.
7331         (currently_caught_type_list): New static variable.
7332         (java_complete_expand_methods): Purge unchecked exceptions from
7333         throws clause list. Call PUSH_EXCEPTIONS before walk and
7334         POP_EXCEPTIONS after.
7335         (resolve_qualified_expression_name): Pass new argument as NULL to
7336         patch_method_invocation_stmt.
7337         (patch_method_invocation_stmt): New argument ref_decl. Invoke
7338         PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
7339         argument list when appropriate. Use new argument if non null to
7340         store selected method decl.
7341         (patch_invoke): Convert if necessary args of builtin types before
7342         forming CALL_EXPR. Argument list no longer reversed here.
7343         (invocation_mode): Treat final methods as static methods.
7344         (java_complete_tree): New cases for THROW_EXPR: and
7345         SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
7346         function call.
7347         (complete_function_arguments): No more RECORD_TYPE
7348         conversion. Function parameter nodes no longer saved.
7349         (valid_ref_assignconv_cast_p): Avoid handling null type.
7350         (patch_binop): Fixed null constant reference handling.
7351         (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
7352         BUILD_THROW macros.
7353         (patch_try_statement): Fixed comments. Record caught types in
7354         list, push the list, expand try block and pop the list.
7355         (patch_synchronized_statement, patch_throw_statement,
7356         check_thrown_exceptions, check_thrown_exceptions_do,
7357         purge_unchecked_exceptions): New functions.
7358         * typeck.c (lookup_argument_method): Allow WFL in place of method
7359         DECL_NAME during method definition check
7360
7361 1998-10-09  Tom Tromey  <tromey@cygnus.com>
7362
7363         * gjavah.c (decode_signature_piece): New function.
7364         (print_c_decl): Use it.  Added `name_override' argument.
7365         (print_method_info): Use name_override argument to print_c_decl.
7366         (seen_fields): Removed.
7367         (print_field_info): Don't update seen_fields.
7368         (struct method_name): New structure.
7369         (method_name_list): New global.
7370         (print_method_info): Add new method to list of methods.
7371         (name_is_method_p): New function.
7372         (print_field_info): If field name has same name as method, then
7373         change field name.
7374         (process_file): Parse methods before fields.
7375         (field_pass): New global.
7376         (HANDLE_END_FIELD): Take field_pass into account.
7377
7378 Wed Oct  7 12:10:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7379
7380         * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
7381         (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
7382
7383 Sat Oct  3 13:29:46 1998  Anthony Green  <green@cygnus.com>
7384
7385         * jvspec.c: Fix bug in jvgenmain_spec patch.
7386
7387 Fri Oct  2 17:22:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7388
7389         * Makefile.in (lang.o:): Install dependency on java-tree.def.
7390         * decl.c (soft_exceptioninfo_call_node): New global variable.
7391         (init_decl_processing): Fixed indentation. soft_badarrayindex_node
7392         takes extra integer argument. soft_exceptioninfo_call_node
7393         initialized.
7394         * except.c (java_set_exception_lang_code): New function
7395         (method_init_exceptions): Called here.
7396         (prepare_eh_table_type): New function.
7397         (expand_end_java_handler): Called here.
7398         * expr.c (build_java_throw_out_of_bounds_exception): Now features
7399         one argument. Modified generation of call to
7400         soft_badarrayindex_node to use new argument.
7401         (build_java_arrayaccess): Pass faulty index value to
7402         build_java_throw_out_of_bounds_exception.
7403         (generate_name): New function.
7404         (java_lang_expand_expr): New local variables node, current,
7405         has_finally_p. Expand TRY_EXPR node.
7406         (process_jvm_instruction): Replace top of the stack with thrown
7407         object reference when entering exception handler.
7408         * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
7409         specific tree codes.
7410         * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
7411         global.
7412         (DECL_SPECIFIC_COUNT): New macro.
7413         (prepare_eh_table_type, java_set_exception_lang_code,
7414         generate_name): New function declarations.
7415         (match_java_method): Declaration deleted.
7416         (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
7417         macros.
7418         * lex.c (TRY_TK, CATCH_TK): Generate location information.
7419         * parse.h (redefinition_error, refine_accessible_methods_list,
7420         can_cast_to_p): Function declaration removed.
7421         (classitf_redefinition_error, variable_redefinition_error,
7422         parse_jdk1_1_error, find_applicable_accessible_methods_list,
7423         find_most_specific_methods_list, argument_types_convertible,
7424         enter_a_block, valid_builtin_assignconv_identity_widening_p,
7425         valid_cast_to_p, valid_method_invocation_conversion_p,
7426         try_reference_assignconv, add_stmt_to_compound,
7427         build_jump_to_finally, build_tree_list, patch_try_statement,
7428         java_get_catch_block): New function declarations.
7429         * parse.y (string_buffer_type): Global variable deleted.
7430         (group_of_labels, catches, catch_clause, catch_clause_parameter,
7431         finally): Rules tagged <node>.
7432         (TRY_TK, CATCH_TK): Token tagged <operator>.
7433         (class_body_declaration:, class_member_declaration:,
7434         formal_parameter:, explicit_constructor_invocation:,
7435         interface_member_declaration:, constant_declaration:,
7436         primary_no_new_array:, class_instance_creation_expression:,
7437         array_creation_expression:): Issue error on unsuported JDK1.1
7438         features.
7439         (try_statement:, catches:, finally:): Define actions.
7440         (catch_clause_parameter): New rule.
7441         (catch_clause:): Use new rule catch_clause_parameter.
7442         (parse_jdk1_1_error): New function.
7443         (redefinition_error): Renamed classitf_redefinition_error.
7444         (variable_redefinition_error): New function.
7445         (check_class_interface_creation): Call
7446         classitf_redefinition_error.
7447         (java_complete_tree): Added error message on JDEP_TYPE: case.
7448         (complete_class_report_errors): Fixed indentation.
7449         (declare_local_variables): Call variable_redefinition_error.
7450         (source_end_java_method): Call java_set_exception_lang_code and
7451         emit_handlers where appropriate.
7452         (java_method_add_stmt): Call add_stmt_to_block.
7453         (add_stmt_to_block): New function.
7454         (lookup_method_invoke): Fixed outside comment. new local variable
7455         candicates.  Call find_applicable_accessible_methods_list and
7456         find_most_specific_methods_list when searching for a
7457         method. Modified error report to list possible candidates when
7458         applicable.
7459         (find_applicable_accessible_methods_list,
7460         find_most_specific_methods_list, argument_types_convertible): New
7461         function.
7462         (refine_accessible_methods_list): Function deleted.
7463         (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
7464         expr (if applicable) before calling patch_array_ref.
7465         (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
7466         (enter_block): Fixed comment.
7467         (enter_a_block): New function.
7468         (patch_assignment): Reorganized. Call try_reference_assignconv for
7469         references. Call valid_cast_to_p instead of can_cast_to_p.
7470         (try_reference_assignconv,
7471         valid_builtin_assignconv_identity_widening_p): New functions.
7472         (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
7473         (valid_cast_to_p, valid_method_invocation_conversion_p): New
7474         functions.
7475         (build_string_concatenation): Don't resolve StringBuffer.
7476         (patch_cast): Fixed inverted arguments.
7477         (patch_array_ref): Code to save array expr deleted. Call
7478         valid_cast_to_p instead of can_cast_to_p.
7479         (generate_labeled_block): Call generate_name.
7480         (build_jump_to_finally, build_try_statement, java_get_catch_block,
7481         patch_try_statement): New functions.
7482         * typeck.c (match_java_method): Function deleted.
7483
7484 Fri Oct  2 13:48:36 1998  Anthony Green  <green@cygnus.com>
7485
7486         * jvspec.c: jvgenmain_spec uses different temporary file names.
7487
7488 Fri Oct  2 12:50:19 1998  Anthony Green  <green@cygnus.com>
7489
7490         * jvspec.c (lang_specific_driver): Fail if user specifies
7491         --main= when not linking.
7492
7493 Mon Sep 28 13:48:33 1998  Tom Tromey  <tromey@cygnus.com>
7494
7495         * class.c (make_class_data): Push value for `thread' field.
7496         * decl.c (init_decl_processing): Added `thread' field to class.
7497
7498         * class.c (add_field): Always make static fields externally
7499         visible.
7500
7501 Sat Sep 26 08:22:47 1998  Anthony Green  <green@cygnus.com>
7502
7503         * expr.c (build_java_athrow,
7504         build_java_throw_out_of_bounds_exception, expand_invoke,
7505         build_newarray, expand_java_multianewarray, build_java_monitor):
7506         Update comments to reflect _Jv_* function names.
7507
7508 Fri Sep 25 16:03:02 1998  Per Bothner  <bothner@cygnus.com>
7509
7510         * decl.c (complete_start_java_method):  DECL_RESULT is always promoted.
7511         * decl.c (start_java_method):  Handle PROMOTE_PROTOTYPES target macro.
7512         * parse.y (expand_start_java_method):  Likewise.
7513
7514 Thu Sep 24 12:20:35 1998  Per Bothner  <bothner@cygnus.com>
7515
7516         * expr.c (pop_arguments):  Handle PROMOTE_PROTOTYPES target macro.
7517
7518         * class.c (push_class):  IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
7519         (add_field):  No longer need to convert from RECORD_TYPE to pointer,
7520         * expr.c:  Remove no-longer-needed calls to promote_type.
7521         * decl.c (give_name_to_locals):  Liekwise.
7522         * jcf-parse.c (get_class_constant):  Compensate for new signatures.
7523         * parse.y:  Add/remove promote_type calls as appropriate.
7524         * typeck.c (parse_signature_type):  Returns POINTER_TYPE for objects.
7525         (parse_signature_string):  Likewise.
7526         (build_java_array_type):  Fix for now signature convenions.
7527
7528         * lex.c (java_lex):  Fix (from Alex) for JC1_LITE problem.
7529
7530 Wed Sep 23 14:49:35 1998  Tom Tromey  <tromey@cygnus.com>
7531
7532         * class.c (init_class_processing): libjava function renamed to
7533         _Jv_RegisterClass.
7534
7535 Tue Sep 22 12:00:02 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7536
7537         * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
7538         * java-tree.def: Fixed DEFTREECODE third argument.
7539         (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
7540         CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
7541         * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
7542         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
7543         JAVA_THIS_EXPR): Now replaced by tree code definitions.
7544         (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
7545         * lang.c (java_tree_code_type, java_tree_code_length,
7546         java_tree_code_name): New arrays.
7547         (lang_init): Append Java tree node definitions to Gcc ones.
7548         * lex.c (expression_obstack): Declared as extern when JC1_LITE
7549         defined.
7550         (java_init_lex): Initialize wfl_append, wfl_string_buffer,
7551         wfl_to_string.
7552         (java_lex): Allow declaration of empty string constants. Retain
7553         location information on CASE_TK and DEFAULT_TK.
7554         * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
7555         JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
7556         Modified to be more robust.
7557         (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
7558         (build_new_invocation, try_builtin_assignconv,
7559         patch_switch_statement, string_constant_concatenation,
7560         build_string_concatenation, patch_string_cst, patch_string,
7561         java_expand_switch): New function declarations.
7562         * parse.y: Rules related to switch and EH tagged <node>.
7563         (label_id): Set to NULL_TREE
7564         (wfl_string_buffer, wfl_append, wfl_to_string): New static global
7565         tree nodes.
7566         (this_or_super:): Fixed indentation.
7567         (statement:, statement_nsi:, statement_without_trailing_substatement:,
7568         statement_expression:): Removed call to RULE on all sub-rules.
7569         (switch_expression:, switch_labels:): New rules.
7570         (switch_statement:, switch_block:, switch_block_statement_groups:,
7571         switch_block_statement_group:, switch_labels:, switch_label:):
7572         Defined actions.
7573         (throw_statement:, synchronized_statement:, try_statement:):
7574         Defined temporary actions.
7575         (class_instance_creation_expression:): Call
7576         build_new_invocation. Fixed indentation.
7577         (field_access): Fixed indentation.
7578         (method_invocation): Likewise.
7579         (make_qualified_primary): Use THIS_EXPR.
7580         (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
7581         resolving from SUPER, set *type_found.
7582         (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
7583         (java_complete_tree): Removed unused local variable `location'. Case
7584         for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
7585         NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
7586         on MODIFY_EXPR: and all binary operator tree code cases. Removed
7587         STRING_CST: case. default: checks for patchable strings.
7588         (complete_function_arguments): Transform string constant or
7589         crafted StringBuffer if necessary.
7590         (build_method_invocation): Fixed comments.
7591         (build_new_invocation): New function.
7592         (patch_assignment): Call try_builtin_assignconv to figure a valid
7593         assignment conversion between builtin types.
7594         (try_builtin_assignconv): New function.
7595         (build_binop): Use URSHIFT_EXPR directly to call build.
7596         (operator_string): Use UNARY_PLUS_EXPR.
7597         (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
7598         operator.
7599         (do_merge_string_cste, merge_string_cste,
7600         string_constant_concatenation, build_string_concatenation,
7601         patch_string, patch_string_cst): New function.
7602         (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
7603         (patch_unaryop): Likewise. New test of valid ++/-- operands.
7604         (build_newarray_node): Use NEW_ARRAY_EXPR.
7605         (build_this): Use THIS_EXPR.
7606         (build_return): Enable debug information on return statement.
7607         (build_if_else_statement): Likewise.
7608         (complete_labeled_statement): Fixed related comment.
7609         (build_loop_body): Fixed comment.
7610         (build_bc_statement): Enable debug information on break/continue
7611         statements.
7612         (patch_bc_statement): Fixed typos. Handle SWITCH statement
7613         context.
7614         (patch_switch_statement, case_identity, java_expand_switch): New
7615         functions.
7616
7617 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
7618
7619         * buffer.h (BUFFER_INIT):  New macro.
7620         * jcf-write.c (struct jcf_partial):  New type.  Put global stuff here.
7621         Pass (struct jcf_partial *state) to most functions.
7622         (jcf_block, jcf_relocation):  New types.
7623         Support labels, branches, conditionals, loops.
7624
7625 Mon Sep 21 15:08:48 1998  Tom Tromey  <tromey@cygnus.com>
7626
7627         * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
7628
7629 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
7630
7631         * decl.c (integer_type_node):  Make it have INT_TYPE_SIZE.
7632         * verify.c (verify_jvm_instructions):  Use int_type_not (32 bits),
7633         not integer_type_node (INT_TYPE_SIZ bits).
7634
7635         * parse.y (patch_if_else_statement):  Accept promoted_boolean_type_node.
7636
7637         * jcf-reader.c (get_attribute):  New HANDLE_EXCEPTION_TABLE hook.
7638         * jcf-dump.c (print_exception_table):  New function.
7639         (disassemble_method):  Better handling of wide instructions.
7640         Make more robust for bad input.
7641
7642 Wed Sep 30 20:53:51 1998  Jeffrey A Law  (law@cygnus.com)
7643
7644         * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
7645         FreeBSD.
7646
7647 Thu Sep 17 19:45:01 1998  Jeffrey A Law  (law@cygnus.com)
7648
7649         * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
7650
7651 Thu Sep 17 16:21:52 1998  Tom Tromey  <tromey@cygnus.com>
7652
7653         * Makefile.in ($(PARSE_H)): Removed target.
7654
7655 Thu Sep 17 01:57:07 1998  Jeffrey A Law  (law@cygnus.com)
7656
7657         * Makefile.in (JAVA_OBJS): Add memmove.o
7658         (memmove.o): New target & rules.
7659
7660 Tue Sep 15 23:21:55 1998  Tom Tromey  <tromey@cygnus.com>
7661
7662         * expr.c (expand_invoke): Don't generate a call to the class init
7663         code.
7664
7665 Mon Sep 14 10:14:47 1998  Jeffrey A Law  (law@cygnus.com)
7666
7667         * Makefile.in: Add many missing dependencies.
7668         * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
7669         as appropriate.
7670         * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
7671         * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
7672
7673 Fri Sep 11 14:05:21 1998  Per Bothner  <bothner@cygnus.com>
7674
7675         * decl.c (complete_start_java_method):  If method is static (and
7676         not private) call _Jv_InitClass.
7677         * expr.c (expand_invoke):  Don't call build_class_init.
7678
7679         * jvspec.c (jvgenmain_spec):  Fix spec for generated .o file.
7680
7681 Thu Sep 10 10:33:31 1998  Jeffrey A Law  (law@cygnus.com)
7682
7683         * Make-lang.in (GCJ): Define before using.
7684
7685 Wed Sep  9 21:23:10 1998  Jeffrey A Law  (law@cygnus.com)
7686
7687         * gjavah.c (java_no_argument): Renamed from no_argument to avoid
7688         losing due to namespace pollution in GNU getopt.h
7689
7690 Wed Sep  9 13:33:39 1998  Tom Tromey  <tromey@cygnus.com>
7691
7692         * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
7693         (java.all.cross): Likewise.
7694         (java.rest.encap): Likewise.
7695
7696 Tue Sep  8 10:34:05 1998  Jeffrey A Law  (law@cygnus.com)
7697
7698         * gjavah.c (print_class_decls): Fix thinko in arglist
7699         * jcv-io.c (find_classfile): Similarly.
7700
7701 Mon Sep  7 13:59:49 1998  Jeffrey A Law  (law@cygnus.com)
7702
7703         * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
7704
7705 Sat Sep  5 16:08:01 1998  Tom Tromey  <tromey@cygnus.com>
7706
7707         * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
7708         (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
7709         * Makefile.in (PARSE_C): New macro.
7710         (PARSE_H): Likewise.
7711         (PARSE_SCAN_C): Likewise.
7712         ($(PARSE_C)): Target renamed from parse.c.
7713         ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
7714         (clean): Remove parse-scan.c as well.
7715         (parse.o): Depend on $(PARSE_C).
7716
7717 Sat Sep  5 08:48:40 1998  Anthony Green  <green@cygnus.com>
7718
7719         * README, license.terms: Removed.
7720
7721         * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
7722         decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
7723         javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
7724         jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
7725         keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
7726         lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
7727         verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
7728         and Java trademark attribution.
7729
7730 Fri Sep  4 10:42:05 1998  Tom Tromey  <tromey@cygnus.com>
7731
7732         * Makefile.in: Use gcjh, not gjavah.
7733         * config-lang.in (stagestuff): Use gcjh, not gjavah.
7734         * Make-lang.in: Changed gjavah to gcjh everywhere.
7735
7736 Thu Sep  3 18:04:09 1998  Per Bothner  <bothner@cygnus.com>
7737
7738         * gjavah.c:  Support new -prepend -add -append flags.
7739         (print_method_info):  Method is not virtual if class is final.
7740
7741 Thu Sep  3 12:03:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7742
7743         * jv-scan.c: Fixed copyright assignment.
7744         * keyword.gperf: Likewise.
7745         * keyword.h: Likewise.
7746         * lex.c: Fixed copyright assignment.
7747         (java_lex): Push unicode back when parsing '<'.
7748         * lex.h: Fixed copyright assignment.
7749         * parse-scan.y: Likewise.
7750         * parse.h: Fixed copyright assignment.
7751         (build_debugable_stmt, complete_for_loop): New function prototypes.
7752         * parse.y: Fixed copyright assignment.
7753         (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
7754         size_zero_node when completing a loop with no exit condition.
7755         (for_statement_nsi:): Define action.
7756         (for_init:, for_update:): Return size_zero_node when empty.
7757         (declare_local_variables): Call build_debugable_stmt.
7758         (build_debugable_stmt): New function.
7759         (build_loop_body): Build debugable statement around loop
7760         condition part.
7761         (complete_loop_body): Take into account the debugable statement
7762         around the EXIT_EXPR.
7763         (complete_loop_body): New function.
7764         (patch_exit_expr): Fixed condition inversion.
7765
7766 Wed Sep  2 11:53:58 1998  Tom Tromey  <tromey@cygnus.com>
7767
7768         * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
7769         name of thread define.
7770         * jvspec.c (THREAD_NAME): New macro.
7771         (GCLIB): Likewise.
7772         (THREADLIB): Likewise.
7773         (lang_specific_driver): Recognize attempt to link with thread
7774         library or gc library.  Recognize -ljava on command line so it
7775         isn't linked against more than once.
7776
7777 Wed Sep  2 11:28:35 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7778
7779         * parse-scan.y (report_main_declaration): Name of the class
7780         containing `main' can be a qualified name.
7781
7782 Mon Aug 31 13:25:58 1998  Tom Tromey  <tromey@cygnus.com>
7783
7784         * config-lang.in: Changed gjavac to gjc everywhere.
7785         * Make-lang.in: Changed gjavac to gjc everywhere.
7786
7787 Thu Aug 27 02:28:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7788
7789         * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
7790         (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
7791         and install the files.
7792         * Makefile.in (JAVA_OBJS_LITE): New variable.
7793         (compiler:): Now include jv-scan as a dependency.
7794         (../jv-scan$(exeext), parse-scan.c): New targets.
7795         (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
7796         * config-lang.in (compilers): Removed gcj, gjavah from the list.
7797         * jcf-parse.c (parse_source_file): Call java_layout_classes and
7798         check for errors even if parse_only.
7799         * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
7800         defined.
7801         (yylex): New function. Uses java_lex body.
7802         (java_lex): Removed commented out statement. Remove local variable
7803         literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
7804         appropriate.  Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
7805         DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
7806         SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
7807         if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
7808         SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
7809         where appropriate.
7810         (java_lex_error): Empty if JC1_LITE is defined.
7811         (java_get_line_col): Return 0 if JC1_LITE is defined.
7812         * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
7813         SET_MODIFIER_CTX): Moved into the section containing the macros
7814         conditionally defined by JC1_LITE.
7815         (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
7816         argument if JC1_LITE is defined.
7817         (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
7818         REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
7819         is defined.
7820         (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
7821         FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
7822         SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
7823         to different values according to JC1_LITE.
7824         * parse.h (int_fits_type_p, stabilize_reference): Prototype not
7825         declared if JC1_LITE set.
7826         (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
7827         defined if JC1_LITE not set.
7828         (struct parser_ctx): Reorganized and skip the jc1 front end part
7829         if JC1_LITE set.
7830         (java_layout_classes): New function definition.
7831         (java_push_parser_context, java_init_lex, yyparse, yylex,
7832         yyerror): Prototype always declared. All other static function
7833         prototypes declared only if JC1_LITE is not set.
7834         * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
7835         declared in parse.h.
7836         (java_layout_classes): New function.
7837         (java_complete_expand_methods): No longer layout the class here.
7838         * parse-scan.y: New file.
7839         * jv-scan.c: New file.
7840
7841 Tue Aug 25 10:17:54 1998  Tom Tromey  <tromey@cygnus.com>
7842
7843         * gjavah.c (main): Handle -friend option.
7844         (friend_specs): New global.
7845         (generate_access): Handle friend_specs.
7846         (process_file): Likewise.
7847         (MAX_FRIENDS): New macro.
7848         (friend_count): New global.
7849         (print_cxx_classname): Added `prefix' argument.  Ignore arrays.
7850         Changed all callers.
7851
7852 Mon Aug 24 20:19:27 1998  Per Bothner  <bothner@cygnus.com>
7853
7854         * jcf-dump.c (process_class):  Move JCF_FINISH use to main,
7855         (main):  Handle processing all the entries of a named .zip archive.
7856         * jcf-io.c (jcf_trim_old_input):  New function.
7857         * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le):  New macros.
7858
7859 Mon Aug 24 07:35:13 1998  Per Bothner  <bothner@cygnus.com>
7860
7861         * lang.c (flag_assume_compiled):  Make default be on.
7862
7863 Fri Aug 21 17:29:04 1998  Per Bothner  <bothner@cygnus.com>
7864
7865         * jcf-dump.c:  Add bunches of flags to control output more.
7866         (process_class):  New function;  support printing more than one class.
7867         (main): Support new --print-main and --javap flags.
7868         * jcf-reader.c (IGNORE_ATTRIBUTE):  New hook.
7869         * jcf.h (CPOOL_INDEX_IN_RANGE):  New macro.
7870
7871 Thu Aug 20 14:24:47 1998  Per Bothner  <bothner@cygnus.com>
7872
7873         Change mangling of dispatch table to match C++ vtable (w/thunks).
7874         * class.c (build_dtable_decl), java-tree.h:  New function.
7875         (make_class_data):  Call it.
7876         * decl.c (init_decl_processing):  Likewise.
7877
7878 Wed Aug 19 17:57:07 1998  Warren Levy  <warrenl@cygnus.com>
7879
7880         * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
7881         soft_anewarray; adjust args passed.
7882         * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
7883         match _Jv_NewObjectArray.
7884
7885 Wed Aug 19 09:33:23 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7886
7887         * decl.c (push_labeled_block, pop_labeled_block): New functions.
7888         * expr.c (loopup_label): Call create_label_decl.
7889         (create_label_decl): New function.
7890         (java_lang_expand_expr): Call expand_start_bindings with argument
7891         set to zero.
7892         * java-tree.h Added space after PROTO in function declarations
7893         when necessary.
7894         (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
7895         (create_label_decl, push_labeled_block): New function
7896         declarations.
7897         * lex.c (label_id): Initialize.
7898         (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
7899         switch.
7900         * parse.h Added space after PROTO in function declarations when
7901         necessary.
7902         (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
7903         LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
7904         LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
7905         PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
7906         macros.
7907         (struct parser_ctxt): New fields current_loop,
7908         current_labeled_block.
7909         (build_if_else_statement, patch_if_else_statement,
7910         add_stmt_to_compound, patch_exit_expr, build_labeled_block,
7911         generate_labeled_block, complete_labeled_statement,
7912         build_bc_statement, patch_bc_statement, patch_loop_statement,
7913         build_new_loop, build_loop_body, complete_loop_body): New function
7914         declarations.
7915         * parse.y (java_warning_count): New global variable.
7916         (label_id): New static variable.
7917         (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
7918         (block:): Return size_zero_node when block is empty.
7919         (empty_statement:): Return size_zero_node.
7920         (statement:): Implement supplemental action when for_statement: is
7921         reduced.
7922         (label_decl:): New rule.
7923         (labeled_statement:): Rewritten using label_decl. Actions
7924         implemented.
7925         (labeled_statement_nsi:): Likewise.
7926         (if_then_statement): Actions implemented.
7927         (while_expression): New rule.
7928         (while_statement:): Rewritten using while_expression. Actions
7929         implemented.
7930         (while_statement_nsi:): Likewise.
7931         (do_statement_begin:): New rule.
7932         (do_statement:): Rewritten using do_statement_begin. Actions
7933         implemented.
7934         (for_statement:): Rewritten using for_begin. Actions implemented.
7935         (for_statement_nsi:): Likewise.
7936         (for_header:, for_begin:): New rules.
7937         (for_init:): Actions implemented.
7938         (statement_expression_list:, break_statement:,
7939         continue_statement:): Likewise.
7940         (yyerror): Count number of issued warning(s).
7941         (java_report_errors): Report error(s) and/or warning(s).
7942         (java_complete_class): Use build_java_argument_signature to
7943         recompute completed method signature.
7944         (java_check_regular_methods): New locals method_wfl and aflags.
7945         Use method_wfl instead of lookup_cl during error reports. Fixed
7946         indentation and modified some error messages. Use
7947         lang_printable_name in method instead of the DECL_NAME. New code
7948         to issue warnings on methods not overriding corresponding methods
7949         private to a different package.
7950         (java_method_add_stmt): Call add_stmt_to_compound.
7951         (add_stmt_to_compound): New function.
7952         (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
7953         LOOP_EXPR, EXIT_EXPR and COND_EXPR.
7954         (build_if_else_statement, patch_if_else_statement,
7955         build_labeled_block, generate_labeled_block,
7956         complete_labeled_statement, build_new_loop, build_loop_body,
7957         complete_loop_body, patch_loop_statement, build_bc_statement,
7958         patch_bc_statement, patch_exit_expr): New functions.
7959         * typeck.c (build_java_signature): Build argument signature before
7960         enclosing it in between parenthesis.
7961
7962 Mon Aug 17 17:44:24 1998  Warren Levy  <warrenl@cygnus.com>
7963
7964         * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
7965         (JAVA_OBJS): Added reminder comment
7966
7967 Thu Aug 13 10:01:45 1998  Nick Clifton  <nickc@cygnus.com>
7968
7969         * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
7970         be interpreted as a long long.
7971
7972 Thu Aug 13 14:34:07 1998  Warren Levy  <warrenl@cygnus.com>
7973
7974         * decl.c (init_decl_processing): Use _Jv_InitClass, not
7975         soft_initialise_class.  Use _Jv_NewMultiArray, not
7976         soft_multianewarray.  Use _Jv_ThrowBadArrayIndex, not
7977         soft_badarrayindex.  Use _Jv_CheckCast, not soft_checkcast.  Use
7978         _Jv_CheckArrayStore, not soft_checkarraystore.  Use
7979         _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
7980
7981 Wed Aug 12 14:23:13 1998  Per Bothner  <bothner@cygnus.com>
7982
7983         * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
7984         length_identifier_node):  New global tree node constants.
7985         * parse.y (kw_super, kw_this, kw_length):  Removed globals.
7986         Replace uses by super_identifier_node etc.
7987         * lex.c (kw_super, kw_this, kw_length):  Don't initialize.
7988
7989         * parse.y (resolve_field_access):  Don't special-case ".length" if
7990         flag_emit_class_files.
7991         (patch_array_ref):  Leave as ARRAY_REF if flag_emit_class_files.
7992         * jcf-write.c (generate_bytecode_insns):  Handle ARRAY_REF opcode
7993         and ARRAY.length.
7994
7995 Tue Aug 11 11:31:55 1998  Per Bothner  <bothner@cygnus.com>
7996
7997         * decl.c (init_decl_processing): Remove unused method_type_node fields.
7998         * class.c (make_method_value):  Remove init for removed fields.
7999
8000         * class.c (layout_class):  Use build_java_argument_signature.
8001         * java-tree.h (TYPE_ARGUMENT_SIGNATURE):  New macro.
8002
8003         * typeck.c (push_java_argument_signature):  Removed.  Merged into ...
8004         (build_java_argument_signature):  Use TYPE_ARGUMENT_SIGNATURE cache.
8005         (build_java_signature):  Don't use push_java_argument_signature.
8006
8007         * typeck.c (lookup_argument_method):  New function.
8008         * parse.y (java_check_regular_methods):  Use lookup_argument_method
8009         instead of lookup_java_method2 followed by lookup_java_method.
8010
8011         * parse.y (check_method_redefinition):  Minor optimization.
8012
8013         * jcf-write.c (generate_bytecode_insns):  Handle RETURN_EXPR,
8014         MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
8015
8016 Mon Aug 10 09:57:15 1998  Tom Tromey  <tromey@cygnus.com>
8017
8018         * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
8019         c-pragma.o.
8020
8021         * gjavah.c (java_float_finite): Use K&R-style definition.
8022         (java_double_finite): Likewise.
8023         (generate_access): Now returns void.  Changed all callers.
8024         (last_access_generated): Removed.
8025         (process_file): Only make a single pass over the .class file.
8026
8027 Wed Jul 29 17:50:23 1998  Per Bothner  <bothner@cygnus.com>
8028
8029         * class.c (get_dispatch_table):  Add extra dummy vtable entry,
8030         for compatibility for G++ (with -fvtable-thunks).
8031         * expr.c (build_invokevirtual):  Add one for extra dummy vtable entry.
8032
8033         * gjavah.c (process_file):  Use public inheritance for super-class.
8034
8035 Wed Jul 29 13:19:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8036
8037         * lex.c (java_init_lex): Initialize ctxp->package.
8038         * parse.h (struct parser_ctxt): package and package_len replaced
8039         by tree package, an identifier node. Field method_decl_list is
8040         gone. Fixed comments.
8041         (lookup_field_wrapper, merge_qualified_name, not_accessible,
8042         class_in_current_package): New function prototypes.
8043         * parse.y (array_type:): Set class loaded flag on primitive type
8044         arrays.
8045         (package_declaration:): Assign ctxp->package to the
8046         identifier node.
8047         (method_invocation:): Handle invocation of method qualified by
8048         `super'.
8049         (single_type_import_declaration:): Removed ambiguity check.
8050         (java_pop_parser_context): New local variable `next'. Reset and
8051         set IMPORT_CLASSFILE_NAME flags on current and previous import
8052         list.
8053         (java_accstring_lookup): Use new local macro COPY_RETURN.
8054         (lookup_field_wrapper): New function.
8055         (parser_qualified_classname): Use merge_qualified_name.
8056         (parser_check_super_interface): Broaden error message.
8057         (do_resolve_class): Check for qualified class name in the current
8058         compilation unit if appropriate.
8059         (process_imports): Check for already defined classes.
8060         (check_pkg_class_access): Got rid of call to
8061         get_access_flags_from_decl.
8062         (java_complete_expand_methods): Call safe_layout_class based on
8063         the current class size.
8064         (make_qualified_primary): Build a WFL qualification on primary if
8065         none exists.
8066         (merge_qualified_name): New function.
8067         (make_qualified_name): Use merge_qualified_name.
8068         (resolve_expression_name): Use safe_lookup_field.
8069         (resolve_field_access): Got rid of call to get_access_flags_from_decl.
8070         (resolve_qualified_expression_name): Likewise. Check on resolved
8071         element accessibility.
8072         (not_accessible_p, class_in_current_package): New functions.
8073         (maybe_access_field): Got rid of call to get_access_flags_from_decl.
8074         (patch_method_invocation_stmt): Merged common pieces. Check
8075         accessibility of invoked method.
8076         (check_for_static_method_reference): Add returned type in error
8077         message.
8078         (invocation_mode): Get rid of bogus check on PRIVATE methods.
8079         (refine_accessible_methods_list): Merged two conditions in test.
8080         (java_complete_class): Sanity check on stabilize_ref gone.
8081         * zextract.c (read_zip_archive): Cast lseek second argument to long.
8082
8083 Tue Jul 28 21:39:22 1998  Per Bothner  <bothner@cygnus.com>
8084
8085         * class.c (hashUtf8String):  Fix - use new JavaSoft specification.
8086
8087 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8088
8089         * gjavah.c (F_NAN): Removed.
8090         (F_NAN_MASK): New macro.
8091         (F_POSITIVE_INFINITY): Removed.
8092         (F_NEGATIVE_INFINITY): Likewise.
8093         (java_float_finite): Rewrote.
8094         (D_NAN_MASK): Renamed.
8095         (java_double_finite): Rewrote.
8096         (D_POSITIVE_INFINITY): Removed.
8097         (D_NEGATIVE_INFINITY): Likewise.
8098
8099         * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
8100         If verbose, print underlying representation of value in hex.
8101
8102 Fri Jul 24 14:14:32 1998  Per Bothner  <bothner@cygnus.com>
8103
8104         * buffer.h, buffer.c:  New files.
8105         * Makefile.in (JAVA_OBJS):  Add buffer.o.
8106
8107         Support locals variables and writing their debug entries to .class.
8108         * jcf-write.c:  Simplify some by user new buffer type.
8109         (vode_buffer_grow):  Removed.
8110         (struct localvar_info):  New type.
8111         (localsvars, localvartable):  New buffers.
8112         (localvar_alloc, localvar_free):  New functions.
8113         (generate_bytecode_insns):  Handle local variables.
8114         (generate_classfile):  Write LocalVariableTable attribute.
8115
8116 Fri Jul 24 13:46:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8117
8118         * jcf-io.c (open_in_zip): Check the zipfile magic number.
8119         * zipfile.h (ZIPMAGIC): New macro.
8120
8121 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8122
8123         * Makefile.in (gjavah.o): Updated dependencies.
8124         (jcf-dump.o): Likewise.
8125         (all.indirect): Use ../gjavah.
8126         (../gjavah$(exeext)): Likewise.
8127         (clean): Don't remove gjavah.
8128         (clean): Remove parse.c, not java/parse.c.
8129         * Make-lang.in (java): Added gjavah.
8130         (gjavah$(exeext)): New target.
8131         (GJAVAH_SOURCES): New macro.
8132         (java.all.build): Added gjavah.
8133         (java.all.cross): Likewise.
8134         (java.rest.encap): Likewise.
8135         * config-lang.in (compilers, stagestuff): Added gjavah.
8136
8137 Thu Jul 23 18:33:56 1998  Tom Tromey  <tromey@cygnus.com>
8138
8139         * gjavah.c (java_float_finite): New function.
8140         (java_double_finite): Likewise.
8141         (F_POSITIVE_INFINITY): New macro.
8142         (F_NEGATIVE_INFINITY): Likewise.
8143         (F_NAN): Likewise.
8144         (D_POSITIVE_INFINITY): Likewise.
8145         (D_NEGATIVE_INFINITY): Likewise.
8146         (D_NAN): Likewise.
8147         (print_field_info): Use java_float_finite and java_double_finite.
8148
8149 Thu Jul 23 15:28:24 1998  Per Bothner  <bothner@cygnus.com>
8150
8151         * parse.y (method_header):  Name "this" implicit argument.
8152
8153 Wed Jul 22 15:47:30 1998  Per Bothner  <bothner@cygnus.com>
8154
8155         * jcf-write.c:  Write out LineNumberTable attribute in .class file.
8156         (linenumber_buffer, linenumber_ptr, linenumber_limit):  New statics.
8157         (put_linenumber):  New function.
8158         (generate_bytecode_insns, generate_classfile):  Write line numbers.
8159
8160 Wed Jul 22 14:39:00 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8161
8162         * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
8163         (lookup_name, build_known_method_ref, build_class_init,
8164         build_invokevirtual, invoke_build_dtable, match_java_method,
8165         build_field_ref, pushdecl_force_head, build_java_binop,
8166         binary_numeric_promotion, build_decl_no_layout,
8167         build_java_arrayaccess, build_newarray, build_anewarray,
8168         build_java_array_length_access, build_java_arraynull_check): New
8169         extern function prototypes.
8170         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8171         JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
8172         java-tree.h.
8173         * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
8174         to NULL
8175         * jcf.h (jcf_out_of_synch): New extern function prototype.
8176         * parse.h: Static/global function implemented in parse.y
8177         prototyped and declarations moved at the end of the file.
8178         (DECL_P): Check that the argument isn't null.
8179         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8180         JAVA_THIS_EXPR): No longer defined here. See java-tree.h
8181         (QUAL_DECL_TYPE): New macro.
8182         (PARAMS): Macro definition removed.
8183         * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
8184         (return_statement:): Call build_return.
8185         (field_access:): Call make_qualified_primary in sub rule.
8186         (method_invocation:): Build method invocation and call
8187         make_qualified_primary when processing primaries.
8188         (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
8189         get_type_from_signature.
8190         (java_check_regular_method): Extra integer 0 argument when calling
8191         lookup_java_method2.
8192         (lookup_java_interface_method2): Extra method DECL argument when
8193         calling lookup_java_interface_method2.
8194         (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
8195         COMPOUND_EXPR node.
8196         (java_complete_expand_method): Layout current class iff not
8197         already done. Don't process interface's methods.
8198         (java_complete_expand_method): Use super class only if it
8199         exists. Use current class otherwise.
8200         (make_qualified_primary): New function.
8201         (resolve_expression_name): Process qualified expression or
8202         expression from primary the same way.
8203         (resolve_expression_name): Two last arguments to
8204         resolve_field_access are now NULL_TREEs.
8205         (resolve_field_access): New variable is_static. Local field must
8206         be DECLs. is_static computed on field DECLs only. Append code in
8207         where_found to the field access if necessary. Use QUAL_DECL_TYPE
8208         to initialize field_type.
8209         (resolve_qualified_expression_name): New local variable,
8210         previous_call_static and is_static. Handle primaries with function
8211         calls, casts, array references and `this'. `super' now handled as
8212         `(super_class)this'. Use is_static to clarify boolean expressions.
8213         Added code to handle case where a proper handle is required to
8214         access a field. Use QUAL_DECL_TYPE where applicable.
8215         (maybe_access_field): New function.
8216         (patch_method_invocation_stmt): New arguments primary, where,
8217         is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
8218         deleted. Use `where' as a type to search from if specified. Check
8219         for static method reference where forbidden. Append primary or
8220         current_this to the argument list if not calling constructor nor
8221         static methods.
8222         (check_for_static_method_reference): New function.
8223         (patch_invoke): Layout the class on which new is done if
8224         necessary.
8225         (lookup_method_invoke): Changed format to report errors on
8226         methods.
8227         (qualify_ambiguous_name): New local variable this_found. Now
8228         handle things from primaries. Method call are considered
8229         expression names.
8230         (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
8231         changed into NULLs.
8232         (not_initialized_as_it_should_p): Comply with the new DECL_P.
8233         (java_complete_tree): New case fo RETURN_EXPR. Process function
8234         call arguments in separate function.
8235         (complete_function_arguments): New function.
8236         (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
8237         anymore.
8238         (patch_assignment): Take the return function slot into account as
8239         a RHS. Distinguish assignment from a return.
8240         (valid_ref_assignconv_cast_p): Use build_java_argument_signature
8241         when checking methods in interfaces.
8242         (resolve_type_during_patch): NULL argument to unresolve_type_p
8243         instead of NULL_TREE.
8244         (patch_newarray): Fixed typo in comment.
8245         (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
8246         (build_return, patch_return): New functions.
8247         * typeck.c (lookup_java_constructor): Fixed typo in comment.
8248
8249 Tue Jul 21 12:10:04 1998  Per Bothner  <bothner@cygnus.com>
8250
8251         * constants.c (find_name_and_type_constant, find_fieldref_index,
8252         find_methodref_index):  New methods.
8253         * expr.c (build_invoke_non_interface):  If flag_emit_class_files,
8254         just return given method.  Also, rename to build_known_method_ref.
8255         (expand_invoke):  Rename call to build_invoke_non_interface.
8256         * java-tree.h, parse.h:  Update prototype.
8257         * parse.y, decl.c, jcf-parse.c:  Suppress calls to back-end functions
8258         (such as expand_expr_stmt) if flag_emit_class_files.
8259         * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
8260         STACK_TARGET, IGNORE_TARGET):  New macros.
8261         (code_buffer, code_ptr, code_limit, code_S, code_SP_max):  New globals.
8262         (generate_bytecode_insn):  New function to generate method's bytecode.
8263         (generate_classfile):  Node generate Code attribute for a method.
8264         (code_buffer_grow, push_constant1, push_constant2, push_int_const,
8265         push_long_const, field_op, adjust_typed_op, maybe_wide):
8266         New functions used by generate_bytecode_insn.
8267
8268         * typeck.c (signature_include_return):  Remove variable.
8269         (push_java_argument_signature, build_java_argument_signature):  New.
8270         (build_java_signature):  Use push_java_argument_signature.
8271         * parse.y:  Use build_java_argument_signature instead of fiddling
8272         with signature_include_return.
8273
8274 Fri Jul 17 09:48:51 1998  Tom Tromey  <tromey@cygnus.com>
8275
8276         * gjavah.c (print_c_decl): Always generate JArray<>* for array
8277         types.
8278
8279         * Makefile.in (all.indirect): Added gjavah$(exeext).
8280         (gjavah$(exeext)): Added $(exeext).
8281         (clean): Likewise.
8282
8283 Thu Jul 16 15:29:20 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8284
8285         * class.c (layout_class): Call to java_layout_parsed_class replace
8286         by safe_layout_class.
8287         * expr.c (build_java_array_length_access): Removed static storage
8288         class in the function definition.
8289         (build_java_arraynull_check): Likewise.
8290         Also fixed typos in two comments.
8291         * lex.c (java_init_lex): Initialize static global kw_length.
8292         (java_lex): Use BUILD_OPERATOR on RETURN_TK.
8293         * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
8294         java_lex_error.
8295         (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
8296         * parse.h (resolve_no_layout): New static function declaration.
8297         (get_identifier_in_static): Declaration removed.
8298         (java_layout_parsed_class): Function name declaration changed to
8299         safe_layout_class.
8300         (build_newarray_node, patch_newarray, resolve_type_during_patch,
8301         not_initialized_as_it_should_p, build_this): New static function
8302         declarations.
8303         (pushdecl_force_head, build_java_binop, int_fits_type_p,
8304         binary_numeric_promotion, stabilize_reference,
8305         build_decl_no_layout, build_java_arrayaccess): Extern function
8306         declarations moved into their own section.
8307         (build_newarray, build_anewarray, build_java_array_length_access,
8308         build_java_arraynull_check): New extern function declarations.
8309         (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
8310         (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
8311         fake tree codes.
8312         (CALL_CONSTRUCTOR_P): New macro.
8313         * parse.y (kw_length): New static global tree node.
8314         (return_statement): Tagged <node>.
8315         (RETURN_TK): Tagged <operator>.
8316         (variable_declarator_id:): Build variable declaration with an
8317         empty initialization value if a syntax error was found in the
8318         initialization part of the variable declaration.
8319         (statement_without_trailing_substatement:): return_statement: now
8320         uses the default rule.
8321         (return_statement:): Temporarily fixed to return NULL_TREE.
8322         (primary_no_new_array:): Call build_this when THIS_TK was parsed.
8323         (class_instance_creation_expression:): Class creation rules now
8324         call build_method_invocation upon reduction.
8325         (array_creation_expression:): Rules call build_newarray_node upon
8326         reduction.
8327         (dim_exprs:): Build a list of dimension expressions.
8328         (dim_expr:): Store location of the OSB_TK in the dimension
8329         expression node.
8330         (method_invocation:): Added a new error rule.
8331         (build_unresolved_array_type): WFL argument may also be an array
8332         on a primitive type. Name of the argument changed to reflect this.
8333         (method_declarator): Insert argument type at the beginning of the
8334         argument type list and later reverse the list.
8335         (unresolved_type_p): Argument 'returned' may be optionally
8336         NULL_TREE.
8337         (java_layout_class_from_source): Function renamed
8338         safe_layout_class.
8339         (resolve_and_layout): Now call resolve_no_layout and
8340         safe_layout_class.
8341         (resolve_no_layout): New function.
8342         (purify_type_name): New function.
8343         (complete_class_report_errors): Call purify_type_name during error
8344         report on a type not found.
8345         (process_imports): error_found local variable doesn't need to be
8346         initialized to zero.
8347         (declare_local_variables): New local type_wfl. Fixed typo in error
8348         message. type_wfl assigned to unresolved type and used to register
8349         incomplete type. Build a WFL around the variable initialization
8350         statement so that debug info can be generated on it.
8351         (source_start_java_method): Reverse argument list after they've
8352         been processed.
8353         (current_this): New static global variable.
8354         (java_complete_expand_methods): Set current_this when appropriate.
8355         (resolve_expression_name): Build correct static and non static
8356         field access bearing a simple name.
8357         (resolve_field_access): Resolve the length field of arrays. Handle
8358         f.m() cases.
8359         (patch_method_invocation_stmt): Set the type of the method
8360         invocation to error_mark_node. This value is later overridden by a
8361         valid type, if any. Don't handle qualified constructor invocation
8362         as qualified method invocation. Call lookup_method_invoke with its
8363         new flag. It's no longer necessary to access the selected method
8364         as the value of a tree list. Handle constructor invocation.
8365         (patch_invoke): Reverse argument list when invoking non interface
8366         methods. Insert call to new as the first argument of the
8367         constructor.
8368         (invocation_mode): Return a INVOKE_STATIC is the invoked method is
8369         defined within a final class. Return INVOKE_STATIC if the invoked
8370         method is a constructor.
8371         (lookup_method_invoke): New lc argument is a flag to indicate a
8372         constructor lookup. Now handle constructor lookup. Choose the most
8373         specific method in case several were matching the invocation
8374         requirements. Return a method decl instead of a tree list featuring
8375         one single method decl element.
8376         (refine_accessible_methods_list): New lc flag argument to
8377         indicate that a constructor is being looked up.
8378         (not_initialized_as_it_should_p): New function.
8379         (java_complete_tree): Now process fake tree codes
8380         JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
8381         save_expr on resolved function call arguments. Case on
8382         UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
8383         (patch_assignment): LHS can be a field access expression. When
8384         dealing with reference, lhs_type is the promoted type of the
8385         rhs_type, not the RHS. Use not_initialized_as_it_should_p where
8386         applicable.
8387         (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
8388         (patch_binop): Use not_initialized_as_it_should_p where
8389         applicable.
8390         (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
8391         (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
8392         where applicable.
8393         (resolve_type_during_patch): New function.
8394         (patch_cast): Call resolve_type_during_patch to resolve type and
8395         report error accordingly.
8396         (patch_array_ref): Use not_initialized_as_it_should_p where
8397         applicable. Array base expression is saved before being
8398         used. Promote the type of an array elements if it contains non
8399         builtin types.
8400         (build_newarray_node, patch_newarray, build_this): New functions.
8401
8402 Thu Jul 16 10:46:47 1998  Tom Tromey  <tromey@cygnus.com>
8403
8404         * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
8405         increment it in `for' statement.
8406         (print_field_info): If number is inf or nan, don't print it.
8407         (print_method_info): If method name is `delete', just ignore it.
8408         (print_c_decl): Special-case jstringArray.
8409
8410         * gjavah.c (help): New function.
8411         (no_argument): New function.
8412         (usage): Changed text.
8413         (main): Rewrote argument handling.  Now handles -v, --help,
8414         --version.
8415         (version): New function.
8416         (found_error): New global.
8417         (main): Return found_error.
8418         (generate_access): Set found_error.
8419         (print_c_decl): Likewise.
8420
8421 Wed Jul 15 10:36:27 1998  Tom Tromey  <tromey@cygnus.com>
8422
8423         * gjavah.c (print_c_decl): Don't print "," when examining field.
8424         Skip type name when looking at "[L" types.
8425         (process_file): Now static.
8426         (generate_access): Now returns int.
8427         (last_access_generated): New global.
8428         (process_file): Clear last_access_generated; make multiple passes
8429         over the class.
8430         (print_field_info): Just return if generate_access returns true.
8431         (print_method_info): Likewise.  Also, allow <init> functions to
8432         pass through.
8433         (print_c_decl): Added is_init argument.  Print constructors
8434         properly.
8435         (print_cxx_classname): Use UTF8_GET to extract characters from
8436         string.
8437         (print_base_classname): New function.
8438         (print_class_decls): New function.
8439         (process_file): Use it.
8440         (utf8_cmp): New function.
8441
8442 Mon Jul 13 14:21:47 1998  Nick Clifton  <nickc@cygnus.com>
8443
8444         * lang-options.h: Format changed to match changes in gcc/toplev.c
8445         to implement a --help option.
8446
8447 1998-07-10  Brendan Kehoe  <brendan@cygnus.com>
8448
8449         * decl.c (init_decl_processing): Revert change to dtable_type.
8450
8451 Thu Jul  9 18:22:12 1998  Per Bothner  <bothner@cygnus.com>
8452
8453         * java-tree.h (CLASS_P):  Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
8454
8455 1998-07-08  Brendan Kehoe  <brendan@cygnus.com>
8456
8457         * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
8458
8459         * lang.c (lang_init): Default flag_exceptions to 1, without
8460         checking to see if it's 2 first.
8461
8462 Wed Jul  8 03:01:32 1998  Jeffrey A Law  (law@cygnus.com)
8463
8464         * constants.c: Include "system.h".
8465         * decl.c: Likewise.
8466         * lang.c (flag_new_exceptions): Get via extern now.
8467         (lang_init_options): New functions.  Turn on flag_new_exceptions.
8468
8469 Tue Jul  7 12:56:48 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8470
8471         * lex.c (java_lex): Return 0 when we see an invalid character in
8472         the input.
8473
8474         * lex.c (java_read_char): Specify extra argument when calling
8475         java_lex_error.
8476         (java_read_unicode, java_parse_end_comment,
8477         java_parse_escape_sequence): Likewise,
8478         (java_lex): Specify extra argument when calling
8479         java_lex_error. Test that IDs are beginning with a legal character
8480         for IDs. Handle invalid characters with an error message and a
8481         call to java_lex_error.
8482         (java_lex_error): Adjust column position by new argument
8483         `forward'. Issue an error even if in the middle of reporting an
8484         other error.
8485
8486 1998-07-07  Brendan Kehoe  <brendan@cygnus.com>
8487
8488         * jcf-io.c (find_class): Zero out BUFFER before we use it, since
8489         we don't explicitly put a null pointer when we're copying it.
8490
8491 Tue Jul  7 09:38:38 1998  Tom Tromey  <tromey@cygnus.com>
8492
8493         * gjavah.c (print_cxx_classname): New function.
8494         (super_class_name): Likewise.
8495         (print_super_fields): Removed.
8496         (in_super): Removed.
8497         (print_field_info): Never generate #defines.
8498         (print_c_decl): Changed generated types to match JNI.  No longer
8499         print class name before method name.
8500         (print_method_info): Print "static" before static methods.
8501         Print "virtual" before non-final methods.
8502         (usage): Use exit(1), not exit(-1).
8503         (main): Likewise.
8504         (print_field_info): Use %.17g to print a double.
8505         (last_access): New globals.
8506         (process_file): Initialize last_access.
8507         (usage): Now static.
8508         (ACC_VISIBILITY): New define.
8509         (generate_access): New function.
8510         (print_field_info): Call it.
8511         (print_method_info): Likewise.  Also, generate information for all
8512         methods, not just native methods.  Return void.
8513         (print_c_decl): Return void.
8514         (print_field_info): Return void.
8515
8516 Thu Jul  2 16:53:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8517
8518         * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
8519         processing the jc1 grammar file. Prefix bison functions and
8520         variables with java_.
8521         (parse.c): Dependencies on parse.h and lex.h
8522         * expr.c (build_java_arrayaccess): Function now global.
8523         * java-tree.h: Comment reorganized to carry on previous
8524         classification effort.
8525         (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
8526         RESOLVE_TYPE_NAME_P): New flags on WFLs.
8527         * jcf-parse.c (parse_source_file): java_parse_source_file renamed
8528         java_parse (new prefix java_ generated by bison).
8529         (java_layout_parsed_class, java_register_parsed_class): Function
8530         call removed.
8531         (yyparse): Removed unnecessary call to init_outgoing_cpool.
8532         * lex.c (static tree wfl_op): Variable deleted.
8533         (java_init_lex): Initialize kw_super and kw_this. Initialize more
8534         ctxp fields to NULL_TREE.
8535         (java_lex): No longer create WFL for operators. Filename caching
8536         mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
8537         created as STRING_CST and later expanded. Removed extra argument
8538         to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
8539         and SUPER.
8540         (build_wfl_node): Removed code in comments.
8541         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
8542         store token and location data in the current bison token.
8543         * parse.h: Removed pre-processor based symbol prefixes hack. Moved
8544         static/extern function declaration at the beginning of the file.
8545         (struct qualification): Data structure definition deleted.
8546         (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
8547         (qualify_ambiguous_name): Function declaration modified. Function
8548         now returns nothing.
8549         (build_array_ref, patch_array_ref, make_qualified_name,
8550         resolve_qualified_expression_name, maybe_generate_clinit,
8551         resolve_field_access): New static function declarations.
8552         (build_java_arrayaccess): New extern function declaration.
8553         (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
8554         (CALL_EXPR_PRIMARY): Macro deleted.
8555         (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
8556         (struct parser_ctxt): Field initialized_final
8557         removed. non_static_initialized, static_initialized: New fields.
8558         * parse.y (static tree kw_super, static tree kw_this): New global
8559         static.
8560         (%union): tree wfl field of operator member replaced by int
8561         location. WFLs are non longer created for operators.
8562         (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
8563         (qualified_name:): Now calls make_qualified_name to build the
8564         identifier.
8565         (type_declaration:): Consider generating <clinit> when class
8566         parsing completed.
8567         (variable_declarator:): Directly build an assignment node when the
8568         variable is initialized when declared.
8569         (this_or_super:): Build a WFL and set current location when THIS
8570         or SUPER are parsed.
8571         (expression_statement:): Wrap statement around a WFL.
8572         (primary_no_new_array:): Fixed typo. Changed value returned by
8573         THIS_TK because of its new type (temporary).
8574         (dim_exprs:): Temporary fix because of OSB_TK's new type.
8575         (field_access:): Build qualified name with SUPER.
8576         (method_invocation:): Fixed returned value because of SUPER's new
8577         type.
8578         (array_access:): Use OSB_TK location information.
8579         (post_increment_expression:, post_decrement_expression:,
8580         unary_expression:, pre_increment_expression:,
8581         pre_decrement_expression:, unary_expression_not_plus_minus:,
8582         cast_expression:, multiplicative_expression:,
8583         additive_expression:, shift_expression:, relational_expression:,
8584         equality_expression:, and_expression:, exclusive_or_expression:,
8585         inclusive_or_expression:, conditional_and_expression:,
8586         conditional_or_expression:, assignment:): Use new location/token
8587         information available on operators.
8588         (create_class): Set super_decl_type to NULL_TREE when processing
8589         java.lang.Object.
8590         (register_fields): Field initialization is now a MODIFY_EXPR
8591         node. Chain initialization code to the matching lists (according
8592         the the field declaration modifiers).
8593         (maybe_generate_clinit): New function.
8594         (method_header): Don't set method's DECL_NAME to a WFL when adding
8595         methods to java.lang.Object.
8596         (resolve_and_layout): Now can return NULL_TREE if the type
8597         resolution fails. Otherwise, return the class DECL instead of its
8598         TYPE.
8599         (check_method_redefinition): Don't patch method DECL_NAME if it
8600         belongs to java.lang.Object.
8601         (process_imports): Simply assign error_found to the value returned
8602         by check_pkg_class_access.
8603         (declare_local_variables): Don't use their init statements (if
8604         any) when parsing error were previously found. Reuse MODIFY_EXPR
8605         build during parsing as an init statement.
8606         (java_method_add_stmt): Now return the current method body.
8607         (java_layout_parsed_class, java_register_parsed_class): Functions
8608         removed.
8609         (java_complete_expand_methods): Initialize the constant pool on a
8610         per class basis. Layout the classes before expanding their method
8611         bodies. Don't try expand artificial constructor code if error were
8612         found. Make the classes data and register them if no error were
8613         found.
8614         (java_complete_expand_method): Retrieve an artificial constructor
8615         argument list before entering its body. Assign the top block to
8616         the artificial constructor function body and set types of declared
8617         blocks and compound statements to void. Walk method body if not an
8618         artificial constructor.
8619         (make_qualified_name, cut_identifier_in_qualified): New functions.
8620         (resolve_expression_name): Fixed comments. Save/restore the
8621         current class CLASS_LOADED_P flag value. Build non qualified
8622         static field access and handle qualified expression names.
8623         (resolve_field_access, resolve_qualified_expression_name): New
8624         functions.
8625         (patch_method_invocation_stmt): Use the new expression resolution
8626         scheme, calling resolve_field_access when the function call is
8627         resolved as an expression.
8628         (qualify_ambiguous_name): Function rewritten to work on qualified
8629         expression produced by make_qualified_name.
8630         (java_complete_tree): Promote type when function's argument are
8631         RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
8632         the assignment to discover further errors if RHS is a expression
8633         name that fails to evaluate. Declare LHS initialized even though
8634         the assignment failed. Don't use the location variable and removed
8635         extra argument in patch function calls. Now handle the ARRAY_REF
8636         case and build internal string representation when STRING_CSTs are
8637         walked.
8638         (build_method_invocation): Don't wrap function call around a WFL.
8639         (build_assignment): Likewise. Use the operator location
8640         information.
8641         (patch_assignment): Handle array access LHSs. Handle error
8642         provenance, resulting in a better error report.
8643         (build_binop): Use op_location from operator as binop location
8644         information.
8645         (build_unaryop, build_incdec, build_cast): Likewise.
8646         (patch_binop): Extract location information from the node. Fixed
8647         typo in error message.
8648         (patch_unary_op): Extract location information from the node.
8649         (build_array_ref, patch_array_ref): New functions.
8650
8651 Wed Jul  1 13:11:36 1998  Tom Tromey  <tromey@cygnus.com>
8652
8653         * expr.c (expand_java_INSTANCEOF): Changed calling convention to
8654         match _Jv_IsInstanceOf.
8655         * decl.c (init_decl_processing): Use _Jv_NewArray, not
8656         soft_newarray.  Use _Jv_IsInstanceOf, not soft_instanceof.
8657
8658 Tue Jun 30 14:12:54 1998  Tom Tromey  <tromey@cygnus.com>
8659
8660         * decl.c (init_decl_processing): Functions are now named
8661         _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
8662
8663 Mon Jun 29 14:47:10 1998  Per Bothner  <bothner@cygnus.com>
8664
8665         * java-tree.h (load_class):  Add prototype.
8666         * class.c (is_compiled_class):  Add missing arg to load_class.
8667         * expr.c (expand_java_NEW):  Call load_class.
8668         * parse.y (process_import):  Removed bogus use of void return value.
8669
8670 Thu Jun 25 11:50:48 1998  Per Bothner  <bothner@cygnus.com>
8671
8672         * decl.c, java-tree.h (soft_athrow_node):  Renamed to soft_node.
8673         Function name is "_Jv_Throw" instead of "soft_athrow".
8674         * decl.c, java-tree.h (soft_new_node):  Renamed to alloc_object_node.
8675         Function name is "_Jv_AllocObject" instead of "soft_new".
8676         Takes an extra parameter (object size).
8677         * expr.c:  Update calls.
8678
8679 Wed Jun 24 13:59:02 1998  Per Bothner  <bothner@cygnus.com>
8680
8681         * lex.c (java_get_line_col):  Handle end-of-file.
8682         * except.c (expand_end_java_handler):  Handle null type (i.e. finally).
8683
8684 Wed Jun 24 09:22:34 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
8685
8686         * lang.c (lang_init): Make -fexceptions the default.
8687         * except.c (maybe_start_try, maybe_end_try): Don't do anything if
8688         exception handling is not turned on.
8689
8690 Tue Jun 23 10:17:09 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
8691
8692         * lang.c (flag_new_exceptions): Make this this default.
8693         * decl.c (end_java_method): Call emit_handlers.
8694         * except.c (method_init_exceptions): Set language code and version.
8695         (expand_start_java_handler): Enable exception, and call
8696         expand_eh_region_start.
8697         (expand_end_java_handler): Enable exception, and set up catch blocks.
8698         (emit_handlers): New routine to generate the saved handlers.
8699         * java-except.h (emit_handlers): Add prototype.
8700
8701 Fri Jun 12 11:31:24 1998  Per Bothner  <bothner@cygnus.com>
8702
8703         We used to have three different representations of the constant pool:
8704         the CPool structure, the tree_constant_pool, and the constructures
8705         used to build the Class object (which may need class and string
8706         constants) in compiled code.  None were appropriate for compiling
8707         to .class files, so I did a major overhaul.
8708
8709         First, the tree_constant_pool array was removed.  Things were
8710         modified to the CPool structure in the JCF could be used.
8711         Second, a "capacity" field was added to the CPool, and functions
8712         written to search for a matching constant, adding one if not found.
8713         The code that generated the Class object was changed to use a CPool.
8714         The actual TREE_LISTs used to build the CONSTRUCTORs used for
8715         the static Class object are now only in build_constants_constructor.
8716         Finally, I wrote code which can generate a .class file (including its
8717         constant pool) from the RECORD_TYPE of a class.  This is a big step
8718         on the way to compiling Java source into .class files.
8719
8720         * jcf-write.c:  New file. Writes out a RECORD_TYPE as a .class file.
8721         * Makefile.in (JAVA_OBJS):  Added jcf-write.o.
8722
8723         * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
8724         CONSTANT_ResolvedString, CONSTANT_ResolvedClass):  New macros.
8725         (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
8726         COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
8727         (COMPONENT_REF_CLASS):  Replaced by COMPONENT_REF_CLASS_INDEX.
8728         (lang_type):  Removed constant_pool field.
8729         * jcf.h (CPool):  Renamed size to count.  Added field capacity.
8730         (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
8731         CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT):  New macros.
8732         Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
8733
8734         * constants.c (current_constant_pool_tags, current_constant_pool_data,
8735         current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
8736         * constants.c (build_constants_constructor):  Use new outgoing_cpool.
8737         (set_constant_entry, find_constant1, find_constant2,
8738         find_class_constant, count_constant_pool_bytes, write_constant_pool,
8739         find_utf8_constant, find_class_or_string_constant):  New functions.
8740
8741         * jcf-parse.c (load_class):  Don't save/restore tree-constant_pool.
8742         (get_constant):  Use current_jcf.cpool instead of tree_constant_pool.
8743         (give_name_to_class, get_class_constant):  Likewise.
8744         * jcf-parse.c, java-tree.h (tree_constant_pool):  Removed.
8745         (get_name_and_type_constant, get_ref_constant):  Removed.
8746         * parse.h (parser_ctxt):  Remove field tree_constant_pool.
8747         * parse.y:  Don't save/restore tree_constant_pool.
8748         * verify.c (verify_jvm_instructions):  Update for new approach.
8749         * expr.c (expand_invoke, expand_java_field_op): Likewise.
8750
8751         * lang-options.h:  Added -femit-class-file, -femit-class-files.
8752         * lang.c (flag_emit_class_files), java-tree.h:  New flag.
8753         (lang_f_options):  Added "emit-class-file(s)".
8754
8755         * expr.c (build_java_arrayaccess):  Generate more efficient array
8756         bounds checking, by using unsigned compare.
8757
8758         * expr.c (expand_invoke):  Re-arrange error checks to make more robust.
8759
8760 Wed Jun 10 17:34:42 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8761
8762         * parse.h: New comment on the handling of unresolved type
8763         identifiers. JDEPs are now part of the jdep_code enum.
8764         (typedef struct jdep): Now use enum jdep_code or int, depending on
8765         availability. Both are narrowed down to an 8 bits bitfield.
8766         (CALL_EXPR_PRIMARY): Fixed comment.
8767
8768 Wed Jun 10 10:54:39 1998  Tom Tromey  <tromey@cygnus.com>
8769
8770         * Make-lang.in (java): Added gjavac and jvgenmain.
8771         (java.start.encap): Depend on gjavac.
8772         (java.rest.encap): Depend on jvgenmain.
8773
8774         * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
8775         (JAVA_CROSS_NAME): Likewise.
8776         (java.all.build): Depend on jvgenmain and gjavac.
8777         (java.all.cross): Depend on jvgenmain and gjavac-cross.
8778         (jvgenmain$(exeext)): New target.
8779         (java.install-common): Wrote.
8780         * config-lang.in (compilers, stagestuff): Added gjavac and
8781         jvgenmain.
8782
8783 Wed Jun 10 12:19:04 1998  Dave Brolley  <brolley@cygnus.com>
8784
8785         * lang.c (lang_decode_option): New argc/argv interface.
8786
8787 Tue Jun  9 18:12:46 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8788
8789         * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
8790         * decl.c (build_decl_no_layout): New function.
8791         * expr.c (java_lang_expand_expr): Layout declarations found in
8792         blocks before they're pushed.
8793         * jcf-parse.c (load_class): Save current line when parsing class
8794         file.
8795         (parse_source_file): Register class before expanding their
8796         methods.
8797         * lang.c (put_decl_node): Produce `null' when `void *' is
8798         processed.
8799         * lex.c (static tree wfl_op): New static global, for error report
8800         on casts.
8801         (java_init_lex): wfl_operator and wfl_op initialized
8802         here. Filename caching added for wfl_op. Return wfl_op when `(' is
8803         parsed.
8804         * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
8805         patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
8806         build_unresolved_array_type): New static function definitions.
8807         (build_decl_no_layout): New extern function declared.
8808         (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
8809         faulty modifier exists.
8810         (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
8811         (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
8812         (UNARY_PLUS_EXPR): New fake operator.
8813         (struct parser_ctxt): New field osb_number.
8814         * parse.y (static tree wfl_operator): New static WFL for operator
8815         bound error messages.
8816         (DECR_TK, INCR_TK): Moved.
8817         (OP_TK): Tagged <operator>.
8818         (array_type:): Now call build_unresolved_array_type.
8819         (dim_expr:): Count the number of '[' seen.
8820         (post_increment_expression, post_decrement_expression,
8821         pre_increment_expression, pre_decrement_expression,
8822         unary_expression_not_plus_minus, unary_expression:): Actions are
8823         now building the corresponding unary expressions.
8824         (cast_expression:): Actions are now building cast expressions.
8825         (build_unresolved_array_type): New function.
8826         (create_interface): Reset the number of declared interfaces.
8827         (create_class): Likewise.
8828         (method_header): Methods declared within the scope of an interface
8829         are now implicitly set public and abstract.
8830         (java_complete_class): Variable's and parameter's type are patched
8831         with a promoted type.
8832         (declare_local_variables): Resolved non builtin types are promoted
8833         before being used to build a variable decl. Removed type patch
8834         posted on variable initialization statement.
8835         (source_start_java_method): Use build_decl_no_layout to build the
8836         decl of a parameter of incomplete type.
8837         (java_register_parsed_class): Process interfaces too. Call
8838         rest_of_decl_compilation on each processed class declarations.
8839         (java_complete_expand_methods): Don't attempt to expand things in
8840         interfaces.
8841         (java_complete_tree): Process CONVERT_EXPR, even though it always
8842         has a type. Propagate error_mark_node to node's type too. Promote
8843         method's call argument type and return error_mark_node if
8844         argument's completion didn't work. MODIFY_EXPR can have a WFL as a
8845         RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
8846         handle unary operator nodes.
8847         (build_assignment): Added comment.
8848         (print_int_node): New function.
8849         (patch_assignment): New second argument. New error handling. Use
8850         print_int_node. Handle references. Use can_cast_to_p to issue
8851         different error message according to the context and check upon
8852         the initialization of the RHS.
8853         (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
8854         (operator_string): Handle more operators.
8855         (patch_binop): No longer use a function static
8856         wfl_operator. Improved error message on shift distance.
8857         (build_unaryop, build_incdec, build_cast, patch_unaryop,
8858         patch_cast): New functions.
8859
8860 Fri Jun  5 18:03:07 1998  Per Bothner  <bothner@cygnus.com>
8861
8862         * jvspec.c:  New file.
8863         * Make-lang.in:  New rules to build gjavac from jvspec.c and ../gcc.c.
8864
8865         * java-tree.h (identifier_subst):  Add declaration.
8866
8867 Thu Jun  4 13:44:23 1998  Tom Tromey  <tromey@cygnus.com>
8868
8869         * jvgenmain.c (main): Generate call to JvRunMain.
8870
8871         * class.c (make_class_data): Push value for "sync_info" field.
8872         * decl.c (init_decl_processing): Push "sync_info" field.
8873
8874 Wed Jun  3 20:39:14 1998  Per Bothner  <bothner@cygnus.com>
8875
8876         * typeck.c (build_java_array_type):  Set TYPE_NAME to actual
8877         Java (source) name, not signature.
8878         Set TYPE_ALIGN to (at least) that of element_type.
8879
8880 Tue Jun  2 15:19:19 1998  Per Bothner  <bothner@cygnus.com>
8881
8882         * class.c:  Moved classname-mangling-rekated code to ...
8883         * mangle.c:  ... this new file.
8884         * jvgenmain.c:  New program (needs mangle.c) to generate main program.
8885         * Makefile.in:  Update for above changes.
8886
8887 Mon Jun  1 09:58:36 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8888
8889         * expr.c (truthvalue_conversion): Convert integer and floating
8890         point value to their truth value.
8891         * lex.c (java_lex): Handle the `null' literal.
8892         * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
8893         (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
8894         ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
8895         New macros.
8896
8897         * parse.y: Reorganization/documentation on token declaration.
8898         (binop_lookup[]): New added new tree codes.
8899         (relational_expression): Build corresponding binary operators.
8900         (equality_expression, conditional_and_expression,
8901         conditional_or_expression): Likewise.
8902         (java_complete_class): Fix crash in debug message.
8903         (java_complete_tree): Check initialization of method call
8904         arguments. Further bogus node evaluation to detect more error
8905         during assignments. Handles more binary operators.
8906         (patch_assignment): Use DECL_P.
8907         (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
8908         code.
8909         (operator_string): Handle more case. Compacted source.
8910         (patch_binop): Changed function comment. Checking for
8911         uninitialized first operand takes the compound assignment into
8912         account and uses DECL_P. Checking for uninitialized second operand
8913         delayed to routine's end. Use macros to issue type bound error
8914         messages and issue messages on both operands if their types are
8915         different. Force fixed type into node. Handle all binary
8916         operators.
8917
8918 Wed May 27 10:30:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8919
8920         * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
8921         * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
8922         build operator node and return tokens.
8923         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
8924         * parse.h (java_complete_tree): Changed returned type in prototype.
8925         (build_method_invocation, build_assignment, patch_assignment,
8926         patch_binop): New static function declarations.
8927         (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
8928         BUILD_EXPR_WFL): New macros.
8929         * parse.y (enum tree_code binop_lookup[]): New static for token to
8930         TREE_CODE lookup.
8931         (%union): Parser union has new sub-structure `operator'.
8932         (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
8933         PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
8934         ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
8935         ASSIGN_ANY_TK): Tokens tagged `operator'.
8936         (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
8937         AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
8938         MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
8939         REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
8940         (assignment_operator:): Rule tagged `operator'.
8941         (expression_statement:): Re-installed default rule.
8942         (method_invocation:): Sub rules call build_method_invocation.
8943         (postfix_expression:): Don't attempt to resolve name here. Just
8944         return an ID.
8945         (multiplicative_expression:): Sub-rules build corresponding binop
8946         expression node.
8947         (additive_expression:, shift_expression:, and_expression:,
8948         exclusive_or_expression:, inclusive_or_expression:): Likewise.
8949         (assignment:): Sub rule invoke build_assignment.
8950         (assignment_operator:): Default rules on sub rules.
8951         (force_error): Added documentation on this variable.
8952         (declare_local_variables): Build initialization calling
8953         build_assignment.
8954         (expand_start_java_method): Removed unused rtx declaration. Mark
8955         arguments as already initialized.
8956         (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
8957         (java_complete_expand_methods): Don't process next method if
8958         completion of the previous one triggered errors.
8959         (java_complete_expand_method): Call source_end_java_method if no
8960         error were found during completion.
8961         (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
8962         locals declaratilon. Handle names found within a class. Return
8963         error_mark_node when things aren't found.
8964         (patch_method_invocation_stmt): Return error_mark_node on failures.
8965         (patch_invoke): Removed unused local. Return the correct node.
8966         (java_complete_tree): Now returns a value. The BLOCK section binds
8967         local identifiers and the type of a BLOCK is now void. Assign the
8968         result of operand completion on COMPOUND_EXPR. Assign the
8969         encapsulated node of a WFL to the result of its completion, except
8970         when the node is an identifier. Now handle MODIFY_EXPR and several
8971         binary operators. Return error_mark_node on errors.
8972         (build_method_invocation, build_assignment, patch_assignment,
8973         build_binop, operator_string, patch_binop): New functions.
8974         * typeck.c (binary_numeric_promotion): New function.
8975
8976 Thu May 21 12:01:04 1998  Per Bothner  <bothner@cygnus.com>
8977
8978         * class.c (identifier_subst):  New convenience wrapper for ident_subst.
8979         Replace most uses of ident_subst by identifier_subst.
8980
8981         * class.c (push_class_static_dummy_field):  Removed function.
8982         (build_class_ref):  Find Class object decl by looking up "CNAME.class",
8983         instead of looking got "class" static field.  Create that decl here.
8984         (class_identifier_node):  Removed;  no longer needed.
8985         (init_class_processing):  Don't init class_identifier_node.
8986         * jcf-parse.c (jcf_parse):  Don't call push_class_static_dummy_field.
8987         Do nreverse 0 times (instead of twice) for Object and Class.
8988         * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
8989
8990 Wed May 20 16:35:04 1998  Per Bothner  <bothner@cygnus.com>
8991
8992         * jcf-parse.c (parse_class-file):  Set lino to smallest line number,
8993         while initializing linenumber_count and linenumber_table.
8994         Do it before init_function_start (which calls emit_line_note).
8995         * expr.c (expand_byte_code):  Don't need to clear lineno here.
8996
8997 Mon May 18 16:23:32 1998  Tom Tromey  <tromey@cygnus.com>
8998
8999         * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
9000         then mangle number as _N_.
9001
9002         * class.c (mangle_class_field): New function.
9003         (build_class_ref): Set assembler name of class reference using
9004         mangle_class_field.
9005         (push_class_static_dummy_field): Likewise.
9006
9007 Sun May 17 12:52:35 1998  Michael Tiemann <tiemann@cygnus.com>
9008
9009         * parse.y (source_start_java_method): Use TREE_SET_CODE instead
9010         of assigning to TREE_CODE.  The latter method exploits a feature
9011         of GCC that is not ANSI compliant.
9012
9013 Thu May 12 13:44:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9014
9015         * decl.c (pushdecl_force_head): New function.
9016         (pushlevel): Removed conditional printf.
9017         (complete_start_java_method): Don't enter local variable scope if
9018         function is compiled from source code.
9019         * expr.c: parse.h now included
9020         (java_lang_expand_expr): New function.
9021         * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
9022         printf. Terminate buffer when doing directories.
9023         * jcf-parse.c (parse_source_file): Call lang_init_source before
9024         parsing and before code generation.
9025         * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
9026         use printf if the macro is defined.
9027         * lang.c (lang_init): Install lang_expand_expr hook on
9028         java_lang_expand_expr.
9029         (java_dummy_print): New function.
9030         (lang_init_source): New function.
9031         * lex.c (java_lex): Remember location of an opening brace at the
9032         second nesting level.
9033         (java_is_eol): Unget character seen after a CR if it is EOF.
9034         * parse.h: Now includes lex.h
9035         (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
9036         printf if the macro is defined.
9037         (expand_start_java_method, build_expr_block, enter_block,
9038         exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
9039         New static function declarations.
9040         (pushdecl_force_head): New extern function declaration.
9041         (INCOMPLETE_TYPE_P): New macro.
9042         (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
9043         (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
9044         BLOCK_EXPR_ORIGIN): New macros.
9045         (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
9046         DECL_SOURCE_LINE_LAST): New macros.
9047         (struct parser_ctxt): Removed field current_method_decl, redundant
9048         with the field current_function_decl. Added fields
9049         first_ccb_indent1 and pending_block.
9050         * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
9051         BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
9052         tagged <node>
9053         (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
9054         (compilation_unit:): Cosmetic on sub rule.
9055         (type_declaration:): Cosmetic on sub rules. Added an error rule.
9056         (variable_initializer:): Installed default rule on expression:.
9057         (method_declaration:): method_header: starts a new
9058         method. method_body: installs the function body, absorbs blocks
9059         emitted for temporary variable scopings, pops function's body block
9060         and merges function's last statement lineno in DECL_SOURCE_LINE.
9061         (method_body:): Installed default rules.
9062         (block:): Call enter_block when an opening brace is seen.  Absorb
9063         scoping blocks and call exit_block when a closing brace is seen.
9064         (block_statement:): Cosmetic changes.
9065         (method_invocation:): Create WFL around CALL_EXPR node.
9066         (patch_stage): Added comment around definition.
9067         (method_header): Try to use first_ccb_indent1 as the first line of
9068         the method, so BP debug info are emitted at the first opening
9069         brace of the function. If the function has no body, use the
9070         location of the function's name. Override currently defined method
9071         name with the matching WFL so we can point redefinition errors
9072         using the location where the function's name was declared.
9073         (check_abstract_method_header): Interprets DECL_NAME as an
9074         identifier or as a WFL, accordingly.
9075         (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
9076         (check_method_redefinition): Use DECL_NAME as a WFL. Extract
9077         location and name information out of it and reinstall DECL_NAME to
9078         its original identifier node value.
9079         (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
9080         function's source code).
9081         (read_import_dir): Test the value returned by find_class and issue
9082         a fatal accordingly.
9083         (declare_local_variables): Push a new block for the scope of the
9084         new variable(s) if code has been already generated at that nesting
9085         level. Pinpoint redefinition errors using the variable id
9086         WFLs. Generate initialization code if necessary. If the variable
9087         type is incomplete, register a patch on its decl.
9088         (source_start_java_method): Rewritten. Define a new block for the
9089         function's parameters. Build parameter decl out of function's
9090         arguments and register them for a patch if their types are
9091         incomplete.
9092         (expand_start_java_method): Includes the part of
9093         source_start_java_method that was pushing the parameter decls and
9094         completing the method start code.
9095         (source_end_java_method): Removed call the expand_end_bindings and
9096         poplevel (already taken care of). Reinstall function's arguments
9097         and get function's last line of code before calling
9098         expand_function_end.
9099         (java_method_add_stmt): New comment before the function's
9100         code. Complement the second operand of the current COMPOUND_EXPR
9101         if necessary.
9102         (java_complete_expand_methods): Don't generate debug info on line
9103         zero when expanding a generated constructor.
9104         (java_complete_expand_method): Set start and end line numbers for
9105         a artificially generated constructor to one and manually call
9106         enter_block and exit_block when defining it. For all methods:
9107         expand function's start calling the new expand_start_java_method
9108         and invoke java_complete_tree on the effective method's body, if
9109         any.
9110         (resolve_expression_name): Now use lookup_name_in_blocks to search
9111         local variable decls and print out an error when variables are
9112         undefined.
9113         (patch_method_invocation_stmt): Inserted comment before the
9114         function's code.
9115         (lookup_method_invoke): Chain method's arguments using chainon
9116         with the current arg list as a second argument. Inserted missing
9117         IDENTIFIER_POINTER when reporting an error on methods not found.
9118         (refine_accessible_methods_list): Don't retain constructors.
9119         (patch_arguments): Function removed.
9120         (java_complete_tree): Inserted comment before the function's
9121         code. New case for BLOCKs. Moved the WFL case a bit
9122         further. Complete function's arguments.
9123         (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
9124         maybe_absorb_scoping_blocks): New functions.
9125
9126 Mon Apr 27 10:50:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9127
9128         * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
9129         previously set.
9130         * jcf-parse.c (parse_source_file, java_error_count): New forward
9131         and extern declarations.
9132         (java_parse_abort_on_error): Macro moved.
9133         (jcf_parse_source): fatal called if fopen fails. Now calls
9134         parse_source_file.
9135         (parse_source_file): New parse_only parameter. Reflects the
9136         elimination of the second pass.
9137         (yyparse): parse_source_file called with argument set to 0.
9138         * jcf.h (JCF_ZERO): Sets java_source to zero.
9139         * lex.c (java_init_lex): pass argument is gone. Function modified
9140         to be called once during the analysis of a file.
9141         (java_unget_unicode): Fixed typo in fatal message.
9142         (java_get_line_col): Likewise.
9143         (java_lval): Likewise. String literals no longer built during
9144         second pass.
9145         * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
9146         account.
9147         * parse.h (MODIFIER_WFL): New macro.
9148         (parse_check_super, parser_check_super_interface): Now return int.
9149         (parser_chain_incomplete_item, not_builtin_p,
9150         complete_method_decl): Declarations removed.
9151         (build_method_invocation_stmt, build_invoke): Renamed using the
9152         `patch' instead of `build'
9153         (register-incomplete_type, obtain_incomplete_type,
9154         java_complete_tree, java_complete_expand_method,
9155         unresolved_type_p, create_jdep_list): New function declarations.
9156         (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
9157         END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
9158         (jdep): New typedef on new struct _jdep.
9159         (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
9160         JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
9161         JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
9162         JDEP_RESOLVED_P): New macros.
9163         (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
9164         JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
9165         JDEP_VARIABLE): New enum values and jdep kinds.
9166         (jdeplist): New typedef on struct _jdeplist.
9167         (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
9168         macros.
9169         (CALL_EXPR_PRIMARY): New macro.
9170         (struct parser_ctxt): Fields java_pass, current_method_decl,
9171         method_decl_list deleted. New field jdeplist.
9172         (INCOMPLETE_P): Macro deleted.
9173         * parse.y (single_type_import_declaration:): Removed pass switch.
9174         (type_import_on_demand_declaration): Likewise.
9175         (field_declaration:): Removed pass switch on all sub rules.
9176         (class_declaration:): Call the complete_class_decl removed on
9177         class_body rules.
9178         (method_declaration:): Removed second pass switch. No longer chain
9179         methods decl when method_header reduced.
9180         (method_header:): Sub rules no longer depend on pass switch.
9181         (method_declarator:): Likewise.
9182         (method_body:): Likewise.
9183         (abstract_method_declaration:): Likewise.
9184         (block_statement:): Likewise.
9185         (local_variable_declaration:): Likewise.
9186         (argument_list:): Likewise.
9187         (method_invocation:): Likewise. Call to build_method_invocation_stmt
9188         removed. Partial CLASS_EXPR tree node built instead.
9189         (postfix_expression:): Removed pass switch on all sub rules.
9190         (java_pop_parser_context): Free classd_list content.
9191         (yyerror): Call obstrack_grow0 to finalize error message.
9192         (check_class_interface_creation): Comment modified to reflect new
9193         returned value meaning. Removed second pass switch. Return 1 if an
9194         error was found, 0 otherwise. Adjust pointer on filename if a
9195         leading path separator was found.
9196         (maybe_create_class_interface_decl): Removed first pass switch
9197         when linking the class decl to the class_list. Install a new
9198         jdep_list for the class.
9199         (add_superinterfaces): List of unresolved interfaces is
9200         gone. Unresolved interfaces are directly added to the current
9201         dependencies list.
9202         (create_interface): Second pass shortcut removed.
9203         ctpx->modifier_ctx access through MODIFIER_WFL.
9204         (create_class): Second pass shortcut removed. Call to
9205         register_incomplete_type replaces the call to
9206         parser_chain_incomplete_item.
9207         (complete_class_decl): Function removed.
9208         (duplicate_declaration_error): New way of retrieving redeclared
9209         item type.
9210         (register_fields): Call to lookup_modifier_cl replaced by
9211         MODIFIER_WFL. New way of handling unresolved type, using
9212         unresolved_type_p and obtain_incomplete_type.
9213         register_incomplete_type replaces call to parser_chain_incomplete_item.
9214         (patch_stage): New static global variable.
9215         (method_header): New way of handling unresolved type, using
9216         unresolved_type_p and obtain_incomplete_type. patch_stage used to
9217         indicates that the method decl needs to be patched.
9218         (check_abstract_method_header): Call to lookup_modifier_cl
9219         replaced by MODIFIER_WFL.
9220         (method_declarator): Incomplete argument type are registered
9221         calling register_incomplete_type. Patch on the declared method is
9222         issued in that case.
9223         (unresolved_type_p): New function.
9224         (parser_check_super_interface): New comment to reflect function's
9225         modified returned type (int). Function and has a new argument
9226         this_wfl. Call to parse_error_context uses this_wfl instead of
9227         relying on lookup_cl.
9228         (parser_check_super): Comment reflects function's new returned
9229         type (int). Function returns non zero value on error.
9230         (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
9231         register_incomplete_type, jdep_resolve_class): New functions to
9232         handle incomplete types in declarations.
9233         (java_complete_class): Rewritten to work with the new incomplete
9234         type handling scheme.
9235         (complete_class_report_errors): Likewise.
9236         (complete_method_decl): Removed: it jobs is now handled by
9237         java_complete_class.
9238         (do_resolve_class): Class loaded in not already loaded and not
9239         found in Java source code.
9240         (java_check_regular_methods, java_check_abstract_methods): Don't
9241         call complete_method_decl anymore.
9242         (lookup_modifier_cl, not_builtin_p): Functions deleted.
9243         (read_import_dir): Got rid of the pass number dependency.
9244         (declare_local_variables): New handling of unresolved types (patch
9245         issued).
9246         (source_start_java_method): New parameter level. Function called
9247         with level set to 1 when argument types are potentially
9248         unresolved.  Called to complete the job with level set to 2 once
9249         types are complete.
9250         (source_end_java_method): Call to permanent_allocation
9251         removed. Waiting to be replaced by a more suitable obstack
9252         management.
9253         (java_complete_expand_methods, java_complete_expand_method,
9254         java_expand_finals): New functions.
9255         (build_method_invocation_stmt): Renamed
9256         patch_method_invocation_stmt. Extracts function call expression
9257         (wfl) and arguments (args) from CALL_EXPR tree operands.
9258         (build_invoke): Renamed patch_invoke. Fixed typo in fatal
9259         call. Patch the function and argument operand of the CALL_EXPR
9260         tree argument.
9261         (patch_argument, java_complete_tree): New functions.
9262
9263 Mon Apr 20 18:26:57 1998  Per Bothner  <bothner@cygnus.com>
9264
9265         Recover from missing fields and methods (i.e. error instead of fatal).
9266         * decl.c, java-tree.h (TYPE_identifier_node):  New global constant.
9267         * expr.c (expand_invoke):  Recover from missing method.
9268         (expand_java_field_op):  Recover from missing field.
9269         Inline references to java.lang.{Integer,Char,...}.TYPE.
9270         * typeck.c (get_type_from_signature), java-tree.h:  New function.
9271         * class.c (add_method):  Use get_type_from_signature.
9272         (build_class_ref):  Handle a class that was not found.
9273         * typeck.c (convert):  Handle conversion to pointers (for convenience).
9274         * verify.c (verify_jvm_instructions):  Use get_type_from_signature
9275         instead of lookup_field to handle missing fields.
9276
9277         * jcf-parse.c (process_zip_dir):  Set java_source.
9278
9279 1998-04-20  Brendan Kehoe  <brendan@cygnus.com>
9280
9281         * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
9282
9283 Tue Apr 14 15:59:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9284
9285         * jcf-parse.c (load_class): Don't change input_filename before
9286         calling jcf_parse_source (but still do it before calling
9287         jcf_parse).
9288         (jcf_parse_source): Assign input_filename after having saved the
9289         parser context.
9290         * lex.c (java_init_lex): Chain a WFL node to the import on demand
9291         list. ctxp->modifier_ctx zeroed according to its new
9292         definition. ctxp->filename initialized. Removed
9293         JAVA_MODIFIER_CTX_UNMARK.
9294         (java_unget_unicode): Update the character based column position.
9295         (java_allocate_new_line): ref_count not used anymore. Always free
9296         ctxp->p_line. Initialize c_line->char_col to 0.
9297         (java_get_unicode): Update the character based column position.
9298         (java_lex): Use ctxp->elc to store current position in source
9299         file, at the beginning of the parsed token. Set modifier_ctx entry
9300         corresponding to the parse modifier to a WFL node. Return a WFL
9301         node when an identifier is parsed.
9302         (java_lex_error): Now uses ctxp->elc to store current position in
9303         source.
9304         (build_wfl_node, java_is_eol, java_get_line_col): New functions.
9305         * lex.h (build_wfl_node): New function definitions.
9306         (struct java_line): ref_count and next fields are gone. New field
9307         char_col.
9308         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
9309         JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
9310         (JAVA_COLUMN_DELTA): New macro.
9311         (java_lc): New typedef on new struct _java_lc.
9312         * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
9313         (parse_error_context, parse_warning_context): Changed prototypes.
9314         (java_get_line_col): Added as an available global function.
9315         (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
9316         (IC_DECL): Replaced by macro IC_TYPE
9317         (DEPEND_WFL): New macro.
9318         (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
9319         wrong modifier.
9320         (exit_java_complete_class): Removed a commented out statement.
9321         (struct parser_ctxt): Added comments on fields. modifier_ctx is
9322         now an array of tree nodes. Deleted fields line_list and
9323         e_line. New field elc, to replace e_line.
9324         * parse.y (array_type:): Build WFL node.
9325         (qualified_name:): Build a single WFL node out of two. Retain
9326         the location information of the first node in the resulting node.
9327         (package_declaration:): Use package name as a WFL node
9328         (single_type_import_declaration:): Use imported name as a WFL node.
9329         (type_import_on_demand_declaration:): Use root of the imported
9330         packages as a WFL node.
9331         (field_declaration:): Removed unused local variable cl.
9332         (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
9333         (yyerror): New static elc. Removed static error_line, error_pos.
9334         New local code_from_source. Save ctxp->elc into elc at the first
9335         pass. Call java_get_line_col to get a string of the line where
9336         the error occured.
9337         (debug_line): Removed static function.
9338         (parse_error_context, parse_warning_context): Parameter cl is now
9339         a WFL node. Use its value to initialize ctxp->elc.
9340         (redefinition_error): Parameter cl is now a WFL node.
9341         (parse_add_interface): New parameter wfl. No longer call
9342         lookup_cl, use wfl instead.
9343         (check_class_interface_creation): Parameter cl is now a WFL node.
9344         (maybe_create_class_interface_decl): Likewise.
9345         (add_superinterfaces): New function.
9346         (create_interface): Removed local cl, node, super_decl,
9347         super_decl_type.  Function now uses id as a WFL node. Better
9348         warning/error report on obsolete or forbidden mix of
9349         modifiers. Now calls add_superinterfaces to register interfaces.
9350         (create_class): Removed local cl, node. Local variable id is used
9351         as a WFL node. Better error report on forbidden modifier
9352         mix. Uses add_superinterfaces to register interfaces.
9353         (find_field): Argument cl is now a WFL node. Now store the WFL
9354         node of a fields that needs to be checked for their
9355         initialization.
9356         (method_header): Local variable node non longer used. Local
9357         variable id replaces cl.
9358         (check_modifiers_consistency): Local variable cl is now a WFL
9359         node.
9360         (method_declarator): Local variable cl replaced by parameter id.
9361         (parser_qualified_name): Now uses parameter name as a WFL node.
9362         (parser_check_super_interface): New parameter wfl, for achieve
9363         greater accuracy during error reports.
9364         (parser_chain_incomplete_item): New parameter named location. Used,
9365         along the decl, to construct the incomplete item node.
9366         (java_complete_class): resolve_class now uses WFL node extracted
9367         from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
9368         where appropriate.
9369         (complete_method_decl): Unresolved function's argument types are WFL.
9370         (resolve_class): Parameter cl is now a WFL node.
9371         (resolve_and_layout): Likewise.
9372         (do_resolve_class): Likewise. Try first to use cl and then do the
9373         lookup on the decl when calling check_pkg_class_access.
9374         (complete_class_report_errors): Use IC_TYPE in place of
9375         TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
9376         instead of doing a lookup over the decl.
9377         (java_check_final): Use WFL info from field tree list.
9378         (lookup_cl): Rewritten and returns a statically defined WFL node.
9379         (lookup_modifier_cl): Now uses information from WFL nodes.
9380         (process_imports): Likewise.
9381         (read_import_dir): name and cl arguments replaced by a single WFL
9382         node. Function modified accordingly.
9383         (find_in_imports_on_demand): Now uses WFL node.
9384         (check_pkg_class_access): cl argument is now a WFL node.
9385         (declare_local_variables): Fixed to use WFL nodes.
9386         (resolve_expression_name): Likewise.
9387         (build_method_invocation_stmt): name_combo argument renamed
9388         wfl. Function modified to use WFL nodes.
9389         (build_invoke): cl used as a WFL node when calling build_expr_wfl.
9390         (lookup_method_invoke): cl is now a WFL node. Added missing
9391         IDENTIFIER_POINTER to class type decl name.
9392
9393 Tue Apr 14 15:23:29 1998  Dave Brolley  <brolley@cygnus.com>
9394
9395         * lang.c (init_parse): Now returns char* containing the filename.
9396
9397 Fri Apr 10 11:36:04 1998  Per Bothner  <bothner@cygnus.com>
9398
9399         * class.c (layout_class):  Mangle repeated arg types to match cc1plus.
9400
9401         * decl.c, java-tree.h (integer_four_node):  New INTEGER_CST node.
9402         * class.c (make_class_data):  If flag_assume_compiled, initial class
9403         state is CSTATE_PREPARED; make superclass and interfaces direct
9404         references, rather than constant pool indexes.
9405
9406 Thu Apr  9 16:10:56 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9407
9408         * parser.y: Include flags.h. Removed debug variable pl.
9409         (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
9410         (block:): Likewise.
9411         (labeled_statement_nsi:): Generate debug info when reducing
9412         expression_statement:.
9413         (check_pkg_class_access): get_access_flags_from_decl invokation
9414         fixed for new CLASS_* flags location.
9415         (source_end_java_method): Save/restore parser context when
9416         entering/leaving this routine. Restore lineno to its right value
9417         before calling expand_end_bindings.
9418         (build_method_invocation_stmt): build_invoke called with the
9419         current line information.
9420         (build_invoke): New argument cl. Wrap the function call around a
9421         wfl node.
9422         (refine_accessible_methods_list): Changed comment, removed
9423         unnecessary code.
9424         * parse.h: Fixed typo in comments.
9425         (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
9426         (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
9427         (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
9428         parser_ccb_indent.
9429         * lex.c (java_lex): Record the last closing curly bracket of a
9430         function.
9431         * jcf-parse.c (jcf_parse_source): Now calls
9432         java_check_methods. Clarified comment, fixed typo.
9433
9434 1998-04-09  Dave Brolley  <brolley@cygnus.com>
9435
9436         * lang.c (init_parse): Expose for non USE_CPPLIB builds.
9437         (finish_parse): Expose for non USE_CPPLIB builds.
9438
9439 Wed Apr  8 13:06:23 1998  Jeffrey A Law  (law@cygnus.com)
9440
9441         * lang.c (lang_print_xnode): New function.
9442
9443 Fri Apr  3 13:22:41 1998  Per Bothner  <bothner@cygnus.com>
9444
9445         * decl.c (class_dtable_decl), java-tree.h:  New tree node.
9446         * class.c (get_dispatch_vector, get_dispatch_table):  New functions
9447         used to build a class's dispatch table.
9448         (make_class_data):  Generate dispatch table if flag_assume_compiled.
9449         Set dtable of class object to address of class_dtable_decl.
9450
9451         * decl.c (int_decl_processing):  Make soft_badarrayindex_node
9452         be volatile and have side effects - generates better code.
9453
9454         * class.c, expr.c, parse.y:  CLASS_INTERFACE, CLASS_FINAL, etc:
9455         These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
9456
9457         * expr.c (expand_invoke):  If class is final, method is
9458         effectively final, so can call it directly.
9459
9460         * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE):  New macros.
9461
9462         * Makefile.in, Make-lang.in:  Add missing $(exeext)s.
9463
9464 Thu Mar 19 16:59:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9465
9466         * parse.y (build_method_invocation_stmt): Removed extra argument
9467         to build_invoke.
9468
9469 Mon Mar 16 17:25:19 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9470
9471         * expr.c (dtable_indent): Now static global.
9472         (expand_invoke): Now call invoke_build_dtable and
9473         build_invokevirtual.
9474         (invoke_build_dtable, build_invokevirtual): New functions.
9475         * jcf-io.c (find_class): Defer issuing a warning by setting
9476         jcf->outofsynch to 1.
9477         * jcf-parse.c (jcf_out_of_synch): New function.
9478         (load_class): Test this_jcf.outofsynch flag and call
9479         jcf_out_of_synch accordingly.
9480         * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
9481         comment indentation.
9482         * lex.c (java_get_unicode): Fixed code indentation.
9483         (java_lex): Create string literal. Fixed typo. Removed several
9484         premature obstack_free.
9485         * parse.h: New enums for name resolution and invocation mode.
9486         (struct qualification): New data structure.
9487         (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
9488         (do_resolve_class, build_method_invocation_stmt,
9489         breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
9490         debug_line, identical_subpath_p, invocation_mode,
9491         refine_accessible_methods_list, build_invoke,
9492         lookup_method_invoke): New functions declared.
9493         (build_invokevirtual, invoke_build_dtable, match_java_method,
9494         build_field_ref, jcf_out_of_synch): New references to external
9495         functions.
9496         (struct parse_ctxt): Removed artificial_constructor field.
9497         * parse.y: (array_type:): Type defined for this rule.
9498         (class_type:): Installed default rule for interface_type:.
9499         (array_type:): Now build Java array type.
9500         (qualified_name:): Now use obstack_grow0.
9501         (method_declaration:): Skip the artificial constructor added to
9502         the list, if any.
9503         (abstract_method_declaration:): Execute the code only during pass 1.
9504         (block:): Installed default rule in block_statements:.
9505         (block_statement:): Add the statement to the method during pass 2.
9506         (statement_expression): Installed default rule for
9507         method_invocation:.
9508         (argument_list:): Added code to build the argument list.
9509         (method_invocation:): Added call to create the method invocation
9510         node.
9511         (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
9512         (debug_line): New function for debug.
9513         (complete_class_decl): No longer do something during pass 1.
9514         (method_header): Use BUILD_PTR_FROM_NAME.
9515         (parser_qualified_classname): Use obstack_grow0. Removed bogus
9516         obstack_free.
9517         (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
9518         function's main comment.
9519         (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
9520         classes.
9521         (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
9522         (resolve_class): Now works with arrays.
9523         (do_resolve_class, resolve_and_layout): New functions.
9524         (java_check_regular_methods): Reverse method list before and after
9525         having processed it. No longer set ctxp->artificial_constructor.
9526         (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
9527         accordingly. Fixed typo in issued error message. Now use
9528         obstack_grow0.
9529         (find_in_imports_on_demand): Now use obstack_grow0.
9530         (declare_local_variables): Use BUILD_PTR_FROM_NAME.
9531         (source_end_java_method): Call expand_expr_stmt instead of
9532         expand_expr. Calls it before calling expand_function_end.
9533         (java_method_add_stmt): Do nothing if errors were found during
9534         parsing.
9535         (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
9536         (build_method_invocation_stmt, build_invoke, invocation_mode,
9537         lookup_method_invoke, refine_accessible_methods_list,
9538         qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
9539         New functions.
9540         * typeck.c (build_java_signature): Properly end method signature
9541         if return type skipped.
9542         (match_java_method): New function.
9543
9544 Mon Mar 16 10:40:47 1998  Per Bothner  <bothner@cygnus.com>
9545
9546         * jcf-io.c (find_classfile):  If USE_JCF_STDIO, fopen in binary mode.
9547
9548 Wed Feb 25 08:55:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9549
9550         * expr.c (build_invoke_non_interface): New function.
9551         (methods_ident, ncode_ident): Now static globals.
9552         (expand_invoke): Use build_invoke_non_interface.
9553         * java-tree.h (struct lang_decl): New field function_decl_body.
9554         (DECL_FUNCTION_BODY): New macro.
9555         * jcf-parse.c (jcf_parse_source): Deeper check before setting
9556         CLASS_FROM_SOURCE_P.
9557         (parse_source_file): Fixed typos. Call java_layout_parsed_class
9558         before starting pass 2. Call to java_generate_parsed_class replaced
9559         by java_register_parsed_class.
9560         * lex.c: Fixed typo in header. Some line width related formating.
9561         * lex.h: Some line width related formating.
9562         * parse.h (source_end_java_method, resolve_expression_name,
9563         complete_class_decl, maybe_create_class_interface_decl,
9564         check_class_interface_creation): New static function declarations.
9565         (java_layout_parsed_class, java_method_add_stmt): New function
9566         declarations.
9567         (struct parser_ctxt): Field mark_class_generate removed. New
9568         fields class_list and artificial_constructor.
9569         * parse.y: Fixed typo in header.
9570         (class_declaration:): Call complete_class_decl when class body
9571         parsed.
9572         (method_declaration:): Call source_end_java_method in pass 2 when
9573         the method body is defined.
9574         (postfix_expression:): Do expression name resolution on sub-rule
9575         name during pass 2.
9576         (create_class, create_interface): Merged common pieces.
9577         (check_class_interface_creation, maybe_create_class_interface_decl):
9578         New functions.
9579         (complete_class_decl): New function.
9580         (register_fields): Fixed line width related typo.
9581         (method_header): Correctly skip first argument when fixing
9582         argument line. Changed the loop.
9583         (java_check_circular_reference): Now use ctxp->class_list.
9584         (java_complete_class): Removed start/stop marking.
9585         (java_check_regular_methods): Now takes a class decl as an
9586         argument.  Add default constructor if none were encountered.
9587         (java_check_methods): Now use ctxp->class_list. Changed call to
9588         java_check_regular_methods.
9589         (source_start_java_method): Set DECL_ARG_TYPE for each function
9590         arguments.
9591         (source_end_java_method, java_method_add_stmt): New functions.
9592         (java_generate_parsed_class): No longer exists.
9593         (java_layout_parsed_class, java_register_parsed_class): New functions.
9594         (resolve_expression_name): New function.
9595
9596 Thu Feb 12 11:54:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9597
9598         * jcf-parse.c: (parse_source_file): Check on errors after init lex.
9599         * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
9600         until pass initializations are done. Call read_import_dir with
9601         pass set to 0.
9602         * parse.h: (lookup_modifier_cl): New function declared.
9603         (INTERFACE_FIELD_MODIFIERS): New macro.
9604         (OBSOLETE_MODIFIER_WARNING): New macro.
9605         * parse.y: (register_fields): Class type and current field name in
9606         local variables. Check modifier(s) if adding field(s) to an interface.
9607         (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
9608         and report errors using the faulty modifier line context.
9609         (lookup_modifier_cl): New function.
9610         (read_import_dir): Detect and report default import processing
9611         failure.
9612
9613 1998-02-11  Brendan Kehoe  <brendan@cygnus.com>
9614
9615         Add a pair of -fassume-compiled/-fno-assume-compiled options.
9616         * class.c (is_compiled_class): Return 1 after making sure it
9617         qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
9618         * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
9619         * java-tree.h (flag_assume_compiled): Add decl.
9620         * lang.c (lang_f_options): Add the flag.
9621         (flag_assume_compiled): Add decl, default to 0.
9622
9623 Wed Feb 11 11:27:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9624
9625         * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
9626         (is_compiled_class): Likewise.
9627         (layout_class): Likewise.
9628         (layout_class): Detect and lay out classes defined in source code.
9629         (interface_of_p, add_interface_do, may_add_interface): New
9630         function.
9631         (add_interface): Now use add_interface_do.
9632         (add_method_1): New function.
9633         (add_method): Now use add_method_1.
9634         (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
9635         (complete_start_java_method): New function.
9636         (start_java_mehod): Now call complete_start_java_method.
9637         * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
9638         (expand_invoke): Likewise and fixed typo.
9639         *gjava.c: (print_super_field): Use new argument to find_class
9640         DO_CLASS_FILE.
9641         (main): Likewise.
9642         *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
9643         (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
9644         QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
9645         IDENTIFIER_NODE.
9646         (CLASS_COMPLETE_P): New flag on TYPE_DECL.
9647         (add_method_1, push_class): New prototypes.
9648         *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
9649         *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
9650         directory where the class was found.
9651         (find_class): New argument DO_CLASS_FILE. Function find_class
9652         modified accordingly.
9653         *jcf-parse.c: (fix_class_path): New function.
9654         (load_class): Use new VERBOSE argument. load_class now finds and
9655         loads/parses .class/.java files. Save read_state of current_jcf
9656         if necessary.
9657         (java_parser_abort_on_error): New macro.
9658         (jcf_parse_source, parse_source_file): New function.
9659         (jcf_parse): Fixed typo.
9660         (yyparse): Call parse_source_file () only.
9661         (process_zip_dir): Fixed typo, fix zdir->filename_length when
9662         writing the real class name back in the zip directory entry.
9663         (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
9664         (jcf_figure_file_type): Fixed bogus alloc and bcopy.
9665         *jcf.h: (typedef struct JCF): New fields java_source and zipd.
9666         (find_class): Prototype fixed.
9667         *lex.c: Added 1998 time stamp.
9668         Removed all static global variables, moved into the parser
9669         context data structure.. Now include unistd.h if SEEK_SET not
9670         defined.
9671         (java_init_lex): Rewritten.
9672         (java_sneak_unicode): Modified current unicode access in current line.
9673         (java_unget_unicode): Likewise.
9674         (java_allocate_new_line): New allocation management.
9675         (java_read_char): Modified access and storage of unget_utf8_value.
9676         New way of processing current unicode.
9677         (java_store_unicode, java_read_unicode): Fixed typo in declaration.
9678         (java_get_unicode): Now use the parser context.
9679         (java_lineterminator): Likewise.
9680         (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
9681         of the reentrant parser implementation. Function now use the
9682         parser context data structure and java_lval. Fixed production of
9683         the float and double constant "out of range" error message. Fixed
9684         obstack use. Return integer value when hitting a modifier. Now
9685         return type for TRUE, FALSE and other predefined types. Return
9686         identifier as a TREE_LIST list containing the current line context
9687         as the TREE_VALUE sub-node.
9688         (java_unicode_2_utf8): Fixed typo in declaration.
9689         (java_lex_error): Now use the parser context data structure.
9690         *lex.h: Added 1998 time stamp.
9691         (struct java_line): New fields ref_count and next.
9692         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
9693         JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
9694         (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
9695         *parse.h: Added 1998 time stamp.
9696         (java_parse_source_file): Renamed from parse_source_file.
9697         (YYERROR_NOW, YYNOT_TWICE): Fixed.
9698         (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
9699         INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
9700         JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
9701         THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
9702         END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
9703         CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
9704         (struct parser_ctxt): New data structure to keep the parser context.
9705         *parse.y: Added 1998 time stamp, got rid of static global variables.
9706         (java_error_count, ctxp): New global variables.
9707         (%union): New value field.
9708         (numeric_type, integral_type): Rules removed.
9709         (primitive_type): Rule defined to handle integral, float, double and
9710         boolean types.
9711         (qualified_name, package_declaration,
9712         single_type_import_declaration, type_import_on_demand_declaration,
9713         modifiers, class_declaration, super, interfaces,
9714         interface_type_list, class_body, field_declaration,
9715         field_declaration, variable_declarators, variable_declarator,
9716         variable_declarator_id, method_declaration, method_header,
9717         formal_parameter_list, formal_parameter, method_body, block,
9718         static, interface_declaration, extends_interfaces,
9719         abstract_method_declaration, local_variable_declarators): Rules now
9720         define actions.
9721         (force_error, do_warning): New global statics.
9722         (push_parser_context, parser_context_save_global,
9723         parser_context_restore_global, pop_parser_context): New functions.
9724         (yyerror): Now uses the global parser context. Fixed use of obstack.
9725         (parse_error, parse_error_context, parse_warning_context,
9726         java_accstring_lookup, redefinition_error, check_modifiers,
9727         parser_add_interface, create_interface, create_class, find_field,
9728         duplicate_declaration_error, register_fields, method_header,
9729         check_modifiers_consistency, check_abstract_method_header,
9730         method_declarator, parser_qualified_classname,
9731         parser_check_super_interface, parser_check_super,
9732         parser_chain_incomplete_item, java_check_circular_reference,
9733         layout_class_from_source, java_complete_class,
9734         complete_method_decl, resolve_class, complete_class_report_errors,
9735         java_check_final, check_method_redefinition,
9736         java_check_regular_methods, java_check_abstract_methods,
9737         java_check_methods, lookup_java_interface_method2,
9738         lookup_java_method2, lookup_cl, find_name_in_single_imports,
9739         process_imports, find_in_imports, read_import_entry,
9740         read_import_dir, find_in_imports_on_demand,
9741         check_pkg_class_access, not_builtin_p, declare_local_variables,
9742         source_start_java_method, java_generate_parsed_class): New
9743         functions.
9744         *typeck.c: (signature_include_return): New global variable.
9745         (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
9746         to add the function returned type in the signature.
9747
9748 1998-02-09  Brendan Kehoe  <brendan@cygnus.com>
9749
9750         * jcf-io.c (open_in_zip): Use strncmp and LEN.
9751
9752 Thu Jan 29 16:12:13 1998  Dave Brolley  <brolley@cygnus.com>
9753
9754         * Make-lang.in (java.info): Added.
9755         (java.install-info): Added
9756
9757 1998-01-27  Brendan Kehoe  <brendan@cygnus.com>
9758
9759         * Makefile.in (clean): Also remove java/parse.c.
9760
9761 1998-01-26  Brendan Kehoe  <brendan@cygnus.com>
9762
9763         Add a pair of -fbounds-check/-fno-bounds-check options.
9764         * lang.c (lang_decode_option): Add code to grok arguments.
9765         (flag_bounds_check): Add decl.
9766         (lang_f_options): New array w/ the option in it.
9767         * java-tree.h (flag_bounds_check): Add decl.
9768         * lang-options.h: New file.
9769         * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
9770         of a static macro value.
9771         (JAVA_ARRAY_EXCEPTION): Delete macro.
9772
9773 Fri Jan 23 14:19:47 1998  Per Bothner  <bothner@cygnus.com>
9774
9775         * typeck.c (build_java_array_type):  Fix two bugs in previous change.
9776         * expr.c (build_anewarray):  Add missing promote_type.
9777
9778 Thu Jan 22 17:43:45 1998  Per Bothner  <bothner@cygnus.com>
9779
9780         Add array types with known length to optimize bounds checking.
9781         * typeck.c (build_java_array_type):  Take length parameter.
9782         (java_array_type_length, build_prim_array_type):  New functions.
9783         * java-tree.h:  Update for new functions.
9784         * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
9785         * class.c:  Use build_prim_array_type.
9786         * expr.c (can_widen_reference_to):  Handle known-length array types.
9787         (verify_jvm_instructions):  Keep track of integer push instructions
9788         followed by newarray/anewarray, so we can build known-length arrays.
9789         (JAVA_ARRAY_DATA_OFFSET):  Replace by ...
9790         (java_array_data_offset):  New function.
9791         (build_java_array_length_access):  New function.  Optimize if constant.
9792         (build_java_arrayaccess):  Constant fold bounds check.
9793         (expand_java_newarray, expand_java_anewarray):  Replaced by ...
9794         (build_newarray, build_anewarray):  New functions.
9795         (ARRAY_NEW_NUM, ARRAY_NEW_PTR):  Use build_{a,}newarray.
9796         * verify.c (merge_types):  Handle known-lengh array types.
9797
9798 Mon Jan 19 13:09:25 1998  Per Bothner  <bothner@cygnus.com>
9799
9800         * expr.c (expand_byte_code):  Fix performace bug, which caused
9801         searching linenumber_table to be linear rather than constant.
9802
9803 Fri Dec 12 19:18:42 1997  Per Bothner  <bothner@cygnus.com>
9804
9805         * Makefile.in (BISON, BISONFLAGS):  Add missing macros.
9806
9807         * decl.c, java-tree.h (soft_fmod_node):  New global.
9808         * decl.c (init_decl_processing):  Define __builtin_fmod.
9809         * expr.c (build_java_binop):  Implement TRUNC_MOD_EXPR for REAL_TYPE
9810         using __builtin_fmod.
9811
9812 Thu Dec  4 13:22:59 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9813
9814         * keyword.h: New file, output of keyword.gperf as processed by
9815         gperf.
9816         * lex.c (java_lex_init): Initialize java_error_flag.
9817         * parse.c (YYERROR_NOW): Uses java_error_flag.
9818         * parse.y: New static java_error_flag. Useless definition of
9819         buffer_error gone.
9820         * parse.y (java_error): Portable error recovery using
9821         java_error_flag (not yet completely tuned).
9822
9823 1997-12-04  Brendan Kehoe  <brendan@lisa.cygnus.com>
9824
9825         * Makefile.in (parse.c): Use $(srcdir) for parse.y.
9826
9827 Wed Dec  3 18:37:42 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9828
9829         * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
9830         (parse.c, lex.c, keyword.h): New rules for Java source code
9831         front-end.
9832         * parse.c: Renamed into jcf-parse.c.
9833         * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
9834         * keyword.gperf: New file, Java keywords.
9835         * parse.y: New file, Java language grammar.
9836         * parse.h: New file, Java language grammar definitions.
9837         * lex.c: New file, Java language lexer.
9838         * lex.h: New file, Java language lexer definitions.
9839
9840 Wed Dec  3 17:00:17 1997  Per Bothner  <bothner@cygnus.com>
9841
9842         * decl.c (clinit_identifier_node), java-tree.h:  New global.
9843         * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P):  Removed.
9844         * verify.c (verify_jvm_instructions):  Inline use of removed macros.
9845         * expr.c (expand_java_field_op):  Check for invalid assignment
9846         to final field.
9847
9848         * jcf-reader.c (get_attribute):  Test for wrong attribute length.
9849
9850 Mon Oct 27 17:46:36 1997  Per Bothner  <bothner@cygnus.com>
9851
9852         * verify.c (verify_jvm_instructions):  When processing a handler,
9853         attempt to set the current_subr to the right value.
9854         (More complicated code combines Sep 17 and Oct 22 versions.)
9855
9856 Fri Oct 24 11:36:54 1997  Per Bothner  <bothner@cygnus.com>
9857
9858         * class.c (push_class):  Figure out (guess) name of source file.
9859         * parse.c  (set_source_filename):  Set DECL_SOURCE_FILE of class decl.
9860         (give_name_to_class):  Don't guess source name;  use DECL_SOURCE_FILE.
9861         (parse_class_file):  Change return type from int to void.
9862         Call debug_start_source_file/debug_end_source_file.
9863
9864         * expr.c (build_java_binop):  Fix masking 2nd operand.
9865         * decl.c (init_decl_processing):  Set sizetype first.
9866
9867 Wed Oct 22 19:39:05 1997  Per Bothner  <bothner@cygnus.com>
9868
9869         * verify.c (verify_jvm_instructions):  Don't set current_subr to NULL.
9870         (Revert Sep 17 change.)
9871
9872 Tue Oct 21 15:09:02 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9873
9874         * parse.c (process_zip_dir): Skip ZIP entries not bearing the
9875         .class extension in their name and fix thing so we don't process
9876         them parse_zip_file_entries().
9877         (parse_zip_file_entries): Cleaned unused local variables.
9878
9879 Mon Oct 20 14:52:42 1997  Per Bothner  <bothner@cygnus.com>
9880
9881         * expr.c (can_widen_reference_to):  Allows equal array element types.
9882         (expand_byte_code):  PRE_RET must expand OPERAND_VALUE (to get index).
9883         * jcf-dump.c (RET):  Get (and print) index.
9884
9885         * verify.c (verify_jvm_instructions case OPCODE_anewarray):
9886         Promote element type to POINTER_TYPE.
9887
9888 Mon Oct 20 13:40:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9889
9890         * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
9891         find_in_current_zip, jcf_figure_file_type): Moved from
9892         jcf-reader.c to parse.c.
9893         * zextract.c: (read_zip_archive): takes file_comment_length possible
9894         field into account.
9895
9896 Mon Oct 20 11:45:06 1997  Per Bothner  <bothner@cygnus.com>
9897
9898         * verify.c (verify_jvm_instructions):  Var can also be promoted to int.
9899
9900         * verify.c (merge_types):  Handle array types even better ...
9901
9902 Fri Oct 17 15:56:37 1997  Per Bothner  <bothner@cygnus.com>
9903
9904         * expr.c (java_stack_pop):  Fix use of NULL_TREE for TYPE_SECOND.
9905
9906         * java-tree.h (PUSH_FIELD):  Set DECL_ARTIFICIAL.
9907         * class.c (make_class_data):  Don't build fields_decl if no fields.
9908         When building fields_decl, skip if DECL_ARTIFICAL.
9909
9910         * expr.c (java_stack_swap):  Update stack_type_map.
9911         * verify.c (merge_types):  Handle array types better.
9912
9913 Wed Oct 15 18:09:45 1997  Per Bothner  <bothner@cygnus.com>
9914
9915         * class.c (add_field):  Don't promote short integral fields to
9916         int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
9917         * expr.c (push_value):  Promote and convert short integral values.
9918
9919         * decl.c, java-tree.h (integer_two_node):  New constant node.
9920         * verify.c (merge_types):  Check for TYPE_RETURN_ADDR.
9921
9922 Wed Oct 15 17:04:50 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9923
9924         * class.c (append_gpp_mangled_type): Use function argument
9925         unpromoted type to generate mangled name.
9926
9927 Mon Oct 13 16:52:55 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9928
9929         * constants.c (build_constant_data_ref): Now uses current_class
9930         instead of main_class.
9931         (build_constants_constructor): Now uses current_class instead of
9932         main_class.
9933         * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
9934         of the global variable SeepZipFiles done here.
9935         * zextract.c (read_zip_archive): extra_field optional field taken
9936         into account while computing the position of the class file in the
9937         archive.
9938         * verify.c (verify_jvm_instructions): Use current_jcf to search
9939         the constant pool.
9940         * parse.c (load_class): First search for the class to load in the
9941         current zip file. Saves current_jcf (restored before returning
9942         from that function). Don't call JCF_FINISH in the class was found
9943         in the current ZIP file.
9944         (jcf_parse): If the class was found in the current ZIP file, save
9945         its tree_constant_pool (for later reuse).
9946         (parse_class_file): New function. Process each method defined in
9947         the current class and record the class as to be later registered.
9948         (yyparse): Rewritten. Figure the type of the current file and switch
9949         accordingly.
9950         * lang.c: New global variable current_jcf.
9951         (lang_init): Removed compiling_from_source test (done later, in
9952         yyparse). Removed call the jcf_parse ().
9953         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
9954         (typedef struct JCF): New fields seen_in_zip (to mark a class found
9955         in the current ZIP file) and zip_offset (offset to the class data in
9956         the current zip file).
9957         * jcf-reader.c: zipfile.h included.
9958         localToFile: New ZipFileCache static global variable
9959         (parse_zip_file_entries): New function. Browse the current ZIP
9960         file directory and process each class found.
9961         (process_zip_dir): New function. Register each class found in the
9962         ZIP file directory. The class aren't parsed but a valid JCF is
9963         link to each of them.
9964         (find_in_current_zip): New function. Search for a class in the
9965         current ZIP file directory. If found, prepare the class so that it
9966         can be loaded.
9967         (jcf_figure_file_type): New function. Examine the file structure
9968         to figure a class file, a ZIP file. If none of these categories are
9969         matched, a source file is assumed.
9970         * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
9971         SeenZipFile: New global variable.
9972         (open_in_zip): Use zipmember's length to accelerate the search for
9973         a member. If zipmember was NULL and zip file successfully read,
9974         return 0.
9975         * java-tree.h: New global variable current_jcf declared.  Added
9976         declaration for current_constant_pool_tags, current_constant_pool_data,
9977         current_constant_pool_length, current_constant_pool_data_ref.
9978         (struct lang_type): Augmented with two fields. struct JCF *jcf (to
9979         store the JCF of classes seen in a zip file) and tree *constant_pool
9980         (to save a loaded class constant pool). current_class declared here.
9981         * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
9982         retrieve method_ref_constant.
9983         (PUSHC): java_push_constant_from_pool now uses current_jcf.
9984         (OBJECT): get_class_constant now uses current_jcf.
9985         (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
9986         (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
9987         (expand_invoke): Now uses current_class instead of main_class
9988         (build_class_init): Now uses current_class instead of main_class
9989         * class.c: New static global variable registered_class.
9990         (register_class): New function.
9991         (emit_register_class): Modified to use registered_class instead of
9992         main_class
9993         (is_compiled_class): Now take into account class seen in the archive.
9994
9995 Mon Oct  6 12:03:23 1997  Per Bothner  <bothner@cygnus.com>
9996
9997         * except.h:  Renamed to: java-except.h.
9998         * parse.c, except.c, expr.c, verify.c:  Update #include accordingly.
9999         * except.c:  Add semi-working (commented out) implementation.
10000
10001         * expr.c (expand_iinc):  Add needed flush_quick_stack.
10002         * parse.c (set_source_filename):  New function.
10003         (give_name_to_class):  Set input_filename from package.classname.java.
10004
10005         * jcf-io.c (find_class):  Don't look first in ".".
10006
10007 Wed Oct  1 11:26:10 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10008
10009         * zextract.c (read_zip_archive): Now takes into account the
10010         extra_field field.
10011         * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
10012
10013 Sat Sep 20 12:44:28 1997  Per Bothner  <bothner@cygnus.com>
10014
10015         * constants.c, java-tree.h (build_internal_class_name):  New function.
10016         (alloc_class_constant):  Re-implement using build_internal_class_name.
10017         * class.c (make_class_data):  Likewise.
10018         * class.c (hashUtf8String):  Make hash algorithm match String.hashCode.
10019
10020 Wed Sep 17 13:15:23 1997  Per Bothner  <bothner@cygnus.com>
10021
10022         * verify.c (verify_jvm_instructions):  Temporarily set current_subr
10023         to NULL before pushing an exception handler target.
10024
10025         * expr.c (flush_quick_stack):  Save from low stack indexes to high.
10026         (java_stack_swap, java_stack_dup):  Re-write to be safe from
10027         clobbering registers.
10028         (build_class_init):  New function.
10029
10030 Wed Sep 17 11:02:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10031
10032         * typeck.c (build_java_array_type): Temporary use
10033         permanent_obstack to create the array 'length' field.
10034         * expr.c (lookup_label): Temporay use permanent_obstack to create
10035         label if not found.
10036         * class.c (push_super_field): Tempory use permanent_obstack.
10037
10038 Mon Sep 15 11:33:31 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10039
10040         * typeck.c (type_for_mode): Now handles double_type_node and
10041         float_type_node.
10042         * verify.c (verify_jvm_instructions): The instruction following
10043         the wide bytecode is checked. OPCODE_ret added to the list of
10044         wide.
10045
10046 Thu Sep 11 19:45:18 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10047
10048         * class.c (make_class): Temporary use permanent_obstack. Set the
10049         class CLASS_P field to 1.
10050         (push_class): Temporary use permanent_obstack.
10051         (set_super_info): Temporary use permanent_obstack.
10052         (add_method): Temporary use permanent_obstack, set
10053         METHOD_TRANSIENT().
10054         (add_field): Temporary use permanent_obstack. Sets
10055         FIELD_VOLATILE() and FIELD_TRANSIENT().
10056         (build_class_ref): Temporary use permanent_obstack if the class
10057         isn't compiled.
10058         (build_static_field_ref): Temporary use permanent_obstack when
10059         creating field's rtl.
10060         (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
10061         ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
10062         and fields. Function finalized, as far as flag handling.
10063         (push_class_static_dummy_field): Temporary use permanent_obstack.
10064         (emit_register_class): Force generation of class registration at
10065         -O3 or deeper.
10066         * decl.c (end_java_method): Call permanent_allocation() before
10067         returning.
10068         * expr.c (can_widen_reference_to): Added comment to interface
10069         handling, fixed typo.
10070         (lookup_field): Now uses CLASS_P() to correct FIXME
10071         (expand_invoke): Verification on public && !static &&
10072         !abstract moved into soft_lookupinterfacemethod (kaffe).
10073         Use Object class dtable if objectref is an array when expanding
10074         invokeinterface.
10075         (java_push_constant_from_pool): Temporary use permanent_obstack
10076         for CONSTANT_string
10077         * parse.c (get_ref_constant): Temporary use permanent_obstack to
10078         create constant references.
10079         (get_constant): Temporary use permanent_obstack to create constant.
10080         (load_class): Temporary use permanent_obstack to load class.
10081         (jcf_parse): Temporary use permanent_obstack to perform class
10082         layout.
10083         * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
10084         (build_java_signature): Temporary use permanent_obstack.
10085         * verify.c: (verify_jvm_instruction): removed unecessary verification
10086         on ACC_SUPER flag.
10087         * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
10088         (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
10089         (CLASS_P): Defined
10090
10091 Thu Sep 11 11:57:32 1997  Per Bothner  <bothner@cygnus.com>
10092
10093         * class.c (append_gpp_mangled_type):  Fix typo.
10094         (emit_register_class):  Use main_class to get class object, rather
10095         than looking for no-longer-existing static decl starting with _CL.
10096         * typeck.c (parse_signature_type):  Promote array element type
10097         if it is a RECORD_TYPE.
10098
10099 Wed Sep 10 16:09:23 1997  Per Bothner  <bothner@cygnus.com>
10100
10101         * class.c (push_class_static_dummy_field):  New function.
10102         (mangle_static_field):  New. Do G++-style mangling of static fields.
10103         (layout_class):  Mandle static fields here, not in add_field.
10104         (build_class_ref):  The class object is now a dummy static field.
10105         * decl.c (find_local_variable):  Look for best, instead of first match.
10106         * expr.c (push_type):  Always promote_type, not just for RECORD_TYPE.
10107         (build_java_athrow):  Don't check here if exception is Throwable.
10108         * java-tree.h (TYPE_UNSET):  Renamed to TYPE_UNKNOWN.
10109         (TYPE_USED):  Removed.  No longer used ...
10110         * parse.c (jcf_parse):  Call push_class_static_dummy_field.
10111         * verify.c (push_pending_label):  New function.
10112         (push_pending_block):  Renamed to check_pending_block.
10113         (merge_types):  Remove unneeded suuport for TYPE_UNUSED.
10114         (verify_jvm_instructions):  Only reset prev_eh_ranges (to force
10115         re-checking possible handlers) after a store (less wasted work).
10116         Check for null handler (finally) before calling add_handler.
10117         Various changes to (finally?) correctly handle try/finally.
10118
10119 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
10120
10121         * class.c: Include stdio.h.
10122
10123 Thu Sep  4 21:30:55 1997  Per Bothner  <bothner@cygnus.com>
10124
10125         * expr.c (expand_invoke):  Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
10126         to make sure class is initialized before static/special invoke.
10127
10128         * verify.c (verify_jvm_instructions):  On a store instruction,
10129         call find_local_variable to force pre-allocation of decl and rtx.
10130         * decl.c (push_jvm_slot):  Set DECL_REGISTER on stack slots.
10131
10132 Wed Sep  3 16:13:23 1997  Per Bothner  <bothner@cygnus.com>
10133
10134         * class.c (build_class_ref):   Strip off "promoted_" if need be.
10135         (make_field_value): Call build_java_signature when needed.
10136         (layout_class):  Don't make_function_rtl if METHOD_ABSTRACT.
10137         * expr.c (build_java_athrow):  Don't push_value of exception.
10138         (build_java_binop):  Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
10139         match specification of [fd]cmp[lg] for NaNs.
10140         (expand_byte_code):  Add support for exception handler ranges.
10141         * except.c:  Add skeleton for EH code-generation.
10142         * verify.c (merge_types):  Treat all promoted integral types as equal.
10143         * constants.c (build_constants_constructor):  To force creation of
10144         current_constant_pool_data_ref, call build_constant_data_ref.
10145
10146         * javaop.def (lload):  Fix typo.
10147         * jcf-dump.c (main):  Clear filename to prevent possibly-bad free.
10148
10149 Tue Sep  2 17:37:25 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
10150
10151         * parse.c: Don't include function.h.
10152
10153 Wed Aug 27 18:33:04 1997  Per Bothner  <bothner@cygnus.com>
10154
10155         * except.[ch]:  New files.
10156         * Makefile.in (JAVA_OBJS):  Add except.o
10157         * expr.c:  Temporary warning about unimplemented exceptions.
10158         * verify.c:  Verify exception handlers.
10159
10160         * jcf-dump.c (disassemble_method):  Print exception table.
10161
10162 Wed Aug 27 13:26:58 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10163
10164         * expr.c (verify_jvm_instructions): Started a thorough
10165         verification of invoke* bytecodes.
10166         (expand_byte_code): flush quick stack if PC is the target of a
10167         branch.  and undef RET (conflicting with config/i386/i386.h).
10168         (expand_java_arrayload): Fixed bogus cast, when Boolean type is
10169         used.
10170         (expand_invoke): Now handles invokeinterface and do more
10171         verification according to the bytecode.
10172         (lookup_field): Don't try to load the class if processing
10173         dtable_type.
10174         (can_widen_reference_to): Now handles interfaces.
10175         * decl.c (init_decl_processing): New global variable
10176         soft_lookupinterfacemethod_node, declared in java-tree.h.
10177         Call set_super_info on string_type_node.
10178         * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
10179         defined.
10180         * class.c (set_super_info): Fills the CLASS_* flags according to
10181         access_flags.
10182         (get_access_flags_from_decl): Handles all class flags.
10183
10184 Tue Aug 26 18:54:34 1997  Per Bothner  <bothner@cygnus.com>
10185
10186         * class.c (add_method):  Zero out newly-allocated DECL_LANG_SPECIFIC.
10187         * parse.c (yyparse):  Check for abstract method, and missing code.
10188         * expr.c (expand_byte_code):  Change interface.
10189         * lang.c (put_decl_node):  Print promoted types prettier.
10190         * verify.c (verify_jvm_instruction):  Change interface.
10191         Partial support for scanning exception table.
10192         For load instructions, handle promoted integral types.
10193
10194 Thu Aug 21 13:48:01 1997  Per Bothner  <bothner@cygnus.com>
10195
10196         * verify.c:  New file, with contents moved from expr.c.
10197         * expr.c:  Bunch of stuff (mostly verification) moved to verify.c.
10198         * typeck.c (is_array_type_p):  Moved here from expr.c.
10199         * java-tree.h:  Add some now-needed function declarations.
10200         * Makefile.in (JAVA_OBJS): Added verify.o.
10201
10202 Wed Aug 20 14:34:34 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10203
10204         * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
10205         METHOD_ABSTRACT flag.
10206
10207         * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
10208         (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
10209         (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
10210
10211         * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
10212         variables.
10213         (start_java_method): Hook for SYNCHRONIZED methods.
10214
10215         * expr.c (build_java_jsr, build_java_ret): New functions
10216         (JSR,PRE): New macros
10217         (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
10218         (verify_jvm_instructions): tableswitch, lookupswitch,
10219         monitorenter, monitorexit, goto_w: verified.
10220         (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
10221         (build_java_monitor): New function.
10222         (MONITOR_OPERATION): Modified to call build_java_monitor()
10223         (verify_jvm_instructions): Started a thorough verification of
10224         invoke* bytecodes.
10225
10226 Tue Aug 19 13:35:49 1997  Per Bothner  <bothner@cygnus.com>
10227
10228         Support verification of jsr/ret subroutines (used for try/finally).
10229         * decl.c (return_address_type_node):  New type node.
10230         * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
10231         RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
10232         LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED):  New macros.
10233         (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
10234         TYPE_USED):  New macros for special types in type_map.
10235
10236         * java-tree.h (BCODE_JUMP_TARGET):  Renamed to BCODE_TARGET.
10237         (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET):  Replaced by
10238         BCODE_JUMP_TARGET.
10239         * expr.c (expand_byte_code):  Fix logic to warn of unused instructions.
10240
10241         * expr.c (can_widen_reference_to):  New function.
10242         (pop_type):  Use it.
10243         (merge_type_state):  Support handling start of subroutine.
10244         (push_pending_block):  Return char* error message, instead of calling
10245         fatal on an error.  Also handle subroutines.
10246         (verify_jvm_instructions):  Handle errors from push_poending_block.
10247         Support jsr and ret instructions.
10248
10249 Tue Aug 19 13:33:36 1997  Per Bothner  <bothner@cygnus.com>
10250
10251         * jcf-io.c (find_classfile):  Fix thinko.
10252         * jcf-dump.c:  Add CONVERT2 (to match changed javaop.def).
10253
10254 Tue Aug 12 20:14:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
10255
10256         * Makefile.in (BISON): Remove.
10257
10258 Thu Aug  7 23:08:24 1997  Per Bothner  <bothner@cygnus.com>
10259
10260         * Makefile.in:  Convert to autoconf.
10261         * config-lang.in (outputs):  Added java/Makefile.
10262
10263         * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
10264         Rename cc1java to jc1.
10265
10266         * lang.c (init_parse, finihs_parse):  New functions #ifdef USE_CPPLIB.
10267         * Makefile.in (INTERNAL_CFLAGS):  Add @extra_c_flags.
10268
10269         * class.c (class_depth):  Do load_class if needed.
10270
10271         Mostly better verification.
10272         * decl.c (pushdecl):  Set TYPE_STUB_DECL for a type.
10273         (init_decl_processing):  Change return type of soft_checkcast.
10274         * expr.c (expand_java_CHECKCAST):  Do push_value of the "casted" value.
10275         * lang.c (put_decl_string, put_decl_node, lang_printable_name,
10276         lang_print_error):  New functions.
10277         (lang_init):  Set global hook print_error_function to lang_print_error.
10278         * expr.c:  In the type_map ptr_type_node is only used for null now.
10279         (pop_type, merge_types):  Hence ptr_type_node matches any reference.
10280         (merge_types):  Dererence pointer to record types before comparing.
10281         (decode_newarray_type, merge_types):  On error just return NULL.
10282         (build_java_binop):  Add preliminary implementation (with warning)
10283         for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
10284         (lookup_label):  Set DECL_IGNORED_P (for dwarf2out).
10285         (expand_compare, expand_java_goto, expand_java_call):  Don't
10286         push_pending_block, since that only makes sense when verifying.
10287         (merge_type_state):  Different return codes.
10288         (push_pending_block):  A block may need to be verified more than once.
10289         (expand_byte_code):  Warn about unused code at code generation time.
10290         (verify_jvm_instruction):  Changed logic, since code may need to be
10291         re-verified if type-state has changed.  Also, better error handling.
10292         Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
10293         Improve newarray, anewarray, ?aload, athrow,
10294         * java-tree.h (LABEL_CHANGED):  New macro.
10295
10296 Tue Aug  5 12:21:27 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10297
10298         * decl.c (soft_athrow_node): New global variable initialized.
10299         * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
10300         * typeck.c (convert): Added support for REAL_TYPE.
10301         (convert_to_char): New function.
10302         (convert): Handle CHAR_TYPE.
10303         * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
10304         SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
10305         (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
10306         promoted type.
10307         (verify_jvm_instructions): Added break a the end of bogus unop: label.
10308         (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
10309         (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
10310         (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
10311         (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
10312         to Use The Right Things.
10313         (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
10314         compatible with INT. BOOLEAN is made equivalent to BYTE.
10315         (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
10316         OPCODE_ifnonnull): Now supported.
10317         (build_java_athrow): New function.
10318
10319 Mon Aug  4 15:46:45 1997  Per Bothner  <bothner@cygnus.com>
10320
10321         Rename method name <init> to match G++ (and fix mangling).
10322         * class.c (layout_class):  Replace method name of <init> by class name.
10323         (make_method_value):  Do inverse renaming of constructor from <init>.
10324         * java-tree.h (DECL_CONSTRUCTOR_P):  New macro.
10325         * typeck.c (lookup_java_constructor):  New function.
10326         * expr.c (expand_invoke):  If method_name is <init>, call
10327         lookup_java_constructor to find constructor.
10328
10329         * parse.c (get_constant):  Handle CONSTANT_Float and CONSTANT_Double.
10330
10331 Fri Aug  1 11:37:09 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10332
10333         * parse.c (get_class_constant): Modified to handle array "classes"
10334         * typeck.c (set_local_type): Bug fixed when filling type_map[] with
10335         wide type.
10336         (convert): Modified to handle real type.
10337         * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
10338         soft_multianewarray, soft_newarray_node, soft_throw_node): New global
10339         variables declared.
10340         * decl.c (soft_badarrayindex_node, soft_anewarray_node,
10341         soft_multianewarray, soft_newarray_node, soft_throw_node): New
10342         global variables initialized.
10343         (find_local_variable): Handles the case of a pointer
10344         (end_java_method): Restore the use of one more scope
10345         * expr.c (build_java_arraynull_check, build_java_arrayaccess,
10346         build_java_array_length_access, expand_java_arrayload,
10347         expand_java_arraystore, expand_java_array_length,
10348         expand_java_multianewarray, expand_java_anewarray,
10349         build_java_check_indexed_type, is_array_type_p,
10350         build_java_throw_out_of_bound_exception): New functions.
10351         (STORE_INTERNAL): Now forces type of the decl to be type of the value.
10352         (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
10353         OPCODE_<t>aload): Implemented code for verification.
10354         (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
10355         ARRAY_NEW_MULTI): Macro defined.
10356         (CONVERT): Modified to invoke convert().
10357         (case OPCODE_aload2): Fixed index typo from 2 to 1.
10358
10359 Thu Jul 31 12:48:18 1997  Per Bothner  <bothner@cygnus.com>
10360
10361         * class.c (push_class):  Set DECL_ARTIFICIAL (for dbxout.c).
10362         (build_class_ref, is_compiled_class):  Handle pointer-to-record types.
10363         (make_class_data):  Field name needs '/' as package prefix.
10364         * expr.c (type_stack_dup, java_stack_dup):  Fix fencepost errors.
10365
10366 Fri Jul 25 11:44:21 1997  Per Bothner  <bothner@cygnus.com>
10367
10368         Implement debug information for local variables.
10369         * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
10370         DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
10371         DECL_LOCAL_SLOT_CHAIN):  New macros.
10372         (struct lang_decl_var):  New type.
10373         * parse.c (give_name_to_locals):  Move to decl.c.
10374         * decl.c (give_name_to_locals):  Re-written to Do The Right Thing.
10375         (start_java_method):  Re-write parameter handling.
10376         (pending_local_decls):  New global variable.
10377         (push_jvm_slot, maybe_pushlevels, maybe_poplevels):  New functions.
10378         (find_local_variable):  Accept pc so we can skips decls not in range.
10379         (struct binding_level):  Add end_pc field.
10380         * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
10381         (various):  Change so current pc gets passed to find_local_variable.
10382
10383         * decl.c (init_decl_processing):  Re-arrange fields in
10384         class_type_node and and method_type_node to match kaffe 0.9.1.
10385         * class.c (make_method_value, make_class_data):  Update
10386         initializations to match.
10387
10388 Wed Jul 16 17:17:50 1997  Per Bothner  <bothner@cygnus.com>
10389
10390         * class.c (unicode_mangling_length, emit_unicode_mangled_name,
10391         append_gpp_mangled_name, append_gpp_mangled_type):  New functions.
10392         (push_super_field):  New function.
10393         (make_class_data):  Handle inheritance of class static initializer.
10394         (layout_class):  New name mangling.
10395         * constants.c (build_constant_data_ref):  Init type of data array
10396         to a one-element array.
10397         (build_constants_constructor):  Set DECL_SIZE from complete array type.
10398         * decl.c:  Rename class_type, object_type etc to class_type_node,
10399         object_type_node etc.  Make former inherit from latter.
10400         * expr.c (expand_invoke):  Add cast of function address.
10401         * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE):  New.
10402         * parse.c (yyparse):  Don't call layout_class here.
10403         * typeck.c (build_java_array_type):  Set TYPE_ARRAY_ELEMENT.
10404
10405 Sat Jun 14 12:06:57 1997  Per Bothner  <bothner@cygnus.com>
10406
10407         * decl.c, class.c:  Update method type to match latest Kaffe snapshot.
10408         * constants.c (lookup_name_constant):  Renamed to alloc_name_constant.
10409         (alloc_class_constant):  New.
10410         * expr.c (expand_invoke):  Make sure method's class is initialized.
10411         * class.c (interits_from_p, emit_register_class):  New functions.
10412         * parse.c (yyparse):  Call emit_register_class.
10413
10414 Mon Jun  9 18:08:06 1997  Per Bothner  <bothner@cygnus.com>
10415
10416         * constants.c:  New file, to handle constant pool.
10417         * Makefile.in (JAVA_OBJS):  Add constants.o.
10418         * decl.c (init_decl_processing):  Update, fix, finish various structs.
10419         (pushdecl_top_level):  New.
10420         * parse.c (layout_class):  Moved to class.c.
10421         * expr.c (java_push_constant_from_pool):  New function.
10422         * class.c (build_class_ref):  Make work fully
10423         (make_class_data):  Emit super-class, constant pool, interface vector.
10424
10425 Tue Jun  3 10:14:31 1997  Per Bothner  <bothner@cygnus.com>
10426
10427         java-tree.h (DECL_SIGNATURE, BCODE_EMITTED):  Remove.
10428         (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P):  New.
10429         * class.c (class_depth):  New function.
10430         (lookup_named_class):  Replaced by new function lookup_class.
10431         * decl.c (object_type_node, string_type_node):  New.
10432         Remove various types that we no longer need.
10433         * expr.c (verify_jvm_instructions):  New separate verifier pass.
10434         (push_type, pop_type):  New functions for verifier.
10435         (type_stack_dup, pop_argument_types, merge_types):  Likewise.
10436         (expand_byte_code):  Simplify, since we assume already verified.
10437         (expand_invoke):  Now mostly works.
10438         * javaop.def:  Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
10439         * lang.c (main_class):  Move to parse.c.  Don't make_class yet.
10440         * parse.c:  Wait to allocate class object until we know its name.
10441         (layout_class):  Calculate DECL_VINDEX for each virtual method.
10442         * typeck.c (get_array_type):  Rename to ...
10443         (build_java_array_type):  ... and provide working implementation.
10444         (build_java_signature):  New function - build Java signature of type.
10445         (set_java_signature):  New function - cache signature with type.
10446         (lookup_java_method):  New function.
10447
10448 Tue May  6 22:08:24 1997  Per Bothner  <bothner@deneb.cygnus.com>
10449
10450         * class.c (ident_subst):  Take extra SUFFIX parameter.
10451         (add_field):  Set DECL_ASSEMBLER_NAME of static fields;  more.
10452         (set_constant_value, build_static_field_ref, is_compiled_class):  New.
10453         (build_class_ref):  Actually implement.
10454         * decl.c, java-tree.h:  Renamed some xx_type to xx_type_node.
10455         * decl.c (builtin_function):  New.
10456         (init_decl_processing):  Update for current Kaffe.  Declare some
10457         builtin Kaffe functions.
10458         * expr.c (build_address_of):  New.
10459         (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
10460         Renamed (from expand_java_new etc), and added working implementations.
10461         (build_field_ref):  Now also handle static fields.
10462         (expand_invoke):  Implement invokestatic, and start implement rest.
10463         * java-opcodes.h:  Use javaop.def to avoid duplicated list.
10464         * javaop.def:  Rename invokevirt -> invokevirtual.
10465         * lang.c (use_handles):  Removed.
10466         * parse.c:  Add support for ConstantValue atribute.
10467         Handle nested loading of a class.  (JPOOL_UTF):  New.
10468
10469 Tue Mar 11 20:11:05 1997  Per Bothner  <bothner@deneb.cygnus.com>
10470
10471         * expr.c (expand_java_pushc):  Support #ifndef REAL_ARITHMETIC case.
10472
10473 Thu Feb 27 14:24:29 1997  Per Bothner  <bothner@deneb.cygnus.com>
10474
10475         * Make-lang.in (java.install-man):  New empty rule.
10476         * typeck.c (set_local_type):  New function.
10477         * expr.c (STORE_INTERNAL):  Call find_local_variable,
10478         not find_stack_slot.  Call set_local_type.
10479
10480 Wed Feb 12 16:11:05 1997  Per Bothner  <bothner@kalessin.cygnus.com>
10481
10482         * java-tree.h:  Various new macros for constructing RECORD_TYPEs,
10483         and building RECORD_TYPE CONSTRUCTORs.
10484         Also support for creating Utf8Const objects from an INDETIFIER_NODE.
10485
10486         * lang.c (use_handles):  Change the default to 0.
10487         * decl.c:  Define and build class_type, field_type, utf8const_type.
10488         * class.c (make_class_data, make_field_value,
10489         get_access_flags_from_decl, build_class_ref, build_utf8_ref,
10490         hashUtf8String, strLengthUtf8, mangled_classname:
10491         Functions to build reflective data structures.
10492         * parse.c (yyparse):  Call make_class_data.
10493
10494         * jcf-io.c (open_class, find_classfile):  New functions.
10495         * jcf-dump.c:  Support reading classfile from explicitly-named
10496         class file (without CLASSPATH searching).
10497
10498 Thu Oct 24 14:10:16 1996  Per Bothner  <bothner@deneb.cygnus.com>
10499
10500         * jcf-reader.c:  Add parameter list to HANDLE_CONSTANT_Utf8.
10501         * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
10502         Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
10503         (get_constant):  Now trivial for CONSTANT_Utf8.
10504
10505         * jcf.h:  Make NEW_CPOOL the default.
10506         * jcf.h, jcf-reader.c, parse.c:  Remove support for !NEW_CPOOL.
10507
10508 Thu Oct 24 13:52:45 1996  Per Bothner  <bothner@deneb.cygnus.com>
10509
10510         New directory.