OSDN Git Service

* java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
[pf3gnuchains/gcc-fork.git] / gcc / java / ChangeLog
1 2000-01-30  Bryce McKinlay  <bryce@albatross.co.nz>
2
3         * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
4         * decl.c (init_decl_processing): Use integer_minus_one_node, not
5         integer_negative_one_node.
6         * expr.c (build_java_binop): Likewise.
7
8 2000-01-24  Jeff Sturm  <jeff.sturm@commerceone.com>
9
10         * zextract.c (read_zip_archive): Read file_offset before writing
11         zipd and consequently clobbering the header contents.
12
13 2001-01-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
14
15         * Make-lang.in: Remove all dependencies on defaults.h.
16         * decl.c: Don't include defaults.h.
17         * expr.c: Likewise.
18         * parse.y: Likewise.
19
20 2001-01-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
21
22         * ChangeLog (2001-01-21): Fixed typo.
23         * class.c (layout_class_method): Code accounting for WFLed
24         method DECL_NAMEs deleted.
25         * constant.c (find_methodref_index): Likewise.
26         * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
27         * java-tree.h (DECL_FUNCTION_WFL): New macro.
28         (struct lang_decl): New field `wfl'.
29         (java_get_real_method_name): Prototype deleted.
30         * mangle.c (mangle_method_decl): Code accounting for WFLed
31         method DECL_NAMEs deleted.
32         * parse.h (GET_METHOD_NAME): Macro deleted.
33         * parse.y (reset_method_name): Deleted.
34         (method_header): Set DECL_FUNCTION_WFL.
35         (check_abstract_method_header): Code accounting for WFLed method
36         DECL_NAMEs deleted.
37         (java_get_real_method_name): Deleted.
38         (check_method_redefinition): Code accounting for WFLed method
39         DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
40         (java_check_regular_methods): Likewise.
41         (java_check_abstract_methods): Likewise.
42         (java_expand_classes): Don't call `reset_method_name.'
43         (search_applicable_method_list): Use DECL_NAMEs instead of
44         GET_METHOD_NAME.
45         * typeck.c (lookup_do): Code accounting for WFLed method
46         DECL_NAMEs deleted.
47
48 2001-01-25  Richard Earnshaw  <rearnsha@arm.com>
49
50         * lex.c (java_read_char): Check for EOF from getc first.
51
52 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
53
54         * class.c (layout_class): Don't lay the superclass out if it's
55         already being laid out.
56         * jcf-parse.c (handle_innerclass_attribute): New function.
57         (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
58         handle_innerclasses_attribute.
59         (jcf_parse): Don't load an innerclasses if it's already being
60         laid out.
61         * jcf-write.c (append_innerclass_attribute_entry): Static
62         `anonymous_name' and its initialization deleted. `ocii' and `ini'
63         to be zero for anonymous classes.
64
65 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
66
67         * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
68         necessary.
69         * jcf-parse.c (set_source_filename): Use
70         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
71
72 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
73
74         * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
75         gets a unique asm name.
76
77 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
78
79         * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
80         (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
81         if necessary.
82         (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
83         * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
84         * parse.y (lookup_package_type_and_set_next): Deleted.
85         (resolve_package): Removed unnecessary code.
86         (find_applicable_accessible_methods_list): `finit$' can't be
87         inherited.
88         * verify.c (pop_argument_types): Added missing prototype.
89
90 2001-01-23  Bryce McKinlay  <bryce@albatross.co.nz>
91
92         * config-lang.in: Disable java by default.
93
94 2001-01-23  Tom Tromey  <tromey@redhat.com>
95
96         * gcj.texi (Copying): New node.
97         Added copyright information.
98
99 2001-01-21  Per Bothner  <per@bothner.com>
100
101         Various fixes to allow compiling a compressed .jar/.zip archive.
102         * zipfile.h (struct ZipFileCache):  Replace by struct ZipFile.
103         (struct ZipFile):  Add fields name and next (from  ZipFileCache).
104         (struct ZipDirectory):  New field zipf points to owning ZipFile.
105         * jcf.h (struct ZipDirectory):  Add forward declaration.
106         (struct JCF):   Declare zipd field to have type struct ZipDirectory.
107         Remove seen_in_zip and zip_offset fields.
108         (JCF_SEEN_IN_ZIP):  New macro.
109         * zextract.c (read_zip_archive):  Set ZipDirectory's zipf field.
110         * jcf-io.c:  Change all ZipFileCache to ZipFile.
111         (read_zip_member):  New function.
112         (open_in_zip):  Call read_zip_member.
113         * jcf-parse.c (find_in_current_zip):  Remove function.
114         (read_class):  Merge in find_in_current_zip functionality.
115         Call read_zip_member if needed.
116         (parse_zip_file_entries):  Use read_zip_member.
117         (process_zip_dir):  Update for removed and added JCF fields.
118         (jcf_figure_file_type):  Re-use, don't copy initial ZipFile struct.
119
120 2001-01-21  Per Bothner  <per@bothner.com>
121
122         Minor optimization of static ggc roots.
123         * jcf-parse.c (parse_roots):  New static field.
124         (current_field, current_method, current_file_list):  Replace by macros
125         naming fields of parse_roots.
126         (init_jcf_parse):  Combine 3 ggc_add_tree_root calls to 1.
127         * class.c (class_roots):  New static field.
128         (registered_class, fields_ident, info_ident, class_list):
129         New macros naming fields of parse_roots.
130         (build_static_field_ref):  Don't register roots here.
131         (layout_class):  Static field list replaced by macro class_list.
132         (init_class_processing):  Call ggc_add_tree_root for 4 roots.
133         Initialize fields_ident and info_ident here.
134
135 2001-01-21  Per Bothner  <per@bothner.com>
136
137         * jcf-parse.c (ggc_mark_jcf):  New function.
138         (init_jcf_parse):  Register current_jcf as ggc root.
139
140 2001-01-21  Per Bothner  <per@bothner.com>
141
142         * lang.c (put_decl_node):  Print method's name.
143
144 2001-01-21  Per Bothner  <per@bothner.com>
145
146         * verify.c (VERIFICATION_ERROR_WITH_INDEX):  New macro.
147         (verify_jvm_instructions):  Use it, for better error messages on loads.
148
149 2001-01-21  Per Bothner  <per@bothner.com>
150
151         * verify.c (merge_type_state):  Still may have to merge even if
152         LABEL_VERIFIED (label).
153
154 2001-01-21  Per Bothner  <per@bothner.com>
155
156         * parse.y (method_header):  Don't set the DECL_NAME of a FUNCTION_DECL
157         to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
158
159 2001-01-19  Per Bothner  <per@bothner.com>
160
161         * expr.c (pop_type_0):  Only return object_ptr_type_node on mismatch
162         if expeting an interface type.  Refines Tom's change of 2000-09-12.
163
164 2001-01-18  Per Bothner  <per@bothner.com>
165
166         * gcj.texi (Input Options): Mention .java files.
167
168 2001-01-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
169
170         * lang-options.h (-Wunsupported-jdk11): Removed.
171         * lang.c (flag_not_overriding): Deleted.
172         (flag_static_local_jdk1_1): Likewise.
173         (lang_W_options): Removed "unsupported-jdk11" entry.
174         * parse.y (java_check_methods): Removed dead code.
175
176 2001-01-17  Tom Tromey  <tromey@redhat.com>
177
178         Changes suggested by Per Bothner:
179         * gcj.texi (Input Options): Don't mention input files.
180         (Code Generation): Updated --main information.
181         (Invoking jcf-dump): Mention that --javap is incomplete.
182         From Alexandre Petit-Bianco:
183         (Warnings): Don't mention -Wunsupported-jdk11.
184         My stuff:
185         (Compatibility): Mention JDK 1.2-ness of libraries.
186         (Resources): Mention resources used when writing gcj.
187
188 2001-01-17  Tom Tromey  <tromey@redhat.com>
189
190         * gcj.texi: New file.
191         * Make-lang.in ($(srcdir)/java/gcj.info): New target.
192         (java.info): Depend on gcj.info.
193         (java/gcj.dvi): New target.
194         (java.dvi): Depend on gcj.dvi.
195         (java.install-info): Wrote.
196
197 2001-01-16  Jeff Sturm  <jeff.sturm@appnet.com>
198
199         * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
200         having called make_decl_rtl.
201
202 2001-01-14  Per Bothner  <per@bothner.com>
203
204         Various patches to emit better messages on verification errors.
205         * expr.c (push_type_0):  Return error indication on stack overflow,
206         instead of callinfg fatal.
207         (push_type):  Now just call push_type_0 (nd fatal on overflow).
208         (pop_type_0):  Return detailed error message (in a char** argument).
209         (pop_type):  If pop_type_0 fails, print error message.
210         (pop_argument_types):  Moved to verify.c.
211         * verify.c (pop_argument_types):  Moved from expr.c.
212         Return a (possible) error message, rather than void.
213         (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING):  New macros.
214         (verify_jvm_instruction):  Use new macros, improving error messages.
215         For case OPCODE_astore use object_ptr_type_node.
216         * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED):  New macros.
217         (pop_type_0, push_type_0, pop_argument_types):  Update accordingly.
218
219         * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
220         constant, return body without wrapper.  (Improves constant folding.)
221         * lex.c (build_wfl_node):  Clear TREE_TYPE from returned node.
222
223 2001-01-13  Per Bothner  <per@bothner.com>
224
225         * expr.c (expand_java_field_op):  Assigning to a final field outside
226         an initializer does not violate JVM spec, so should be warning, not
227         error.  (Sun's verifier does not complain - though MicroSoft's does.)
228         
229 2001-01-12  Joseph S. Myers  <jsm28@cam.ac.uk>
230
231         * gjavah.c (version), jcf-dump.c (version): Update copyright year
232         to 2001.
233
234 2001-01-11  Bryce McKinlay  <bryce@albatross.co.nz>
235
236         * parse.y (resolve_expression_name): Permit instance variables from
237         enclosing context in super constructor call.
238         (resolve_qualified_expression_name): Permit enclosing class's qualified
239         "this" in super constructor call.
240
241 2001-01-10  Mark Mitchell  <mark@codesourcery.com>
242
243         * class.c (build_utf8_ref): Remove last argument in call to
244         make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
245         (build_class_ref): Likewise.
246         (build_static_field_ref): Likewise.
247         (get_dispatch_table): Likewise.
248         (layout_class_method): Likewise.
249         (emit_register_classes): Likewise.
250         * constants.c (build_constant_data_ref): Likewise.
251         * decl.c (builtin_function): Likewise.
252         (create_primitive_vtable): Likewise.
253         * expr.c (build_known_method_def): Likewise.
254         (build_jni_stub): Likewise.
255         (java_lang_expand_expr): Likewise.
256         
257 2001-01-10  Tom Tromey  <tromey@redhat.com>
258
259         * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
260
261 2001-01-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
262
263         * java-tree.h (lang_printable_name_wls): New prototype.
264         * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
265         rather than `current_class' to print type name. Don't prepend type
266         names when printing constructor names.
267         (lang_printable_name_wls): New function.
268         * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
269         `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
270         * parse.y (patch_method_invocation): Message tuned for constructors.
271         (not_accessible_p): Grant `private' access from within
272         enclosing contexts.
273         
274 2001-01-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
275
276         All files with updated copyright when applicable.
277         * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
278         * class.c (mangle_class_field): Function removed.
279         (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
280         (utf8_cmp, cxx_keyword_p): Moved to lex.c.
281         (build_class_ref): Call `java_mangle_class_field' instead of
282         `mangle_class_field.'
283         (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
284         (layout_class): Call `java_mangle_decl' instead of 
285         `mangle_static_field.'
286         (cxx_keywords): Initialized static array moved to `lex.c.'
287         (layout_class_method): Changed leading comment. Simplified to
288         call `java_mangle_decl.' Local `ptr' moved in for loop body.
289         * decl.c (lang_mark_tree): Mark field `package_list.'
290         * java-tree.h (TYPE_PACKAGE_LIST): New macro.
291         (struct lang_type): New field `package_list.'
292         (unicode_mangling_length): Prototype removed.
293         (append_gpp_mangled_name, append_gpp_mangled_classtype,
294         emit_unicode_mangled_name): Likewise.
295         (cxx_keyword_p): New prototype.
296         (java_mangle_decl, java_mangle_class_field,
297         java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
298         * jcf-parse.c (jcf_parse_source): Constify `file' argument to
299         `build_expr_wfl.'
300         * jvgenmain.c (main_method_prefix): Global variable removed.
301         (main_method_suffix): Likewise.
302         (do_mangle_classname): New function.
303         (main): Call it. Format changed to accomodate new mangling scheme.
304         * lex.c: (utf8_cmp): Conditionally prototyped.
305         (cxx_keywords): Moved from class.c, conditionally defined.
306         (utf8_cmp, cxx_keyword_p): Likewise.
307         * mangle.c (obstack.h, ggc.h): Included.
308         (mangle_field_decl): New function.
309         (mangle_method_decl, mangle_type, mangle_pointer_type,
310         mangle_array_type, mangle_record_type,
311         find_compression_pointer_match, find_compression_array_match,
312         find_compression_record_match,
313         find_compression_array_template_match, set_type_package_list,
314         entry_match_pointer_p, emit_compression_string, init_mangling,
315         finish_mangling, compression_table_add, mangle_member_name): Likewise.
316         (mangle_obstack): New global.
317         (MANGLE_RAW_STRING): New macro.
318         (unicode_mangling_length): Turned static.
319         (append_unicode_mangled_name): Renamed from
320         `emit_unicode_mangled_name.'  Turned static. `mangle_obstack'
321         replaces `obstack', removed from the parameter list.
322         (append_gpp_mangled_name): Turned static. `mangle_obstack'
323         replaces parameter `obstack', removed from the parameter list. Call 
324         `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
325         (append_gpp_mangled_classtype): Removed.
326         (compression_table, compression_next): New static variables.
327         * parse.y (temporary_obstack): Extern declaration removed.
328
329 2001-01-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
330
331         * parse.y (patch_binop): Compute missing type in error situations.
332
333 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
334
335         * class.c (make_class_data): Push initial value for "arrayclass".
336         * decl.c (init_decl_processing): Add new class field "arrayclass".
337
338 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
339
340         From patha@softlab.ericsson.se:
341         * parse.y (switch_label): Use build, not build1, to construct 
342         DEFAULT_EXPR.
343
344 2001-01-04  Neil Booth  <neil@daikokuya.demon.co.uk>
345
346         * lang.c (lang_decode_option): Change -MA to -MP.
347         * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
348         Update to new prototype; do quote targets.
349         (jcf_dependency_write): Update.
350
351 2000-12-22  Bryce McKinlay  <bryce@albatross.co.nz>
352
353         Shorten primitive array allocation path:
354         * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
355         to create new primitive arrays.
356         * expr.c (build_newarray): If generating native code, call 
357         soft_newarray_node with a reference to the primitive TYPE identifier
358         instead of type_value.
359         
360 2000-12-17  Bryce McKinlay  <bryce@albatross.co.nz>
361
362         Fix for PRs gcj/312 and gcj/253:
363         * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
364         dest if they arn't already.
365         * class.c (layout_class): Call maybe_layout_super_class on 
366         superinterfaces also, but only if compiling from bytecode.
367
368         Fix for PR gcj/373:
369         * parse.y (create_class): Set ACC_STATIC if class is declared in an
370         interface.
371
372 2000-12-15  Tom Tromey  <tromey@redhat.com>
373
374         * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
375         set.
376
377 2000-12-14  Andrew Haley  <aph@redhat.com>
378
379         * boehm.c (mark_reference_fields): Change test to correctly detect
380         bitmap overflow.
381
382 2000-12-15  Andreas Jaeger  <aj@suse.de>
383
384         * config-lang.in (lang_dirs): Added.
385
386 2000-12-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
387
388         * parse.y (end_artificial_method_body): Fixed undefined behavior.
389         Credits go to rth for finding it.
390
391 2000-12-13  Mike Stump  <mrs@wrs.com>
392
393         * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
394
395 2000-11-07  Tom Tromey  <tromey@cygnus.com>
396
397         * Make-lang.in (JAVA_LEX_C): Added chartables.h.
398         * lex.c (java_ignorable_control_p): Removed.
399         (java_letter_or_digit_p): Removed.
400         (java_start_char_p): New function.
401         (java_read_char): Return `int', not `unicode_t'.  Changed
402         callers.
403         (java_read_unicode): Likewise.
404         (java_read_unicode_collapsing_terminators): Likewise.
405         (java_get_unicode): Likewise.
406         (java_new_lexer): Initialize hit_eof.
407         (java_parse_end_comment): Take `int' argument.
408         (java_parse_doc_section): Likewise.
409         (java_parse_escape_sequence): Don't allow backlash-newline.
410         Return `int'.
411         * lex.h (JAVA_DIGIT_P): Removed.
412         (_JAVA_LETTER_OR_DIGIT_P): Removed.
413         (_JAVA_IDENTIFIER_IGNORABLE): Removed.
414         (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
415         (JAVA_PART_CHAR_P): New macro.
416         (UEOF): Now -1.
417         (JAVA_CHAR_ERROR): Now -2.
418         (java_lexer): New field `hit_eof'.
419         * chartables.h: New file.
420         * gen-table.pl: new file.
421
422 2000-11-20  Tom Tromey  <tromey@cygnus.com>
423             Alexandre Petit-Bianco  <apbianco@cygnus.com>
424
425         * parse.y (java_complete_lhs): Only allow compound assignment of
426         reference type if type is String.
427
428 2000-12-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
429
430         * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
431         jcf-path.c: Likewise.
432
433 2000-12-09  Anthony Green  <green@redhat.com>
434
435         * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
436         filestart and filename_length as int values.
437
438 2000-12-07  Mo DeJong  <mdejong@redhat.com>
439
440         * jcf-io.c (find_class): Correct the logic that tests to see if a
441         .java file is newer than its .class file. The compiler was
442         incorrectly printing a warning when file mod times were equal.
443
444 2000-12-07  Zack Weinberg  <zack@wolery.stanford.edu>
445
446         * jvgenmain.c: Use ISPRINT not isascii.
447
448 2000-12-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
449
450         * parse.y (end_artificial_method_body): Fixed typo.
451
452 2000-12-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
453
454         * parse.y (patch_method_invocation): Pick the correct enclosing
455         context when creating inner class instances.
456         Fixes gcj/332.
457
458 2000-11-26  Joseph S. Myers  <jsm28@cam.ac.uk>
459
460         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
461         Update copyright year to 2000.
462
463 2000-11-23  Anthony Green  <green@redhat.com>
464
465         * jcf-parse.c (init_jcf_parse): Register current_file_list root.
466         Move current_file_list out of yyparse and make it static.
467
468         * expr.c: Declare quick_stack and tree_list_free_list as static
469         (init_expr_processing): Register quick_stack and
470         tree_list_free_list roots.
471
472 2000-11-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
473
474         * parse.y (build_outer_field_access): New local `decl_ctx', use
475         it. Check for field's context and current class immediate outer
476         context inheritance.
477         (outer_field_access_p): Consider fields inherited from the last
478         enclosing context.
479         (build_access_to_thisn): Stop at the last enclosing context if
480         necessary.
481         Fixes gcj/367.
482
483 Thu Nov 23 02:19:14 2000  J"orn Rennecke <amylaar@redhat.com>
484
485         * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
486
487 2000-11-22  Bryce McKinlay  <bryce@albatross.co.nz>
488
489         * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
490         scratch buffer.
491
492 2000-11-20  Tom Tromey  <tromey@cygnus.com>
493
494         * jv-scan.c (help): Document --complexity.
495         (options): Added --complexity.
496         (flag_complexity): New global.
497         (main): Call `report'.
498         * parse-scan.y (complexity): New global.
499         (if_then_statement, if_then_else_statement,
500         if_then_else_statement_nsi, switch_block_statement_group,
501         while_expression, do_statement, for_begin, continue_statement,
502         throw_statement, catch_clause, finally, method_invocation,
503         conditional_and_expression, conditional_or_expression,
504         conditional_expression): Update complexity.
505         (reset_report): Reset complexity.
506         (report): New function.
507
508 2000-11-20  Tom Tromey  <tromey@cygnus.com>
509
510         * lex.c (yylex): Added STRICT_TK case.
511         * parse.y (STRICT_TK): Added.
512         * parse-scan.y (STRICT_TK): Added.
513         * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
514         `;'.  Use 4, not 3, with -k option.  Correctly rename resulting
515         file.
516         * keyword.h: Rebuilt.
517         * keyword.gperf (strictfp): Added.
518
519 2000-11-20  Tom Tromey  <tromey@cygnus.com>
520
521         * lex.c (yylex): Recognize floating point constants with leading
522         0.
523
524 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
525
526         * java-tree.h (cyclic_inheritance_report): Constify.
527         * parse.y (cyclic_inheritance_report): Likewise.
528
529 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
530
531         * parse.y (goal): Remove call to ggc_add_string_root.
532
533 2000-11-16  Zack Weinberg  <zack@wolery.stanford.edu>
534
535         * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
536         Create string in scratch buffer, then pass to build_string.
537
538 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
539
540         * parse.y (issue_warning_error_from_context): Add
541         ATTRIBUTE_PRINTF.
542
543 2000-11-11  Anthony Green  <green@redhat.com>
544
545         * jcf-parse.c (process_zip_dir): Add finput parameter.
546         (jcf_figure_file_type): Call process_zip_dir with appropriate
547         argument.
548
549 2000-11-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
550
551         * decl.c (copy_lang_decl): Use memcpy, not bcopy.
552         * jcf-parse.c (jcf_figure_file_type): Likewise.
553
554 2000-11-09  Joseph S. Myers  <jsm28@cam.ac.uk>
555
556         * parse.y (create_new_parser_context): Use memset () instead of
557         bzero ().
558
559 2000-11-08  Tom Tromey  <tromey@cygnus.com>
560
561         * gjavah.c (process_file): Only include gcj/cni.h when generating
562         CNI stubs.
563
564 2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>
565
566         * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
567         (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
568         instead of bzero ().
569
570 2000-11-05  Tom Tromey  <tromey@cygnus.com>
571
572         * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
573         * lex.c (IS_ZERO): New define.
574         (java_perform_atof): Error on floating point underflow.
575
576 2000-11-04  Tom Tromey  <tromey@cygnus.com>
577
578         * lex.c (java_parse_escape_sequence): Only read two octal
579         characters if the first one is greater than 3.  Don't allow
580         "octal" numbers to include the digits 8 or 9.
581
582 2000-11-05  Joseph S. Myers  <jsm28@cam.ac.uk>
583
584         * Make-lang.in (java.distdir): Remove.
585
586 2000-11-03  Tom Tromey  <tromey@cygnus.com>
587
588         * Make-lang.in (java.dvi): New target.
589         Partial fix for PR other/567.
590
591         * lang-options.h: Mention -Wout-of-date.
592         * jcf-dump.c (flag_newer): New global.
593         * gjavah.c (flag_newer): New global.
594         * jcf-io.c (find_class): Only warn when flag_newer set.
595         * lang.c (flag_newer): New global.
596         (struct string_option): New declaration.
597         (lang_W_options): New global.
598         (process_option_with_no): New function.
599         (lang_decode_option): Use it.
600
601         * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
602         * gjavah.c (cxx_keyword_subst): Handle any number of trailing
603         `$'.
604
605         * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
606         (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
607         * lex.c (java_read_unicode): Removed `term_context' argument.
608         Recognize any number of `u' in `\u'.
609         (java_read_unicode_collapsing_terminators): New function.
610         (java_get_unicode): Use it.
611         (java_lineterminator): Removed.
612         (yylex): Produce error if character literal is newline or single
613         quote.  Return if eof found in middle of `//' comment.  EOF in
614         `//' comment is only an error if pedantic.
615         (java_ignorable_control_p): New function.
616         (java_parse_end_comment): Return if eof found in middle of
617         comment.
618         Include flags.h.
619         * jv-scan.c (pedantic): New global.
620
621 2000-10-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
622
623         * parse.y (outer_field_access_p): Inherited fields aren't
624         consider outer fields.
625         (maybe_build_thisn_access_method): Use
626         PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
627         (resolve_expression_name): Trigger an error if a static field
628         is being accessed as an outer field.
629
630 2000-10-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
631
632         * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
633         Fixes gcj/365.
634
635 2000-10-27  Zack Weinberg  <zack@wolery.stanford.edu>
636
637         * Make-lang.in: Move all build rules here from Makefile.in,
638         adapt to new context.  Wrap all rules that change the current
639         directory in parentheses.  Expunge all references to $(P).
640         When one command depends on another and they're run all at
641         once, use && to separate them, not ;.  Add OUTPUT_OPTION to
642         all object-file generation rules.  Delete obsolete variables.
643
644         * Makefile.in: Delete.
645         * config-lang.in: Delete outputs= line.
646
647 2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
648
649         * parse.y (patch_method_invocation): NULLify this_arg when already
650         inserted.
651         (maybe_use_access_method): Handle call to methods unrelated to the
652         current class. Fixed comment.
653         Fixes gcj/361.
654
655 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
656
657        * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
658        scope.
659
660 2000-10-24  Tom Tromey  <tromey@cygnus.com>
661
662         * lex.c (java_new_lexer): Initialize new fields.  Work around
663         broken iconv() implementations.
664         (java_read_char): Swap bytes if required.  Use fallback decoder if
665         required.
666         (byteswap_init, need_byteswap): New globals.
667         (java_destroy_lexer): Only close iconv handle if it is in use.
668         * lex.h (java_lexer): New fields read_anything, byte_swap,
669         use_fallback.
670         Made out_buffer unsigned.
671
672 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
673
674         * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
675         where an enclosing context can be set on the jdep.
676         (do_resolve_class): Fixed identation.
677
678 2000-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
679
680         * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
681
682         * jcf-reader.c (peek_attribute, skip_attribute): Only define
683         when requested.
684
685         * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
686
687         * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
688
689 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
690
691         * jcf-write.c (OP1): Update `last_bc'.
692         (struct jcf_block): Fixed indentation and typo in comments.  New
693         field `last_bc'.
694         (generate_bytecode_insns): Insert `nop' if `jsr' immediately
695         follows `monitorenter'.
696         * parse.y (patch_synchronized_statement): New local `tmp'. Call
697         `patch_string'.
698         Fixes gcj/232.
699
700 2000-10-16  Tom Tromey  <tromey@cygnus.com>
701
702         * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
703         * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
704         * lang-options.h: Added -MA, -MT, -MF..
705         * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
706         (DEPEND_TARGET_SET): New macro.
707         (DEPEND_FILE_ALREADY_SET): Likewise.
708         (init_parse): Handle new flags.
709         * jcf.h (jcf_dependency_print_dummies): Declare.
710         * Make-lang.in (s-java): Added mkdeps.o.
711         * Makefile.in (BACKEND): Added mkdeps.o.
712         (../gcjh$(exeext)): Added mkdeps.o.
713         (../jcf-dump$(exeext)): Added mkdeps.o.
714         * jcf-depend.c: Include mkdeps.h.
715         (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
716         add_entry): Removed.
717         (jcf_dependency_reset): Rewrote.
718         (dependencies): New global.
719         (jcf_dependency_set_target): Rewrote.
720         (jcf_dependency_add_target): Likewise.
721         (jcf_dependency_add_file): Likewise.
722         (munge): Removed.
723         (print_ents): Removed.
724         (jcf_dependency_write): Rewrote.
725         (print_dummies): New global.
726         (jcf_dependency_print_dummies): New function
727         (jcf_dependency_write): Call deps_dummy_targets if required.
728
729 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
730
731         * gjavah.c (add_class_decl): Removed unused variables `tname',
732         `tlen' and `name_index'.
733         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
734         * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
735         in `wfl_operator' with value.
736         (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
737         (jcf_figure_file_type): Fixed identation.
738         * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
739         * parse.y (analyze_clinit_body): New function.
740         (static_initializer:): Reset `current_static_block'.
741         (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
742         `wfl_operator' with new value.
743         (lookup_cl): Use EXPR_WFL_FILENAME.
744         (maybe_yank_clinit): Handle bogus <clinit> bodies, call
745         analyze_clinit_body.
746         (build_outer_field_access): Access to this$<n> built from
747         current_class, not its outer context.
748         (build_access_to_thisn): Fixed leading comment. Tidied things up.
749         (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
750         (patch_method_invocation): Use `is_static_flag' when already
751         initialized.
752         (patch_newarray): Removed assignment in ternary operator.
753
754 2000-10-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
755
756         * except.c (free_eh_ranges): Don't free `whole_range'.
757
758 2000-10-15  Anthony Green  <green@redhat.com>
759
760         * decl.c (init_decl_processing): Call init_class_processing before
761         anything else.
762
763 2000-10-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
764
765         * check-init.c (check_init): Fixed leading comment. Use
766         LOCAL_FINAL_P.
767         * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
768         (give_name_to_locals): Likewise.
769         (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
770         fields in lang_decl_var.
771         * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
772         DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
773         (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
774         (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
775         DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
776         (LOCAL_FINAL): Rewritten.
777         (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
778         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
779         (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
780         `init_final' fields.
781         (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
782         `final_uid', `final_liic', `final_ierr' and `local_final' fields.
783         (TYPE_HAS_FINAL_VARIABLE): New macro.
784         (struct lang_type): Added `afv' field.
785         * parse.y (check_static_final_variable_assignment_flag): New function.
786         (reset_static_final_variable_assignment_flag): Likewise.
787         (check_final_variable_local_assignment_flag): Likewise.
788         (reset_final_variable_local_assignment_flag): Likewise.
789         (check_final_variable_indirect_assignment): Likewise.
790         (check_final_variable_global_assignment_flag): Likewise.
791         (add_inner_class_fields): Use LOCAL_FINAL_P.
792         (register_fields): Handle local finals and final variables.
793         (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
794         (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
795         (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
796         on local finals.
797         (java_complete_expand_methods): Loop to set
798         TYPE_HAS_FINAL_VARIABLE. Call
799         `reset_final_variable_local_assignment_flag' and
800         `check_final_variable_local_assignment_flag' accordingly before
801         and after constructor expansion. Call
802         `reset_static_final_variable_assignment_flag'
803         before expanding <clinit> and after call
804         `check_static_final_variable_assignment_flag' if the
805         current_class isn't an interface. After all methods have been
806         expanded, call `check_final_variable_global_assignment_flag' and
807         `check_static_final_variable_assignment_flag' if the current class
808         is an interface.
809         (maybe_yank_clinit): Fixed typo in comment.
810         (build_outer_field_access_methods): Removed old sanity check. Use
811         FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
812         Don't create access methods for finals.
813         (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
814         (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
815         existing DECL_INIT has been processed.
816         (java_complete_lhs): Likewise.
817         (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
818         Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
819         logic.
820         (patch_assignment): Use LOCAL_FINAL_P.
821         (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
822         DECL_INITIAL is nullified.
823         Fixes gcj/163.
824
825 2000-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
826
827         * Make-lang.in (parse.c, parse-scan.c): Create atomically.
828
829         * Makefile.in (parse.c, parse-scan.c): Likewise.
830
831 2000-10-12  Mark Mitchell  <mark@codesourcery.com>
832
833         * class.c (temporary_obstack): Remove.
834         (make_class): Don't mess with obstascks.
835         (push_class): Likewise.
836         (set_super_info): Likewise.
837         (add_method_1): Likewise.
838         (add_method): Likewise.
839         (add_field): Likewise.
840         (build_utf8_ref): Likewise.
841         (build_class_ref): Likewise.
842         (build_static_field_ref): Likewise.
843         (finish_class): Likewise.
844         (push_super_field): Likewise.
845         (layout_class): Likewise.
846         (layout_class_methods): Likewise.
847         (init_class_processing): Likewise.
848         * constants.c (get_tag_node): Likewise.
849         (build_constant_data_ref): Likewise.
850         * decl.c (ggc_p): Remove.
851         (copy_lang_decl): Use ggc_alloc.
852         (complete_start_java_method): Don't mess with obstacks.
853         (start_java_method): Likewise.
854         (end_java_method): Likewise.
855         * except.c (link_handler): Use xmalloc.
856         (free_eh_ranges): New function.
857         (method_init_exceptions): Use it.
858         (add_handler): Use xmalloc.
859         (expand_start_java_handler): Don't mess with obstacks.
860         (prepare_eh_table_type): Likewise.
861         (expand_end_java_handler): Likewise.
862         * expr.c (push_value): Likewise.
863         (create_label_decl): Likewise.
864         (build_jni_stub): Likewise.
865         (java_lang_expand_expr): Likewise.
866         (note_instructions): Use xrealloc.
867         (java_push_constant_from_pool): Don't mess with obstacks.
868         (process_jvm_instruction): Likewise.
869         * java-tree.h (cyclic_inheritance_report): Remove duplicate
870         declaration.
871         * jcf-parse.c (get_constant): Don't mess with obstacks.
872         (read_class): Likewise.
873         (jcf_parse): Likewise.
874         * lex.c (expresion_obstack): Remove.
875         (java_lex): Don't use obstack_free.
876         * parse.h (exit_java_complete_class): Don't mess with obstacks.
877         (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
878         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
879         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
880         * parse.y (gaol): Add more GC roots.
881         (add_inner_class_fields): Adjust calls to MANGLE_* macros.
882         (lookup_field_wrapper): Likewise.
883         (obtain_incomplete_type): Don't mess with obstacks.
884         (build_alias_initializer_paramter_list): Adjust calls to MANGLE_*
885         macros.
886         (craft_constructor): Don't mess with obstacks.
887         (safe_layout_class): Likewise.
888         (java_complete_class): Likewise.
889         (source_end_java_method): Likewise.
890         (build_outer_field_access_methods): Likewise.
891         (build_outer_method_access_method): Likewise.
892         (maybe_build_thisn_access_method): Likewise.
893         (build_dot_class_method_invocation): Likewise.
894         (java_complete_tree): Likewise.
895         (java_complete_lhs): Likewise.
896         (do_merge_string_cste): Likewise.
897         (patch_string_cst): Likewise.
898         (array_constructor_check_entry): Likewise.
899         * typeck.c (build_java_array_type): Likewise.
900         (parse_signature_string): Likewise.
901         (build_java_signature): Likewise.
902
903 2000-10-12  Tom Tromey  <tromey@cygnus.com>
904
905         Fix for PR gcj/356:
906         * gjavah.c (add_class_decl): Don't special-case inner classes.
907         (add_namelet): Likewise.
908
909 2000-10-11  Rodney Brown  <RodneyBrown@mynd.com>
910
911         * java-tree.h: Constify current_encoding.
912         * lang.c: Constify current_encoding.
913
914 2000-10-10  Jeff Sturm  <jeff.sturm@appnet.com>
915
916         * jvgenmain.c (class_mangling_suffix): Omit `.'.
917         (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
918
919 2000-10-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
920
921         * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
922         patch. Fixes gcj/340.
923
924 2000-10-10  Tom Tromey  <tromey@cygnus.com>
925
926         * lex.c (java_new_lexer): Initialize out_first and out_last
927         fields.
928         * lex.h (java_lexer): Added out_buffer, out_first, out_last.
929
930 2000-10-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
931
932         * parse.y (pop_current_osb): New function.
933         (array_type:): Use `dims:', changed actions
934         accordingly. Suggested by Anthony Green.
935         (array_creation_expression:): Used pop_current_osb.
936         (cast_expression:): Likewise.
937         (search_applicable_method_list): Fixed indentation.
938
939 2000-10-08  Anthony Green  <green@redhat.com>
940
941         * parse.y (array_type_literal): Remove production.
942         (type_literals): Refer to array_type, not array_type_literal.
943
944 2000-10-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
945
946         Patch contributed by Corey Minyard.
947         * decl.c (check_local_named_variable): New function.
948         (tree check_local_unnamed_variable): Likewise.
949         (find_local_variable): Splitted. Call check_local_{un}named_variable.
950
951 2000-10-07  Anthony Green  <green@redhat.com>
952
953         * class.c (layout_class): Handle case where superclass can't be
954         layed out yet.
955
956 2000-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
957
958         * Makefile.in (keyword.h): Refer to GNU FTP site for updated
959         gperf.
960
961 2000-10-05  Tom Tromey  <tromey@cygnus.com>
962
963         * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
964         * jvgenmain.c (class_mangling_prefix): Removed.
965         (class_mangling_suffix): New global.
966         (main): Use it.
967         * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
968         `$'.
969         (print_method_info): Handle overrides for static and final
970         methods.
971         (process_file): Generate declaration for class object field.
972         * class.c (cxx_keywords): New array.
973         (utf8_cmp): New function.
974         (cxx_keyword_p): New function.
975         (layout_class_method): Mangle C++ keywords by appending `$'.
976         (mangle_field): New function.
977         (mangle_class_field): Use mangle_field.  Mangle class name as
978         `class$'.
979         (mangle_static_field): Use mangle_field.
980
981 Tue Oct  3 13:44:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
982
983         * decl.c (find_local_variable): Removed uncessary type check and
984         fixed range check typo. From Corey Minyard.
985
986 Wed Sep 13 16:06:52 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
987
988         * decl.c (give_name_to_locals): New local `code_offset'. Call
989         `maybe_adjust_start_pc'.
990         * expr.c (note_instructions): New function.
991         (expand_byte_code): Don't collect insn starts here.
992         (peek_opcode_at_pc): New function.
993         (maybe_adjust_start_pc): Likewise.
994         * java-tree.h (maybe_adjust_start_pc): Declare.
995         (note_instructions): Likewise.
996         * jcf-parse.c (parse_class_file): Call `note_instructions'.
997
998 Wed Sep 13 11:50:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
999
1000         * parse.y (field_access:): Fixed indentation.
1001         (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
1002
1003 2000-09-07  Tom Tromey  <tromey@cygnus.com>
1004
1005         Fix for PR gcj/307:
1006         * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
1007         JPRIMITIVE_TYPE_P, for arithmetic operators.
1008         (patch_method_invocation): Indentation fix.
1009         (try_builtin_assignconv): Handle boolean specially.  Fixed typo.
1010         (valid_builtin_assignconv_identity_widening_p): Handle boolean.
1011         (do_unary_numeric_promotion): Cleaned up code.
1012         (valid_cast_to_p): Handle boolean correctly.
1013
1014 2000-09-27  Tom Tromey  <tromey@cygnus.com>
1015
1016         * lex.c (java_read_unicode): Reset bs_count when finished with
1017         `\u' sequence.
1018
1019 2000-10-01  Mark Mitchell  <mark@codesourcery.com>
1020
1021         Convert to GC.
1022         * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
1023         * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
1024         (typeck.o): Depend on ggc.h.
1025         * class.c (add_method_1): Use GC functions for allocation.
1026         (init_class_processing): Register roots.
1027         * decl.c (ggc_p): Set to 1.
1028         (pending_local_decls): Make it static.
1029         (push_jvm_slot): Use GC functions for allocation.
1030         (init_decl_processing): Register roots.
1031         (give_name_to_locals): Use GC functions for allocation.
1032         (lang_mark_tree): New function.
1033         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
1034         functions for allocation.
1035         * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
1036         * lex.c (java_lex): Use build_string, rather than replicating it
1037         inline.
1038         * parse.y (goal): Add more roots.
1039         (mark_parser_ctxt): New function.
1040         * typeck.c: Include ggc.h.
1041
1042 2000-09-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1043
1044         * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
1045         contains something else than MODIFY_EXPR.
1046
1047 2000-09-23  Mark Mitchell  <mark@codesourcery.com>
1048
1049         * Make-lang.in (JAVA_SRCS): Include java-tree.h.
1050         * Makefile.in (parse.o): Depend on ggc.h.
1051         (class.o): Likewise.
1052         (constants.o): Likewise.
1053         (decl.o): Likewise.
1054         (expr.o): Likewise.
1055         (jcf-parse.o): Likewise.
1056         (jcf-write.o): Likewise.
1057         (mangle.o): Likewise.
1058         * class.c: Include ggc.h.
1059         (build_static_field_ref): Register GC roots.
1060         (layout_class): Likewise.
1061         (init_class_processing): Likewise.
1062         * constants.c: Include ggc.h.
1063         (current_constant_pool_data_ref): Remove.
1064         (tag_nodes): Move it to ...
1065         (get_tag_node): ... here.  Register GC roots.
1066         * decl.c: Include ggc.h.  Remove many global tree definitions.
1067         (throw_node): Define.
1068         (java_global_trees): Likewise.
1069         (predef_filenames): Make the size a constant.
1070         (init_decl_processing): Adjust accordingly.
1071         (init_decl_processing): Call init_jcf_parse.  Register GC roots.
1072         * expr.c: Include ggc.h.
1073         (init_expr_processing): Register GC roots.
1074         (build_invokeinterface): Likewise.
1075         * java-tree.h: Replace extern tree declarations with macros.
1076         (java_global_trees): New variable.
1077         (java_tree_index): New enumeration.
1078         (init_jcf_parse): Declare.
1079         * jcf-parse.c: Include ggc.h.
1080         (current_class): Remove declaration.
1081         (main_class): Likewise.
1082         (all_class_list): Likewise.
1083         (predefined_filename_p): Adjust for constant size of
1084         predef_filenames.
1085         (init_jcf_parse): New function.
1086         * jcf-write.c: Include ggc.h.
1087         (generate_classfile): Register GC roots.
1088         (append_synthetic_attribute): Likewise.
1089         (append_innerclass_attribute_entry): Likewise.
1090         * lang.c: Include ggc.h.
1091         (lang_print_error): Register GC roots.
1092         * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
1093         with macros.
1094         * parse.y: Include ggc.h.
1095         (wfl_operator): Remove.
1096         (goal): Register GC roots.
1097         (java_pop_parser_context): Adjust for new field names.
1098         (java_parser_context_save_global): Likewse.
1099         (java_parser_context_restore_global): Likewise.
1100         (java_parser_context_suspend): Likewise.
1101         (java_parser_context_resume): Likewise.
1102         (verify_constructor_circularity): Register GC roots.
1103         (lookup_cl): Likewise.
1104         (java_reorder_fields): Likewise.
1105         (build_current_this): Likewise.
1106         (class_in_current_package): Likewise.
1107         (argument_types_convertible): Likewise.
1108         (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
1109
1110 2000-09-14  Tom Tromey  <tromey@cygnus.com>
1111
1112         * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
1113
1114 2000-09-13  Tom Tromey  <tromey@cygnus.com>
1115
1116         * jcf-parse.c: Include <locale.h>.
1117         * jv-scan.c: Include <locale.h>.
1118
1119 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1120
1121         * expr.c (pop_type_0): Return `Object' if trying to merge two
1122         interface types.
1123         * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
1124         interface types; `Object' is always a valid supertype.
1125
1126 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1127
1128         Fix for PR gcj/33:
1129         * jv-scan.c (help): Document --encoding.
1130         (options): Added `encoding' entry.
1131         (OPT_ENCODING): New define.
1132         (main): Handle --encoding.
1133         Include <langinfo.h> if nl_langinfo exists.
1134         * lang-options.h: Document --classpath, --CLASSPATH, --main, and
1135         --encoding.
1136         * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
1137         (parse_source_file): Correctly call java_init_lex.  Added `finput'
1138         argument.  Use nl_langinfo to determine default encoding.
1139         * java-tree.h (current_encoding): Declare.
1140         * parse.y (java_parser_context_restore_global): Don't restore
1141         `finput'.
1142         (java_parser_context_save_global): Don't set `finput' field.
1143         (java_pop_parser_context): Don't restore `finput'.  Free old lexer
1144         if required.
1145         * lang.c (current_encoding): New global.
1146         (lang_decode_option): Recognize `-fencoding='.
1147         (finish_parse): Don't close finput.
1148         * parse.h (struct parser_ctxt): Removed `finput' and
1149         `unget_utf8_value' fields.  Added `lexer' field.
1150         (java_init_lex): Fixed declaration.
1151         * lex.c (java_new_lexer): New function.
1152         (java_destroy_lexer): Likewise.
1153         (java_read_char): Added `lex' argument.  Handle iconv case.
1154         (java_read_unicode): Added `lex' argument.  Count backslashes in
1155         lexer structure.
1156         (java_init_lex): Added `finput' and `encoding' arguments.  Set
1157         `lexer' field in ctxp.
1158         (BAD_UTF8_VALUE): Removed.
1159         (java_lex): Handle seeing UEOF in the middle of a string literal.
1160         * lex.h: Include <iconv.h> if HAVE_ICONV defined.
1161         (java_lexer): New structure.
1162         (UNGETC): Removed.
1163         (GETC): Removed.
1164         (DEFAULT_ENCODING): New define.
1165         (java_destroy_lexer): Declare.
1166
1167 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1168
1169         Fix for PR gcj/343:
1170         * lex.c (java_init_lex): Initialize java_io_serializable.
1171         * parse.y (java_io_serializable): New global.
1172         (valid_ref_assignconv_cast_p): An array can be cast to
1173         serializable.
1174
1175 2000-09-10  Zack Weinberg  <zack@wolery.cumb.org>
1176
1177         * decl.c, expr.c: Include defaults.h if not already included.
1178         Don't define the *_TYPE_SIZE macros.
1179
1180 2000-09-09  Geoffrey Keating  <geoffk@cygnus.com>
1181
1182         * typeck.c (build_java_array_type): Correct first parameter
1183         in ADJUST_FIELD_ALIGN invocation.
1184
1185 2000-09-06  Tom Tromey  <tromey@cygnus.com>
1186
1187         * lang-specs.h: Also recognize `-femit-class-files'.
1188
1189 2000-09-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1190
1191         * verify.c (merge_types): Load the types to merge if necessary.
1192
1193 2000-09-02  Anthony Green  <green@redhat.com>
1194
1195         * jcf-io.c: Include zlib.h.
1196         (open_in_zip): Read compressed class file archives.
1197         * zipfile.h (ZipDirectory): Add uncompressed_size and
1198         compression_method fields.
1199         * zextract.c (read_zip_archive): Collect file compression info.
1200
1201 2000-08-15  Bryce McKinlay  <bryce@albatross.co.nz>
1202
1203         * parse.y (do_resolve_class): Also explore superclasses of
1204         intermediate enclosing contexts when searching for inner classes.
1205
1206 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1207
1208         * parse.y (variable_declarator_id:): Better error message.
1209         (expression_statement:): Use YYNOT_TWICE.
1210         (cast_expression:): Likewise.
1211         (assignment:): Likewise.
1212
1213 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1214
1215         * parse.y (do_merge_string_cste): New locals. Create new
1216         STRING_CSTs each time, use memcpy. Fixes gcj/311.
1217
1218 2000-08-07  Hans Boehm  <boehm@acm.org>
1219
1220         * boehm.c (mark_reference_fields): Set marking bits for all words in
1221         a multiple-word record.
1222         (get_boehm_type_descriptor): Use the procedure marking descriptor for
1223         java.lang.Class.
1224
1225 2000-08-31  Mike Stump  <mrs@wrs.com>
1226
1227         * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
1228         jcf-dump$(exeext)): Make parallel safe.
1229
1230 2000-08-29  Zack Weinberg  <zack@wolery.cumb.org>
1231
1232         * jcf-parse.c (set_source_filename): Constify a char *.
1233         * jcf-write.c (append_innerclasses_attribute,
1234         make_class_file_name): Constify a char *.  Don't recycle a
1235         variable for an unrelated purpose.
1236         * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
1237         (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
1238
1239 2000-08-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1240
1241         * expr.c (can_widen_reference_to): Fixed indentation.
1242         * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
1243         * parse.y: `finit$' replaces `$finit$' in comments.
1244         (try_builtin_assignconv): Fixed leading comment.
1245
1246 2000-08-25  Greg McGary  <greg@mcgary.org>
1247
1248         * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
1249
1250 2000-08-24  Greg McGary  <greg@mcgary.org>
1251
1252         * lang.c (lang_decode_option): Use ARRAY_SIZE.
1253         * parse.y (BINOP_LOOKUP): Likewise.
1254
1255 2000-08-22  Andrew Haley  <aph@cygnus.com>
1256
1257         * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
1258         sign extending. Fixes gcj/321.
1259         * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
1260         combining to make a jlong. Fixes gcj/321.
1261
1262 2000-08-21  Nix  <nix@esperi.demon.co.uk>
1263
1264         * lang-specs.h: Do not process -o or run the assembler if
1265         -fsyntax-only.
1266
1267 2000-08-16  Andrew Haley  <aph@cygnus.com>
1268
1269         * typeck.c (build_java_array_type): Rewrite code to do array
1270         alignment.  Take into account back-end macros when aligning array
1271         data.  Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
1272         user to set alignment. Fixes gcj/252 and 160.
1273
1274 2000-08-09  Tom Tromey  <tromey@cygnus.com>
1275
1276         * parse.y (check_abstract_method_definitions): Now return `int'.
1277         Check implemented interfaces.  Fixes PR gcj/305.
1278
1279         * parse.y (patch_switch_statement): Disallow `long' in switch
1280         expressions.  Fixes PR gcj/310.
1281
1282 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1283
1284         * decl.c (finit_leg_identifier_node): New global.
1285         (init_decl_processing): Use `finit$' to initialize
1286         finit_identifier_node. Use `$finit$' to initialize
1287         finit_leg_identifier_node.
1288         * expr.c (expand_java_field_op): Use ID_FINIT_P.
1289         * java-tree.h (finit_identifier_node): Changed attached comment.
1290         (finit_leg_identifier_node): New declaration.
1291         (ID_FINIT_P): Take finit_identifier_node and
1292         finit_leg_identifier_node into account. This is a backward
1293         compatibility hack.
1294
1295 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1296
1297         * jcf-write.c (generate_bytecode_conditional): Re-installed lost
1298         Jan 6 2000 patch.
1299         (generate_bytecode_insns): Check `nargs' before emitting it.
1300         * verify.c (merge_type_state): Fixed typo.
1301         * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
1302         generate_bytecode_{conditional,insns}.
1303
1304 Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
1305
1306         * check-init.c (check_init): Add case for BIT_FIELD_REF (required
1307         for -pg builds).
1308
1309 2000-08-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1310
1311         * class.c (maybe_layout_super_class): Fixed indentation.
1312         * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
1313         (java_check_methods): New function declaration.
1314         * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
1315         instead of `str_ptr'.
1316         * jcf-write.c (generate_bytecode_insns): Emit number the of args
1317         of a `invokeinterface' at the right time.
1318         * parse.h (WFL_STRIP_BRACKET): New macro.
1319         (SET_TYPE_FOR_RESOLUTION): Use it.
1320         * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
1321         (check_class_interface_creation): Don't check for cross package
1322         innerclass name clashes.
1323         (method_header): Behave properly if MDECL is `error_mark_node'.
1324         (method_declarator): Return `error_mark_node' if bogus current
1325         class.
1326         (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
1327         (resolve_and_layout): New local `decl_type', set and used. Call
1328         java_check_methods.
1329         (java_check_methods): New method.
1330         (java_layout_classes): Use it.
1331         (resolve_qualified_expression_name): No EH check necessary in
1332         access$<n>.
1333         (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
1334         `case' statement.
1335         (patch_assignment): Set DECL_INITIAL on integral final local.
1336
1337 2000-08-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1338
1339         * java-tree.h (flag_extraneous_semicolon): New extern.
1340         * lang-options.h: (-Wextraneous-semicolon): New option.
1341         * lang.c (flag_redundant): Fixed typo in leading comment.
1342         (flag_extraneous_semicolon): New global.
1343         (lang_decode_option): Set `flag_extraneous_semicolon' when
1344         -Wall. Decode `-Wextraneous-semicolon'.
1345         * parse.y (type_declaration:): Removed `SC_TK' hack, added
1346         `empty_statement' rule.
1347         (class_body_declaration): Likewise.
1348         (method_body:): Accept `;' as a method body.
1349         (static_initializer:): Removed `SC_TK' hack.
1350         (constructor_block_end:): Likewise.
1351         (empty_statement:): Report deprecated empty declaration. Fixes
1352         gcj/295
1353
1354 2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1355
1356         * parse.y (build_dot_class_method_invocation): Changed parameter
1357         name to `type'. Build signature from `type' and convert it to a
1358         STRING_CST if it's an array.
1359         (patch_incomplete_class_ref): `build_dot_class_method_invocation'
1360         to use `ref_type' directly.
1361
1362 Sun Aug  6 00:47:24 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
1363
1364         * lang-options.h: Added a comma after the last element to avoid
1365         syntax errors when other languages define additional options.
1366
1367 2000-08-04  Zack Weinberg  <zack@wolery.cumb.org>
1368
1369         * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
1370         * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
1371         (jc1): Link with $(BACKEND).
1372         (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
1373
1374 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
1375
1376         * jvspec.c: Adjust type of second argument to
1377         lang_specific_driver, and update code as necessary.
1378
1379         * class.c (build_dtable_decl): Initialize dummy.
1380
1381 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1382
1383         * parse.y (maybe_yank_clinit): When generating bytecode: non empty
1384         method bodies not to rule out discarding `<clinit>'; don't use
1385         <clinit> to initialize static fields with constant initializers.
1386
1387 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1388
1389         * gjavah.c (print_method_info): Added `synth' parameter. Skip
1390         synthetic methods.
1391         (method_synthetic): New global.
1392         (HANDLE_METHOD): Recognize synthetic method and tell
1393         `print_method_info' about it.
1394         (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
1395         processing a synthetic method.
1396         * jcf-reader.c (skip_attribute): New function.
1397         ( skip_attribute): Likewise.
1398
1399 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1400
1401         * parse.y (build_outer_field_access): Fixed comments.
1402         (fix_constructors): Emit the initialization of this$<n> before
1403         calling $finit$.
1404         (resolve_qualified_expression_name): Build an access to `decl' if
1405         necessary.
1406
1407 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1408
1409         * parse-scan.y (curent_class): Non longer const.
1410         (inner_qualifier, inner_qualifier_length): Deleted.
1411         (current_class_length): New global.
1412         (bracket_count): Fixed typo in leading comment.
1413         (anonymous_count): New global.
1414         (class_instance_creation_expression:): Handle anonymous classes.
1415         (anonymous_class_creation:): New rule.
1416         (push_class_context): Rewritten.
1417         (pop_class_context): Likewise.
1418         (INNER_QUALIFIER): Macro deleted.
1419         (report_class_declaration): call `push_class_context' when
1420         entering the function. `fprintf' format modified not to use
1421         INNER_QUALIFIER.
1422         (report_class_declaration): Assign `package_name' and
1423         `current_class' to NULL separatly.
1424
1425 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1426
1427         * expr.c (build_invokeinterface): Call layout_class_methods on
1428         target interface.
1429
1430 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1431             Anthony Green  <green@cygnus.com>
1432             Alexandre Petit-Bianco  <apbianco@cygnus.com>
1433
1434         * class.c (make_class_data): Create vtable for abstract classes.
1435         (get_dispatch_table): Changed to cope with abstract classes.
1436
1437 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1438
1439         * parse.y (patch_method_invocation): Don't reverse the argument
1440         list when dealing with anonymous class constructors. Fixed typo in
1441         comment.
1442
1443 2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1444
1445         * parse.y (build_alias_initializer_parameter_list): Reverse
1446         crafted list when building aliases for anonymous class
1447         constructors.
1448
1449 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1450
1451         * parse.y (jdep_resolve_class): Don't bother checking potential
1452         innerclass access if `decl' is NULL.
1453         (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
1454         WFL.
1455
1456 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1457
1458         * parse.c: Remove (again.)
1459
1460 2000-07-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1461
1462         * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
1463         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
1464         outside the `if' statement, alias to innerclass removed, `decl'
1465         used to mark the class complete.
1466
1467 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1468
1469         * parse.y (simple_name:): Fixed typo in error message.
1470
1471 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1472
1473         * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
1474         or its first operand can be error marks.
1475
1476 2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1477
1478         * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
1479         * parse.y (method_header): Likewise.
1480
1481 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1482
1483         * parse.y (process_imports): Consider that one might be trying to
1484         import an innerclass. Fixes gcj/254
1485
1486 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1487
1488         * parse.y (find_as_inner_class): Handle the case where the
1489         enclosing context of an innerclass has been loaded as bytecode.
1490
1491 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1492
1493         * parse.y (simple_name:): Reject `$' in type names.
1494         (resolve_type_during_patch): Use `type' as a second
1495         argument to resolve_no_layout. Fixes gcj/257.
1496
1497 2000-07-18  Bryce McKinlay  <bryce@albatross.co.nz>
1498
1499         * parse.y (find_most_specific_methods_list): Select the only
1500         non-abstract method even if max has been set.
1501         Fixes gcj/285, gcj/298.
1502
1503 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
1504
1505         * lang-specs.h: Added %(jc1) to java compiler options.
1506
1507 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
1508
1509         * .cvsignore: New file.
1510
1511 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1512
1513         * parse.y (not_accessible_p): Access granted to innerclasses
1514         (indirectly) extending the reference type. Fixes gcj/249.
1515
1516 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1517
1518         * parse.y (patch_method_invocation): Fixed comment.
1519         (maybe_use_access_method): Build this$<n>s to the context of the
1520         target method, or a type that extends it. Fixes gcj/242.
1521
1522 2000-07-13  Mark Mitchell  <mark@codesourcery.com>
1523
1524         * parse.c: Remove.
1525
1526 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1527
1528         * parse.y (fold_constant_for_init): Avoid bullish conversion.
1529
1530 2000-07-13  Tom Tromey  <tromey@cygnus.com>
1531
1532         * lang-specs.h: Added %{I*}.
1533
1534 2000-07-13  Zack Weinberg  <zack@wolery.cumb.org>
1535
1536         * lang-specs.h: Use the new named specs.  Remove unnecessary braces.
1537
1538 2000-07-12  Mark Mitchell  <mark@codesourcery.com>
1539
1540         * parse-scan.c: Remove.
1541
1542 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1543
1544         * class.c (set_super_info): Handled protected inner classes.
1545         (common_enclosing_context_p): Bail early if arguments aren't both
1546         inner classes.
1547         (get_access_flags_from_decl): Handle private and protected inner
1548         classes.
1549         * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
1550         (CLASS_PROTECTED): Likewise.
1551         (struct lang_type): New bitfield `poic'.
1552         * parse.y (jdep_resolve_class): Call check_inner_class_access on
1553         inner classes only.
1554         (check_inner_class_access): Renamed arguments, added
1555         comments. Handles protected inner classes (fixes gcj/225)
1556         (not_accessible_p): Fixed comments. Avoid handling inner classes.
1557
1558 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1559
1560         * parse.y (resolve_qualified_expression_name): Verify qualified
1561         access to `this'. Fixes gcj/239.
1562
1563 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1564
1565         * jcf-write.c (generate_classfile): Don't install ConstantValue
1566         for null pointers.
1567
1568 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1569
1570         * parse.y (resolve_qualified_expression_name): Handle inner class
1571         access. Fixes gcj/256.
1572
1573 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1574
1575         * jcf-write.c (generate_classfile): Properly install the
1576         ConstantValue attribute and the initial value constant pool index
1577         on string constants.
1578         * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
1579         class files.
1580
1581 2000-07-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1582
1583         * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
1584         construct.
1585         * parse.y (find_as_inner_class): Fixed typo.
1586         (do_resolve_class): Explore enclosing contexts when searching for
1587         innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
1588         (check_inner_class_access): Check `decl' which can be null in case
1589         of previous errors.
1590
1591 2000-07-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1592
1593         * java-tree.h (java_debug_context): Declared `extern'.
1594         (safe_layout_class): Likewise.
1595         * parse.y (resolve_field_access): Field must be `static' in order
1596         to be replaced by its initial value. Added comments.
1597         (find_applicable_accessible_methods_list): Fixed typo.
1598         (find_most_specific_methods_list): Methods found in innerclasses
1599         take over methods founds in the enclosing contexts.
1600         (java_complete_tree): Loosen restrictions on the type of DECLs
1601         that can be replaced by their initialization values.
1602         (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
1603
1604 2000-07-05  Tom Tromey  <tromey@cygnus.com>
1605
1606         * Make-lang.in (PARSE_DIR): New macro.
1607         (PARSE_RELDIR): Likewise.
1608         (PARSE_C): Likewise.
1609         (PARSE_SCAN_C): Likewise.
1610         ($(PARSE_C)): New target.
1611         ($(PARSE_SCAN_C)): Likewise.
1612         (SET_BISON): New macro.
1613         (BISONFLAGS): Likewise.
1614         (JAVABISONFLAGS): Likewise.
1615
1616 2000-07-02  Bryce McKinlay  <bryce@albatross.co.nz>
1617
1618         * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
1619         argument on the first pass for CNI as well as JNI.
1620         (print_method_info): Set up method name on the first pass only.
1621
1622 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1623
1624         * parse.y (parser_qualified_classname): Removed parameter
1625         `is_static'.
1626         (create_interface): Removed first passed parameter to
1627         parser_qualified_classname.
1628         (create_class): Likewise. Don't install alias on static
1629         innerclasses. Fixes gcj/275.
1630
1631 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1632
1633         * parse.y (maybe_generate_pre_expand_clinit): Don't build a
1634         debugable statement with empty_stmt_node. Fixes gcj/272
1635
1636 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1637
1638         * expr.c (build_instanceof): Layout type after it's loaded. Fixes
1639         gcj/271.
1640
1641 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1642
1643         * jcf-write.c (push_long_const): Appropriately cast short negative
1644         constant to jword.
1645
1646 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1647
1648         * parse.y (verify_constructor_super): Use loop variable
1649         `m_arg_type' initialized with `mdecl_arg_type'.
1650
1651 2000-06-29  Tom Tromey  <tromey@cygnus.com>
1652
1653         * parse.y (resolve_field_access): Handle case where `type_found'
1654         is NULL.
1655
1656 2000-06-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1657
1658         * expr.c (lookup_field): The same field can be found through two
1659         different interface. Don't declare it ambiguous in that case.
1660
1661 2000-06-27  Tom Tromey  <tromey@cygnus.com>
1662
1663         * lex.c (java_lineterminator): Don't recognize \r after \n.  If \r
1664         follows \r, then unget it at a lower level.
1665
1666 2000-06-26  Tom Tromey  <tromey@cygnus.com>
1667
1668         * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
1669         java_complete_tree.
1670
1671 2000-06-25  Tom Tromey  <tromey@cygnus.com>
1672
1673         * parse.y (for_statement): Wrap expression in a WFL if it is a
1674         constant.  For PR gcj/268.
1675
1676 2000-06-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1677
1678         * parse.y (do_resolve_class): Minor optimiztion in the package
1679         list search. Removed unecessary test and return statement.
1680         (valid_ref_assignconv_cast_p): Order of arguments to
1681         enclosing_context_p fixed.
1682
1683 2000-06-24  Tom Tromey  <tromey@cygnus.com>
1684
1685         * expr.c (lookup_field): Print error and return error_mark_node if
1686         field reference is ambiguous.
1687
1688         * parse.y (check_abstract_method_definitions): Also check if
1689         `other_method' is abstract.
1690
1691 2000-06-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1692
1693         * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
1694         classes.
1695         * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
1696         (struct lang_type): New field `pic'.
1697         (CLASS_PRIVATE): New macro.
1698         * parse.y (check_inner_class_access): New function.
1699         (jdep_resolve_class): Call it.
1700
1701 2000-06-23  Tom Tromey  <tromey@cygnus.com>
1702
1703         * parse.y (patch_incomplete_class_ref): Initialize the returned
1704         class.  For PR gcj/260.
1705
1706 2000-06-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1707
1708         * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
1709
1710 2000-06-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1711
1712         * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
1713         Java specific checks.
1714         * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
1715         screened by DECL_P.
1716         * java-tree.def (CASE_EXPR): Marked 'e'.
1717         (DEFAULT_EXPR): Likewise.
1718         * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
1719         screened by DECL_P.
1720         * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
1721         Java specific checks.
1722         (generate_bytecode_insns): Test try_block for BLOCK before using
1723         BLOCK_EXPR_BODY.
1724         * parse.y (build_wfl_wrap): Added `location' argument. Set
1725         EXPR_WFL_LINECOL accordingly.
1726         (dim_expr:): Wrap constants with WFLs.
1727         (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
1728         (resolve_package): Check for `stmt' not being a BLOCK before
1729         building a debuggable statement with it.
1730         (make_qualified_primary): Added extra parameter to build_wfl_wrap
1731         invocation.
1732         (resolve_field_access): Make sure `decl' is a DECL before treating
1733         it as such.
1734         (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
1735         IDENTIFIER_NODE before treating it as such.
1736         (patch_new_array_init): Make sure `elt' is a TREE_LIST before
1737         treating it as such.
1738         (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
1739         to be applied only on non array types.
1740
1741 2000-06-16  Per Bothner  <per@bothner.com>
1742
1743         * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN):  Don't
1744         define in terms of DECL_RESULT, as that fails when --enable-checking.
1745
1746 2000-06-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1747
1748         * jcf-write.c (CHECK_PUT): Add static prototype.  Make pointer
1749         types the same in comparison.
1750         (CHECK_OP): Add static prototype.
1751
1752 2000-06-13  Jakub Jelinek  <jakub@redhat.com>
1753
1754         * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
1755         * parse.y (java_complete_class): Set DECL_USER_ALIGN.
1756         * parse.c: Rebuilt.
1757
1758 2000-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1759
1760         * decl.c (create_primitive_vtable): Prototype.
1761
1762         * jcf-write.c (generate_bytecode_insns): Initialize variable
1763         `saved_context'.
1764
1765         * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
1766
1767 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
1768
1769         * parse.y (find_applicable_accessible_methods_list): Use a hashtable
1770         to track searched classes, and do not search the same class more than
1771         once. Call find_applicable_accessible_methods_list on immediate
1772         superclass, instead of search_applicable_method_list on all ancestors.
1773         Fix for PR gcj/238.
1774
1775 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
1776
1777         * parse.y (register_fields): Permit static fields in inner classes
1778         if they are final. Fix for PR gcj/255.
1779
1780 2000-06-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1781
1782         * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
1783         * parse.y (find_in_imports): Returned type changed to void,
1784         leading comment fixed.
1785         (register_package): New function.
1786         (qualify_and_find): Likewise.
1787         (package_declaration:): Use `register_package'.
1788         (single_type_import_declaration:): Removed local variable
1789         `node'. Added missing `;' for consistency.
1790         (type_import_on_demand_declaration:): Use `chainon' to link new
1791         entries.
1792         (lookup_field_wrapper): Lookup local variables defined in outer
1793         contexts first.
1794         (java_complete_class): Don't reverse the list of imported on demand.
1795         (do_resolve_class): Reorganized. Removed local variable
1796         `original_name'. Call `qualify_and_find' with the current package
1797         name, invoke `find_in_imports_on_demand' right after. Call
1798         `qualify_and_find' with the packages we've seen so far. Fixed
1799         operations numbering in comments.
1800         (java_expand_class): Don't reverse `package_list'.
1801         (find_most_specific_methods_list): New local variables `abstract'
1802         and `candidates'. Use them to pick the right method.
1803
1804 Tue Jun  6 11:39:05 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
1805
1806         * parse.y (check_modifiers_consistency): Don't subtract out
1807         `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
1808
1809 2000-06-04  Philipp Thomas  <pthomas@suse.de>
1810
1811         * Makefile.in (INTLLIBS): New.
1812         (LIBS): Add above.
1813         (DEPLIBS): Ditto.
1814
1815 Fri Jun  2 16:48:55 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1816
1817         * class.c (get_dispatch_table): Build the vtable dummy entry list
1818         element with a null purpose. Fixed leading comment.
1819         (build_dtable_decl): Build an accurate dtable type when appropriate
1820         and use it.
1821
1822 2000-06-02  Richard Henderson  <rth@cygnus.com>
1823
1824         * lang.c (lang_get_alias_set): New.
1825
1826 2000-05-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1827
1828         * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
1829         before using it as the accessed field.
1830
1831 2000-05-31  Tom Tromey  <tromey@cygnus.com>
1832
1833         * java-tree.h (boolean_array_vtable, byte_array_vtable,
1834         char_array_vtable, short_array_vtable, int_array_vtable,
1835         long_array_vtable, float_array_vtable, double_array_vtable):
1836         Declare.
1837         * expr.c (get_primitive_array_vtable): New function.
1838         (create_primitive_vtable): New function.
1839         (java_lang_expand_expr): Enable code to statically generate
1840         arrays.
1841         * decl.c (init_decl_processing): Create primitive vtables.
1842         (boolean_array_vtable, byte_array_vtable, char_array_vtable,
1843         short_array_vtable, int_array_vtable, long_array_vtable,
1844         float_array_vtable, double_array_vtable): Define.
1845
1846 2000-05-26  Zack Weinberg  <zack@wolery.cumb.org>
1847
1848         * java/parse.y (find_applicable_accessible_methods_list):
1849         Don't add an uninitialized value to the list.
1850
1851 2000-05-25  Tom Tromey  <tromey@cygnus.com>
1852
1853         * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
1854         when trying to see if field's class should be initialized.  Always
1855         initialize field's declaring class, not qualified class.
1856         For PR gcj/162.
1857
1858         * parse.y (array_constructor_check_entry): Pass `wfl_value', not
1859         `wfl_operator', to maybe_build_primttype_type_ref.
1860         Fixes PR gcj/235.
1861
1862 2000-05-23  Bryce McKinlay  <bryce@albatross.co.nz>
1863
1864        * parse.y (patch_method_invocation): Don't try to lookup methods
1865        in primitive types.
1866
1867 2000-05-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1868
1869         * parse.y (resolve_field_access): Call the appropriate <clinit>
1870         before accessing the length of a static array. Craft a decl for
1871         the field while its time. Fixes PR gcj/129.
1872
1873 2000-05-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1874
1875         * parse.y (resolve_package): Correctly set `*next' (was off by
1876         one.)
1877         (resolve_qualified_expression_name): Fixed comment.
1878
1879 Thu Apr 27 17:47:34 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1880
1881         * jcf-parse.c (jcf_parse_source): Reset current_class and
1882         current_function_decl to NULL before parsing a new file.
1883
1884 Thu Apr 27 17:25:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1885
1886         * parse.y (block_end:): If the collected block doesn't feature a
1887         statement, insert an empty statement.
1888
1889 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1890
1891         * parse.y (maybe_yank_clinit): New function.
1892         (maybe_generate_pre_expand_clinit): Always link <clinit> at the
1893         end of the list of methods belonging to a class.
1894         (java_complete_expand_method): Check whether <clinit> is really
1895         necessary and expand it accordingly.
1896
1897 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1898
1899         * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
1900         processed by the method's switch statement.
1901
1902 2000-05-19  Tom Tromey  <tromey@cygnus.com>
1903
1904         * java-tree.h: Added init state enum.
1905         * decl.c (emit_init_test_initialization): Initialize class
1906         initialization check variable by looking at class' state.
1907
1908 2000-05-19  Tom Tromey  <tromey@cygnus.com>
1909
1910         * java-tree.h (build_instanceof): Declare.
1911         (build_get_class): Declare.
1912         * parse.y (patch_binop): Use build_instanceof.
1913         * expr.c (build_instanceof): New function.  If class is final,
1914         don't make a function call.
1915         (expand_java_INSTANCEOF): Use it.
1916         (build_get_class): New function.
1917
1918 2000-05-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
1919
1920         * jcf-write.c (generate_classfile): Scan the source_file for
1921         slashes with the right pointer variable.
1922
1923 Wed May 17 17:27:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
1924
1925         * lang.c (lang_decode_option): Update -Wunused flags by calling
1926         set_Wunused.
1927         * decl.c (poplevel): Replace warn_unused with warn_unused_label.
1928
1929 2000-05-09  Zack Weinberg  <zack@wolery.cumb.org>
1930
1931         * check_init.c (check_init): Constify local char *.
1932         * class.c (push_class): Constify local char *.
1933         * java_tree.h: Update prototypes.
1934         * jcf-io.c (open_class): Constify filename parameter and
1935         return value.
1936         (find_class): Remove redundant string copy.  Cast return from
1937         open_class.
1938         * jcf-parse.c (read_class, parse_class_file, yyparse):
1939         Constify local char *.
1940         * jcf-write.c (generate_bytecode_insns, generate_classfile):
1941         Constify local char *.
1942         * jcf.h (JCF): Constify filename and classname.
1943         (JCF_FINISH): Cast args to FREE to char * when appropriate.
1944         * lang.c (init_parse): Constify parameter and return value.
1945         * lex.c (java_get_line_col): Constify filename parameter.
1946         * parse.h: Constify parser_ctxt.filename.  Update prototypes.
1947         * parse.y (java_parser_context_suspend,
1948         issue_warning_error_from_context, safe_layout_class): Constify
1949         local char *.
1950         * parse.c: Regenerate.
1951
1952 2000-05-08  Tom Tromey  <tromey@cygnus.com>
1953
1954         * expr.c (build_jni_stub): Cache the result of
1955         _Jv_LookupJNIMethod.
1956
1957 2000-05-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1958
1959         * decl.c (predef_filenames_size): Now 7.
1960         (predef_filenames): New seventh entry.
1961
1962 2000-05-04  Tom Tromey  <tromey@cygnus.com>
1963
1964         * boehm.c (mark_reference_fields): Don't mark RawData fields.
1965         Keep track of when we've seen a reference field after a
1966         non-reference field.
1967         (get_boehm_type_descriptor): Handle case where we see
1968         non-reference fields but no trailing reference field.
1969         * decl.c (rawdata_ptr_type_node): Define.
1970         (init_decl_processing): Initialize rawdata_ptr_type_node.
1971         * java-tree.h (rawdata_ptr_type_node): Declare.
1972
1973 2000-05-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1974
1975         * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
1976         specifiers in calls to fprintf.
1977
1978 2000-05-03  Andrew Haley  <aph@cygnus.com>
1979
1980         * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
1981
1982         * javaop.h (WORD_TO_INT): New function.
1983         (IMMEDIATE_s4): Use WORD_TO_INT.
1984         * jcf.h (JPOOL_INT): Ditto.
1985
1986         * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
1987         separator.
1988
1989 2000-04-19  Tom Tromey  <tromey@cygnus.com>
1990
1991         * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
1992         on native function.
1993         * jcf-parse.c (parse_class_file): Call build_jni_stub for native
1994         JNI methods.
1995         * expr.c (build_jni_stub): New function.
1996         * lang-specs.h: -fjni and -femit-class-file are incompatible.
1997         * parse.c: Rebuilt.
1998         * parse.y (java_complete_expand_methods): Expand a native method
1999         and call build_jni_stub if -fjni given.
2000         * lang-options.h: Document -fjni.
2001         * lang.c (flag_jni): New global.
2002         (lang_f_options): Added `jni' entry.
2003         * java-tree.h (soft_lookupjnimethod_node,
2004         soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
2005         Declare.
2006         (flag_jni): Declare.
2007         (build_jni_stub): Declare.
2008         (struct lang_decl): Added `native' flag.
2009         (METHOD_NATIVE): Redefined to use `native' field of lang specific
2010         structure.
2011         * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
2012         soft_jnipopsystemframe_node): New globals.
2013         (init_decl_processing): Set them.  _Jv_InitClass only takes one
2014         argument.
2015
2016         * java-tree.def: Put into `C' mode.
2017
2018 2000-04-27  Tom Tromey  <tromey@cygnus.com>
2019
2020         Fix for PR gcj/2:
2021         * expr.c (expand_invoke): Generate check to see if object pointer
2022         is null in nonvirtual invocation case.
2023         * java-tree.h (soft_nullpointer_node): Declare.
2024         * decl.c (soft_nullpointer_node): New global.
2025         (init_decl_processing): Initialize soft_nullpointer_node.
2026         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
2027         or `private' methods.
2028         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
2029
2030 Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2031
2032         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
2033         from <clinit>
2034
2035 2000-04-26  Tom Tromey  <tromey@cygnus.com>
2036
2037         * zextract.c (find_zip_file_start): New function.
2038         (read_zip_archive): Use it.
2039
2040 2000-04-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2041
2042         * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
2043
2044 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2045
2046         * class.c (common_enclosing_context_p): New function.
2047         * java-tree.h (common_enclosing_context_p): Added prototype.
2048         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
2049         classes sharing an outer context with the current instance.
2050         * parse.y (build_access_to_thisn): Fixed leading comment.
2051         (verify_constructor_super): New local `supper_inner'. Skip
2052         enclosing context argument in the case of inner class constructors.
2053         (patch_method_invocation): Insert proper context as second
2054         parameter to pure inner class constructor super invocations.
2055
2056 Mon Apr 24 14:59:36 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2057
2058         * parse.y (end_class_declaration): Reset the interface number
2059         counter.
2060
2061 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2062
2063         * parse.y (source_start_java_method): Deleted unecessary code.
2064         (patch_method_invocation): Fixed comment.
2065
2066 2000-04-24  Robert Lipe <robertlipe@usa.net>
2067
2068         * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
2069
2070 2000-04-23  Tom Tromey  <tromey@cygnus.com>
2071
2072         * boehm.c (mark_reference_fields): Use int_byte_position.
2073
2074 2000-04-22  Tom Tromey  <tromey@cygnus.com>
2075
2076         * boehm.c (mark_reference_fields): Only call byte_position on
2077         non-static fields.
2078
2079 2000-04-22  Tom Tromey  <tromey@cygnus.com>
2080
2081         * boehm.c (mark_reference_fields): Added `last_view_index'
2082         argument.  Use DECL_FIELD_OFFSET to determine field's offset.
2083
2084 Thu Apr 20 17:41:28 2000  Mo DeJong  <mdejong@cygnus.com>
2085
2086         * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
2087         * parse.y (check_class_interface_creation): Fixed comments. Select
2088         permitted modifiers for (inner) interfaces. Changed error message
2089         to report rejected modifiers used with local classes.
2090
2091 2000-04-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2092
2093         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
2094         of directly inherited type considered in scope.
2095         * parse.y (do_resolve_class): Search inherited classes for inner
2096         classes.
2097
2098 2000-04-20  Tom Tromey  <tromey@cygnus.com>
2099
2100         * parse.y (not_accessible_p): Use member's class, not current
2101         class, when doing inheritance check for protected reference.
2102         Fixes PR gcj/124.
2103
2104 Thu Apr 20 18:20:58 2000  Jason Schroeder  <shrode@subnature.com>
2105
2106         * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
2107
2108 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2109
2110         * parse.y (lookup_field_wrapper): Search for final local aliases.
2111         (resolve_expression_name): Let lookup_field_wrapper search for
2112         final local aliases. Force the value of `name' if one is found.
2113         (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
2114         an expression name. Fixed comments.
2115
2116 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2117
2118         * parse.y (yyerror): `msg' can be null, don't use it in that case.
2119
2120 2000-04-19  Tom Tromey  <tromey@cygnus.com>
2121
2122         * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
2123
2124 2000-04-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2125
2126         * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
2127
2128 2000-04-18  Tom Tromey  <tromey@cygnus.com>
2129
2130         PR gcj/211:
2131         * gjavah.c (utf8_cmp): Changed return value.
2132         (cxx_keyword_subst): Handle all C++ keywords.  Allocate new return
2133         result.
2134         (cxx_keywords): New global.
2135         (get_field_name): Handle new result of cxx_keyword_subst.
2136         (print_method_info): Likewise.
2137
2138 2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
2139
2140         * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
2141         with a newline, for CNI.
2142         (print_stub_or_jni): Print a space or newline before method name for
2143         CNI as well as JNI.
2144         (print_cxx_classname): Don't write leading "::" in CNI stub method.
2145         (process_file): Include gcj/cni.h if generating CNI stubs.
2146
2147 2000-04-16  Tom Tromey  <tromey@cygnus.com>
2148
2149         * gjavah.c (decompile_method): Use print_field_name.
2150         Fixes PR gcj/205.
2151
2152 2000-04-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2153
2154         * parse.y (java_expand_classes): Reverse the package list once.
2155         (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
2156         reduction.
2157         (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
2158         the `==' and `!=' operators.
2159
2160 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2161
2162         * jcf-write.c (generate_bytecode_insns): At invokation time,
2163         always relate an interface method to the type of its selector.
2164
2165 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2166
2167         Fix for PR gcj/2:
2168         * expr.c (expand_invoke): Generate check to see if object pointer
2169         is null in nonvirtual invocation case.
2170         * java-tree.h (soft_nullpointer_node): Declare.
2171         * decl.c (soft_nullpointer_node): New global.
2172         (init_decl_processing): Initialize soft_nullpointer_node.
2173         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
2174         or `private' methods.
2175         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
2176
2177 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2178
2179         Fix for PR gcj/140:
2180         * parse.y (check_final_assignment): Recognize assignments to the
2181         `length' field of an array when generating class files.
2182
2183 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2184
2185         * class.c (decl_hash): Prototype removed.
2186         (decl_compare): Likewise.
2187
2188 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2189
2190         * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
2191         * parse.y (check_modifiers_consistency): Check for final/volatile
2192         clash.  Fixes PR gcj/164.
2193
2194 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2195
2196         * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
2197         made global.
2198         (java_hash_compare_tree_node): Renamed from `decl_compare, made
2199         global.
2200         (add_method_1): Use `java_hash_hash_tree_node' and
2201         `java_hash_compare_tree_node'.
2202         * java-tree.h: (java_hash_hash_tree_node): Prototyped.
2203         (java_hash_compare_tree_node): Likewise.
2204         * parse.y (find_applicable_accessible_methods_list): Create,
2205         delete and use a hash table to remember already searched interfaces.
2206
2207 2000-04-03  Matt Welsh  <mdw@cs.berkeley.edu>
2208
2209         * jcf-depend.c (add_entry): Fixed bug where list was always replaced
2210         with latest entry.
2211
2212 2000-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2213
2214         * boehm.c (mark_reference_fields, set_bit): Prototype.
2215         (set_bit): Un-ANSI-fy definition.
2216
2217         * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
2218         Prototype.
2219
2220         * decl.c (emit_init_test_initialization): Likewise.
2221
2222         * gjavah.c (jni_print_char): Likewise.
2223
2224         * parse.y (create_new_parser_context): Likewise.
2225
2226 Thu Mar 30 15:26:56 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2227
2228         * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
2229         patch missing hunk. Fixed indentation.
2230
2231 2000-03-30  Tom Tromey  <tromey@cygnus.com>
2232
2233         * gjavah.c (D_NAN_MASK): Only define as word-reversed when
2234         HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
2235
2236 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2237
2238         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
2239         when negative *before* using it as an array index.
2240         * ChangeLog: Fixed typo.
2241
2242 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2243
2244         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
2245         to 0 when it reaches -1.
2246
2247 2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2248
2249         * jcf-parse.c (get_constant): Properly cast `num' during the
2250         invocation of `add_double'.
2251         * jcf-write.c (push_long_const): Properly cast `lo' before
2252         comparing it to short bounds.
2253         * parse-scan.y (interface_declaration:): Rule re-arrange so that
2254         `interface_body:' is reduced after the current interface is
2255         pushed.
2256
2257 2000-03-26  Tom Tromey  <tromey@cygnus.com>
2258
2259         * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
2260         Java-specific `-f' option.
2261
2262 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2263
2264         * decl.c (init_decl_processing): Only call initialize_sizetypes once.
2265         Adjust order of making types.
2266         Make bitsize_*_node values.
2267
2268 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2269
2270         * class.c (make_field_value): Use byte_position.
2271         * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
2272         (java_array_data_offset): Likewise.
2273         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
2274         bzero call.
2275
2276 2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2277
2278         * parse.y (check_abstract_method_definitions): New local
2279         `end_type_reached'. Make sure we also consider `end_type'.
2280         (java_check_abstract_method_definitions): Make sure we eventually
2281         consider `java.lang.Object'.
2282         (maybe_use_access_method): Don't use access method if not in the
2283         context of a pure inner class or if the method's context is right.
2284         (find_applicable_accessible_methods_list): New static flag
2285         `object_done'. Don't search abstract classes as interfaces. Fixed
2286         indentation. Fixed the `java.lang.Object' only search. Search
2287         class interface(s) first, then fully search enclosing contexts.
2288         (find_most_specific_methods_list): Pick the closest candidate when
2289         they're all abstract.
2290
2291 Mon Mar 20 08:58:51 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2292
2293         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
2294         properly initialize `finished_label'. Don't emit gotos for empty
2295         try statements.
2296
2297 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
2298
2299         * except.c (emit_handlers): Clear catch_clauses_last.
2300
2301 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2302
2303         * parse.y (check_method_types_complete): New function.
2304         (create_class): Reset anonymous class counter only when seeing an
2305         non inner classe.
2306         (java_complete_class): JDEP_METHOD: Don't recompute signature
2307         if incomplete.
2308
2309 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2310
2311         * class.c (build_static_ref): Fixed indentation in comment.
2312         * java-tree.def (TRY_EXPR): Fixed typo in name.
2313         (CLASS_LITERAL): Likewise.
2314         * java-tree.h: (TYPE_DOT_CLASS): New macro.
2315         (struct lang_type): New field `dot_class'.
2316         * jcf-write.c (generate_bytecode_insns): Fixed error message.
2317         (generate_classfile): Method `class$' is synthetic.
2318         * parse.y (build_do_class_method): New function.
2319         (build_dot_class_method_invocation): Likewise.
2320         (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
2321         (resolve_qualified_expression_name): Handle CLASS_LITERAL.
2322         (qualify_ambiguous_name): Likewise.
2323         (patch_incomplete_class_ref): Invoke synthetic method if necessary.
2324         (build_try_statement): Fixed leading comment.
2325
2326 Fri Mar 17 08:09:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2327
2328         * class.c (make_field_value): Properly handle sizes.
2329         (get_dispatch_vector): Use tree_low_cst and host_integerp.
2330         (layout_class_method): Count using trees.
2331         * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
2332         * expr.c (java_array_data_offset): Use int_bit_position.
2333         (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
2334         (build_invokevirtual): Use tree_low_cst and do computations with trees.
2335
2336 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2337
2338         * lang.c (flag_hash_synchronization): New global.
2339         (lang_f_options): Added `hash-synchronization'.
2340         * lang-options.h: Mention -fhash-synchronization.
2341         * java-tree.h (flag_hash_synchronization): Declare.
2342         * expr.c (java_lang_expand_expr): Only push `sync_info' value when
2343         hash table synchronization is disabled.
2344         * decl.c (init_decl_processing): Only push `sync_info' value when
2345         hash table synchronization is disabled.
2346         * class.c (make_class_data): Only push `sync_info' field when hash
2347         table synchronization is disabled.  Removed dead code.
2348
2349 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2350
2351         * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
2352
2353 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2354
2355         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
2356         classes.
2357         * parse.y (patch_method_invocation): Handle anonymous classes
2358         creation in static context.
2359
2360 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2361
2362         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
2363         * parse.y (resolve_qualified_expression_name): Use it.
2364         (patch_method_invocation): Likewise.
2365
2366 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2367
2368         * parse.y (register_incomplete_type): JDEP_ENCLOSING set
2369         depending on the type of dependency which dictates what the
2370         current class is.
2371         (unresolved_type_p): Resolved types limited to the current class.
2372
2373 2000-03-15  Tom Tromey  <tromey@cygnus.com>
2374
2375         * decl.c (init_decl_processing): Set type of `sync_info' to be
2376         pointer to Object.
2377
2378         * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
2379         Correctly compute bit number for current slot.  Zero `high' and
2380         `low' in DS_LENGTH case.  Don't skip inherited fields.  Use
2381         mark_reference_fields.
2382         (mark_reference_fields): New function.
2383
2384 Tue Mar 14 17:15:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2385
2386         * parse.y (register_incomplete_type): Fixed initialization of
2387         JDEP_ENCLOSING.
2388
2389 2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2390
2391         * parse-scan.y (inner_qualifier, inner_qualifier_length): New
2392         static globals.
2393         (push_class_context, pop_class_context): New function.
2394         (class_body:): Call pop_class_context.
2395         (interface_body:): Likewise.
2396         (INNER_QUALIFIER): New macro.
2397         (report_class_declaration): Changed output format and use
2398         INNER_QUALIFIER. Call push_class_context.
2399
2400 2000-02-14  Andrew Haley  <aph@cygnus.com>
2401
2402         * check-init.c (check_init): Add new cases for unary and binary
2403         tree nodes.
2404
2405 2000-03-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2406
2407         * parse.y (resolve_package): Set `next' once a type name has been
2408         progressively discovered.
2409         (resolve_qualified_expression_name): Propagate resolution only if
2410         there are remaining qualifiers. Take into account `q' might have
2411         been cleared after re-qualification.
2412         * parse.y (patch_method_invocation): New local `resolved'.
2413         Section dealing with qualified expression rewritten to use
2414         resolve_field_access.
2415
2416 Mon Mar 13 12:21:13 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2417
2418         * parse.h (PUSH_CPC): Fixed indentation.
2419         (DEBUG_CPC): New macro.
2420         (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
2421         SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
2422         * parse.y (class_body_declaration:): Use
2423         SET_CPC_INSTANCE_INITIALIZER_STMT.
2424         (method_declaration:): Check for null current_function_decl.
2425         (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
2426         (java_parser_context_pop_initialized_field): Better handling of
2427         empty lists.
2428         (maybe_make_nested_class_name): Mark nested class name as
2429         qualified when necessary.
2430         (end_class_declaration): Don't call java_parse_context_resume when
2431         one or more error occured.
2432         (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
2433         (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
2434         SET_CPC_INITIALIZER_STMT.
2435         (method_header): Check for inner classes declaring static methods.
2436         (resolve_qualified_expression_name): Handle situation where `this'
2437         is implied.
2438
2439 Mon Mar 13 11:36:51 2000  Hans Boehm <boehm@acm.org>
2440
2441         * typeck.c (build_prim_array_type): Correctly set the high word too.
2442
2443 2000-03-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2444
2445         * parse.y (java_complete_expand_methods): Leave <clinit> out of
2446         ordinary methods.
2447         (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
2448         list of methods for interfaces.
2449
2450 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2451
2452         * parse.y (qualify_ambiguous_name): Properly handle expressions
2453         using `null'.
2454
2455 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2456
2457         * parse.y (check_final_assignment): Extended to process
2458         COMPOUND_EXPR.
2459         (patch_assignment): Have check_final_assignment called only once.
2460
2461 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2462
2463         * java-tree.h (IS_INIT_CHECKED): New flag.
2464         * check-init.c (check_init): Test and set IS_INIT_CHECKED.
2465         * parse.y (patch_string): Call force_evaluation_order on the
2466         completed string concatenation tree.
2467         * expr.c (force_evaluation_order): Call force_evaluation_order on
2468         function's arguments too.
2469
2470 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2471
2472         * decl.c (emit_init_test_initialization): Mark KEY as unused.
2473         * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
2474         (build_anewarray): Likewise.
2475         * parse.y (patch_newarray): Likewise.
2476         * parse.c: Regenerated.
2477
2478 2000-03-06  Bryce McKinlay  <bryce@albatross.co.nz>
2479
2480         * decl.c (init_decl_processing): Added new class fields `depth',
2481         `ancestors', and `idt' to class_type_node. Use
2482         _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
2483         * class.c (make_class_data): Push initial values for new fields.
2484         * java-tree.h: Updated prototype for `build_invokeinterface'.
2485         * expr.c (build_invokeinterface): Changed parameters to accept
2486         `method' tree. Calculate index of `method' in its declaring
2487         interface. Build call to _Jv_LookupInterfaceMethodIdx.
2488         (expand_invoke): Call `build_invokeinterface' with new parameters.
2489         * parse.y (patch_invoke): Call `build_invokeinterface' with new
2490         parameters.
2491
2492 2000-03-06  Bryce McKinlay <bryce@albatross.co.nz>
2493
2494         * typeck.c (lookup_do): Search superinterfaces first
2495         when looking up an interface method. From Godmar Back
2496         <gback@cs.utah.edu>
2497
2498 2000-03-06  Tom Tromey  <tromey@cygnus.com>
2499
2500         * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
2501
2502 2000-03-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2503
2504         * java-tree.h (lookup_argument_method2): Declared.
2505         (safe_layout_class): Prototype moved from parse.h.
2506         * parse.h (safe_layout_class): Prototype moved to java-tree.h.
2507         * parse.y (java_check_regular_methods): Local `super_class' gone.
2508         Call lookup_argument_method2 instead of lookup_argument_method.
2509         Perform modifier match for methods found declared in implemented
2510         interfaces. Fixed indentation problem. Overriding/hiding error
2511         report to take place only for methods found in classes.
2512         * typeck.c (lookup_argument_method): Changed leading
2513         comment. Re-written by calling lookup_do.
2514         (lookup_argument_method2): New function.
2515         (lookup_java_method): Re-written by calling lookup_do.
2516         (lookup_do): New function.
2517
2518 Thu Mar  2 15:18:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2519
2520         * check-init.c (check_init): Removed dead code. Handle (blank)
2521         final variables.
2522         * parse.y (declare_local_variables): New local `final_p', set it
2523         and use it to initialize LOCAL_FINAL.
2524         (check_final_assignment): Only check FIELD_DECLs.
2525
2526 2000-02-17  Tom Tromey  <tromey@cygnus.com>
2527
2528         * Makefile.in (JAVA_OBJS): Added boehm.o.
2529         (boehm.o): New target.
2530         * Make-lang.in (JAVA_SRCS): Added boehm.c.
2531         * java-tree.h (flag_use_boehm_gc): Declare.
2532         (get_boehm_type_descriptor): Declare.
2533         * lang.c (lang_f_options): Added `use-boehm-gc'.
2534         (flag_use_boehm_gc): New global.
2535         * lang-options.h: Added -fuse-boehm-gc.
2536         * boehm.c: New file.
2537         * class.c (get_dispatch_table): If class uses a Boehm type
2538         descriptor, put it in the vtable.
2539         (make_class_data): Removed dead code.
2540
2541 2000-03-03  Per Bothner  <per@bothner.com>
2542
2543         * decl.c (init_decl_processing):  Initialize sizetype properly.
2544
2545 2000-03-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2546
2547         * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
2548         (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
2549         * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
2550         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
2551         (jcf_parse): New local `current'. Load innerclasses seen in outer
2552         context being processed.
2553         * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
2554         * jcf-write.c (append_innerclasses_attribute): New function.
2555         (append_innerclasses_attribute_entry): Likewise.
2556         (get_access_flags): Handle static classes. Set anonymous and local
2557         classes to be private.
2558         (generate_classfile): Attribute count adjusted. Call
2559         append_innerclasses_attribute.
2560         * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
2561         PURE_INNER_CLASS_TYPE_P.
2562         * parse.y (parser_qualified_classname): New parameter `is_static',
2563         produce non qualified name accordingly.
2564         (block_statement:): Set LOCAL_CLASS_P when declaring local class.
2565         (create_interface): Added argument to parser_qualified_classname.
2566         (create_class): Added argument to parser_qualified_classname. Setup
2567         alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
2568         (add_inner_class_fields): Fixed indentation.
2569         (method_declarator): Use PURE_INNER_CLASS_DECP_P.
2570         (method_declarator): Fixed typo in comment.
2571         (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
2572         (build_current_thisn): Likewise.
2573         (patch_method_invocation): Likewise.
2574
2575 2000-03-01  Martin von Loewis  <loewis@informatik.hu-berlin.de>
2576
2577         * decl.c (current_function_decl): Move to toplev.c.
2578
2579 Mon Feb 28 08:20:42 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2580
2581         * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
2582         (DECL_BIT_INDEX): Use underlying representation.
2583         * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
2584
2585 Sun Feb 27 16:40:33 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2586
2587         * expr.c (build_java_ret): Pass proper type to size_binop.
2588
2589 2000-02-25  Anthony Green  <green@cygnus.com>
2590
2591         * expr.c (build_class_init): Mark the decl to be ignored by
2592         check_init.
2593         * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
2594         * check-init.c: Move DECL_BIT_INDEX to java-tree.h
2595         * class.c (init_test_hash_newfunc): New function.
2596         (decl_hash): New function.
2597         (decl_compare): New function.
2598         * decl.c (emit_init_test_initialization): New function.
2599         (complete_start_java_method): Traverse the init test hashtable,
2600         calling emit_init_test_initialization.
2601         (always_initialize_class_p): Define.
2602         * expr.c (build_class_init): Use initialization tests when
2603         emitting class initialization code.
2604         (always_initialize_class_p): Declare.
2605         * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
2606         1.
2607         * java-tree.h: Include hash.h.
2608         (DECL_FUNCTION_INIT_TEST_TABLE): Define.
2609         (struct lang_decl): Add init_test_table field.
2610         (init_test_hash_entry): Define.
2611
2612 Fri Feb 25 18:41:31 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2613
2614         * gjavah.c (main): Avoid using `argi' to report unimplemented
2615         options.
2616
2617 Fri Feb 25 18:47:25 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2618
2619         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
2620         initialize locals to avoid warnings. Local `exception_type' moved
2621         into if statement.
2622
2623 Fri Feb 25 18:00:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2624
2625         * parse.y (resolve_expression_name): Use `orig' as a second
2626         argument to resolve_field_access.
2627         (resolve_field_access): Removed unecessary code when dealing with
2628         static fields.
2629
2630 Wed Feb 23 17:41:50 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2631
2632         * class.c (push_super_field): Don't push the field twice.
2633         * jcf-parse.c (parse_source_file): Call java_reorder_fields.
2634         * parse.h (java_reorder_fields): Prototyped.
2635         * parse.y (java_reorder_fields): New function.
2636         (java_layout_class): Simplified not to worry about re-ordering.
2637
2638 2000-02-23  Tom Tromey  <tromey@cygnus.com>
2639
2640         * gjavah.c (print_name): In JNI case, correctly quote string.
2641         (print_method_info): Don't handle overrides in JNI mode.
2642
2643 2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2644
2645         * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
2646         value type set to `boolean_type_node'.
2647
2648 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
2649
2650         * jcf-dump.c (main): Test for correct condition after
2651         output file creation.
2652
2653 2000-02-19  Anthony Green  <green@cygnus.com>
2654
2655         * jcf-depend.c (add_entry): Fix test for first list entry.
2656
2657 Sat Feb 19 18:43:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2658
2659         * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
2660         * constants.c (build_constants_constructor): Likewise.
2661
2662 2000-02-19  Anthony Green  <green@cygnus.com>
2663
2664         * jcf-depend.c (add_entry): Add entries to the end of the list.
2665
2666 Wed Nov 03 02:16:00 PST 1999  Pekka Nikander  <pekka.nikander@hut.fi>
2667
2668         * decl.c (INT_TYPE_SIZE): Define if necessary.
2669         (expand_java_return): Handle the case of a native integer smaller
2670         than a JVM integer.
2671
2672 2000-02-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
2673
2674         * gjavah.c (help): Use GCCBUGURL.
2675         * jv-scan.c (help): Likewise.
2676         * jcf-dump.c (help): Likewise.
2677
2678 Thu Feb 17 14:30:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2679
2680         * jcf-write.c (generate_bytecode_insns): Don't generate empty
2681         `finally' clauses.
2682
2683 Thu Feb 17 13:20:58 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2684
2685         * jcf-parse.c (load_class): Call `fatal' if no file containing
2686         the target class are found.
2687
2688 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
2689
2690         * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
2691         lex.c, lex.h, and PARSE_H to...
2692         (parse.o, parse-scan.o): ...here, respectively.
2693
2694         * lex.c: Split out code that may trigger SIGFPE from yylex()
2695         to its own function.
2696         * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
2697
2698 2000-02-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2699
2700         * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
2701
2702 2000-02-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2703
2704         * parse.y (outer_field_access_p): Stop in time when outer contexts
2705         are exhausted.
2706         (resolve_qualified_expression_name): Properly qualify *everything*
2707         after a package.type to be resoled as expression names.
2708         (find_applicable_accessible_methods_list): Save/restore `class' to
2709         isolate it from a possible outer context search.
2710
2711 2000-02-15  Tom Tromey  <tromey@cygnus.com>
2712
2713         * gjavah.c (jni_print_char): New function.
2714         (print_full_cxx_name): Use it.
2715         (decode_signature_piece): Likewise.
2716         (print_cxx_classname): Likewise.
2717
2718 2000-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2719
2720         * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
2721         version.o.
2722         (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
2723
2724         * gjavah.c: Include version.h.
2725
2726         * jcf-dump.c: Likewise.
2727
2728         * jv-scan.c: Likewise.
2729
2730 Sat Feb 12 04:34:04 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2731
2732         * parse.y (outer_field_access_fix): First parameter now a tree
2733         node. Check for assignement to final. First argument to
2734         build_outer_field_access_fix modified to accomodate prototype.
2735         (build_outer_field_access): Don't check for assignment to final
2736         here.
2737         (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
2738         possibly returned by outer_field_access_fix. Changed
2739         outer_field_access_fix's first argument.
2740         (check_final_assignment): $finit$'s context is OK.
2741         (patch_unaryop): Use node instead of its line/column value when
2742         calling outer_field_access_fix.
2743
2744 Fri Feb 11 17:38:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2745
2746         * parse.y (interface_declaration:): No longer tagged
2747         <node>. Re-installed default action.
2748         (class_member_declaration:): Handle inner interfaces.
2749         (interface_member_declaration): Handle inner interfaces and
2750         classes.
2751         (create_interface): Push error if one seen. Suspend parsing
2752         context when processing an inner interface.
2753         (register_fields): Inner class static field limitations not to
2754         apply to inner interfaces.
2755
2756 Thu Feb 10 22:07:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2757
2758         * jcf-parse.c (load_class): Update `java_error_count' when a
2759         class' file can't be found.
2760         (parse.y): Avoid (byte)code generation when errors seen.
2761
2762 Thu Feb 10 20:10:43 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2763
2764         * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
2765         decodes a valid node.
2766         (patch_binop): Handle TRUNC_DIV_EXPR.
2767
2768 Thu Feb 10 16:04:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2769
2770         * parse.y (resolve_package): New local `acc'. Try to progressively
2771         build and guess a package and type name.
2772
2773 Thu Feb 10 12:52:09 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2774
2775         * parse.y (find_applicable_accessible_methods_list): Load and
2776         layout the search class if necessary.
2777         (java_complete_tree): Keep to original type of the folded initial
2778         value.
2779
2780 2000-02-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2781
2782         * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
2783         Generate error message if circularity is detected. New static
2784         local `list'.
2785         * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro.  *
2786         * jcf-write.c (generate_bytecode_insns): Very simply handle
2787         SAVE_EXPR.
2788         * parse.y (java_check_circular_reference): Use
2789         `cyclic_inheritance_report' during report, if necessary.
2790         (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
2791         walking NEW_ARRAY_INIT twice.
2792
2793 2000-02-09  Tom Tromey  <tromey@cygnus.com>
2794
2795         * parse.y (check_class_interface_creation): Allow inner classes to
2796         be `private' or `protected', check modifiers' consistency. Prevent
2797         block local classes from bearing any modifiers.
2798
2799 2000-02-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2800
2801         * except.c (check_start_handlers): Re-add prototype lost in last
2802         patch.
2803         (maybe_start_try): Remove excess argument to `check_start_handlers'.
2804
2805 2000-02-09  Andrew Haley  <aph@cygnus.com>
2806
2807         * decl.c (clear_binding_level): Remove excess initializer.
2808         (maybe_poplevels): Remove unused variable.
2809         (force_poplevels): Ditto.
2810         (struct binding_level): Add comment.
2811
2812 2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2813
2814         * jcf-write.c (generate_classfile): Don't consider
2815         pre-initialization with reference value (use <clinit> instead.)
2816         * parse.y (java_fix_constructors): No generated constructor for
2817         interfaces.
2818         (build_outer_field_access): Removed debug message.
2819         (outer_field_expanded_access_p): Adapted to bytecode generation.
2820         (build_outer_field_access_method): Use fix_method_argument_names.
2821         (build_outer_method_access_method): Fixed indentation. Added
2822         comment. Handle access method generation for static and also void
2823         methods.
2824         (build_access_to_thisn): Inserted debug message.
2825         (maybe_build_thisn_access_method): Use fix_method_argument_names.
2826         (resolve_qualified_expression_name): Fixed comment.
2827         (not_accessible_p): Adapted to bytecode generation. Added comment.
2828         (patch_method_invocation): Added comment.
2829         (maybe_use_access_method): Fixed leading comment. Handle static
2830         methods.
2831         (java_complete_lhs): Don't shortcut handling of initialized upon
2832         declaration String type static fields when generating bytecode.
2833         (patch_unaryop): Handle outer field access when generating
2834         bytecode.
2835
2836 Thu Feb  3 20:23:19 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2837
2838         * java-tree.h (FIELD_THISN): New macro.
2839         * jcf-write.c (append_synthetic_attribute): New function.
2840         (generate_classfile): Set "Synthetic" attribute on this$<n>,
2841         val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
2842         * parse.y (add_inner_class_fields): Set FIELD_THISN for created
2843         this$<n> fields.
2844         (build_outer_field_access): Turned on access functions usage and
2845         generation when compiling to bytecode.
2846         (maybe_use_access_method): Likewise.
2847
2848 2000-01-25  Andrew Haley  <aph@cygnus.com>
2849
2850         * java-except.h (struct eh_range): Add `expanded' field.
2851         (maybe_start_try): Add end_pc arg.
2852         (maybe_end_try): Ditto.
2853         * java-tree.h (force_poplevels): new function.
2854         * expr.c (expand_byte_code): Don't call maybe_start_try or
2855         maybe_end_try.
2856         * except.c (add_handler): Reset expanded.
2857         (expand_start_java_handler): Set expanded.
2858         (check_start_handlers): Don't expand a start handler that's
2859         already been expanded.
2860         (maybe_start_try): Add end_pc arg.  Only expand a handler which
2861         ends after end_pc.
2862         (expand_end_java_handler): call force_poplevels.
2863         (force_poplevels): new function.
2864         * decl.c (binding_level): Add start_pc of binding level.
2865         (maybe_pushlevels): Call maybe_start_try when pushing binding
2866         levels.
2867         (maybe_poplevels): Call maybe_end_try when popping binding levels.
2868         (LARGEST_PC): Define.
2869         (clear_binding_level): Use LARGEST_PC.
2870
2871         * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
2872         * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
2873         (binding_depth, is_class_level, current_pc): new variables.
2874         (struct binding_level): ditto.
2875         (indent): new function.
2876         (push_jvm_slot): add debugging info.
2877         (maybe_pushlevels): ditto.
2878         (maybe_poplevels): ditto.
2879         (pushlevel): ditto.
2880         (poplevel): ditto.
2881         (start_java_method): ditto.
2882         (give_name_to_locals): comment only.
2883         * except.c (binding_depth, is_class_level, current_pc):
2884         new variables.
2885         (expand_start_java_handler): add debugging info.
2886         (expand_end_java_handler): ditto.
2887
2888 2000-02-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2889
2890         * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
2891         (print_name_for_stub_or_jni, process_file): Constify a char*.
2892
2893 2000-02-03  Tom Tromey  <tromey@cygnus.com>
2894
2895         * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
2896
2897 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
2898
2899         * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
2900         assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
2901         defined to be 1.
2902
2903 Wed Feb  2 18:43:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2904
2905         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
2906         * java-tree.h (TYPE_II_STMT_LIST): New macro.
2907         (struct lang_type): New field `ii_block'.
2908         * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
2909         CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
2910         * parse.h (struct parser_ctxt): New field `instance_initializers'.
2911         (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
2912         CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
2913         CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
2914         macros.
2915         * parse.y (add_instance_initializer): New function.
2916         (in_instance_initializer): New static global.
2917         (class_body_declaration:): Link instance initializer block.
2918         (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
2919         (array_creation_expression:): Remove unused local.
2920         (java_parser_context_push_initialized_field): Fixed leading
2921         comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
2922         CPC_INSTANCE_INITIALIZER_LIST.
2923         (java_parser_context_pop_initialized_field): Likewise.
2924         (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
2925         (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
2926         CPC_INITIALIZER_STMT.
2927         (fix_constructors): New local `class_type'. Use it. Call
2928         add_instance_initializer.
2929         (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
2930         (patch_return): Forbid return in instance initializers.
2931         (patch_throw_statement): Enforce exception handling in the context
2932         of instance initializers.
2933
2934 2000-02-03  Tom Tromey  <tromey@cygnus.com>
2935
2936         * Make-lang.in (java.mostlyclean): Remove executables in
2937         `mostlyclean'.
2938
2939 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
2940
2941         * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
2942         HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
2943         (java_float_finite): Convert to use union Word from javaop.h.
2944         (java_double_finite): Convert to use union DWord from javaop.h.
2945
2946 2000-02-02  Tom Tromey  <tromey@cygnus.com>
2947
2948         * gjavah.c (options): Added `jni' entry.
2949         (help): Document -jni.
2950         (flag_jni): New global.
2951         (process_file): Handle JNI output.  Don't print text from
2952         -prepend, -add, etc, when generating stubs.  Only remove `.class'
2953         suffix if it actually exists.
2954         (main): Create a `.c' file when run with `--jni --stubs'.  Create
2955         correct output file name with `--jni'.
2956         (print_include): Mangle header name differently in JNI case.
2957         (HANDLE_METHOD): In JNI mode, call print_method_info to generate
2958         method list.
2959         (print_method_info): Handle JNI case.  Put signature info into
2960         method name.  Handle case when STREAM is NULL.
2961         (print_name_for_stub_or_jni): New function.
2962         (print_stub_or_jni): Renamed from `print_stub'.  Handle JNI.
2963         (print_cxx_classname): Handle JNI.
2964         (print_full_cxx_name): Likewise.
2965         (decode_signature_piece): Likewise.
2966         (overloaded_jni_method_exists_p): New function.
2967         (struct method_name): Added `signature' and `sig_length' fields.
2968         (HANDLE_END_FIELD): Do nothing in JNI mode.
2969
2970 2000-02-02  Tom Tromey  <tromey@cygnus.com>
2971
2972         * jv-scan.c: Include version.c, <getopt.h>.
2973         (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
2974         (options): New array.
2975         (usage): New function.
2976         (version): New function.
2977         (main): Use getopt_long to parse command line.
2978         * jcf-dump.c: Include version.c, <getopt.h>.
2979         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
2980         OPT_JAVAP): New macros.
2981         (options): New array.
2982         (usage): Return `void'.  Changed message.
2983         (help): New function.
2984         (version): New function.
2985         (main): Use getopt_long_only to parse command line.
2986         * gjavah.c: Include <getopt.h>.
2987         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
2988         OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
2989         OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
2990         (options): New array.
2991         (java_no_argument): Removed.
2992         (help): Updated with missing options.
2993         (main): Use getopt_long_only to parse command line.
2994         (usage): Changed message.
2995
2996 Tue Feb  1 22:23:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2997
2998         * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
2999         * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
3000         ANONYMOUS_ARRAY_INITIALIZER): New access macros.
3001         * parse.y (array_creation_expression:): Handle anonymous arrays.
3002         (build_array_from_name): Don't set `ret_name' if null.
3003         (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
3004         (qualify_ambiguous_name): Likewise.
3005         (java_complete_expand_class): Likewise.
3006
3007 Tue Feb  1 14:59:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3008
3009         * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
3010         * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
3011         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
3012         (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
3013         (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
3014         AIPL_FUNCTION_COMPLETED_INVOCATION.
3015         (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
3016         AIPL_FUNCTION_INVOCATION_READY.
3017         (AIPL_FUNCTION_DECLARATION): New enum entry.
3018         * parse.y (reorder_static_initialized): New function.
3019         (java_parser_context_pop_initialized_field): Use it.
3020         (add_inner_class_fields): Use
3021         MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
3022         augmented. Install marker after last alias initializer, if any.
3023         (generate_finit): Fixed typo. Don't try to retain only the used
3024         fields.
3025         (method_header): Compute and set DECL_FUNCTION_NAP.
3026         (method_declarator): Fixed comment. Insert alias initializer in
3027         parameter list.
3028         (build_alias_initializer_parameter_list): Fixed leading
3029         comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
3030         replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
3031         (java_complete_expand_class): Code to retain only used aliases
3032         removed.
3033         (java_complete_expand_methods): New local `first_decl'. Generate
3034         $finit$ first, then expand the constructors, regular methods and
3035         <clinit>.
3036         (java_complete_expand_method): Don't report error on missing
3037         return statement if previously detected bogus.
3038         (fix_constructors): Don't patch constructor parameters list.
3039         (patch_method_invocation): Use new AIPL enum values. Reverse
3040         alias initializer list for anonymous classes.
3041
3042 2000-01-30  Anthony Green  <green@redhat.com>
3043
3044         * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
3045         determine how many stack slots to pop.
3046
3047 2000-01-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3048
3049         * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
3050         error handling/recovery.
3051         * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
3052
3053 Fri Jan 28 20:10:57 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3054
3055         * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
3056         FIELD_LOCAL_ALIAS_USED): New macros.
3057         (DECL_FUNCTION_NAP): New macro.
3058         (struct lang_decl): New field `nap'.
3059         (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
3060         (struct lang_type): New fields `finit_stmt_list' and
3061         `clinit_stmt_list'.
3062         (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
3063         * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
3064         (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
3065         UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
3066         (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
3067         AIPL_FUNCTION_INVOCATION_READY): New enum fields.
3068         (BUILD_THROW): Macro line separator re-indented.
3069         * parse.y (end_class_declaration): New function.
3070         (maybe_generate_pre_expand_clinit): New name for
3071         java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
3072         pre-expand static fields.
3073         (maybe_generate_clinit): Function deleted.
3074         (check_for_static_method_reference): Prototype's parameter list
3075         indented.
3076         (generate_finit): New name for maybe_generate_finit. Changed
3077         leading comment. Function rewritten to use
3078         TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
3079         (build_alias_initializer_parameter_list): New function.
3080         (java_parser_context_pop_initialized_field): Likewise.
3081         (add_inner_class_fields): Likewise.
3082         (type_declaration:): Call end_class_declaration.
3083         (class_member_declaration:): Likewise.
3084         (formal_parameter_list:): Fixed typos.
3085         (formal_parameter:): Use ARG_FINAL_P to mark created tree list
3086         element. Improved error handling.
3087         (block_statement:): Call end_class_declaration.
3088         (anonymous_class_creation:): Likewise.
3089         (create_anonymous_class): Fixed comments.
3090         (create_class): Call add_inner_class_fields.
3091         (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
3092         (method_header): Use MARK_FINAL_PARMS.
3093         (finish_method_declaration): Use UNMARK_FINAL_PARMS.
3094         (method_declarator): Propagate final argument flag.
3095         (craft_constructor): New local `artificial'. Call
3096         build_alias_initializer_parameter_list. Use
3097         CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
3098         (source_start_java_method): Mark parm decls with LOCAL_FINAL if
3099         necessary.
3100         (complete_expand_class): Get rid of unused outer context local
3101         alias fields.
3102         (java_complete_expand_methods): Fixed leading
3103         comment. Generate/pre-expand <clinit> first. Changed method
3104         expansion order to regular, $finit$, constructors, <clinit>.
3105         (java_complete_expand_method): Set current_function_decl.
3106         (fix_constructors): Fix constructor parameter list to account for
3107         outer context local alias initializers.
3108         (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
3109         (resolve_expression_name): Lookup outer context local aliases. New
3110         local `access', use it.
3111         (patch_method_invocation): Patch inner class ctor invocation with
3112         outer context local aliases initialization values. $finit$
3113         invocation patching now includes things generated with
3114         build_alias_initializer_parameter_list.
3115         (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
3116         (build_super_invocation): Likewise.
3117         (patch_assignment): Changed comment.
3118
3119 2000-01-27  Andrew Haley  <aph@cygnus.com>
3120
3121         * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
3122         (emit_if): Ditto.
3123         (emit_jsr): Ditto.
3124
3125 2000-01-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3126
3127         * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
3128         concatenation.
3129         (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
3130
3131         * parse.y (register_fields): Don't pass a format specifier to
3132         OBSOLETE_MODIFIER_WARNING.
3133         (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
3134         instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
3135         specifier.
3136         (check_modifiers): Change function into a macro.
3137         (check_class_interface_creation): Pass a literal format string.
3138
3139 2000-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3140
3141         * buffer.h: PROTO -> PARAMS.
3142         * check-init.c: Likewise.
3143         * class.c: Likewise.
3144         * constants.c: Likewise.
3145         * convert.h: Likewise.
3146         * decl.c: Likewise.
3147         * except.c: Likewise.
3148         * expr.c: Likewise.
3149         * gjavah.c: Likewise.
3150         * java-except.h: Likewise.
3151         * java-tree.h: Likewise.
3152         * jcf-depend.c: Likewise.
3153         * jcf-dump.c: Likewise.
3154         * jcf-parse.c: Likewise.
3155         * jcf-path.c: Likewise.
3156         * jcf-reader.c: Likewise.
3157         * jcf-write.c: Likewise.
3158         * jcf.h: Likewise.
3159         * jv-scan.c: Likewise.
3160         * jvgenmain.c: Likewise.
3161         * jvspec.c: Likewise.
3162         * lang.c: Likewise.
3163         * lex.c: Likewise.
3164         * lex.h: Likewise.
3165         * parse-scan.y: Likewise.
3166         * parse.h: Likewise.
3167         * parse.y: Likewise.
3168         * typeck.c: Likewise.
3169         * verify.c: Likewise.
3170         * xref.c: Likewise.
3171         * xref.h: Likewise.
3172         * zextract.c: Likewise.
3173         * zipfile.h: Likewise.
3174
3175 2000-01-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3176
3177         * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
3178         (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
3179         * constants.c (build_constant_data_ref): Check for cached
3180         current_constant_pool_data_ref. Cache current_constant_pool_data_ref
3181         in TYPE_CPOOL_DATE_REF.
3182         * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
3183         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
3184         (struct lang_type): New fields `cpool' and `cpool_data_ref'.
3185         (LOCAL_FINAL): New macro.
3186         * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
3187         constant pool -- don't try to reuse.
3188         (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
3189         TYPE_LANG_SPECIFIC.
3190         (find_in_current_zip): Use TYPE_JCF.
3191         * parse.h (java_check_final): Prototype removed.
3192         * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
3193         (maybe_create_class_interface_decl,
3194         check_class_interface_creation): Likewise.
3195         (java_expand_finals): Function removed.
3196         (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
3197         (block_statement:): Fixed comment.
3198         (anonymous_class_creation:): Likewise.
3199         (check_class_interface_creation): Reversed Jan 12, 2000 extra
3200         argument patch.
3201         (check_class_interface_creation): Loosened error report on (inner)
3202         public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
3203         (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
3204         (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
3205         argument patch.
3206         (create_interface): Likewise.
3207         (anonymous_class_counter): New static global.
3208         (create_anonymous_class): Reversed Jan 12, 2000 extra argument
3209         patch. Fixed comments.
3210         (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
3211         anonymous_class_counter when declaring a toplevel class.
3212         (craft_constructor): Fixed constructor name when handling
3213         anonymous classes. Anonymous class constructors to feature hidden
3214         this$<n> parameter.
3215         (java_fix_constructors): Added comment.
3216         (java_check_final): Function removed.
3217         (java_complete_expand_methods): Fixed comment. Don't generate
3218         class data, save its outgoing constant pool instead.
3219         (verify_constructor_super): Skip anonymous class constructor
3220         hidden this$<n> parameter.
3221         (java_expand_classes): New local `saved_ctxp'. Removed call to
3222         java_expand_finals and java_check_final. Expand anonymous class
3223         constructors. Generate class data.
3224         (build_super_invocation): Skip anonymous class hidden this$<n>
3225         parameter.
3226         * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
3227         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
3228         (set_java_signature): Likewise.
3229
3230 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
3231
3232         * gjavah.c: Delete ACC_VISIBILITY define.
3233         * jcf.h: Add ACC_VISIBILITY define.
3234         * parse.y: final: rule tagged <value>.
3235         (java_check_regular_methods): Use ACC_VISIBILITY define for
3236         default package access check.
3237         (local_variable_declaration_statement): Use final: rule.
3238
3239 Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
3240
3241         * parse.y (format_parameter:): Use final: rule instead of modifiers:.
3242         (final:): New rule.
3243
3244 2000-01-17  Tom Tromey  <tromey@cygnus.com>
3245
3246         * gjavah.c (print_field_info): Allow non-static final fields.
3247
3248 Fri Jan 14 18:03:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3249
3250         * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
3251         * parse.y (patch_anonymous_class): New function.
3252         (create_anonymous_class): Register incomplete type when the
3253         class/interface to extends/implement isn't known yet.
3254         (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
3255         (verify_constructor_super): Tuned error message.
3256
3257 Fri Jan 14 00:14:24 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3258
3259         * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
3260         (ANONYMOUS_CLASS_P): New macro.
3261         (TYPE_SIGNATURE, TYPE_JCF): New macros.
3262         (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
3263         * parse.y (create_class): Added leading argument.
3264         (maybe_create_class_interface_decl,
3265         check_class_interface_creation): Likewise.
3266         (craft_constructor): New function.
3267         (verify_constructor_super): Added argument in prototype.
3268         (class_declaration:): Inserted leading argument.
3269         (for_begin:): Use FOR_LOOP_P.
3270         (anonymous_class_creation): Create WFL of the anonymous class to
3271         instantiate. Call build_new_invocation. Added comments.
3272         (check_class_interface_creation): Handle parameter `anonymous' in
3273         verbose mode class creation announce.
3274         (link_nested_class_to_enclosing): Exclude anonymous classes.
3275         (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
3276         anonymous class, even though they appear to have an enclosing
3277         context.
3278         (create_interface): Pass extra argument to
3279         check_class_interface_creation.
3280         (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
3281         (create_class): Call check_class_interface_creation and
3282         maybe_create_class_interface_decl with extra new argument. Don't
3283         add private this$<n> to anonymous classes.
3284         (method_declarator): Insert hidden this$<n> to anonymous class
3285         constructors.
3286         (java_fix_constructors): Deleted code creating default
3287         constructor. Call craft_constructor instead.
3288         (java_check_regular_methods): Set `saw_constructor' to 1 for
3289         anonymous classes.
3290         (fix_constructors): Pass extra argument to verify_constructor_super.
3291         (verify_constructor_super): New local `sdecl', use it. Search for
3292         matching constructor (possibly featuring arguments) in super
3293         class.
3294         (lookup_method_invoke): Craft constructor according to arguments
3295         list when dealing with anonymous class constructors.
3296         (build_super_invocation): Pass arguments to anonymous class super
3297         constructors.
3298         (search_loop): Use FOR_LOOP_P.
3299         (labeled_block_contains_loop_p): Likewise.
3300
3301 Wed Jan 12 00:38:47 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3302
3303         * class.c (set_super_info): Set CLASS_STATIC when appropriate.
3304         (enclosing_context_p): New function.
3305         (get_access_flags_from_decl): Handle CLASS_STATIC.
3306         (maybe_layout_super_class): Extra first argument passed to
3307         do_resolve_class.
3308         (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
3309         ID_INIT_P.
3310         * decl.c (access0_identifier_node): New global.
3311         (init_decl_processing): access0_identifier_node initialized.
3312         (pushdecl): Set DECL_CONTEXT only on non type decls.
3313         * expr.c (lookup_field): Lookup inner class fields in enclosing
3314         contexts.
3315         (expand_invoke): Use ID_INIT_P.
3316         (expand_java_field_op): Use DECL_CLINIT_P.
3317         * java-tree.def (CLASS_LITERAL): New tree code.
3318         * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
3319         DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
3320         (struct lang_decl): New field `inner_access'.
3321         (enclosing_context_p): Prototyped.
3322         (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
3323         ID_CLINIT_P): New macros.
3324         (CLASS_STATIC): New macro.
3325         (CLASS_ACCESS0_GENERATED_P): New macro.
3326         (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
3327         TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
3328         INNER_CLASS_P): New macros.
3329         (DECL_INNER_CLASS_LIST): New macro.
3330         * jcf-parse.c (yyparse): Avoid the use of ANSI string
3331         concatenation.
3332         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3333         the shift value to int. Fixed typo in comment.
3334         * lex.c (inst_id, wpv_id): Initialize.
3335         * mangle.c (unicode_mangling_length): Take `$' into account.
3336         * parse.h (DRECOVER, RECOVER): Terminate properly.
3337         (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
3338         (typedef struct _jdep): New field `enclosing'.
3339         (JDEP_ENCLOSING): New macro.
3340         (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
3341         (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
3342         (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
3343         GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
3344         GET_ENCLOSING_CPC_CONTEXT): New macros.
3345         (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
3346         (do_resolve_class): Added extra argument in prototype.
3347         * parse.y (resolve_class): Added extra argument in prototype.
3348         (maybe_create_class_interface_decl): Likewise.
3349         (maybe_use_access_method, build_wfl_wrap): New functions.
3350         (java_complete_expand_classes, java_complete_expand_class):
3351         Likewise.
3352         (java_parser_context_push_initialized_field,
3353         java_parser_context_suspend, java_parser_context_resume):
3354         Likewise.
3355         (maybe_make_nested_class_name, make_nested_class_name,
3356         set_nested_class_simple_name_value,
3357         link_nested_class_to_enclosing, find_as_inner_class,
3358         find_as_inner_class_do, check_inner_class_redefinition,
3359         build_thisn_assign, build_current_thisn, build_access_to_thisn,
3360         maybe_build_thisn_access_method, build_outer_field_access,
3361         build_outer_field_access_methods, build_outer_field_access_expr,
3362         build_outer_method_access_method, build_new_access_id,
3363         build_outer_field_access_method, outer_field_access_p,
3364         outer_field_expanded_access_p, outer_field_access_fix,
3365         build_incomplete_class_ref, patch_incomplete_class_ref,
3366         create_anonymous_class): Likewise.
3367         (inst_id, wpv_id): New static global variables.
3368         (synchronized:): New rule, tagged <node>.
3369         (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
3370         rules.
3371         (anonymous_class_creation:): New rule, tagged <node>.
3372         (NEW_TK): Tagged <node>.
3373         (type_literals, array_type_literal): New rules, tagged <node>.
3374         (class_declaration:): Removed action when reducing by class_body:
3375         (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
3376         using GET_CPC in sub-rules.
3377         (class_member_declaration): Handle inner classes.
3378         (method_declaration): When reducing method_header:, reset
3379         current_function_decl when appropriate.
3380         (method_declarator:): Set the number of formal parameter to 0 for
3381         method declared without arguments.
3382         (constructor_declarator:): Likewise.
3383         (static_initializer:): List of elements kept in a list.
3384         (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
3385         use of the keyword `static' for type declarations.
3386         (block_statement:): Handle inner class declarations.
3387         (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
3388         type qualified `this'.
3389         (class_instance_creation_expression): Use anonymous_class_creation:
3390         to handle inner class instances creation. Handle qualified `new'.
3391         (something_dot_new): Added appropriate actions.
3392         (create_new_parser_context): New function.
3393         (java_push_parser_context, java_parser_context_save_global,
3394         java_parser_context_suspend): Use create_new_parser_context.
3395         (check_modifiers): Changed leading comment.
3396         (check_class_interface_creation): Handle interclasses.
3397         (add_superinterfaces): Fixed comment.
3398         (create_interface): Build qualified name from the raw_name instead
3399         of its matching WFL. Push the initialized fields list. raw_name added
3400         as an extra argument to maybe_create_class_interface_decl.
3401         (create_class): Build qualified name from the raw_name instead of
3402         its matching WFL. Removed assignment to current_parsed_class_un.
3403         Call PUSH_ERROR before returning an error. Suspend the current
3404         parser context when processing an inner class. Push the
3405         initialized fields list. raw_name added as an extra argument to
3406         maybe_create_class_interface_decl. Add the private this$<n>
3407         field.
3408         (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
3409         (register_fields): Get the class type from GET_CPC and handle
3410         previous errors.  Added code to handle the creation of static
3411         fields in inner classes. Initialized fields initialization
3412         statements kept in a list of lists.
3413         (maybe_generate_finit): Initialized fields initialization
3414         statements kept in a list of lists. Use GET_CPC.
3415         (maybe_generate_clinit): Likewise.
3416         (method_header): Use GET_CPC and GET_CPC_UN.
3417         (parser_qualified_classname): Handle inner classes.
3418         (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
3419         (java_fix_constructors): Hide pointer to enclosing context
3420         instance in constructor list when dealing with inner classes.
3421         (jdep_resolve_class): Call resolve_class with extra first argument
3422         JDEP_ENCLOSING.
3423         (resolve_class): Add enclosing context as a first extra argument
3424         to do_resolve_class.
3425         (do_resolve_class): Call find_as_inner_class. Handle WFLs
3426         properly.
3427         (resolve_no_layout): Extra argument added to resolve_class
3428         invocation.
3429         (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
3430         (java_get_real_method_name): Use GET_CPC_UN.
3431         (check_abstract_method_definitions): Use DECL_CLINIT_P.
3432         (java_check_abstract_methods): Handle static method declared in
3433         inner classes by an error.
3434         (java_check_regular_methods): Use DECL_CLINIT_P.
3435         (source_start_java_method): Also set DECL_MAX_LOCALS.
3436         (create_artificial_method): Call java_parser_context_save_global
3437         and java_parser_context_restore_global instead of saving/restoring
3438         the context by hand.
3439         (expand_start_java_method): Improved verbose mode message.
3440         (java_complete_expand_methods): Fixed leading comment. Use
3441         DECL_CLINIT_P.
3442         (fix_constructors): Added assignment to this$<n> if necessary.
3443         (java_expand_classes): Call java_complete_expand_classes instead
3444         of java_complete_expand_methods.
3445         (make_qualified_primary): Simplified.
3446         (merge_qualified_name): Optimized for missing left or right parts.
3447         (resolve_expression_name): Handle access to outer class fields from
3448         interclasses.
3449         (resolve_qualified_expression_name): New macro
3450         RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
3451         classes. Report error on non appropriate qualification of
3452         `new'. Handle qualified `this'.
3453         (not_accessible_p): Allow access to outer class private fields from
3454         inner classes.
3455         (patch_method_invocation): Handle method invocations through
3456         access methods and inner class constructor invocations.
3457         (find_applicable_accessible_methods_list): Search enclosing
3458         contexts of an inner class.
3459         (search_applicable_methods_list): Fixed typo.
3460         (argument_types_convertible): Handle inner class constructors'
3461         hidden outer context reference argument.
3462         (qualify_ambiguous_name): Handle qualified `this'.
3463         (java_complete_lhs): Handle use of field accessed through
3464         artificial access methods in various cases of assignments. Handle
3465         CLASS_LITERAL node.
3466         (check_final_assignment): Use DECL_CLINIT_P.
3467         (valid_ref_assignconv_cast_p): Handle the destination being an
3468         enclosing context of the source.
3469         (patch_unaryop): Handle use of field accessed through artificial
3470         access methods.
3471         (patch_return): Use DECL_CLINIT_P.
3472         (patch_throw_statement): Use DECL_CLINIT_P.
3473         (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
3474         * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
3475         ID_INIT_P.
3476
3477 2000-01-16  Anthony Green  <green@cygnus.com>
3478
3479         * parse.y (build_string_concatenation): Only use
3480         StringBuffer(String) shortcut if String arg is constant.
3481
3482 Wed Jan 12 20:20:11 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3483
3484         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3485         the shift value to int. Fixed typo in comment.
3486
3487 2000-01-11  Mumit Khan  <khan@xraylith.wisc.edu>
3488
3489         * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
3490         * jcf-write.c: Likewise.
3491         * parse.y: Likewise.
3492         * parse.c: Regenerate.
3493
3494 2000-01-09  Anthony Green  <green@cygnus.com>
3495
3496         * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
3497         bytecodes in the correct order.
3498
3499 2000-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3500
3501         * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
3502
3503 Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>
3504
3505         * expr.c (java_lang_expand_expr): Switch to permanent obstack
3506         before building constant array decl.
3507
3508 Thu Jan  6 00:54:10 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3509
3510         * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
3511         method invocation and typo in conditional expression.
3512         (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
3513         the appropriate NOTE_POP.
3514         * parse.y (patch_binop): Shift value mask to feature the right
3515         type.
3516
3517 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3518
3519         * class.c (assume_compiled, assume_compiled_node): Add static
3520         prototype.
3521         (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
3522
3523         * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
3524
3525         * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
3526
3527         * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
3528         to `__modifier' to avoid stringifying it.
3529
3530         * parse.y (verify_constructor_circularity): Don't call a variadic
3531         function with a non-literal format string.
3532         (java_check_abstract_methods): Move unreachable code inside
3533         `continue' statement.
3534         (lookup_method_invoke): Call xstrdup, not strdup.
3535
3536         * expr.c (expand_java_field_op): Avoid the use of ANSI string
3537         concatenation.
3538
3539         * jcf-parse.c (yyparse): Likewise.
3540
3541         * jv-scan.c (main): Likewise.
3542
3543 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3544
3545         * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
3546         ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
3547         ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
3548         concatenation.
3549
3550         * parse.y (synchronized, variable_redefinition_error,
3551         check_class_interface_creation, create_interface, create_class,
3552         method_header, finish_method_declaration,
3553         check_modifiers_consistency, method_declarator,
3554         complete_class_report_errors, check_abstract_method_definitions,
3555         java_check_regular_methods, check_throws_clauses,
3556         java_check_abstract_methods, read_import_dir,
3557         check_pkg_class_access, declare_local_variables, fix_constructors,
3558         cut_identifier_in_qualified, resolve_expression_name,
3559         resolve_qualified_expression_name, patch_method_invocation,
3560         java_complete_lhs, patch_assignment, try_builtin_assignconv,
3561         patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
3562         patch_exit_expr, patch_exit_expr, patch_switch_statement,
3563         patch_try_statement, patch_synchronized_statement,
3564         patch_throw_statement, check_thrown_exceptions,
3565         patch_conditional_expr): Likewise.
3566
3567 Fri Dec 24 00:25:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3568
3569         * Makefile.in (LIBDEPS): Added gcc's errors.o
3570         (../jcf-dump$(exeext):): Link with gcc's errors.o
3571         (../gcjh$(exeext):): Likewise.
3572         * expr.c (expand_java_NEW): Layout the entire target type instead of
3573         laying out its methods only.
3574         (lookup_field): Layout the class after having loaded it.
3575         * java-tree.h (java_debug_context): Declared.
3576         * jcf-io.c (toplev.h): Included.
3577         (find_class): Removed assignment to jcf's outofsynch
3578         field. Force source file to be read if newer than its matching
3579         class file. Tweaked debug messages.
3580         * jcf-parse.c (jcf_out_of_synch): Deleted.
3581         (read_class): Call to jcf_out_of_synch removed.
3582         * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
3583         (jcf_out_of_synch): Prototype deleted.
3584         * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
3585         `deprecated' and `class_err': integer turned into bit fields.
3586         New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
3587         * parse.y (package_list): New global.
3588         (package_declaration:): Record newly parsed package name.
3589         (extra_ctxp_pushed_p): Static global deleted.
3590         (java_parser_context_save_global): Create buffer context for the
3591         purpose of saving globals, if necessary.
3592         (java_parser_context_restore_global): Pop context pushed for the
3593         purpose of saving globals, if necessary.
3594         (java_debug_context_do): New prototype and function.
3595         (java_debug_context): Likewise.
3596         (do_resolve_class): Use already parsed package names to qualify
3597         and lookup class candidate.
3598         (java_pre_expand_clinit): Removed unnecessary local variable.
3599
3600 1999-12-17  Tom Tromey  <tromey@cygnus.com>
3601
3602         * gjavah.c (decode_signature_piece): Print "::" in JArray<>.  This
3603         fixes PR gcj/119.
3604         (process_file): Use `\n\' at end of each line in string.
3605
3606 Thu Dec 16 00:09:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3607
3608         * expr.c (expand_invoke): Layout the loaded class before
3609         attempting to use it.
3610         (expand_java_field_op): Allow final field assignments to take
3611         place in $finit$.
3612         * typeck.c (convert): Return error_mark_node if expr is null.
3613
3614 1999-12-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3615
3616         * class.c (class_depth): Return -1 if the class doesn't load
3617         properly.
3618         * expr.c (can_widen_reference_to): Check for errors during depth
3619         computation and return 0 accordingly.
3620         * jcf-parse.c (parse_source_file): Call java_fix_constructors to
3621         create default constructors and add an other error check.
3622         * parse.h (java_fix_constructors): Prototyped.
3623         * parse.y (java_pre_expand_clinit): Likewise.
3624         (build_super_invocation): Re-prototyped to feature one argument.
3625         (java_check_circular_reference): Directly use `current'.
3626         (java_fix_constructors): New function.
3627         (java_check_regular_methods): Don't create default constructors
3628         here, but abort if none were found.
3629         (java_complete_expand_methods): Pre-process <clinit> calling
3630         java_pre_expand_clinit.
3631         (java_pre_expand_clinit): New function.
3632         (fix_constructors): build_super_invocation invoked with the
3633         current method declaration as an argument.
3634         (build_super_invocation): Use the context of the processed method
3635         decl argument instead of current_class.
3636         * typeck.c (lookup_java_method): Take WFLs in method names into
3637         account.
3638
3639 Tue Dec 14 14:20:16 1999  Per Bothner  <per@bothner.com>
3640
3641         * class.c (make_class_data): flag_keep_inline_functions to keep
3642         private methods in the method array.
3643
3644 1999-12-15  Anthony Green  <green@cygnus.com>
3645
3646         * check-init.c (check_init): Take into account both types of
3647         `throw's when checking for uninitialized variables.
3648
3649 Fri Dec 10 21:53:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3650
3651         * parse.y (java_complete_lhs): Force convertion of array
3652         dimensions to int_type_node, that's what runtime's ABI expects.
3653
3654 Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3655
3656         * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
3657         operand of a WFL, until the Java front-end gets fixed with regard
3658         to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
3659
3660 1999-12-10  Andrew Haley  <aph@cygnus.com>
3661
3662         * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
3663         decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
3664         expr.c (build_java_athrow): Add support for sjlj-exceptions.
3665         java-tree.h: Ditto.
3666         jcf-write.c: Ditto.
3667
3668 Wed Dec  8 15:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3669
3670         * expr.c (java_lang_expand_expr): Switch to permanent obstack
3671         before calling expand_eh_region_start and expand_start_all_catch.
3672         * except.c (expand_start_java_handler): Switch to permanent
3673         obstack before calling expand_eh_region_start.
3674         (expand_end_java_handler): Switch to permanent obstack before
3675         calling expand_start_all_catch.
3676
3677 1999-12-5  Anthony Green  <green@cygnus.com>
3678
3679         * decl.c (init_decl_processing): Mark throw_node as a noreturn
3680         function with side effects.
3681         (init_decl_processing): Mark all memory allocating DECLs with
3682         DECL_IS_MALLOC.
3683
3684 Wed Dec  1 04:25:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3685
3686         * except.c (expand_end_java_handler): Call
3687         expand_resume_after_catch and end_catch_handler.
3688
3689 Tue Nov 30 12:36:15 1999  Anthony Green  <green@cygnus.com>
3690
3691         * verify.c (verify_jvm_instructions): Create new return label
3692         chain if non existant (don't rely on the verified state of the jsr
3693         target.)
3694
3695 Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3696
3697         * jcf-write.c (generate_bytecode_insns): Fixed indentation for
3698         COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
3699
3700         * parse.y (patch_assignment): Removed bogus final class test on
3701         lhs when checking on whether to emit an ArrayStoreException runtime
3702         check.
3703         * expr.c (expand_java_arraystore): Likewise.
3704
3705 1999-11-28 Anthony Green <green@cygnus.com>
3706
3707         * decl.c (find_local_variable): Reuse single slot decls when
3708           appropriate.
3709
3710 Wed Nov 24 17:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3711
3712         * jcf-parse.c (saw_java_source): Global variable removed.
3713         (read_class): Don't use `saw_java_source'. Added extra braces.
3714         (yyparse): Code setting `saw_java_source' removed.
3715
3716 1999-11-24  Mark Mitchell  <mark@codesourcery.com>
3717
3718         * except.c (emit_handlers): Zero catch_clauses after emitting them.
3719
3720 Tue Nov 23 17:29:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3721
3722         * verify.c (merge_type_state): Non verified subroutines being
3723         considered more than once to trigger passive type merge.
3724
3725 Tue Nov 23 10:55:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3726
3727         * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
3728         in case of error. Error message tuned.
3729
3730 1999-11-21  Anthony Green  <green@cygnus.com>
3731
3732         * constants.c (find_methodref_index): Unwrap method names before
3733         inserting them in the constant pool.
3734
3735         * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
3736
3737         * class.c (assume_compiled_node): New typedef.
3738         (assume_compiled_tree): New static data.
3739         (find_assume_compiled_node): New function.
3740         (add_assume_compiled): New function.
3741         (assume_compiled): New function.
3742         * class.c (make_class_data): Use assume_compiled.
3743         (is_compiled_class): Use assume_compiled.
3744
3745         * java-tree.h (add_assume_compiled): Declare.
3746
3747         * lang.c (lang_decode_option): Parse new options.
3748
3749 Wed Nov 17 21:09:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3750
3751         * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
3752         int_type_node: that's what `_Jv_AllocObject' expects.
3753
3754 Thu Nov 11 01:57:14 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3755
3756         * parse.y (lookup_method_invoke): Use lang_printable_name to
3757         reliably build the type name during error report. Fixes PR gcj/97.
3758
3759 1999-11-09  Tom Tromey  <tromey@cygnus.com>
3760
3761         * jcf-path.c: Include <sys/stat.h>.
3762         (jcf_path_init): Search for libjava.zip.  Fixes PR gcj/84.
3763         (DIR_UP): New macro.
3764
3765 Tue Nov  9 12:12:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3766
3767         * parse.y (source_end_java_method): Resume permanent allocation,
3768         reversing Apr 27 1998 patch.
3769         (patch_string_cst): Pop obstacks after having pushed the permanent
3770         ones.
3771
3772 1999-11-05  Tom Tromey  <tromey@cygnus.com>
3773
3774         * class.c (finish_class): Emit inlined methods if any native
3775         methods exist in the class.  Fixes PR gcj/85.
3776
3777 Thu Nov  4 16:27:01 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3778
3779         * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
3780         (qualify_ambiguous_name): Likewise.
3781
3782 Wed Nov  3 15:20:02 MST 1999  Godmar Back <gback@cs.utah.edu>
3783
3784         * typeck.c: (lookup_java_method):  search all inherited
3785         interfaces when looking up interface method.
3786
3787 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3788
3789         * parse.y (method_header:): Issue error message for rule `type
3790         error'.
3791         (synchronized:): Error report when not using synchronized.
3792
3793 Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3794
3795         * parse.y (resolve_qualified_expression_name): Prevent `this' from
3796         being used before the superclass constructor has been called.
3797         (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
3798         instead of `CALL_THIS_CONSTRUCTOR_P'.
3799
3800 Sat Oct 30 21:35:13 1999  Todd T. Fries <todd@lighthouse.fries.net>
3801
3802         * check-init.c: Fix typo in comment.
3803
3804 Fri Oct 29 14:35:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3805
3806         * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
3807         and final method.
3808
3809 Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3810
3811         * parse.y (expression_statement:): Call function to report
3812         improper invocation of a constructor.
3813         (parse_ctor_invocation_error): New function.
3814
3815 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
3816
3817         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
3818         remember_end_note.
3819
3820 1999-10-21  Tom Tromey  <tromey@cygnus.com>
3821
3822         * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
3823         in generated `main'.
3824
3825 Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3826
3827         * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
3828         (qualify_ambiguous_name): Likewise.
3829
3830 Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3831
3832         * parse.y (java_complete_tree): fold_constant_for_init to work on
3833         permanent_obstack.
3834         (java_complete_lhs): Likewise.
3835         (array_constructor_check_entry): Complete an initializer element
3836         on permanent_obstack.
3837
3838 1999-10-19  Tom Tromey  <tromey@cygnus.com>
3839
3840         * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
3841         From Mike Moreton <mike@pillim.demon.co.uk>.
3842
3843 1999-10-15  Greg McGary  <gkm@gnu.org>
3844
3845         * java-tree.h (flag_bounds_check): Remove extern decl.
3846         * lang.c (flag_bounds_check): Remove global variable.
3847         (lang_f_options): Remove "bounds-check" entry.
3848         (lang_init_options): Default flag_bounds_check to "on".
3849
3850 1999-10-14  Tom Tromey  <tromey@cygnus.com>
3851
3852         * jvgenmain.c (usage): New function.
3853         (main): Use it.  Also, handle `-D' options.
3854         * jvspec.c (lang_specific_driver): Recognize -D.
3855         (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
3856
3857         * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
3858
3859 1999-10-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3860
3861         * jcf-dump.c (print_constant, disassemble_method): Don't call a
3862         variadic function with a non-literal format string.
3863
3864         * parse-scan.y (report_main_declaration): Likewise.
3865
3866         * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
3867
3868         * parse.y (read_import_dir, patch_assignment, patch_binop,
3869         patch_array_ref): Likewise.
3870
3871         * typeck.c (build_java_array_type): Likewise.
3872
3873         * verify.c (verify_jvm_instructions): Likewise.
3874
3875 Tue Oct 12 22:28:10 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3876
3877         * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
3878
3879 1999-10-07  Anthony Green  <green@cygnus.com>
3880
3881         * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
3882         where CHECK_PUT may fail for valid reasons.
3883
3884         * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
3885         UNSAFE_PUTN): New macros.
3886
3887 1999-10-04  Tom Tromey  <tromey@cygnus.com>
3888
3889         * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
3890         well.  Fixes Java PR gcj/59.
3891         * parse-scan.y (yyerror): Report errors.
3892
3893 Fri Sep 24 12:23:05 1999  Glenn Chambers  <GChambers@provsol.com>
3894
3895         * decl.c (insert_block): Remove unconditional `abort'.
3896
3897 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
3898
3899         * decl.c (builtin_function): No longer static.  New arg CLASS.  Arg
3900         FUNCTION_CODE now of type int.  All callers changed.
3901         Set the builtin's DECL_BUILT_IN_CLASS.
3902
3903 1999-09-23  Tom Tromey  <tromey@cygnus.com>
3904
3905         * jvspec.c (lang_specific_driver): Don't read spec file if
3906         -fsyntax-only given.
3907
3908 1999-09-22  Tom Tromey  <tromey@cygnus.com>
3909
3910         * lang-specs.h: Added `%(jc1)' to the jc1 spec.
3911
3912         * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
3913         (WORDS_TO_LONG): Likewise.
3914         (WORDS_TO_DOUBLE): Likewise.
3915
3916 Tue Sep 14 16:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3917
3918         * jcf-write.c (RELOCATION_VALUE_0): New macro.
3919         (RELOCATION_VALUE_1): Likewise.
3920         (emit_iinc, emit_reloc, push_constant1, push_constant2,
3921         push_in_const, push_long_const): Prototyped.
3922         (push_constant1): Argument `index' is of type HOST_WIDE_INT.
3923         (push_constant2): Likewise.
3924         (push_int_const): Cast find_constant1's integer arguments to `jword'.
3925         (find_constant_wide): Cast find_constant2's integer arguments to
3926         `jword'.
3927         (find_constant_index): Cast find_constant2's and find_constant2's
3928         integer arguments to `jword'.
3929         (emit_pop): Argument `value' is of type HOST_WIDE_INT.
3930         (emit_switch_reloc): Use RELOCATION_VALUE_0.
3931         (emit_if): Use RELOCATION_VALUE_1.
3932         (emit_goto): Likewise.
3933         (emit_jsr): Likewise.
3934         (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
3935         argument to push_long_const to HOST_WIDE_INT.
3936
3937 1999-09-15  Andreas Schwab  <schwab@suse.de>
3938
3939         * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
3940
3941 1999-09-20  Nick Clifton  <nickc@cygnus.com>
3942
3943         * lang.c (lang_decode_option): Extend comment.
3944
3945 Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3946
3947         * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
3948         instead of fndecl.
3949
3950 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3951
3952         * gjavah.c (get_field_name, print_method_info, print_include,
3953         add_namelet): Use xmalloc, not malloc.
3954
3955         * jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
3956         (munge): Use xrealloc, not realloc, trust xrealloc to handle a
3957         NULL pointer.
3958
3959         * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
3960
3961         * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
3962
3963         * jcf-path.c (add_entry): Likewise.
3964
3965         * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
3966
3967         * jv-scan.c (xmalloc): Remove definition.
3968
3969         * jvgenmain.c (xmalloc): Likewise.
3970
3971         * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
3972
3973         * lex.c (java_store_unicode): Use xrealloc, not realloc.
3974
3975         * parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
3976         concat, not xmalloc/sprintf.
3977         (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
3978         (xstrdup): Remove definition.
3979
3980         * parse.y (duplicate_declaration_error_p,
3981         constructor_circularity_msg, verify_constructor_circularity,
3982         check_abstract_method_definitions, java_check_regular_methods,
3983         java_check_abstract_methods, patch_method_invocation,
3984         check_for_static_method_reference, patch_assignment, patch_binop,
3985         patch_cast, array_constructor_check_entry, patch_return,
3986         patch_conditional_expr): Use xstrdup, not strdup.
3987
3988         * zextract.c (ALLOC): Use xmalloc, not malloc.
3989
3990 Sun Sep 12 23:30:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3991
3992         * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
3993
3994         * jvspec.c: Include gcc.h.  Don't include gansidecl.h.
3995         (do_spec, lang_specific_pre_link, lang_specific_driver,
3996         input_filename, input_filename_length): Don't declare.
3997         (main_class_name, jvgenmain_spec, lang_specific_driver):
3998         Constify a char*.
3999         (lang_specific_driver): All calls to the function pointer
4000         parameter now explicitly call `fatal'.
4001
4002 Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4003
4004         * parse.y (find_applicable_accessible_methods_list): Search
4005         abstract classes as interfaces.
4006
4007 Thu Sep  9 17:33:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4008
4009         * class.c (finish_class): We're now outside a valid method
4010         declaration. Tell the rest of gcc so.
4011
4012 1999-09-08  Bruce Korb  autogen@linuxbox.com
4013
4014         * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
4015
4016 1999-09-07  Tom Tromey  <tromey@cygnus.com>
4017
4018         * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
4019         java-array.h.
4020         (decode_signature_piece): Don't emit "::" in JArray<>.
4021         (print_namelet): Only print trailing `;' when printing a class.
4022
4023 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
4024
4025         * java-tree.h: Delete declarations for all tree nodes now moved to
4026         global_trees.
4027         * decl.c: Delete their definitions.
4028
4029 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
4030
4031         * Make-lang.in (jc1): Depend on ggc-callbacks.o.
4032         * Makefile.in (OBJS): Add ggc-callbacks.o.
4033         (OBJDEPS): Likewise.
4034
4035 1999-09-03  Tom Tromey  <tromey@cygnus.com>
4036
4037         * parse.y (strip_out_static_field_access_decl): Return operand if
4038         it satisfies JDECL_P.
4039
4040 1999-09-02  Tom Tromey  <tromey@cygnus.com>
4041
4042         * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
4043         Handle nested arrays, like `[[I'.
4044
4045 1999-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4046
4047         * class.c (finish_class): Remove unused parameter, all callers
4048         changed.
4049
4050         * expr.c (build_java_athrow): Change return type to void.
4051         (java_lang_expand_expr): Make sure each case in switch returns a
4052         value.
4053
4054         * java-tree.h (finish_class): Fix prototype to take void args.
4055
4056         * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
4057         (main): Issue return from main, not exit.
4058
4059         * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
4060
4061         * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
4062
4063         * jv-scan.c (main): Issue return from main, not exit.
4064
4065         * parse.y (check_abstract_method_definitions,
4066         java_check_abstract_method_definitions): Add static prototypes.
4067         (java_complete_expand_methods): Fix call to `finish_class'.
4068
4069         * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
4070         and `prevpc'.
4071
4072 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4073
4074         * lang.c (language_string): Constify.
4075
4076 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4077
4078         * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
4079         Remove hacks for stuff which comes from libiberty.
4080
4081         * Make-lang.in: Likewise.
4082
4083 Mon Aug 30 16:41:41 1999  Hans-Peter Nilsson  <hp@axis.se>
4084
4085         * Makefile.in (xref.o): Depend on xref.c explicitly.
4086
4087 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4088
4089         * java-tree.h (lang_printable_name): Constify a char*.
4090
4091         * lang.c (lang_printable_name): Likewise.
4092
4093 Fri Aug 27 23:31:57 1999  Jeffrey A Law  (law@cygnus.com)
4094
4095         * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
4096         comments in C code.
4097
4098 1999-08-26  Tom Tromey  <tromey@cygnus.com>
4099
4100         * gjavah.c (print_cxx_classname): Print "::" before qualified
4101         name.
4102
4103 Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4104
4105         * parse.y (lookup_cl): Changed leading comment. Now does its best
4106         to set the column number.
4107         (qualify_ambiguous_name): Take WFL wrappers into account.
4108
4109 Wed Aug 25 15:37:15 1999  Gregg Townsend  <gmt@cs.arizona.edu>
4110
4111         * verify.c (verify_jvm_instructions): Don't check instruction
4112         validity beyond end of method.
4113
4114 1999-08-25  Tom Tromey  <tromey@cygnus.com>
4115
4116         * jvspec.c (lang_specific_driver): Correctly handle --help again.
4117
4118 1999-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4119
4120         * gjavah.c (print_name, print_base_classname, utf8_cmp,
4121         cxx_keyword_subst, generate_access, name_is_method_p,
4122         get_field_name, print_field_name, super_class_name, print_include,
4123         decode_signature_piece, print_class_decls, usage, help,
4124         java_no_argument, version, add_namelet, print_namelet): Add static
4125         prototype.
4126         (print_base_classname, utf8_cmp, cxx_keyword_subst,
4127         name_is_method_p): Constify a char*.
4128         (get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
4129         Provide a final else clause in an if-else-if.
4130         (print_field_info): Add missing final arg in function call to
4131         `print_field_name'.
4132         (print_method_info, decompile_method, decode_signature_piece,
4133         print_c_decl, print_full_cxx_name, print_stub,
4134         print_mangled_classname, super_class_name, print_include,
4135         add_namelet, add_class_decl, print_class_decls, process_file,
4136         help): Constify a char*.
4137
4138         * jcf-write.c (jcf_handler, push_constant1, push_constant2,
4139         push_int_const, find_constant_wide, find_constant_index,
4140         push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
4141         emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
4142         emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
4143         emit_if, emit_goto, emit_jsr, call_cleanups,
4144         make_class_file_name): Add static prototypes.
4145         (generate_bytecode_return, generate_bytecode_insns): Pass a
4146         NULL_PTR, not a NULL_TREE.
4147
4148         * jv-scan.c: Include "jcf.h".
4149         (main): Declare using DEFUN macro.
4150
4151         * jvspec.c (find_spec_file, lang_specific_pre_link,
4152         lang_specific_driver): Add prototypes.
4153         (find_spec_file): Constify a char*.
4154
4155         * keyword.gperf (hash, java_keyword): Add prototypes.
4156
4157         * lang.c (lang_print_error): Add static prototype.
4158         (lang_init): Prefer memcpy over bcopy to avoid casts.
4159
4160         * lex.c (yylex): Add static prototype.
4161
4162         * parse-scan.y: Include "lex.c" earlier.
4163
4164         * parse.h: Remove redundant declaration for `yylex'.
4165
4166         * parse.y (java_decl_equiv, binop_compound_p, search_loop,
4167         labeled_block_contains_loop_p): Add static prototypes.
4168         (not_accessible_p): Make static to match prototype.
4169
4170         * verify.c (start_pc_cmp): Don't needlessly cast away const.
4171
4172 Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4173
4174         * parse.y (check_method_redefinition): Changed leading comment.
4175         (check_abstract_method_definitions): New function.
4176         (java_check_abstract_method_definitions): New function.
4177         (java_check_regular_methods): Call it.
4178         (verify_constructor_super): Fixed indentation.
4179         (lookup_method_invoke): Likewise.
4180
4181 Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4182
4183         * parse.y (method_header): Return a null pointer if the current
4184         class node is null.
4185         (finish_method_declaration): Return if the current function decl
4186         is null.
4187         (source_start_java_method): Likewise.
4188         (java_method_add_stmt): Likewise.
4189
4190 Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4191
4192         * class.c (emit_register_class): Removed unnecessary call to
4193         start_sequence.
4194         * parse.y (labeled_block_contains_loop_p): Removed unused local
4195         variable.
4196
4197 Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4198
4199         * parse.y (java_refold): Added prototype.
4200
4201 Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4202
4203         * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
4204         (java_stabilize_reference): Removed unnecessary `else'.
4205         (java_complete_lhs): Set flag to remember boolean. Call
4206         java_refold. Added comments.
4207         (java_decl_equiv): New function.
4208         (binop_compound_p): Likewise.
4209         (java_refold): Likewise.
4210         (patch_unaryop): Striped static field access assigned to decl and
4211         op. Changed promotion scheme for ++/-- operators.
4212         (search_loop): New function.
4213         (labeled_block_contains_loop_p): Likewise.
4214         (patch_loop_statement): Call labeled_block_contains_loop_p. Added
4215         comment.
4216         (patch_bc_statement): Call search_loop. Fixed comment.
4217
4218 1999-08-14  Anthony Green  <green@cygnus.com>
4219
4220         * expr.c (java_lang_expand_expr): Mark static array data as
4221         referenced.
4222
4223 Tue Aug 10 00:28:31 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4224
4225         * jvgenmain.c (main): NUL-terminate name_obstack.
4226
4227 1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4228
4229         * check-init.c (check_bool2_init, done_alternative): Add static
4230         prototypes.
4231
4232         * class.c (add_interface_do, maybe_layout_super_class): Likewise.
4233         (add_method, build_utf8_ref, build_class_ref,
4234         append_gpp_mangled_type, layout_class_method): Constify a char*.
4235
4236         * decl.c (push_promoted_type, make_binding_level): Add static
4237         prototypes.
4238         (push_promoted_type, pushdecl): Constify a char*.
4239
4240         * except.c (find_handler_in_range, link_handler,
4241         check_start_handlers): Add static prototypes.
4242
4243         * expr.c (process_jvm_instruction): Constify a char*.
4244
4245         * gjavah.c (main): Constify a char*.
4246
4247         * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
4248         Constify a char*.
4249
4250         * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
4251         static prototypes.
4252         (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
4253         munge, print_ents): Constify a char*.
4254
4255         * jcf-dump.c (disassemble_method): Constify a char*.
4256         (print_constant_pool, print_exception_table): Add static prototypes.
4257         (print_constant, print_exception_table, main, disassemble_method):
4258         Constify a char*.
4259
4260         * jcf-io.c (find_classfile, find_class): Likewise.
4261
4262         * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
4263         (set_source_filename, predefined_filename_p): Add static prototypes.
4264         (set_source_filename, get_constant, get_class_constant,
4265         find_in_current_zip): Constify a char*.
4266
4267         * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
4268         static prototypes.
4269         (add_entry, add_path, jcf_path_classpath_arg,
4270         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
4271
4272         * jcf-reader.c (get_attribute, jcf_parse_preamble,
4273         jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
4274         jcf_parse_one_method, jcf_parse_methods,
4275         jcf_parse_final_attributes): Add static prototypes.
4276         (get_attribute): Constify a char*.
4277
4278         * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
4279         jcf_dependency_add_target, jcf_path_classpath_arg,
4280         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
4281
4282         * jv-scan.c (main): Constify a char*.
4283         (gcc_obstack_init): Add prototype arguments.
4284
4285         * jvgenmain.c (gcc_obstack_init): Likewise.
4286         (main): Constify a char*.
4287
4288         * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
4289         static prototypes.
4290         (put_decl_string, lang_print_error): Constify a char*.
4291         (lang_init): Remove redundant extern prototype.
4292
4293         * mangle.c (emit_unicode_mangled_name): Constify a char*.
4294
4295         * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
4296         Add static prototypes.
4297         (get_type_from_signature): Constify a char*.
4298
4299         * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
4300         Add static prototypes.
4301         (start_pc_cmp): Prefer PTR over GENERIC_PTR.
4302         (verify_jvm_instructions): Constify a char*.
4303
4304         * xref.c (xref_flag_value): Likewise.
4305
4306         * xref.h (xref_flag_value): Likewise.
4307
4308         * zextract.c (makeword, makelong): Add static prototypes.
4309         (makeword, makelong): Constify a uch*.
4310
4311 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4312
4313         * lang.c (java_dummy_print): Constify a char*.
4314         (lang_print_error): Likewise.
4315         (lang_init): Remove redundant prototype for `print_error_function'.
4316         (lang_init_source): Likewise.
4317         (lang_identify): Constify a char*.
4318
4319 1999-08-09  Tom Tromey  <tromey@cygnus.com>
4320
4321         * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
4322         (WORDS_TO_LONG): Likewise.
4323         (WORDS_TO_DOUBLE): Likewise.
4324
4325 1999-08-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4326
4327         * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
4328
4329         * expr.c (java_stack_pop, java_array_data_offset,
4330         build_java_throw_out_of_bounds_exception, case_identity,
4331         build_java_check_indexed_type): Add static prototypes.
4332         (linenumber_table, expand_invoke, expand_java_field_op,
4333         build_primtype_type_ref, expand_byte_code): Constify a char*.
4334
4335         * java-tree.h (build_primtype_type_ref, linenumber_table):
4336         Constify a char*.
4337         (java_lang_expand_expr): Add prototype.
4338
4339         * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
4340         `java_lang_expand_expr'.
4341
4342         * lex.c (java_lex_error): Constify a char*.
4343         (java_get_unicode, java_read_char, java_allocate_new_line,
4344         java_unget_unicode, java_sneak_unicode): Prototype.
4345
4346         * parse-scan.y (current_class, package_name, method_declarator,
4347         report_class_declaration, yyerror): Constify a char*.
4348
4349         * parse.h (java_report_errors): Prototype.
4350         (yyerror): Constify a char*.
4351
4352         * parse.y (classitf_redefinition_error, check_modifiers,
4353         parse_jdk1_1_error, lookup_package_type,
4354         lookup_package_type_and_set_next, get_printable_method_name,
4355         purify_type_name): Constify a char*.
4356         (build_super_invocation, maybe_generate_finit,
4357         verify_constructor_super, parser_add_interface,
4358         add_superinterfaces, jdep_resolve_class, note_possible_classname,
4359         java_complete_expand_methods, java_expand_finals,
4360         cut_identifier_in_qualified, java_stabilize_reference,
4361         do_unary_numeric_promotion, operator_string, do_merge_string_cste,
4362         merge_string_cste): Prototype.
4363         (single_type_import_declaration, yyerror,
4364         variable_redefinition_error, build_array_from_name,
4365         build_unresolved_array_type, check_class_interface_creation,
4366         resolve_class, complete_class_report_errors,
4367         note_possible_classname, read_import_dir,
4368         find_in_imports_on_demand, resolve_package, fix_constructors,
4369         check_deprecation, lookup_method_invoke,
4370         maybe_build_primttype_type_ref, array_constructor_check_entry):
4371         Constify a char*.
4372         (java_complete_expand_methods, java_expand_finals): Make static.
4373         (convert_narrow): Remove static prototype.
4374
4375 Tue Aug  3 20:21:20 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
4376
4377         * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
4378
4379 1999-08-02  Richard Henderson  <rth@cygnus.com>
4380
4381         * decl.c: Include defaults.h instead of expr.h.
4382         * parse.y: Likewise.
4383
4384 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
4385
4386         * java/decl.c (start_java_method): Change all uses of
4387         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
4388         Ensure expr.h is included.
4389         * java/expr.c (pop_arguments): Ditto.
4390         * java/parse.y (expand_start_java_method): Ditto.
4391
4392 1999-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4393
4394         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4395
4396 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
4397
4398         * decl.c: Include "function.h".
4399         * except.c: Likewise.
4400         * parse.y: Likewise.
4401         * Makefile.in: Update dependencies.
4402
4403 1999-07-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4404
4405         * expr.c (build_java_soft_divmod): Provide a default case in switch.
4406         (java_lang_expand_expr): Mark parameters `target', `tmode' and
4407         `modifier' with ATTRIBUTE_UNUSED.
4408
4409         * gjavah.c (process_file): Add braces around ambiguous `else'.
4410
4411         * jcf-dump.c (print_access_flags, localvar_free): Change return
4412         type to void.
4413
4414         * parse.y (java_complete_expand_method): Initialize variable
4415         `exception_copy'.
4416         (resolve_qualified_expression_name): Likewise for `field_decl'.
4417         (patch_method_invocation): Likewise for `class_to_search'.
4418         (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
4419         (patch_assignment): Likewise for `lhs_type'.
4420
4421         * verify.c (verify_jvm_instructions): Remove unused variable
4422         `caller'.
4423
4424 1999-07-25  Richard Henderson  <rth@cygnus.com>
4425
4426         * decl.c (va_list_type_node): New.
4427
4428 1999-07-25  Anthony Green  <green@cygnus.com>
4429
4430         * gjavah.c (print_stub): New function.
4431         (METHOD_IS_NATIVE): New macro.
4432         (print_mangled_classname): Make static.
4433         (HANDLE_END_FIELD): Don't emit fields during stub generation.
4434         (process_file): Perform stub generation.
4435         (HANDLE_METHOD): Don't emit class decls during stub
4436         generation.
4437         (HANDLE_END_METHOD): Take into account stub generation.
4438         (print_method_info): Handle stub generation.
4439         (print_stub): New function.
4440         (print_cxx_classname): Make signature consistant with others.
4441         (help): Describe -stubs option.
4442         (main): Create stub file.
4443         (version): Use version.c.
4444         (print_full_cxx_name): New function.
4445         (print_c_decl): Use print_full_cxx_name.
4446
4447 Thu Jul 22 12:41:12 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4448
4449         * check-init.c (check_init): Handle MAX_EXPR.
4450
4451 1999-07-15  Andrew Haley  <aph@cygnus.com>
4452
4453         * lang.c (flag_use_divide_subroutine): New variable.
4454         * typeck.c: (convert_ieee_real_to_integer): Bounds check
4455         fp-to-integer conversion.
4456         (convert): Call convert_ieee_real_to_integer when flag_fast_math
4457         is not set.
4458
4459         * expr.c (build_java_soft_divmod): New function.
4460         (build_java_binop): Call build_java_soft_divmod if
4461         flag_use_divide_subroutine is set.
4462         * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4463         soft_lrem_node: new builtin functions.
4464         (init_decl_processing) Initialize the new builtins.
4465         * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4466         soft_lrem_node: new builtin functions.
4467         (build_java_soft_divmod): New function.
4468         * parse.y: Call build_java_soft_divmod if
4469         flag_use_divide_subroutine is set.
4470         * parse.c: Rebuilt.
4471
4472         * jvspec.c (lang_specific_driver): Always allow an extra arg (for
4473         a --specs= arg) even if not linking.
4474         * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
4475         -fuse-divide-subroutine
4476
4477 Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4478
4479         * parse.y (resolve_and_layout): Check methods only once.
4480         (resolve_qualified_expression_name): Verify thrown exceptions
4481         compatibility.
4482         (check_thrown_exceptions): Reject exceptions thrown in
4483         initializer. Error message tuned.
4484
4485 1999-07-14  Andrew Haley  <aph@cygnus.com>
4486
4487         * expr.c (expand_expr): Do not return the last statement in a
4488         block as the block's value.
4489
4490 Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4491
4492         * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
4493         CALL_EXPR, to avoid order of evaluation changes.
4494
4495 Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4496
4497         * parse.y (qualify_ambiguous_name): Do not use
4498         IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
4499
4500 Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4501
4502         * check-init.c (check_init): Handle MAX_EXPR.
4503         * expr.c (force_evaluation_order): Force method call arguments to
4504         be evaluated in left-to-right order.
4505         * parse.y (qualify_ambiguous_name): Loop again to qualify
4506         NEW_ARRAY_EXPR properly.
4507
4508 Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4509
4510         * parse.y (patch_invoke): Resolve unresolved invoked method
4511         returned type.
4512         (qualify_ambiguous_name): STRING_CST to qualify expression for
4513         type name resolution.
4514
4515 1999-06-24  Andrew Haley  <aph@cygnus.com>
4516
4517         * class.c (finish_class): Whenever a deferred method is
4518         output, rescan the list of methods to see if a new candidate for
4519         output can be found.
4520
4521 1999-06-28  Tom Tromey  <tromey@cygnus.com>
4522
4523         * jvspec.c (lang_specific_driver): Recognize --help.
4524
4525 Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4526
4527         * parse.y (resolve_package): Fixed bogus return statement.
4528         (patch_method_invocation): Resolve method invocation beginning with
4529         a package name qualifier.
4530
4531 1999-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4532
4533         * Make-lang.in (java.stage1): Depend on stage1-start.
4534         (java.stage2): Likewise for stage2-start.
4535         (java.stage3): Likewise for stage3-start.
4536         (java.stage4): Likewise for stage4-start.
4537
4538 Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4539
4540         * parse.y (java_complete_lhs): When doing cross referencing, don't
4541         try to keep file location on a WFL expanded as a CALL_EXPR.
4542
4543 Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4544
4545         * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
4546         compiling to class file a void method with an empty method body.
4547         As a side effect, the bytecode backend will generate the
4548         appropriate `return' instruction.
4549
4550 Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4551
4552         * parse.y (lookup_package_type_and_set_next): New function prototype.
4553         (resolve_package): Search current and imported packages.
4554         (lookup_package_type_and_set_next): New function.
4555
4556 1999-06-22  Andrew Haley  <aph@cygnus.com>
4557
4558         * verify.c (verify_jvm_instructions): Check for pending blocks
4559         before invalid PC test and opcode switch, not after.
4560
4561 1999-06-21  Andrew Haley  <aph@cygnus.com>
4562
4563         * except.c (find_handler_in_range): The upper limit for exception
4564         ranges is exclusive, not inclusive: (start <= pc < end).
4565         (link_handler): find child pointer which points to outer by
4566         searching sibling list: previous code incorrectly assumed that
4567         outer->outer->first_child must point to outer.
4568         * verify.c (verify_jvm_instructions): FIXME added to code for
4569         `athrow'.
4570         (verify_jvm_instructions): Do not assume that the last block
4571         processed in a subroutine is a block which ends with a `ret'
4572         instruction.  With some control flows it is possible that the last
4573         block ends with an `athrow'.
4574
4575 Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4576
4577         * parse.y (qualify_ambiguous_name): Reorganized the post
4578         evaluation of non WFL leading expression nodes.
4579
4580 Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4581
4582         * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
4583         CONVERT_EXPR.
4584
4585 Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4586
4587         * parse.y (qualify_ambiguous_name): Handle qualified expression
4588         beginning with a STRING_CST.
4589
4590 Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4591
4592         * parse.y (register_fields): Set DECL_INITIAL on both
4593         pre-initialized static and public fields.
4594         (resolve_field_access): Static field access expressions to always
4595         use pointer types.
4596         (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
4597         qualification. CONVERT_EXPR to be resolved as an expression name.
4598         (java_complete_lhs): Identify and access qualified final
4599         initialized field in switch statement case expression.
4600         (fold_constant_for_init): Pre-initialized field decl constant to
4601         be folded.
4602
4603 Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4604
4605         * parse.y (note_possible_classname): Mark returned node with
4606         QUALIFIED_P only if the original class name contained a '/'.
4607
4608 Sat Jun  5 11:46:59 1999  Anthony Green  <green@cygnus.com>
4609
4610         * Make-lang.in (gcjh): More parallel build fixes.
4611
4612 1999-06-03  Mike Stump  <mrs@wrs.com>
4613
4614         * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
4615
4616 Wed Jun  2 10:44:38 1999  Anthony Green  <green@cygnus.com>
4617
4618         * except.c (link_handler): Chain exception handlers in order.
4619
4620 Wed Jun  2 10:41:24 1999  Anthony Green  <green@cygnus.com>
4621
4622         * expr.c (expand_byte_code): Fill unreachable bytecode regions
4623         with nops and process as usual in order to always set correct EH
4624         ranges.  Emit detailed warnings about unreachable bytecodes.
4625
4626 Wed Jun  2 10:35:13 1999  Anthony Green  <green@cygnus.com>
4627
4628         * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
4629         constant.
4630
4631 Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4632
4633         * parse.y (lookup_field_wrapper): Unified returned value to NULL
4634           or the searched field decl.
4635
4636 Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4637
4638         * parse.y (fold_constant_for_init): Convert numerical constant
4639         values to the type of the assigned field.
4640
4641 Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4642
4643         * expr.c (lookup_field): Relaxed the test on class loading error
4644         detection.
4645         * parse.y (fold_constant_for_init): Enabeled old code.
4646
4647 Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4648
4649         * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
4650         decide the validity of the cast of a java.lang.Cloneable reference
4651         to an array.
4652         (patch_conditional_expr): Fixed first argument passed to
4653         binary_numeric_promotion.
4654
4655 Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4656
4657         * parse.y (qualify_ambiguous_name): Take into account that a
4658         CONVERT_EXPR might specify a type as a WFL.
4659
4660 Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4661
4662         * parse.y (patch_assignment): Save the rhs before using it as an
4663         argument to _Jv_CheckArrayStore.
4664
4665 Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4666
4667         * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
4668
4669 Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4670
4671         * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
4672         floating point litteral only when the exponent indicator has been
4673         parsed.
4674
4675 Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4676
4677         * parse.y (formal_parameter:): Construct argument tree list
4678         element even if a yet unsupported final parameter was encountered.
4679
4680 Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4681
4682         * parse.y (finish_method_declaration): Issue errors for native or
4683         abstract methods declared with a method body, as well as for non
4684         native or non abstract methods with no method body.
4685
4686 1999-05-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4687
4688         * class.c (build_utf8_ref): Initialize variable `field'.
4689
4690         * decl.c (init_decl_processing): Initialize variable `field'.
4691
4692         * expr.c (build_known_method_ref): Mark parameters `method_type',
4693         `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
4694         (process_jvm_instruction): Likewise for parameter `length'.
4695
4696         * jvspec.c (lang_specific_driver): Mark variables `saw_math',
4697         `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
4698         ATTRIBUTE_UNUSED.
4699
4700         * parse.y (maybe_generate_clinit): Remove unused variable
4701         `has_non_primitive_fields'.
4702         (find_in_imports_on_demand): Initialize variables `node_to_use'
4703         and `cl'.
4704         (patch_binop): Likewise for variable `prom_type'.
4705         (patch_unaryop): Likewise for variable `prom_type'.
4706
4707         * verify.c (verify_jvm_instructions): Likewise for variable `last'.
4708
4709         * xref.c (xref_table): Add missing initializer.
4710
4711 1999-05-14  Tom Tromey  <tromey@cygnus.com>
4712
4713         * java-except.h (struct eh_range): Removed unused `next' member.
4714         * verify.c (verify_jvm_instructions): Call check_nested_ranges
4715         after adding all exception handlers.  Sort exception ranges in
4716         order of start PC.
4717         (struct pc_index): New structure.
4718         (start_pc_cmp): New function.
4719         * except.c (add_handler): Return `void'.  Don't call link_handler;
4720         instead construct an ordinary linked list and do range
4721         coalescing.
4722         (check_nested_ranges): New function.
4723         (link_handler): Changed interface to allow merging of eh_ranges.
4724         Split overlapping ranges.  Return `void'.
4725
4726 Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4727
4728         * parse.y (constructor_block_end:): New rule, tagged <node>.
4729         (constructor_body:): Use `constructor_block_end' instead of
4730         `block_end'.
4731
4732 Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4733
4734         * parse.y (statement_nsi:): Pop `for' statement block.
4735         (java_complete_lhs): Labeled blocks containing no statement are
4736         marked as completing normally.
4737
4738 Fri May 14 12:31:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4739
4740         * xref.c (xref_set_current_fp): New function, defined.
4741         * xref.h (xref_set_current_fp): New function, prototyped.
4742
4743 Fri May 14 11:57:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4744
4745         * check-init.c (check_init): Take into account that
4746         LABELED_BLOCK_STMT can be empty.
4747
4748 Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4749
4750         * parse.y (java_check_regular_methods): Warning check on not
4751         overriding methods with default access in other packages does not
4752         apply to `<clinit>'.
4753         (java_complete_lhs): If block body is an empty_stmt_node, replace
4754         it by NULL_TREE. This prevents gcc from generating an irrelevant
4755         warning.
4756
4757 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4758
4759         * check-init.c (check_init): Removed code accepting to see things
4760         falling through default:, when doing xrefs.
4761         * java-tree.h (do_not_fold): New global variable, declared.
4762         * parse.y (do_not_fold): New global variable, defined.
4763         (java_complete_expand_method): Set `do_not_fold' to the value of
4764         `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
4765         and reinstall them after them have been purged; do not check for
4766         initializations; do not issue missing return errors.
4767         (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
4768         when doing xrefs.
4769         (patch_binop): Skip the fold part when doing xrefs.
4770         (build_string_concatenation): Skip the concatenation part when
4771         doing xrefs.
4772         (patch_synchronized_statement): Do not generate a try-finally when
4773         doing xrefs.
4774         (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
4775         and keep the location where the throw was seen.
4776         * typeck.c (convert): When `do_not_fold' is set, do not attempt
4777         any treatment on the converted node an simply return a NOP_EXPR of
4778         the targeted type.
4779         * xref.c (xref_get_data): New function, defined.
4780         * xref.h (xref_get_data): New function, declared.
4781         (XREF_GET_DATA): Use xref_get_data.
4782
4783 1999-05-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4784
4785         * gjavah.c (print_include): Cast the result of `strlen' to int
4786         when comparing against a signed value.
4787         (add_namelet): Likewise.
4788
4789 1999-05-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4790
4791         * expr.c (expand_invoke): Mark parameter `nargs' with
4792         ATTRIBUTE_UNUSED.
4793         (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
4794
4795         * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
4796         ATTRIBUTE_UNUSED.
4797
4798         * jcf-reader.c (get_attribute): Cast a value to long
4799         when comparing against a signed expression.  Likewise.
4800
4801         * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
4802         HOST_BITS_PER_CHAR.
4803
4804 1999-05-11  Andrew Haley  <aph@cygnus.com>
4805
4806         * parse.y (source_end_java_method): If the current method contains
4807         any exception handlers, force asynchronous_exceptions: this is
4808         necessary because signal handlers in libjava may throw exceptions.
4809         * decl.c (end_java_method): Ditto.
4810
4811 1999-05-11  Tom Tromey  <tromey@cygnus.com>
4812
4813         * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
4814         flags.
4815         * jvspec.c (THREAD_NAME): Removed.
4816         (GC_NAME): Likewise.
4817         (MATHLIB): Likewise.
4818         (WITHLIBC): Likewise.
4819         (GCLIB): Likewise.
4820         (THREADLIB): Likewise.
4821         (MATH_LIBRARY): Likewise.
4822         (lang_specific_driver): Don't add `-l' options to command line.
4823         Instead, add a single --specs option.  Recognize `-L' options and
4824         use them to search for spec file.
4825         (find_spec_file): New function.
4826         (SPEC_FILE): New define.
4827
4828 Tue May 11 11:46:36 1999  Dave Brolley  <brolley@cygnus.com>
4829
4830         * lang-options.h: -MD, -MMD, -M and -MM not needed here for
4831         cpplib-enabled build.
4832
4833 1999-05-05  Per Bothner  <bothner@cygnus.com>
4834
4835         * class.c (make_field_value):  DECL_INITIAL may be a string literal;
4836         temporarily zero it while calling rest_of_decl_compilation.
4837
4838         * java-tree.h (string_ptr_type_node):  Add declaration.
4839         * decl.c:  Define and initialize string_ptr_type_node.
4840         * parse.y (patch_string_cst):  Use string_ptr_type_node.
4841
4842         * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
4843         * parse.y (for_statement):  Now unconditionally exit_block.
4844         (finish_labeled_statement):  No longer exit_block if for-loop.
4845         (patch_loop_statement):  Check harder if the loop is already labeled.
4846
4847         * parse.y (patch_initialized_static_field):  Removed function.
4848         (maybe_generate_clinit):  Removed special handling for interfaces.
4849         (java_complete_expand_methods):  Do a preliminary java_complete_tree
4850         on <clinit> to determine if it can be removed.
4851         (java_complete_expand_method):  Remove special handling for <clinit>.
4852         (java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
4853         optimize if we get back empty_stmt_node.
4854         For MODIFY_EXPR, re-do checking of static initializers.
4855         (fold_constant_for_init):  Don't return immediate if VAR_DECL.
4856         For VAR_DECL, pass correct context.
4857
4858         * verify.c (verify_jvm_instructions):  Better error messages.
4859
4860 1999-05-03  Tom Tromey  <tromey@cygnus.com>
4861
4862         * parse-scan.y (interface_declaration): Call
4863         report_class_declaration for interfaces.
4864
4865 1999-04-30 20:54 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
4866
4867         * Makefile.in: Remove -v from bison command lines.
4868
4869 Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4870
4871         * check-init.c (check_init): Exclude a case of error when doing
4872         xrefs.
4873         * class.c (layout_class_method): Don't generate the error message
4874         twice when compiling from source.
4875         * lang-options.h: Added `-Wredundant-modifers' and
4876         `-Wunusupported-jdk11' flags and help text.
4877         * lang.c (lang_decode_option): Added support for
4878         `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
4879         flag_static_local_jdk11 and flag_redundant set accordingly.
4880         * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
4881         * parse.h (EXPR_WFL_ADD_COL): New macro.
4882         (DECL_END_SOURCE_LINE): Likewise.
4883         (DECL_INHERITED_SOURCE_LINE): Likewise.
4884         * parse.y (static_ref_err): New function, prototyped.
4885         (CCB_TK): Now tagged <operator>.
4886         (class_body:): Remember the location of the closing '}' of a class
4887         definition when doing xrefs.
4888         (block:): Likewise.
4889         (block_end:): Likewise.
4890         (create_class): Remember the location of the inherited class
4891         identifier when doing xrefs.
4892         (register_fields): Added test on first operand of `init' before
4893         testing it TREE_CODE.
4894         (method_header): Store the location of the class identifier in the
4895         class decl when doing xrefs.
4896         (finish_method_declaration): Don't combine first/last method line
4897         when doing xref.
4898         (java_check_regular_methods): Warning check on not overriding
4899         methods with default access on other packages move before check on
4900         static methods. Initialization of `aflags' also moved up.
4901         (resolve_expression_name): Call static_ref_err to report the error.
4902         (static_ref_err): New function, implemented.
4903         (resolve_field_access): Returned simplified static field access
4904         when doing xrefs.
4905         (resolve_qualified_expression_name): Check for illegal use of
4906         static fields in a non static context. Call static_ref_err to
4907         report error in various places.
4908         (java_complete_tree): Do not fold initialized static fields when
4909         doing xrefs.
4910         (java_complete_lhs): Likewise.
4911
4912 1999-04-29  Anthony Green  <green@cygnus.com>
4913
4914         * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
4915         create internal labels.
4916         (lookup_label): Ditto.
4917
4918 Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4919
4920         * class.c (layout_class_method): Generate <clinit>'s rtl for
4921         interfaces.
4922         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
4923         for interfaces' <clinit>.
4924         * expr.c (lookup_field): Search for fields in interfaces.
4925         (expand_invoke): Fixed indentation.
4926         (expand_java_field_op): Likewise. Use IS_CLINIT.
4927         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
4928         (IS_CLINIT): New macro.
4929         * parse.y (type_declaration:): Call maybe_generate_clinit after an
4930         interface was parsed.
4931         (maybe_generate_clinit): Don't generate if the current class is an
4932         interface with only fields of primitive types.
4933         (reset_method_name): Use IS_CLINIT.
4934         (java_complete_expand_method): Expand <clinit> when it exists for
4935         interfaces. Use IS_CLINIT.
4936         (resolve_expression_name): Use DECL_CONTEXT instead of
4937         current_class to build static field references.
4938         (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
4939         ARRAY_REF when doing xreferencing.
4940         (check_final_assignment): Fixed typo in leading comment. Use
4941         IS_CLINIT.
4942         (patch_array_ref): Don't fully expand array references when
4943         xreferencing.
4944         (patch_return): Use IS_CLINIT.
4945         (patch_throw_statement): Likewise.
4946
4947 1999-04-22  Tom Tromey  <tromey@cygnus.com>
4948
4949         * Make-lang.in (JAVA_SRCS): Added check-init.c.
4950
4951 Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4952
4953         * decl.c (predef_filenames, predef_filenames_size): New globals
4954         (init_decl_processing): predef_filenames and predef_filenames_size
4955         initialized.
4956         * java-tree.h (predef_filenames, predef_filenames_size): Declared
4957         extern.
4958         * jcf-parse.c (predefined_filename_p): New function.
4959         (yyparse): Check that files on the command line are specified only
4960         once and issue a warning otherwise.
4961         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
4962         * parse.y (source_end_java_method): Nullify NOP method bodies, to
4963         avoid a gcc warning with -W -Wall turned on.
4964         (java_expand_classes): Abort if errors were encountered.
4965         (java_complete_lhs): If the cross reference flag is set, wrap
4966         field DECL node around a WFL when resolving expression name.
4967
4968 Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4969
4970         * lang.c (lang_decode_option): Fixed returned value when parsing
4971         `-fxref=...' and `-Wall'.
4972         * parse.y (source_end_java_method): Do not generate code when
4973         flag_emit_xref is set.
4974         (resolve_expression_name): Do not build static field access when
4975         flag_emit_xref is set.
4976         (resolve_field_access): No special treatment on `length' when
4977         flag_emit_xref is set. Do not build qualified static field access
4978         when flag_emit_xref is set.
4979         (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
4980         when flag_emit_xref is set.
4981         (patch_assignment): Do not generate array store runtime check when
4982         flag_emit_xref is set.
4983         * xref.c (xref_flag_value): Fixed function declaration
4984         indentation.
4985         (xset_set_data): New function.
4986         * xref.h (xref_set_data): Added prototype for new function.
4987         (typedef struct xref_flag_table): New field data.
4988         (XREF_GET_DATA): New macro.
4989
4990 1999-04-19  Tom Tromey  <tromey@cygnus.com>
4991
4992         * xref.h (enum): Removed trailing comma.
4993
4994         * parse.y (resolve_qualified_expression_name): Added missing
4995         `break'.
4996
4997 Thu Apr 15 13:08:03 1999  Anthony Green  <green@cygnus.com>
4998
4999         * gjavah.c: New prototypes for java_float_finite and
5000         java_double_finite.
5001
5002 Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5003
5004         * parse.y (patch_unaryop): Fixed ++/-- operator check on array
5005         references.
5006
5007 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
5008
5009         * Makefile.in (TREE_H): Add tree-check.h.
5010         (RTL_H): Add genrtl.h.
5011
5012 Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5013
5014         * parse.y (patch_assignment): Added ArrayStoreException runtime
5015         check.
5016
5017 1999-04-06  Per Bothner  <bothner@cygnus.com>
5018
5019         * expr.c (pop_type_0):  New function.
5020         (pop_type):  Use pop_type_0.
5021         * java-tree.h (pop_type_0):  New declaration.
5022         * verify.c (verify_jvm_instructions):  Check return instructions.
5023
5024         * parse.y (patch_binop):  Don't fold if non-constant and emiting
5025         class files.
5026
5027 Mon Apr  5 16:06:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5028
5029         * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
5030
5031         * gjavah.c: Include math.h earlier.  Include tree.h/java-tree.h.
5032         (main_jcf): Don't define.
5033         (process_file): Don't set `main_jcf'.
5034
5035         * java-tree.h (main_jcf): Don't declare.
5036
5037         * jcf-parse.c (main_jcf): Add static definition.
5038
5039         * lang.c (main_jcf): Don't define.
5040
5041 Mon Apr  5 15:43:51 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5042
5043         * class.c (add_method_1): Cast the argument of `bzero' to PTR.
5044
5045         * decl.c (copy_lang_decl): Likewise for `bcopy'.
5046
5047         * jcf-depend.c: Include "config.h", not <config.h>.
5048
5049         * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
5050         `bcopy' to PTR.
5051
5052         * jcf-path.c: Include "config.h", not <config.h>.
5053
5054         * lex.c: Don't include various system header files.
5055         (java_init_lex): Cast the argument of `bzero' to PTR
5056
5057         * parse-scan.y (java_push_parser_context): Likewise.
5058
5059         * parse.y (java_push_parser_context): Likewise.
5060         (patch_bc_statement): Match format specifier to variable argument.
5061
5062         * xref.c: Don't include <stdio.h>.
5063
5064 Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5065
5066         * parse.y (struct parser_ctxt *ctxp): Now global.
5067         (declare_local_variables): Use WFL compound value for the
5068         declaration source line value, when doing cross-referencing.
5069
5070 1999-03-31  Tom Tromey  <tromey@cygnus.com>
5071
5072         * gjavah.c (print_field_info): Allow constants of other types.
5073         (print_include): Generate include when new name is proper prefix
5074         of already printed name.
5075         (add_namelet): Likewise.
5076         (cxx_keyword_subst): New function.
5077         (print_method_info): Use it.
5078         (print_field_name): New function.
5079         (get_field_name): New function.
5080         (print_field_info): Use get_field_name and print_field_name.
5081
5082 Wed Mar 31 11:00:32 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5083
5084         * Makefile.in (keyword.h): Generate using gperf language 'C', not
5085         'KR-C', so gperf uses the `const' keyword on strings.
5086
5087         * keyword.gperf (java_keyword): Const-ify a char*.
5088
5089 Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5090
5091         * parse.y (patch_bc_statement): Fixed identation and a bogus
5092         `printf' format.
5093
5094 Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5095
5096         * parse.y (patch_assignment): Allow static variables in other
5097         classes to be assigned.
5098
5099 Sun Mar 28 22:12:10 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5100
5101         * class.c (maybe_add_interface): Remove unused variable
5102         `interface_binfo'.
5103         (make_class_data): Use = for assignment, not ==.  Likewise.
5104         (emit_register_classes): Remove unused variable `decl'.
5105
5106         * lex.c: Fix comment so as not to contain an embedded `/*'.
5107
5108         * verify.c (verify_jvm_instructions): Remove unused variable
5109         `self_type'.
5110
5111 Sat Mar 27 15:49:18 1999  Per Bothner  <bothner@cygnus.com>
5112
5113         * parse.y (complete_loop_body):  Rename to finish_loop_body.
5114         (complete_labeled_statement):  Rename to finish_labeled_statement.
5115         (complete_for_loop):  Rename to finish_for_loop.
5116         (complete_method_declaration):  Rename to finish_method_declaration.
5117
5118         * java-tree.h (continue_identifier_node):  New global node.
5119         * decl.c:  Define and initialize continue_identifier_node.
5120         * parse.y (generate_labeled_block):  Remove - no longer needed.
5121         (build_loop_body):  Use continue_identifier_node for continue block.
5122         (finish_labeled_statement):  Also do pop_labeled_block actions.
5123         (java_complete_lhs):  POP_LOOP even if error.
5124         (build_labeled_block):  Special handling for continue_identifier_node.
5125         (patch_loop_statement):  Re-organize.
5126         (patch_bc_statement):  Re-write.
5127
5128 Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5129
5130         * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
5131         using a WFL compound value.
5132         * parse.y (xref.h): Include.
5133         (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
5134         WFL compound value.
5135         (register_fields): Set WFL compound value to lineno if doing
5136         xrefs.
5137         (java_complete_expand_method): Call expand_xref if flag_emit_xref
5138         is set.
5139         * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
5140         * xref.h (expand_xref): Prototype renamed from xref_generate.
5141
5142 Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5143
5144         * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
5145         (GET_CURRENT_BLOCK): New macro.
5146         * parse.y (current_static_block): New global variable.
5147         (method_body:): Define action.
5148         (complete_method_declaration): Set current_function_decl to NULL
5149         when work on the current method is done.
5150         (declare_local_variables): Use GET_CURRENT_BLOCK.
5151         (java_method_add_stmt): Likewise.
5152         (java_complete_expand_method): Disable the use of `this' when
5153         expanding <clinit>.
5154         (enter_a_block): If no current method exist, use
5155         current_static_block to link static initializer blocks.
5156         (exit_block): Rewritten to use current_static_block when no current
5157         method decl exists.
5158         (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
5159         (patch_return): Forbid the use of `return' in static initializers.
5160         (patch_throw_statement): Fixed indentation. Issue specific error
5161         for uncaught thrown checked exception in static initializer
5162         blocks. Removed FIXME.
5163
5164 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
5165
5166         * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
5167         Link gcj from gcc.o.
5168
5169 Tue Mar 23 10:48:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5170
5171         * parse.y (find_applicable_accessible_methods_list): When dealing
5172         with interface: ensure that a given interface or java.lang.Object
5173         are searched only once.
5174
5175 Tue Mar 23 10:05:27 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5176
5177         * gjavah.c (print_c_decl): Remove unused argument `flags'.
5178
5179         * jcf-dump.c (print_access_flags): Add braces around if-else.
5180
5181         * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
5182         COMBINE_INPUTS.
5183
5184         * lex.c (build_wfl_node): Add static prototype.
5185
5186         * lex.h (build_wfl_node): Remove static prototype.
5187
5188         * parse.y: Include lex.c early enough to declare everything needed.
5189         Ensure calls to `build_wfl_node' pass the proper arguments.
5190         (create_class): Remove unused variable `super_decl'.
5191         (get_printable_method_name): Initialize variable `name'.
5192
5193 Mon Mar 22 20:14:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5194
5195         * Changelog: Fixed 1999-03-22 typos.
5196         * lang.c (lang_decode_option): Fixed typo in error string in the
5197         XARG section.
5198
5199 1999-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5200
5201         * Makefile.in (JAVA_OBJS): Added entry xref.o.
5202         (xref.o): New rule.
5203         * java-tree.h (flag_emit_xref): Declared extern.
5204         * lang.c (xref.h): Included.
5205         (flag_emit_xref): New global variable.
5206         (lang_decode_option): Added support for -fxref.
5207         * xref.c: Created.
5208         * xref.h: Likewise.
5209
5210 1999-03-21  Manfred Hollstein  <manfred@s-direktnet.de>
5211
5212         * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
5213         linked with.
5214
5215 Sun Mar 21 08:30:30 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5216
5217         * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
5218         $(srcdir)/../system.h and $(JAVA_TREE_H).
5219         (jcf-io.o): Depend on $(JAVA_TREE_H).
5220         (mangle.o): Likewise.
5221
5222         * check-init.c (check_cond_init): Add static prototype.
5223
5224         * class.c (build_java_method_type, hashUtf8String,
5225         make_field_value, get_dispatch_vector, get_dispatch_table,
5226         append_gpp_mangled_type, mangle_static_field): Likewise.
5227         (strLengthUtf8): Hide unused definition.
5228         (hashUtf8String): Const-ify.
5229         (make_field_value): Un-ANSI-fy.
5230
5231         * constants.c: Move inclusion of jcf.h above java-tree.h.
5232         (set_constant_entry, find_class_or_string_constant,
5233         find_name_and_type_constant, get_tag_node,
5234         build_constant_data_ref): Add static prototype.
5235
5236         * decl.c (push_jvm_slot, builtin_function,
5237         lookup_name_current_level): Likewise.
5238         (builtin_function): Const-ify.
5239
5240         * except.c (expand_start_java_handler, expand_end_java_handler):
5241         Add static prototype.
5242
5243         * expr.c (flush_quick_stack, push_value, pop_value,
5244         java_stack_swap, java_stack_dup, build_java_athrow,
5245         build_java_jsr, build_java_ret, expand_java_multianewarray,
5246         expand_java_arraystore, expand_java_arrayload,
5247         expand_java_array_length, build_java_monitor, expand_java_pushc,
5248         expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
5249         expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
5250         expand_compare, expand_test, expand_cond, expand_java_goto,
5251         expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
5252         expand_java_field_op, java_push_constant_from_pool): Likewise.
5253
5254         (decode_newarray_type, expand_iinc): Un-ANSI-fy.
5255         (build_java_arraynull_check): Mark parameters `node' and `type'
5256         with ATTRIBUTE_UNUSED.
5257         (note_label): Likewise for parameter `current_pc'.
5258         (expand_java_call, expand_java_ret): Hide unused definition.
5259
5260         * java-tree.h (make_class, build_constants_constructor,
5261         java_set_exception_lang_code, pop_labeled_block, emit_handlers,
5262         init_outgoing_cpool, register_class, emit_register_classes,
5263         java_layout_seen_class_methods): Prototype.
5264         (unicode_mangling_length): Const-ify.
5265         (append_gpp_mangled_name, append_gpp_mangled_classtype,
5266         emit_unicode_mangled_name, format_int, format_uint,
5267         jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
5268         jcf_print_utf8_replace, open_class): Prototype.
5269
5270         * jcf-dump.c: Include "config.h", not <config.h>.  Don't include
5271         <stdio.h>.  Include tree.h/java-tree.h.
5272         (utf8_equal_string usage, process_class): Add static prototype.
5273         (open_class): Don't prototype this here.
5274         (utf8_equal_string): Match arguments to format specifiers.
5275         (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
5276         TABLE_SWITCH, disassemble_method): Likewise.
5277
5278         * jcf-io.c: Include tree.h/java-tree.h.
5279         (open_class, find_classfile, jcf_print_utf8,
5280         jcf_print_utf8_replace): Const-ify.
5281
5282         * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
5283         parse_class_file): Add static prototype.
5284         (find_in_current_zip): Match definition to existing static
5285         prototype.
5286
5287         * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
5288         (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
5289         finish_jcf_block, define_jcf_label, get_jcf_label_here,
5290         put_linenumber, localvar_alloc, localvar_free, get_access_flags,
5291         write_chunks, adjust_typed_op, generate_bytecode_conditional,
5292         generate_bytecode_return, perform_relocations, init_jcf_state,
5293         init_jcf_method, release_jcf_state, generate_classfile):
5294         Add static prototype.
5295         (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
5296         (make_class_file_name): Const-ify.
5297
5298         * jcf.h (find_classfile): Const-ify.
5299
5300         * jv-scan.c (reset_report): Remove prototype.
5301
5302         * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
5303         (error): Rewrite to allow varargs.
5304
5305         * lang.c (lang_f_options): Const-ify.
5306
5307         * lex.c (java_parse_escape_sequence): Add static prototype.
5308         (java_allocate_new_line): Match definition to existing static
5309         prototype.
5310
5311         * mangle.c Include tree.h/java-tree.h.
5312         (unicode_mangling_length, emit_unicode_mangled_name,
5313         append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
5314
5315         * parse.h (jdep_code): Remove trailing comma in enumeration.
5316         (java_get_line_col): Move prototype outside of !JC1_LITE test.
5317         (reset_report): Add prototype.
5318
5319         * verify.c (push_pending_label, merge_types): Add static
5320         prototypes.
5321
5322         * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
5323
5324 1999-03-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5325
5326         * parse.y (find_applicable_accessible_methods_list): Extend the
5327         search to superinterfaces when relevant.
5328         (search_applicable_methods_list): New function.
5329
5330 1999-03-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5331
5332         * class.c (unmangle_classname): Implemented stricter testing
5333         before setting the QUALIFIED_P flag on an identifier.
5334
5335 Tue Mar 16 15:15:41 1999  Per Bothner  <bothner@cygnus.com>
5336
5337         * parse.y (java_complete_lhs):  Call force_evaluation_order
5338         after patch_newarray.
5339         (patch_binop):  Don't call fold if there are side effects.
5340
5341 1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5342
5343         * parse.y (java_stabilize_reference): Use save_expr instead of
5344         building a SAVE_EXPR node.
5345         (java_complete_lhs): Patch the resulting string of the `+='
5346         operator (if necessary) and complete the RHS after having built
5347         the cast.
5348
5349 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
5350
5351         * class.c (make_class):  Don't set CLASS_P here (because
5352         this function is also called by build_java_array_type).
5353         (push_class):  Set CLASS_P here instead.
5354         * parse.h (TYPE_CLASS_P):  Check for TYPE_ARRAY_P is redundant.
5355
5356         * jcf-dump.c (print_access_flags):  Take extra parameter to indicate
5357         context.  If the context is class, perfer "super" over "synchronized".
5358         * jcf-write.c (generate_classfile):  Don't add ACC_SUPER if interface.
5359
5360         * parse.y (create_class):  Don't call parser_check_super here;
5361         it is not robust.  Always wait until later.
5362
5363         * parse.y (method_header):  For interfaces, set ACC_ABSTRACT (to
5364         match what JDK 1.2 does), but don't set ACC_PUBLIC.
5365
5366 Sat Mar 13 18:16:34 1999  Per Bothner  <bothner@cygnus.com>
5367
5368         * lex.c (java_read_char):  UNGET invalid non-initial utf8 character.
5369         * lex.h (UNGETC):  Change misleading macro.
5370
5371 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5372
5373         * parse.y (java_stabilize_reference): Return NODE when patching a
5374         COMPOUND_EXPR.
5375         (java_complete_lhs): Put parenthesis around truth values.
5376
5377 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5378
5379         * class.c (layout_class_method): Don't make rtl for interface
5380         methods.
5381         * parse.h (GET_TYPE_NAME): New macro.
5382         * parse.y (if_then_statement:): Fixed indentation.
5383         (if_then_else_statement:): Likewise.
5384         (for_statement:): Fixed spacing.
5385         (try_statement:): Fixed indentation.
5386         (create_interface): Don't force interfaces to be abstract.
5387         (method_header): Abstract methods are OK in interfaces.
5388         (declare_local_variables): Fixed typo in comment.
5389         (java_complete_expand_method): Fixed indentation.
5390         (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
5391         non accessible fields.
5392         (java_stabilize_reference): New function.
5393         (java_complete_lhs): Fixed indentation. Use
5394         java_stabilize_reference in compound assignement. Insert the
5395         cast. If not processing `+' fix string constants before processing
5396         binop.
5397
5398 Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5399
5400         * constants.c (find_class_or_string_constant): Cast variable `j'
5401         to a `jword' when comparing against one.
5402
5403         * expr.c (java_lang_expand_expr): Remove unused variables
5404         `has_finally_p' and `op0'.
5405
5406         * gjavah.c (print_field_info): Cast a value to jint when comparing
5407         against one.  Likewise for a jlong.
5408         (add_namelet): Likewise cast a `sizeof' to an int when comparing
5409         against a signed quantity.
5410
5411         * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
5412         (print_signature): Don't needlessly dereference variable `str'
5413
5414         * jcf-reader.c (get_attribute): Mark variables `max_stack' and
5415         `max_locals' with ATTRIBUTE_UNUSED.
5416         (jcf_parse_class): Likewise for variable `index'.
5417
5418         * parse.h (reverse_jdep_list): Remove static prototype.
5419
5420         * parse.y (build_jump_to_finally): Remove prototype and definition.
5421         (reverse_jdep_list): Add static prototype.
5422
5423         * typeck.c (convert_ieee_real_to_integer): Remove unused variables
5424         `assignment' and `expr_decl'.
5425
5426         * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
5427
5428 1999-03-12  Andrew Haley  <aph@cygnus.com>
5429
5430         * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
5431         we'll need a directory separator and a null character.
5432
5433 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
5434
5435         * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
5436
5437   Tue Mar  9 11:52:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5438
5439         * parse.y (method_header): Don't set ACC_ABSTRACT flags on
5440         interfaces.
5441
5442 Fri Mar  5 15:17:29 1999  Per Bothner  <bothner@cygnus.com>
5443
5444         * lex.c (java_parse_end_comment):  Take extra parameter (next char).
5445
5446         * class.c (build_utf8_ref):  Fix possible name class/ambiguity.
5447
5448         * class.c (layout_class_method):  A static method in a base class
5449         is never overridden, so treat it like it doesn't exist.
5450         However, do complain about private non-static method overriding
5451         public static method.
5452
5453         * parse.y:  Don't set unused INITIALIZED_P flag.
5454         * java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
5455
5456         * parse.y (find_expr_with_wfl):  Optimize tail-calls.
5457         (build_array_from_name):  Re-order &index[string] to &string[index].
5458
5459         * parse.y (java_complete_lhs):  Don't call patch_assignment if rhs is
5460         error_mark (it might catch more errors, but it is more likely to lose).
5461
5462 Sat Mar  6 11:17:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5463
5464         * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
5465         (parse-scan.o): Depend on toplev.h.
5466
5467         * class.c (make_method_value): Add prototype.  Make it static.
5468         Remove unused second argument, caller changed.
5469
5470         * expr.c (java_lang_expand_expr): Remove unused variable
5471         `return_label'.
5472
5473         * java-tree.h: Don't prototype find_in_current_zip.
5474         Add prototypes for verify_constant_pool, start_java_method,
5475         end_java_method, give_name_to_locals, expand_byte_code,
5476         open_in_zip, set_constant_value, find_constant1, find_constant2,
5477         find_utf8_constant, find_string_constant, find_class_constant,
5478         find_fieldref_index, find_methodref_index, write_constant_pool,
5479         count_constant_pool_bytes and encode_newarray_type.
5480
5481         * jcf-dump.c: Remove unused variable `LONG_temp'.
5482
5483         * jcf-parse.c: Include parse.h.
5484         (jcf_parse_source): Remove unused parameter, all callers changed.
5485         (jcf_figure_file_type): Add static prototype.
5486         (find_in_current_zip): Likewise.  Also remove unused parameter,
5487         all callers changed.
5488         (read_class): Initialize variable `saved_pos'.
5489
5490         * jcf-reader.c (jcf_parse_preamble): Mark variables
5491         `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
5492
5493         * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
5494         (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
5495         (java_parse_doc_section): Initialize variable `seen_star'.
5496         (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
5497         (java_lex_error): Mark parameters `msg' and `forward' with
5498         ATTRIBUTE_UNUSED.
5499         (java_get_line_col): Mark parameters `filename' and `line' with
5500         ATTRIBUTE_UNUSED.
5501
5502         * parse-scan.y: Include toplev.h.
5503         (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
5504
5505         * parse.h: use `struct JCF', not plain `JCF'.
5506         (java_parser_context_save_global, java_expand_classes
5507         java_parser_context_restore_global, java_parse): Add prototypes.
5508
5509         * typeck.c (convert_ieee_real_to_integer): Remove unused variable
5510         `node'.
5511
5512 Wed Feb 24 16:13:59 1999  Per Bothner  <bothner@deneb.cygnus.com>
5513
5514         *  check-init.c (check_init):  COPYN takes word count, not bit count.
5515
5516 Fri Feb 26 14:06:21 1999  Per Bothner  <bothner@cygnus.com>
5517
5518         * typeck.c (convert_ieee_real_to_integer):  Use save_expr instead of
5519         explicit build_decl.  (Avoids crash in reload when optimizing.)
5520
5521 Thu Feb 25 21:05:04 1999  Per Bothner  <bothner@cygnus.com>
5522
5523         * decl.c (complete_start_java_method):  Handle synchronized method
5524         even when compiling from bytecode.
5525
5526 1999-02-26  Tom Tromey  <tromey@cygnus.com>
5527
5528         * gjavah.c (add_class_decl): Only generate `#include' if outer
5529         class is not the name of the class we are processing.  Correctly
5530         append `.h' in #include.
5531         (process_file): Clean up newlines around generated `#include's.
5532         (decode_signature_piece): Correctly handle inner classes.
5533         (struct include): New structure.
5534         (all_includes): New global.
5535         (print_include): New function.
5536         (add_class_decl): Use it.
5537         (process_file): Likewise.
5538         (add_class_decl): Generate include for java-array.h if array
5539         seen.
5540         (process_file): Don't generate java-array.h include.
5541
5542         * gjavah.c (add_namelet): Check for standard package names here.
5543         (add_class_decl): Don't check for standard package names here.
5544
5545 1999-02-25  Tom Tromey  <tromey@cygnus.com>
5546
5547         * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
5548         When reading a zip file, only use strncmp if both strings are
5549         bigger than the buffer length.  Initialize `k' when looping
5550         through zip file.
5551
5552 1999-02-24  Tom Tromey  <tromey@cygnus.com>
5553
5554         * gjavah.c (struct namelet): New structure.
5555         (add_namelet): New function.
5556         (print_namelet): New function.
5557         (print_class_decls): Use add_namelet and print_namelet to generate
5558         namespaces and not classes.
5559         (method_printed): New global.
5560         (HANDLE_END_METHOD): Examine method_printed.
5561         (print_method_info): Set method_printed when required.  Print
5562         error if function to be ignored is marked virtual.  Handle $finit$
5563         method.
5564         (METHOD_IS_FINAL): New macro.
5565         (print_field_info): Use it.
5566         (HANDLE_METHOD): Clear method_printed.
5567         (method_pass): New global.
5568         (HANDLE_END_FIELD): Call add_class_decl on the first pass.
5569         (process_file): Do two passes over both fields and methods.
5570         (HANDLE_METHOD): Examine method_pass.
5571         (root): New global.
5572         (add_class_decl): New function.
5573         (print_class_decls): Don't scan over entire constant pool.
5574
5575 1999-02-23  Tom Tromey  <tromey@cygnus.com>
5576
5577         * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
5578         disable linking in that case.
5579
5580 1999-02-20  Tom Tromey  <tromey@cygnus.com>
5581
5582         * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
5583         not 0x1f.
5584
5585 Sun Feb 21 14:56:11 1999  Per Bothner  <bothner@cygnus.com>
5586
5587         * decl.c (build_result_decl), java-tree.h:  New method.
5588         (complete_start_java_method):  Handle synchronized methods.
5589         Don't build DECL_RESULT here.  (Ordering dependency problem.)
5590         (start_java_method):  Call build_result_decl here instead  ...
5591         * parse.y (java_complete_expand_method):  ... and here.
5592         (expand_start_java_method): Don't call complete_start_java_method here.
5593         (java_complete_expand_method):  Call it here instead.
5594         * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
5595         * java-tree.h:  ... here.
5596
5597         * expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
5598         * parse.y (java_complete_lhs):  Don't call force_evaluation_order
5599         for ARRAY_REF - it doesn't work when array bounds are checked.
5600         (patch_array_ref):  Handle it here instead.
5601
5602         * jcf-write.c (generate_classfile):  Emit "Exceptions" attribute.
5603
5604 Fri Feb 19 15:35:01 1999  Per Bothner  <bothner@cygnus.com>
5605
5606         Force left-to-right evaluation of binary operations etc.
5607         * expr.c (force_evaluation_order), java-tree.h:  New function.
5608         * parse.y (java_complete_lhs):  Pass binary operations, procedure
5609         calls, and ARRAY_REFs to force_evaluation_order.
5610         (various):  Set TREE_SIDE_EFFECTS more carefully.
5611
5612         Tolerate random (non-UTF8) encoding in comments without complaining.
5613         * lex.c (java_read_char):  Return 0xFFFE if bad UTF8 encoding.
5614         (java_is_eol):  Handle '\r' followed by '\n' instead of vice versa.
5615
5616         * parse.y (resolve_qualified_expression_name):  Handle error_mark.
5617         (java_complete_node case EXPR_WITH_FILE_LOCATION):  Likewise.
5618
5619         * parse.y (java_complete_lhs):  Ignore an empty statement in a
5620         COMPOUND_EXPR.  Don't complain about empty statement after return.
5621
5622 Fri Feb 19 13:00:56 1999  Per Bothner  <bothner@cygnus.com>
5623
5624         * parse.y (obtain_incomplete_type):  Don't wrap unknown types
5625         in TREE_LIST - just chain the POINTER_TYPEs together.
5626         (resolve_class):  If type already resolved, return decl.
5627         After resolving, update TREE_TYPE(class_type), and name (if array).
5628         * parse.h (do_resolve_class), parse.y:  Make non-static.
5629         * class.c (maybe_layout_super_class):  Take this_class argument.
5630         Do do_resolve_class if necessary.
5631         (layout_class, layout_class_methods): Adjust calls appropriately.
5632         * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
5633         JDEP_RESOLVED_P):  Redefined for new TREE_LIST-less convention.
5634         * typeck.c (build_java_array_type):  Don't call layout_class.
5635
5636 Wed Feb 17 15:47:20 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5637
5638         * parse.y (check_pkg_class_access): Allow private class access
5639         within the same package.
5640         (strip_out_static_field_access_decl): New function.
5641         (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
5642         operator argument before testing its nature.
5643
5644 Wed Feb  3 12:38:43 1999  Per Bothner  <bothner@cygnus.com>
5645
5646         * java-tree.def (FINALLY_EXPR):  Removed.  (Now uses TRY_FINALLY_EXPR.)
5647         (TRY_EXPR):  Simplify - it no longer has a finally clause.
5648         * check-init.c (check_init):  Handle TRY_FINALLY_EXPR.
5649         Simpler handling of TRY_EXPR, which no longer has a finally clause.
5650         * expr.c (java_lang_expand_expr):  Likewise.
5651         * java-tree.h (CATCH_EXPR_GET_EXPR):  Removed - no longer needed.
5652         * parse.h (java_get_catch_block), parse.y:  Removed - no longer needed.
5653         * parse.y (java_complete_lhs):  Add support for TRY_FIANLLY_EXPR.
5654         (build_try_statement):  Remove finally parameter and handling.
5655         (build_try_finally_statement):  New function.
5656         (patch_try_statement):   No longer need to support finally clause.
5657         (try_statement):  Update grammar action rules.
5658         * jcf-write.c (generate_bytecode_insns):  Handle TRY_FINALLY_EXPR.
5659         Simpler handling of TRY_EXPR, which no longer has a finally clause.
5660
5661 1998-11-26  Andrew Haley  <aph@viagra.cygnus.co.uk>
5662
5663         * jcf-parse.c (get_constant): Add braces around computation of 'd'
5664         when REAL_ARITHMETIC is not defined.  [Oct 26 fix got overwritten -PB]
5665
5666 1999-02-17  Andrew Haley  <aph@cygnus.com>
5667
5668         * class.c (build_utf8_ref): Back out broken patch which was
5669         intended to to output signatures using '.' as a separator.
5670
5671         * class.c (make_class_data): Output signatures using '.' as a
5672         separator, rather than '/'.
5673         (mangled_classname): Likewise.
5674         (make_field_value): Likewise.
5675         (make_method_value): Likewise.
5676         * constants.c (alloc_class_constant): Likewise.
5677         * expr.c (build_invokeinterface): Likewise.
5678
5679 Thu Feb 11 21:25:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5680
5681         * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
5682         of an ancient workaround.
5683
5684 Wed Feb 10 23:27:33 1999  Jeffrey A Law  (law@cygnus.com)
5685
5686         * jvspec.c (xmalloc): Kill the prototype.  It does not belong
5687         here anymore.
5688
5689 1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5690
5691         * lex.c (yylex): Encode \0 as UTF8.
5692
5693 1999-02-10  Tom Tromey  <tromey@cygnus.com>
5694
5695         * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
5696         * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
5697         (libgcj_zip): Renamed.
5698         * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
5699         LIBJAVA_ZIP_FILE.
5700         (jcf_path_init): Use LIBGCJ_ZIP_FILE.
5701
5702         * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
5703         (GC_NAME): Renamed -lgc to -lgcjgc.
5704
5705 Tue Feb  9 19:31:09 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5706
5707         * lex.c (java_lang_cloneable): Initialize.
5708         * parse.y (java_lang_cloneable): New static variable.
5709         (qualify_ambiguous_name): Take CONVERT_EXPR into account when
5710         doing one more qualification round.
5711         (valid_ref_assignconv_cast_p): Reject null source or
5712         destination. Allow an array to be cast into java.lang.Cloneable.
5713         (patch_cast): Swapped two first arguments to first call to
5714         valid_ref_assignconv_cast_p.
5715
5716 Mon Feb  8 11:50:50 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5717
5718         * parse.h: DECL_P renamed JDECL_P.
5719         * parse.y: DECL_P replaced by JDECL_P.
5720         (build_array_from_name): Always use pointer's type.
5721         (patch_bc_statement): Extra code to search continue target in a
5722         for loop. Fixed comments. Continue target is current loop when
5723         unlabeled.
5724
5725 1999-02-05  Andrew Haley  <aph@cygnus.com>
5726
5727         * class.c (make_class_data): The superclass of an interface should
5728         be null, not class Object.
5729
5730         * lex.c (java_lex): Sign extend hex literals.
5731
5732 1999-02-04  Andrew Haley  <aph@cygnus.com>
5733
5734         * class.c (build_utf8_ref): Output signatures using '.' as a
5735         separator, rather than '/'.
5736         (make_class_data): Likewise.
5737
5738 Wed Feb  3 22:50:17 1999  Marc Espie <Marc.Espie@liafa.jussieu.fr>
5739
5740         * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
5741         mkstemp.o.  Get them from libiberty now.
5742
5743 Tue Feb  2 19:49:12 1999  Jeffrey A Law  (law@cygnus.com)
5744
5745         * jcf-io.c: Do not include sys/stat.h or sys/wait.h
5746
5747 Tue Feb  2 20:04:50 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5748
5749         * jvspec.c (xmalloc): Fix the prototype to match the one obtained
5750         from libiberty.h
5751
5752 Tue Feb  2 10:39:47 1999  Per Bothner  <bothner@cygnus.com>
5753
5754         Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
5755         * jcf-write.c (generate_bytecode_return):  New function.
5756         (generate_bytecode_insns):  Use it, for RETURN_EXPR.
5757
5758         * jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
5759         generate special [fd]const_[01] instructions.
5760
5761         * jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
5762
5763         * verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
5764         handling OPCODE_lookupswitch or OPCODE_tableswitch.
5765
5766 Mon Feb  1 20:44:47 1999  Per Bothner  <bothner@cygnus.com>
5767
5768         * parse.y (patch_method_invocation):  Handle calling static methods,
5769         even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
5770
5771         * parse.y (java_complete_lhs):  Don't complain about unreachable
5772         exit condition in a do-while statement.
5773
5774 Fri Jan 29 18:19:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5775
5776         * lex.c (java_read_char): Fixed utf8 decoding.
5777         (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
5778         range.
5779         * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
5780         comments. Local variable `all_primitive' is gone. Broadened
5781         acceptance of `0' to floating point targets. `long' can now be
5782         widened to `double' or `float'.
5783         (valid_method_invocation_conversion_p): Added leading
5784         comment. Fixed tabulation.
5785         (build_string_concatenation): Optimize out left or right empty
5786         string constants.
5787
5788 Thu Jan 28 18:51:26 1999  Per Bothner  <bothner@cygnus.com>
5789
5790         * jcf-write.c (localvar_alloc):  Only emit entry for
5791         LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
5792         (generate_bytecode_insns):  Only call put_linenumber if
5793         debug_info_level > DINFO_LEVEL_NONE.
5794         * jvspec.c (lang_specific_driver):  If no -O* or -g* option
5795         is specified, add -g1 (for compatibility wih javac).
5796
5797 Thu Jan 28 09:17:51 1999  Hans-Peter Nilsson  <hp@axis.se>
5798
5799         * java/Makefile.in: Add missing dependencies for jcf-dump.o,
5800         gjavah.o, check-init.o, jv-scan.o
5801
5802 Mon Feb  1 09:50:48 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5803
5804         * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
5805
5806         * gjavah.c: Include config.h and system.h.
5807
5808         * javaop.h (inline): Don't define, its handled by system.h.
5809         (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
5810         from `inline' to `static inline'.
5811
5812         * jcf.h (inline): Don't define, its handled by system.h.
5813
5814         * lex.c (inline): Likewise.
5815
5816 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
5817
5818         * lang-specs.h: Map -Qn to -fno-ident.
5819
5820 Fri Jan 29 16:51:56 1999  Richard Henderson  <rth@cygnus.com>
5821
5822         * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
5823
5824 1999-01-29  Tom Tromey  <tromey@cygnus.com>
5825
5826         * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
5827         then cast it to Object before calling `append' method.
5828
5829 Thu Jan 28 14:45:39 1999  Per Bothner  <bothner@cygnus.com>
5830
5831         * check-init.c (check_bool2_init, check_bool_init, check_init):
5832         Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
5833         * jcf-write.c (generate_bytecode_insns):  Likewise.
5834
5835 Thu Jan 28 11:50:11 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5836
5837         * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
5838         * parse.y (patch_cast): Allow a boolean to be cast into a
5839         boolean.
5840
5841 Wed Jan 27 10:19:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5842
5843         * parse.y: (class_declaration:): Fixed indentation.
5844         (class_member_declaration:): Extra `;' after field declaration now
5845         accepted.
5846         (interface_declaration:): Removed debug messages in error reports.
5847         (patch_binop): Nodes created and returned inherit the orignal
5848         node's COMPOUND_ASSIGN_P flag value.
5849         (patch_cast): Fix cast from char to floating point.
5850
5851 Mon Jan 25 17:39:19 1999  Andrew Haley  <aph@cygnus.com>
5852
5853         * except.c, java-except.h (expand_resume_after_catch): new
5854         function.
5855         * expr.c (java_lang_expand_expr): call expand_resume_after_catch
5856         to branch back to main flow of control after a catch block.
5857
5858 Sat Jan 23 23:02:43 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5859
5860         * Makefile.in (parse.o): Depend on $(CONFIG_H) and
5861         $(srcdir)/../system.h.
5862         (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
5863         (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
5864         (jcf-write.o): Likewise.
5865         (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5866         (mangle.o): Depend on $(srcdir)/../toplev.h.
5867         (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5868         (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
5869
5870         * class.c: Include output.h and parse.h.
5871         (mangled_classname): Add the `const' keyword to a char*.
5872         (find_named_method): Hide unused function definition.
5873         (build_utf8_ref): Change type of variable `c' to unsigned char.
5874         Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
5875         (build_class_ref): Add the `const' keyword to a char*.
5876         (layout_class_method): Remove unused variable `buf'.
5877
5878         * decl.c (find_local_variable): Remove unused variable `rtl'.
5879         (pushdecl): Likewise for variables `different_binding_level' and
5880         `oldglobal'.
5881         (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
5882         (maybe_build_cleanup): Likewise for parameter `decl'.
5883
5884         * except.c (expand_start_java_handler): Mark parameter `range'
5885         with ATTRIBUTE_UNUSED.
5886
5887         * expr.c: Include except.h.
5888         (pop_type): Remove unused variable `i'.
5889         (pop_value): Likewise for variables `n_words' and `i'.
5890         (expand_java_arrayload): Likewise for variable `convert'.
5891         (java_lang_expand_expr): Likewise for variables `op0', `type',
5892         `mode', `unsignedp', `node' and `elements'.
5893         (expand_byte_code): Likewise for variables `prev_eh_ranges' and
5894         `eh_ranges'.
5895         (process_jvm_instruction): Add a `const' qualifier to a char*.
5896
5897         * gjavah.c (output_directory): Add the `const' keyword to a char*.
5898         (temp_directory): Likewise.
5899         (print_c_decl): Likewise.
5900         (print_method_info): Likewise.
5901         (decode_signature_piece): Likewise.
5902         (print_mangled_classname): Likewise.
5903
5904         * java-except.h: Provide prototypes for maybe_start_try,
5905         maybe_end_try and add_handler.
5906
5907         * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
5908         (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
5909         (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
5910         init_expr_processing, push_super_field, init_class_processing,
5911         can_widen_reference_to, class_depth, verify_jvm_instructions,
5912         maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
5913         set_local_type, merge_type_state, push_type, load_type_state,
5914         add_interface, find_in_current_zip, append_gpp_mangled_classtype,
5915         emit_unicode_mangled_name): Add prototypes.
5916
5917         * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
5918         (print_signature_type): Use ISDIGIT, not isdigit.
5919         (print_signature): Remove unused variable `j'.
5920
5921         * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
5922         int when comparing against one.
5923
5924         * jcf-parse.c: Include toplev.h.
5925
5926         * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
5927         (localvar_free): Remove unused variable `i'.
5928         (generate_bytecode_conditional): Likewise for variable `kind'.
5929
5930         * jv-scan.c: Include config.h and system.h.  Remove redundant
5931         OS header and gansidecl.h includes.
5932         (warning): Add the `const' keyword to a char*.  Also add
5933         ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
5934         __STDC__, when determining whether to use ANSI-isms.
5935         (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
5936         (xmalloc): Don't redundantly prototype here.
5937         (main): Remove unused parameter `envp'.  Also fix the arguments
5938         passed to function `fatal' to match the format specifier.
5939
5940         * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
5941
5942         * mangle.c: Include toplev.h.
5943         (emit_unicode_mangled_name): Declare parameter `len'.
5944
5945         * parse.y (parse_warning_context): Add the `const' keyword to a
5946         char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
5947         `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
5948         (issue_warning_error_from_context): Add the `const' keyword to
5949         a char*.
5950         (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
5951         not `__STDC__' for whether to use ANSI-isms.
5952
5953         * typeck.c (incomplete_type_error): Mark parameters `value' and
5954         `type' with ATTRIBUTE_UNUSED.
5955         (parse_signature_type): Use ISDIGIT, not isdigit.
5956
5957         * verify.c (check_pending_block): Add the `const' keyword to a char*.
5958         (verify_jvm_instructions): Likewise.  Remove unused variables
5959         `field_name' and `default_val'.
5960
5961         * zextract.c: Include config.h and system.h.  Remove redundant
5962         OS header includes.
5963
5964         * zipfile.h: Prototype `read_zip_archive'.
5965
5966 Thu Jan 21 16:00:06 1999  Andrew Haley  <aph@cygnus.com>
5967
5968         * typeck.c (convert): Allow conversions to void type: some
5969         optimizations in gcc do this.
5970
5971 Thu Jan 21 15:21:49 1999  Andrew Haley  <aph@cygnus.com>
5972
5973         * typeck.c (convert_ieee_real_to_integer): New function.
5974         (convert): When not using fast-math and using hardware fp, convert
5975         an IEEE NaN to zero.
5976
5977 1999-01-18  Andrew Haley  <aph@cygnus.com>
5978
5979         * parse.y (patch_binop): Do a type conversion from signed to
5980         unsigned and then back to signed when a ">>>" is found.
5981
5982 Sun Jan 17 22:34:22 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5983
5984         * java-tree.h: (check_for_initialization): Added prototype.
5985         * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
5986         * parse.y (do_resolve_class): Removed unused locals.
5987         (read_import_dir): Likewise.
5988         (resolve_qualified_expression_name): Array creation
5989         expressions are valid primary expressions.
5990         (qualify_ambiguous_name): Likewise.
5991         (patch_synchronized_statement): Removed unused local.
5992
5993 Sun Jan 17 21:55:42 1999  Jeffrey A Law  (law@cygnus.com)
5994
5995         * Makefile.in (zextract.o): Add dependencies.
5996
5997         * Makefile.in: Do not put ^Ls at the start of a line.
5998
5999 Fri Jan 15 20:16:20 1999  Per Bothner  <bothner@cygnus.com>
6000
6001         * expr.c (process_jvm_instruction):  Coerce to correct Throwable
6002         sub-type the result of the call that gets the exception value.
6003
6004         * parse.y (java_complete_expand_methods):  If flags_syntax_only,
6005         don't call finish_class.
6006
6007         * parse.y (java_check_regular_methods):  If METHOD_PRIVATE,
6008         clear found before continuing.
6009
6010         * verify.c (verify_jvm_instructions):  On an array load, allow
6011         and handle top of stack to be TYPE_NULL.
6012
6013         * gjavah.c (generate_access):  Translate Java package private or
6014         protected access to C++ public, but with a comment.
6015
6016 1999-01-13  Andrew Haley  <aph@cygnus.com>
6017
6018         * expr.c (generate_name): Name prefix changed to avoid clashes
6019         with assembler temp labels.
6020
6021         * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
6022         MODIFY_EXPR.  Without this, code for the assignement may not be
6023         generated at all and the synchronized statement will read an
6024         uninitialized variable.
6025
6026 Wed Jan 13 01:24:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6027
6028         * class.c (maybe_layout_super_class): Fixed returned value.
6029         * lex.c: Added 1999 to the copyright.
6030         (java_init_lex): Initialize java_lang_imported.
6031         * lex.h: Added 1999 to the copyright.
6032         * parse.h: Added 1999 to the copyright.
6033         (REGISTER_IMPORT): Fixed typo in trailing macro.
6034         (CURRENT_OSB): New macro.
6035         (struct parser_ctxt): New fields osb_depth, osb_limit.
6036         * parse.y (java_lang_id): New global variable.
6037         (type_import_on_demand_declaration): Don't import java.lang.* twice.
6038         (array_creation_expression:): Use CURRENT_OSB.
6039         (dims:): Uses a stack to keep track of array dimensions.
6040         (cast_expression:): Use CURRENT_OSB.
6041         (find_expr_with_wfl): Return NULL if node found doesn't meet the
6042         conditions.
6043         (register_fields): Fixed typos in comment.
6044         (check_method_redefinition): Fixed comment indentation.
6045         (java_check_regular_methods): Set saved found wfl to NULL after
6046         having reinstalled it in the previously found DECL_NAME.
6047
6048 Sun Jan 10 13:36:14 1999  Richard Henderson  <rth@cygnus.com>
6049
6050         * gjavah.c (java_float_finite): Use a union to do type punning.
6051         (java_double_finite): Likewise.
6052
6053 Sat Jan  9 11:25:00 1999  Per Bothner  <bothner@cygnus.com>
6054
6055         * parse.y (build_new_array_init):  Don't set EXPR_WFL_LINECOL
6056         on CONSTRUCTOR (since that trashes TREE_CST_RTL).
6057         (patch_new_array_init):  Clear TREE_CONSTANT also if INDIRECT_REF.
6058         (register_fields):  Set TREE_STATIC on NEW_ARRAY_INIT, not on
6059         CONSTRUCTOR (which causes expand_expr to call output_constant_def).
6060         * expr.c (java_lang_expand_expr):  Check TREE_STATIC of NEW_ARRAY_INIT.
6061
6062 Fri Jan  8 15:48:03 1999  Per Bothner  <bothner@cygnus.com>
6063
6064         * check-init.c (check_init):  If compiling to native, we don't
6065         see THROW_EXPR.  Instead, look for a call to throw_node (_Jv_Throw).
6066
6067 1999-01-08  Tom Tromey  <tromey@cygnus.com>
6068
6069         * parse-scan.y (variable_declarator_id): Set or increment
6070         bracket_count.
6071         (bracket_count): New global.
6072         (formal_parameter): Handle case where bracket pairs trail variable
6073         declarator id.
6074
6075 1999-01-07  Andrew Haley  <aph@viagra.cygnus.co.uk>
6076
6077         * jcf-parse.c (yyparse): variable len changed from a char to an
6078         int to prevent overflow.
6079
6080 Wed Jan  6 17:19:46 1999  Per Bothner  <bothner@cygnus.com>
6081
6082         * java-tree.h:  Declare read_class.
6083         * jcf-parse.c (read_class):  New function.
6084         (load_class):  Now just call read_class.
6085
6086         * java-tree.h (java_parse_abort_on_error):  Only return if new errors.
6087         * jcf-parse.c (parse_source_file):  Declare save_error_count,
6088         which is needed by java_parse_abort_on_error macro,
6089         * parse.y (java_layout_classes, java_expand_classes):  Likewise.
6090
6091         * parse.y (register_fields):  Set TREE_STATIC flag of NEW_ARRAY_INIT
6092         constructor, if initializing a static field.
6093         (patch_new_array_init):  Set TREE_CONSTANT if it is.
6094         * expr.c (java_lang_expand_expr):  For a static array constructor
6095         of primitive elements, allocate the array itself statically.
6096         Disabled until we can set the vtable field statically.
6097
6098         * check-init.c:  New file.  Checks for definite assignment.
6099         * Makefile.in (JAVA_OBJS):  Add check-init.o.
6100         * parse.y (java_complete_expand_method): Call check_for_initialization.
6101         * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY):  Moved to java-tree.h.
6102
6103 Wed Jan  6 14:53:10 1999  Graham <grahams@rcp.co.uk>
6104
6105         * parse.y : include system.h instead of including
6106         standard headers directly with the exception of <dirent.h>.
6107
6108 Wed Jan  6 16:20:06 1999  Per Bothner  <bothner@cygnus.com>
6109
6110         * lex.h:  Moved static function declarations to lex.c,
6111         to shut up some -Wall warnings.
6112         * lex.c:  Static function declarations moved here.
6113         * jcf-dump.c:  Small fixes to shut up -Wall warnings.
6114
6115 Tue Jan  5 22:15:40 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6116
6117         * Make-lang.in ($(GCJ).o): Depend on prefix.h.
6118
6119 Tue Dec 22 11:25:19 1998  Per Bothner  <bothner@cygnus.com>
6120
6121         * expr.c (process_jvm_instruction):  Do load_type_state after JSR.
6122         * verify.c (verify_jvm_instructions):  Fix off-by-one error.
6123
6124         * jcf-write.c (CHECK_PUT):  Add (void) cast to avoid -Wall warnings.
6125         (localvar_alloc):  Change return type to void,
6126         (emit_unop):  Remove unused variable size.
6127
6128         * jcf-write.c (struct jcf_block):  Add new union.
6129         (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC):  New macros.
6130         (call_cleanups):  New functions.
6131         (struct jcf_partial):  New fields num_finalizers and return_value_decl.
6132         (generate_bytecode_insns):  Support CLEANUP_POINT_EXPR and
6133         WITH_CLEANUP_EXPR.  Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
6134         * lang.c (lang_init):  Call using_eh_for_cleanups.
6135         * parse.y (java_complete_lhs):  For SYNCHRONIZED_EXPR, defer
6136         completing operands to patch_synchronized_statement.
6137         Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
6138         (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
6139         WITH_CLEANUP_EXPR instead of TRY_EXPR.
6140
6141 Sun Dec 20 16:15:44 1998  John F. Carr  <jfc@mit.edu>
6142
6143         * Make-lang.in: Comment out control-Ls; they upset some makes.
6144
6145 1998-12-18  Tom Tromey  <tromey@cygnus.com>
6146
6147         * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
6148         consistently.
6149
6150 1998-12-17  Tom Tromey  <tromey@cygnus.com>
6151
6152         * parse.y (DIR_SEPARATOR): New define.
6153         (check_class_interface_creation): Use it.
6154
6155         * parse-scan.y (report_main_declaration): Recognize
6156         `java.lang.String' in argument to main.
6157
6158 Wed Dec 16 16:18:59 1998  Per Bothner  <bothner@cygnus.com>
6159
6160         * parse.y (create_interface):  Remove bogus test.
6161
6162 Wed Dec 16 14:42:19 1998  Per Bothner  <bothner@cygnus.com>
6163
6164         * jcf-parse.c (get_constant):  Set TREE_TYPE for string constants.
6165         (HANDLE_CONSTANTVALUE):  If flag_emit_class_files, call get_constant.
6166
6167 1998-12-16  Tom Tromey  <tromey@cygnus.com>
6168
6169         * parse-scan.y (qualified_name): Use correct sprintf format.
6170
6171 1998-12-15  Tom Tromey  <tromey@cygnus.com>
6172
6173         * gjavah.c (print_field_info): Changed how most negative number is
6174         printed.
6175
6176 Mon Dec 14 18:49:29 1998  Per Bothner  <bothner@cygnus.com>
6177
6178         * parse.y (fold_constant_for_init):  New function.
6179         (resolve_expression_name):  Don't replace static final
6180         constant-initialized fields by its value.
6181         (java_complete_lhs):  New.  Same as java_complete_tree, except does
6182         not replace static final constant-initialized fields by their values.
6183         (register_fields):  If there is an initializer, set DECL_INITIAL and
6184         MODIFY_EXPR_FROM_INITIALIZATION_P.
6185         (java_complete_tree):  For MODIFY_EXPR, use java_complete_lhs for lhs.
6186         Only call patch_initialized_static_field if
6187         MODIFY_EXPR_FROM_INITIALIZATION_P.
6188         (patch_initialized_static_field):  If not valid constant, clear
6189         DECL_INITIAL.
6190
6191         * parse.y (lookup_field_wrapper):  Fix thinko.
6192
6193         * parse.y (java_complete_tree):  In EXPR_WITH_FILE_LOCATION,
6194         set and restore global lineno.
6195
6196 1998-12-14  Tom Tromey  <tromey@cygnus.com>
6197
6198         * gjavah.c (print_field_info): If value to print is the smallest
6199         value of its size, then print as hex to avoid later warnings from
6200         C++ compiler.
6201
6202 1998-12-14  Tom Tromey  <tromey@cygnus.com>
6203
6204         * gjavah.c (decompile_method): Decompile `return null'.
6205         (process_file): Generate `#pragma interface'.
6206         (method_declared): New global.
6207         (print_method_info): Set it.
6208         (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
6209         (print_method_info): Handle abstract methods.
6210
6211 Sun Dec 13 17:31:40 1998  Per Bothner  <bothner@cygnus.com>
6212
6213         * parse.y (patch_method_invocation):  If class_decl is null
6214         (e.g. an array type), use original type.
6215
6216         * parse.y (check_thrown_exceptions):  Temporary hack to suppress
6217         errors about uncaught exception from clone (of array, specifically).
6218
6219 1998-12-13  Tom Tromey  <tromey@cygnus.com>
6220
6221         * gjavah.c (decompile_method): Handle all types of `return'
6222         opcode.  Decompile `return this' and `return'.
6223         (method_access): New global.
6224         (print_method_info): Set it.
6225         (decompile_method): Don't decompile a synchronized method.
6226
6227 1998-12-13  Tom Tromey  <tromey@cygnus.com>
6228
6229         * jcf-reader.c (jcf_parse_one_method): Recognize
6230         HANDLE_END_METHOD.
6231         * gjavah.c (HANDLE_END_METHOD): New macro.
6232         (HANDLE_CODE_ATTRIBUTE): New macro.
6233         (decompile_method): New function.
6234         (print_method_info): Don't print `;\n' at end of function decl.
6235         Include java-opcodes.h.
6236         (decompiled): New global.
6237
6238 Sat Dec 12 20:13:19 1998  Per Bothner  <bothner@cygnus.com>
6239
6240         * class.c (build_class_ref):  Handle PRIMTYPE.class if
6241         flag_emit_class_files.
6242         * expr.c (expand_java_field_op):  Don't optimize java.lang.XXX.TYPE
6243         if flag_emit_class_files.
6244         * parse.y (java_complete_tree):  Pre-liminary support for
6245         COMPONENT_REF - only to handle PRIMCLASS.TYPE.
6246
6247         * parse.y (patch_synchronized_statement):   Don't call monitorexit
6248         unless block CAN_COMPLETE_NORMALLY.  Propagate that flag properly.
6249
6250         * java-tree.h (DECL_LOCAL_STATIC_VALUE):  Removed - no longer used.
6251
6252         * zipfile.h (opendir_in_zip):  New declaration.
6253         * jcf-io.c (saw_java_source):  Moved to jcf-parse.c.
6254         (opendir_in_zip):  New function, using code from open_in_zip.
6255         (open_in_zip):  Call opendir_in_zip.
6256         (find_class):  Remove no-longer-used do_class_file parameter,
6257         but add source_ok parameter.  Change logic so if we find a .java file,
6258         we don't look for .class in later classpath emtries.
6259         * jcf-parse.c (load_class):  Pass saw_java_source to find_class.
6260         (jcf_figure_file_type):  Only call open_in_zip if correct magic number.
6261         * gjavah.c: Update call to find_class.
6262         * jcf-dump.c:  Likewise.
6263
6264         * jcf-write.c (put_linenumber):  Handle duplicate line numbers.
6265         (generate_bytecode_insns):  For EXPR_WITH_FILE_LOCATION, do
6266         nothing if body is empty_stmt_node.
6267         Various little fixes so SP gets correctly adjusted.
6268         For NEW_ARRAY_INIT, handle IGNORE_TARGET.
6269         For CALL_EXPR, test if static first.
6270         (generate_classfile):  Ignore fields that are DECL_ARTIFICIAL,
6271         such as the ones we create for Object and Class.
6272         Set and restore current_function_decl.
6273         * parse.y:  Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
6274         (note_possible_classname):  New function.
6275         (read_import_entry):  Removed.  Merged with read_import_dir.
6276         (read_import_dir):  Don't call find_class - that only gives us
6277         the first classpath entry having the needed package.
6278         Use the struct buffer data structure from buffer.h.
6279         (read_import_dir, find_in_imports_on_demand):  The remembered
6280         class names now use '.' (not '/') as package separator.
6281
6282         * parse.y (java_complete_expand_methods):  Call write_classfile
6283         here, and not in java_expand_classes (which only gets first class).
6284
6285 Sat Dec 12 19:46:04 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6286
6287         * parse.y (<type_declaration>):  Do maybe_generate_clinit last.
6288         (register_fields):  If a static fields has an initializer, just
6289         chain it on ctxp->static_initialized, and handle later.
6290         (java_complete_expand_methods):  Force <clinit> first.
6291         (resolve_expression_name, resolve_field_access):  Just get DECL_INITIAL
6292         - it's already been completed.
6293         (patch_initialized_static_field):  New function.
6294         (java_complete_field):  Call it.
6295
6296 Sat Dec 12 19:21:11 1998  Per Bothner  <bothner@cygnus.com>
6297
6298         * expr.c (encode_newarray_type, build_new_array):  New functions.
6299         * java-tree.h:  Declare build_new_array.
6300         * jcf-write.c (patch_newarray):  Use build_new_array.
6301
6302         * expr.c (java_lang_expand_exp):  Support NEW_ARRAY_INIT.
6303         * jcf-write.c (generate_bytecode_insns):  Support NEW_ARRAY_INIT.
6304
6305         * parse.y (patch_new_array_init):  Re-organize.
6306         Now is passed the actual array (pointer) type of the value.
6307         Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
6308         (patch_array_constructor):  Removed - merged into patch_new_array_init.
6309         (java_complete_tree):  Update patch_new_array_init.
6310
6311         * jcf-write.c (find_constant_index):  New function.
6312         (generate_bytecode_insns):  Use find_constant_index.
6313         (generate_classfile):  Use find_constant_index for ConstantValue.
6314
6315 1998-12-11  Tom Tromey  <tromey@cygnus.com>
6316
6317         * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
6318         * decl.c (init_decl_processing): Renamed dtable -> vtable.
6319         * class.c (make_class_data): Renamed dtable -> vtable, and
6320         dtable_method_count -> vtable_method_count.
6321
6322 Thu Dec 10 20:00:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6323
6324         * decl.c (long_zero_node, float_zero_node, double_zero_node): New
6325         global variables, initialized.
6326         * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
6327         Declared new global variables.
6328         * lex.c (java_lex): Return long_zero_node, float_zero_node,
6329         double_zero_node, integer_zero_node upon direct matching.
6330         * parse.y (purify_type_name): Added function prototype.
6331         (duplicate_declaration_error_p): Consider new_type as potentially
6332         being a incomplete type. Use purify_type_name on type string.
6333         (method_header): saved_type: unused variable removed. Don't figure
6334         return type if method name is invalid.
6335         (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
6336         processed by patch_unaryop.
6337         (patch_unaryop): Fixed typo in comment. Re-convert pre/post
6338         increment/decrement node into its original type after binary
6339         numeric promotion on its operands.
6340
6341 Thu Dec 10 11:02:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6342
6343         * parse.y (array_initializer:): Array init operand is NULL_TREE
6344         instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
6345         now an error. Fixed indentation problems.
6346         (patch_string): Handle error_mark_node as an argument.
6347         (patch_new_array_init): Fixed indentation problems.
6348         (array_constructor_check_entry): Removed check on null wfl_value.
6349         Return an error if wfl_value's walk returns an error.
6350
6351 Wed Dec  9 15:37:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6352
6353         * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
6354         * lex.c (java_lex): Remember column position before advancing one
6355         token. Retain location information on OCB_TK.
6356         * lex.h (typedef struct java_lc): Added new field.
6357         * parse.h (GET_SKIP_TYPE): New macro.
6358         (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
6359         * parse.y (build_new_array_init, patch_new_array_init,
6360         patch_array_constructor, maybe_build_array_element_wfl,
6361         array_constructor_check_entry): New function prototypes.
6362         (switch_block:): Tagged <node>.
6363         (OCB_TK): Tagged <operator>.
6364         (array_initializer:): Installed actions.
6365         (variable_initializer): Build location information on element if
6366         necessary.
6367         (switch_statement:): Fixed indentation typo.
6368         (switch_block:): Redefined default action.
6369         (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
6370         (patch_assignment): Removed duplicate code.
6371         (maybe_build_array_element_wfl, build_new_array_init,
6372         patch_new_array_init, patch_array_constructor,
6373         array_constructor_check_entry): New functions.
6374
6375 Mon Dec  7 15:13:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6376
6377         * parse.y (array_initializer): Tagged <node>.
6378         (variable_initializer:): Use default rule.
6379         (array_initializer:): Defined actions.
6380         (variable_initializers:): Likewise.
6381         (resolve_qualified_expression_name): Use DECL_CONTEXT to build
6382         non-static field accesses.
6383         (patch_invoke): Fixed indentation typo.
6384         (java_complete_tree): Likewise.
6385         (build_labeled_block): Changed leading comment. Generate an error
6386         in case of duplicate loop labels.
6387         (patch_conditional_expr): Patch results of string concatenation
6388         operations.
6389
6390 Sun Dec  6 13:45:00 1998  Per Bothner  <bothner@cygnus.com>
6391
6392         * constants.c (find_methodref_index):  When the class is an interface,
6393         generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
6394
6395         * decl.c (finit_identifier_node):  Use "$finit$", rather than
6396         "<finit>" (which Sun's verifier rejects).
6397         * parse.y (maybe_generate_finit):  Leave out meaningless final flag.
6398         (generate_field_initialization_code):  Removed.
6399         (fix_constructors)  Don't add call to $finit$ here (wrong order).
6400         (patch_method_invocation):  Add $finit$ call here.
6401
6402         * java-tree.h (CALL_USING_SUPER):  New macro.
6403         * parse.y (patch_invoke):  Remove im local variable.
6404         (patch_method_invocation, patch_invoke):  Don't pass super parameter.
6405         (patch_invoke):  Use CALL_USING_SUPER instead of from_super parameter.
6406         (resolve_qualified_expression_name):  Maybe set CALL_USING_SUPER.
6407
6408         * jcf-write.c (get_access_flags):  Fix typo ACC_PUBLIC -> ACC_FINAL.
6409
6410         * parse.y (java_complete_tree):  Don't complain about unreachable
6411         statement if it is empty_stmt_node.
6412
6413         * jcf-write.c (find_constant_wide):  New function.
6414         (push_long_const):  Use find_constant_wide.
6415
6416         * jcf-write.c (generate_bytecode_insn):  Fix bug in switch handling.
6417         (generate_bytecode_insn):  Use correct dup variant for MODIFY_EXPR.
6418         Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
6419         Emit invokeinterface when calling an interface method.
6420         Emit invokespecial also when calling super or private methods.
6421
6422         * jcf-write.c (generate_classfile):  Emit ConstantValue attributes.
6423
6424 Sun Dec  6 13:21:18 1998  Per Bothner  <bothner@cygnus.com>
6425
6426         * jcf-dump.c (INVOKE):  If invokeinterface, print number of args.
6427
6428 Thu Dec  3 17:11:12 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6429
6430         * java-tree.h (java_layout_seen_class_methods): New function
6431         prototype.
6432         (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
6433         * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
6434         * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
6435         * parse.y (method_declarator:): Defined action.
6436         (issue_warning_error_from_context): input_filename saved, set to
6437         the appropriate value and restored after java_error is called.
6438         (build_unresolved_array_type): Fixed comment.
6439         (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
6440         (method_header): Deal with return type the same way type are
6441         handled for fields and method's parameters and local variables
6442         types are handled.
6443         (check_method_redefinition): Removed extra CR.
6444         (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
6445         (java_layout_seen_class_methods): New function.
6446         (java_layout_classes): Call java_layout_seen_class_methods.
6447
6448 Thu Dec  3 15:56:50 1998  Per Bothner  <bothner@cygnus.com>
6449
6450         * parse,y (patch_synchronized_statement):  Set CAN_COMPLETE_NORMALLY.
6451
6452 Thu Dec  3 15:08:30 1998  Per Bothner  <bothner@cygnus.com>
6453
6454         * jcf-dump.c (main):  Fix error message.
6455         * jcf-path.c (add_entry):  Style fix.
6456
6457 Wed Dec  2 15:52:25 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6458
6459         * class.c (layout_class_method): Call build_java_argument_signature
6460         on constructors too.
6461         * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
6462         (patch_method_invocation): Define a primary when resolving an
6463         expression name. Augmented comment on code checking illegal `this'
6464         usage. Loosened it test by accepting NEW_CLASS_EXPR.
6465
6466 Tue Dec  1 13:53:24 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6467
6468         * class.c (layout_class_method): Don't report error on non-static
6469         overriding static if the method is private.
6470         * java-tree.h (finish_class): Prototype added.
6471         * lex.c (java_get_line_col): Handle col argument -2 value.
6472         * parse.h: All static method declarations moved to parse.y.
6473         * parse.y: Now contains all static method declarations previously
6474         found in parse.h.
6475         (find_expr_with_wfl, missing_return_error,
6476         unreachable_stmt_error): New functions.
6477         (java_get_real_method_name): Identify constructors bearing class
6478         names in source code compiled classes only.
6479         (java_complete_expand_methods): Call missing_return_error.
6480         (invocation_mode): Private methods invoked as static methods.
6481         (java_complete_tree): Call unreachable_stmt_error.
6482
6483 1998-12-01  Tom Tromey  <tromey@cygnus.com>
6484
6485         * Makefile.in (+target): Removed.
6486         (+xmake_file): Likewise.
6487         (+tmake_file): Likewise.
6488         (.NOEXPORT): Removed duplicate.
6489
6490 Fri Nov 27 13:20:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6491
6492         * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
6493
6494         * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
6495
6496         * jvgenmain.c: Remove the xmalloc prototype, we get it from
6497         libiberty.h.  Provide an xmalloc definition.
6498
6499         * jvspec.c: Remove the xmalloc prototype.
6500
6501         * parse-scan.y: Include config.h and system.h.  Don't include
6502         OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
6503         Provide an xstrdup definition.
6504
6505 Thu Nov 26 22:03:58 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
6506
6507         * jcf-path.c (add_entry): Recognize ".jar" too.
6508         * lang-specs.h: Likewise.
6509
6510 Thu Nov 26 12:44:07 1998  Per Bothner  <bothner@cygnus.com>
6511
6512         * jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
6513         soft_monitorenter_node, soft_monitorexit_node, throw_node.
6514
6515         * jcf-write.c (generate_bytecode_insns):
6516         Handle pre/post-increment/decrement of long.
6517
6518         * jcf-write.c (generate_bytecode_insns):
6519         Handle missing exception handler (finally for synchronized).
6520
6521 Wed Nov 25 09:47:15 1998  Per Bothner  <bothner@cygnus.com>
6522
6523         * java-tree.h (end_params_node):  Declare global.
6524         * decl.c (end_params_node):  New global.
6525         (init_decl_processing, start_java_method):  Use end_params_node for
6526         end of list of parameter types.  Follows correct gcc conventions.
6527         * expr.c (pop_argument_types, pop_arguments):  Likewise.
6528         * lang.c (put_decl_node):  Likewise.
6529         * typeck.c (various places):  Likewise.
6530         * class.y (various places):  Likewise.
6531         * parse.y (various places):  Likewise.
6532
6533         * parse.y (java_complete_tree):  Move CAN_COMPLETE_NORMALLY.
6534         (build_jump_to_finally):  Add missing CAN_COMPLETE_NORMALLY.
6535
6536         * class.c:  Add #include flags.h, remove no-longer needed declaration.
6537
6538         * class.c (layout_class_method):  Remove commented-out code, re-format.
6539         Don't add vtable entry (or index) for private methods.
6540         * expr.c (expand_invoke):  A private method is implicitly final.
6541         * class.c (make_class_data):  If inlining or optimizing,
6542         skip private methods.
6543
6544         * class.c (finish_class):  New function.  Calls existing methods,
6545         but alls emits deferred inline functions.
6546         * jcf-parse.c (parse_class_file):  Call finish_class.
6547         * parse.y (java_complete_expand_methods):  Likewise.
6548
6549         * expr.c (build_java_binop):  Explicit default, to silence -Wall.
6550
6551         * expr.c (CHECK_PC_IN_RANGE):  Add void cast to kill warnings.
6552
6553 Wed Nov 25 00:50:58 1998  Marc Espie <espie@quatramaran.ens.fr>
6554
6555         * jcf-write.c (generate_bytecode_conditional): Fix typo.
6556
6557 Tue Nov 24 17:06:38 1998  Per Bothner  <bothner@cygnus.com>
6558
6559         * (generate_classfile): Always write class access flag with
6560         ACC_SUPER set.
6561
6562 Tue Nov 24 16:34:33 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6563
6564         * class.c (maybe_layout_super_class): New function.
6565         (layout_class): Reorganized. Loop on class methods dispatched into
6566         a new function. Call maybe_layout_super_class.
6567         (layout_class_methods, layout_class_method): New functions.
6568         * expr.c (expand_java_NEW): Call layout_class_methods on loaded
6569         class.
6570         (expand_invoke): Likewise.
6571         * java-tree.h (all_class_list): New global variable declared.
6572         (layout_class_methods, layout_class_method): New function
6573         prototypes.
6574         (LAYOUT_SEEN_CLASS_METHODS): New macro.
6575         * jcf-parse.c (all_class_list): New global variable.
6576         (load_class): Extended what class_or_name can be. Use parser
6577         context mechanism to save globals before calling jcf_parse.
6578         (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
6579         is set on the file name.
6580         (jcf_parse): Layout class methods when Object is loaded, otherwise
6581         record class in all_class_list for delayed method layout.
6582         (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
6583         * lang.c (put_decl_node): Decode <init> into the decl context
6584         class name.
6585         * lex.c (java_allocate_new_line): Use xmalloc.
6586         * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
6587         pointers, not TREE_LIST elements.
6588         (struct parser_ctxt): Fixed comment indentations, added comments
6589         and reordered some fields.
6590         (java_check_methods): Function prototype removed.
6591         * parse.y (java_push_parser_context): Use xmalloc.
6592         (java_parser_context_restore_global): Pop extra pushed ctxp only
6593         when there's nothing next.
6594         (maybe_create_class_interface_decl): Fixed comment, add new
6595         created class decl to all_class_list.
6596         (method_header): Use GET_REAL_TYPE on argument's types.
6597         (method_declarator): Use GET_REAL_TYPE, change type to the real
6598         type in TREE_LIST dependency node. Build argument list with the
6599         real type.
6600         (create_jdep_list): Use xmalloc. Removed allocation error message.
6601         (obtain_incomplete_type): Fixed leading comment. Broadened
6602         incoming argument meaning.
6603         (register_incomplete_type): Use xmalloc. Removed allocation error
6604         message.
6605         (safe_layout_class): Fixed leading comment.
6606         (jdep_resolve_class): Reversed if statement condition and switch
6607         if and else bodies.
6608         (resolve_and_layout): Fixed leading comment. Broadened incoming
6609         argument meaning.
6610         (complete_class_report_errors): New local variable name, for
6611         clarity. purify_type_name used for all error cases.
6612         (java_get_real_method_name): Stricter check on constructors.
6613         (java_check_regular_methods): Reverse methods list only if not
6614         already laid out. Layout artificial constructor.
6615         (java_check_methods): Deleted.
6616         (source_start_java_method): Obtain incomplete type for patchable
6617         method arguments.
6618         (java_layout_classes): Fixed leading comment. Use
6619         LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
6620         statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
6621         before returning. Fixed comments.
6622         (java_expand_classes): Check for errors up front.
6623         (patch_method_invocation): Class to search is resolved and laid
6624         out.
6625
6626 Tue Nov 24 12:57:13 1998  Per Bothner  <bothner@cygnus.com>
6627
6628         * expr.c (java_lang_expand_expr):  Add missing emit_queue.
6629
6630         * javaop.h (int8):  Removed - not used.
6631         (jbyte):  Redefine portably with correct signedness.
6632
6633         * jcf-write.c (generate_bytecode_insns):  Don't free sw_state.cases.
6634
6635         * jcf-write.c (generate_bytecode_insns):  Fix typo
6636         OPCODE_getstatic to OPCODE_getfield.
6637
6638         * java-tree.def (CASE_EXPR, DEFAULT_EXPR):  Kind is 'x', not '1'.
6639         * parse.y (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR,
6640         set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
6641
6642 Thu Nov 19 11:16:55 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6643
6644         * jcf-parse.c (jcf_parse_source): Function returned type is
6645         void. Added prototype.
6646         (jcf_parse): Function returned type is void.
6647         (yyparse): Remove call to fclose on the last parsed file.
6648
6649         * java-tree.h (jcf_parse): Changed jcf_parse prototype.
6650
6651 Wed Nov 18 23:54:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6652
6653         * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
6654         (layout_class): Cope with methods featuring WFL in decl names.
6655         * decl.c (unqualified_object_id_node): New global variable,
6656         initialized.
6657         (build_decl_no_layout): Removed.
6658         * expr.c (build_primtype_type_ref): Handle Double.
6659         (java_lang_expand_expr): Fixed indentations.
6660         * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
6661         (flag_wall, flag_redundant, flag_not_overriding,
6662         flag_static_local_jdk1_1, unqualified_object_id_node): Global
6663         variable declarations.
6664         (build_decl_no_layout): Removed prototype.
6665         (java_get_real_method_name): Added prototype.
6666         (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
6667         (java_parse_abort_on_error): Macro now just returns.
6668         * jcf-parse.c (jcf_parse_source): Check fclose returned
6669         value. Call emit_register_classes if java_report_errors returns
6670         zero.
6671         * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
6672         flag_static_local_jdk1_1): New integer flags.
6673         (lang_decode_option): New flags set here.
6674         * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
6675         (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
6676         the flag_redundant variable.
6677         (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
6678         when parsing java.lang.Object class.
6679         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
6680         NULL_TREE to build.
6681         (resolve_qualified_expression_name): Fixed indentation.
6682         (patch_array_ref): Changed prototype.
6683         (not_initialized_as_it_should_p): Prototype removed.
6684         (java_report_errors): Added function prototype.
6685         * parse.y (formal_parameter:): Changed error message for not yet
6686         supported final parameters.
6687         (class_type_list:): Set both PURPOSE and VALUE of created
6688         TREE_LIST to be class_type.
6689         (primary_no_new_array:): Handle class literals on primitive types.
6690         (parse_warning_context): Reinstalled correct force_error and
6691         do_warning flags setups.
6692         (java_report_errors): Changed prototype. Return java_error_count
6693         value.
6694         (variable_redefinition_error): Consider treating variable type as
6695         a fake pointer.
6696         (create_interface): Warn about redundant abstract modifier if
6697         flag_redundant is set. Changed error message.
6698         (lookup_field_wrapper): Save/restore globals before/after looking
6699         up field.
6700         (duplicate_declaration_error_p): Consider treating declaration
6701         type as a fake pointer.
6702         (register_fields): Extract real type from dependency node. Check
6703         for duplicate field declaration after type adjustment. Use
6704         DECL_INITIAL to store static final initialized values.
6705         (method_header): Extract real function type from dependency node.
6706         (check_abstract_method_header): Use GET_METHOD_NAME.
6707         (obtain_incomplete_type): Layout fake pointer type.
6708         (safe_layout_class): Don't try to check for methods before layout.
6709         (java_complete_class): Don't check for correct throws clause
6710         elements inheritance here.
6711         (resolve_and_layout): Broadened name parameter meaning.
6712         (reset_method_name): Use GET_METHOD_NAME.
6713         (java_get_real_method_name): New function.
6714         (java_check_regular_methods): Don't check methods in
6715         java.lang.Object.  Verify lineage of throws clause elements. Use
6716         flag_no_overriding in warning report.
6717         (check_throws_clauses): Don't check if class was from
6718         bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
6719         (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
6720         (declare_local_variables): Use flag_static_local_jdk1_1 to report
6721         warning on unsupported final local variables. Use build_decl
6722         instead of build_decl_no_layout. Get real local variable type from
6723         dependency node.
6724         (source_start_java_method): Get real parameter type from
6725         dependency node. Call build_decl instead of build_decl_no_layout.
6726         (java_layout_classes): Reverse tree and layout type and class as
6727         required. Mark class as loaded when done.
6728         (resolve_field_access): Fixed indentation. Restricted condition
6729         leading to static field access code generation. Set field_type
6730         decl's TREE_TYPE if QUAL_DECL_TYPE not available.
6731         (resolve_qualified_expression_name): Initialize type_found to
6732         null. Handle static field resolved during qualification. Fixed
6733         layout on non primitive field decl types.
6734         (not_accessible_p): Fixed typo in comment.
6735         (patch_method_invocation): Resolve and layout class to search from
6736         type.
6737         (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
6738         layout non primitive type, if necessary. Make method node only to
6739         report errors.
6740         (find_applicable_accessible_methods_list): Consider WFL'ed method
6741         decl names. Fixed indentation.
6742         (argument_types_convertible): Resolve and layout target type if
6743         necessary.
6744         (java_complete_tree): Fixed indentation problems. Rewrote
6745         CALL_EXPR thrown exceptions check. Re-installed further processing
6746         of the assignment in certain cases.
6747         (patch_assignment): Call maybe_build_primttype_type_ref to perform
6748         inlining on class literals.
6749         (valid_builtin_assignconv_identity_widening_p): Cope with constant
6750         0 literal.
6751         (valid_method_invocation_conversion_p): Likewise.
6752         (patch_string): Temporary disable forbidden use of `this' in
6753         explicit constructor invocations when doing string concatenation
6754         within their scope.
6755         (patch_unaryop): Added comment. Reinstalled code to disable
6756         further check on assignment operation with cast expression RHS.
6757         (patch_switch_statement): Fixed indentation.
6758         (build_try_statement): Call build_decl instead of
6759         build_decl_no_layout.
6760         (patch_synchronized_statement): Likewise.
6761         (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
6762         IS_UNCHECKED_EXPRESSION_P.
6763         (check_thrown_exceptions_do): Changed leading comment. Resolve and
6764         layout argument exception type.
6765         (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
6766         of IS_UNCHECKED_EXPRESSION_P.
6767
6768 Wed Nov 18 14:21:48 1998  Anthony Green  <green@cygnus.com>
6769
6770         * jcf-parse.c (yyparse): Open class file in binary mode.
6771
6772 Sun Nov 15 17:14:17 1998  Per Bothner  <bothner@cygnus.com>
6773
6774         * jvgenmain.c:  Need to #include "gansidecl.h" (to get PROTO).
6775
6776         * jcf-write.c (perform_relocations):  Move check out one loop.
6777
6778 Sun Nov 15 15:09:56 1998  Anthony Green  <green@hoser.cygnus.com>
6779
6780         * Make-lang.in: Fix reference to srcdir.
6781         * jv-scan.c: Add missing xmalloc prototype.
6782         * jvgenmain.c: Ditto.
6783
6784 Sun Nov 15 14:36:29 1998  Per Bothner  <bothner@cygnus.com>
6785
6786         * decl.c (error_mark_node), java-tree.h:  New global.
6787         * parse.y:  Use empty_stmt_node instead of size_zero_node.
6788         (build_if_else_statement):  If missing else, use empty_stmt_node.
6789
6790         * parse.y (not_initialized_as_it_should_p):  Removed, with its callers.
6791         (java_complete_expand_method):  Complain if return is missing.
6792         (java_check_regular_methods):  Comment out incorrect error check.
6793         (not_accessible_p):  Fix incorrect handling of protected methods.
6794         (patch_method_invocation):  Pass correct context to not_accessible_p.
6795         (find_applicable_accessible_methods_list):  Likewise.
6796         (qualify_ambiguous_name):  If ARRAY_REF, it's an expression name.
6797         (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR, set
6798         TREE_TYPE (to void_type_node);  otherwise expand_expr crashes.
6799         (patch_if_else_statement):  Fix setting of CAN_COMPLETE_NORMALLY.
6800
6801         * jcf-write.c (CHECK_OP, CHECK_PUT):  Add some error checking.
6802         (push_int_const):  Remove reundant NOTE_PUSH.
6803         (generate_bytecode_insns - case STRING_CST):  Do NOTE_PUSH.
6804         (- case SWITCH_EXPR):  Fix code generation bug.
6805         (- case PREDECREMENT_EXPR etc):  Remove redundant NOTE_PUSH.
6806         (generate_classfile):  More robust for abstract methods.
6807
6808 Sun Nov 15 13:52:39 1998  Anthony Green  <green@cygnus.com>
6809
6810         * Makefile.in: jv-scan and jvgenmain all require libiberty.
6811         * Make-lang.in: Ditto.
6812
6813         * jv-scan.c: Remove xmalloc and xstrdup definitions.
6814         * jvgenmain: Ditto.
6815
6816 Sun Nov 15 14:10:56 1998  Per Bothner  <bothner@cygnus.com>
6817
6818         * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
6819
6820         * jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.
6821
6822 Sat Nov 14 17:19:18 1998  Per Bothner  <bothner@cygnus.com>
6823
6824         Allow uses of interface types to verify.  This is not really
6825         type-safe, but it matches what Sun does, and is OK as long as
6826         there are appropriate run-time checks.
6827         * verify.c (merge_types):  If merging two interface types,
6828         just set the result to java.lang.Object.
6829         * expr.c (pop_type):  Any interface is matches by java.lang.Object.
6830
6831 1998-11-13  Tom Tromey  <tromey@cygnus.com>
6832
6833         * gjavah.c (main): Handle --output-class-directory argument.
6834         * jvspec.c (lang_specific_driver): Translate `-d' into
6835         -foutput-class-dir.
6836         * jcf.h (jcf_write_base_directory): Declare.
6837         * lang.c (lang_decode_option): Recognize -foutput-class-dir.
6838         * lang-options.h: Mention -foutput-class-dir.
6839         * jcf-write.c (jcf_write_base_directory): New global.
6840         (make_class_file_name): Put generated .class file into `-d'
6841         directory, or into source directory if -d not given.  Function now
6842         static.
6843         (write_classfile): Free class file name.  Handle case where class
6844         file name is NULL.
6845         (DIR_SEPARATOR): New macro.
6846         Include <sys/stat.h>
6847
6848         * Makefile.in (prefix): New macro.
6849
6850 Thu Nov 12 14:15:07 1998  Per Bothner  <bothner@cygnus.com>
6851
6852         * parse.y (patch_invoke):  Do less if flag_emit_class_files.
6853         * expr.c (build_known_method_ref):  Don't check flag_emit_class_files
6854         here (done in patch_invoke instead).
6855         (case_identity):  Moved here from parse.y.
6856
6857         * java-tree.h (CAN_COMPLETE_NORMALLY):  New macro.
6858         * parse.y (java_complete_tree etc):  Maybe set CAN_COMPLETE_NORMALLY.
6859         * parse.y (java_complete_tree):  Re-order COMPOUND_EXPR in BLOCK
6860         so they can be efficiently scanned without recursion.
6861         Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
6862         * expr.c (java_lang_expand_expr):  Expand statements of COMPOUND_EXPR
6863         in BLOCK iteratively, rather than recursively.
6864
6865         * parse.y (do_unary_numeric_promotion):  New function.
6866         (patch_unaryop, patch_binop, patch_array_ref):  Use it.
6867
6868         * parse.y (patch_newarray):  Various fixes.
6869
6870         Re-do handling of switch statements (for proper block scoping).
6871         * parse.y:  Add just a single block for the enture switch block,
6872         but don't create any "case blocks".
6873         (group_of_labels):  Rmeoved unneeded non-terminal.
6874         CASE_EXPR and DEFAULT_EXPR are added to current block.
6875         * expr.c (java_lang_expand_expr):  Inline SWITCH_EXPR here.
6876         Now also need to handle CASE_EXPR and DEFAULT_EXPR.
6877         * java-tree.h (SWITCH_HAS_DEFAULT):  New macro.
6878         * parse.y (wfl_operator, print_int_node): Make non-static.
6879         (java_complete_tree):  CASE_EXPR and DEFAULT_EXPR are now processed
6880         as part of recursive scan of block.
6881         (java_expand_switch ):  Removed - inlined into java_lang_expand_expr.
6882         (patch_switch_statement):  Most tests move dinto java_complete_tree.
6883
6884         * parse.y:  Make various production be non-typed (void).
6885         * parse.y (parse_error):  Merged into issue_warning_error_from_context.
6886         * parse.y (add_stmt_to_compound):  Don't create/change extra node.
6887         (patch_method_invocation_stmt):  Renamed to patch_method_invocation.
6888
6889         * jcf-write.c (struct jcf_handler):  New type.
6890         (struct jcf_switch_state):  New type.
6891         (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC):  New relocation kinds.
6892         (alloc_handler, emit_unop, emit_reloc):  New functions.
6893         (adjust_typed_op):  Add extra parameter ("max type" offset).
6894         (emit_switch_reloc, emit_case-reloc):  New function.
6895         (generate_bytecode_conditional):  Handle REAL_TYPE comparisons.
6896         (generate_bytecode_insns):  Support REAL_CST, switch statements,
6897         exception handling, method calls, object/array creation, and more.
6898
6899         * class.c:  Remove some unused variables.
6900         * constants.c (find_string_constant):  New function.
6901         (count_constant_pool_bytes):  Fix to correctly handle wide constants.
6902         * decl.c (complete_start_java_method):  Don't _Jv_InitClass
6903         if flag_emit_class_files.
6904
6905 1998-11-12  Tom Tromey  <tromey@cygnus.com>
6906
6907         * jcf-io.c (find_class): Added explanatory comment.
6908
6909         * jcf-path.c (add_entry): Look for `.zip' at end of filename.  Add
6910         trailing slash to `.zip' entries.
6911
6912         * jvspec.c (lang_specific_driver): Correctly handle case where
6913         GC_NAME not defined.
6914
6915 1998-11-11  Tom Tromey  <tromey@cygnus.com>
6916
6917         * jvspec.c (GC_NAME): New define.
6918         (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
6919         if required.
6920         * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
6921
6922 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
6923
6924         * jcf-dump.c (TABLE_SWITCH):  Fix typos.
6925
6926 1998-11-11  Tom Tromey  <tromey@cygnus.com>
6927
6928         * jcf-dump.c (main): Correctly recognize `--'-style long options.
6929
6930 Tue Nov 10 12:34:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6931
6932         * class.c (is_compiled_class): Call safe_layout_class for class
6933         compiled from source.
6934         * conver.h (convert_to_integer, convert_to_real,
6935         convert_to_pointer): Added prototypes.
6936         * decl.c (init_decl_processing): Non longer push the decls of
6937         `methodtable', `constants', `Class', `Field', `dispatchTable'
6938         `jexception' and `Method'.
6939         * expr.c (build_invokeinterface): New function.
6940         (expand_invoke): static variable CLASS_IDENT now in
6941         build_invokeinterface. Use build_invokeinterface.
6942         (expand_java_field_op): Moved code to inline
6943         java.lang.PRIMTYPE.TYPE into a function.
6944         (build_primtype_type_ref): New function.
6945         * java-tree.def (INSTANCEOF_EXPR): New tree code.
6946         * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
6947         FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
6948         (DECL_CONSTRUCTOR_P): Fixed typo in comment.
6949         (DECL_LOCAL_STATIC_VALUE): New macro.
6950         (build_invokeinterface, build_primtype_type_ref): New function
6951         prototypes.
6952         (java_parse_abort_on_error): Macro rewritten.
6953         * jcf-parse.c (current_method): Add comment to declaration.
6954         (parse_zip_file_entries, process_zip_dir, void parse_source_file):
6955         Function prototypes fixed.
6956         (jcf_parse_source): push/pop parser context. save/restore global.
6957         (parse_source_file): Fixed leading comment. Now take a
6958         IDENTIFIER_NODE as an argument. Doesn't check methods, layout
6959         classes and pop the parser context anymore.
6960         (yyparse): Push parser context, save globals, parse the source
6961         file, restore globals and pop the parser context when processing a
6962         source file.
6963         * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
6964         * lex.c (java_parse_doc_section): New function.
6965         (java_lex): Call java_parse_doc_section when appropriate. Build an
6966         operator around INSTANCEOF_TK.
6967         * lex.h (java_lineterminator, java_sprint_unicode,
6968         java_unicode_2_utf8, java_lex_error, java_store_unicode):
6969         Prototypes rewritten.
6970         (java_parse_escape_sequence, java_letter_or_digit_p,
6971         java_parse_doc_section, java_parse_end_comment, java_get_unicode,
6972         java_read_unicode, java_store_unicode, java_read_char,
6973         java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
6974         Added function prototypes.
6975         * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
6976         define.
6977         (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
6978         New macros
6979         (struct parser_ctxt): New fields: deprecated,
6980         current_parsed_class_un, gclass_list.
6981         (fix_method_argument_names, issue_warning_error_from_context,
6982         resolve_package, lookup_package_type): New function prototypes.
6983         (resolve_expression_name): Fixed function prototype.
6984         (find_applicable_accessible_methods_list): Fixed indentation, added
6985         extra argument in prototype.
6986         (check_final_assignment, build_null_of_type, check_deprecation,
6987         check_method_redefinition, reset_method_name,
6988         java_check_regular_methods, java_check_abstract_methods,
6989         maybe_build_primttype_type_ref): New function prototype.
6990         * parse.y (conver.h): Include.
6991         (INSTANCEOF_TK): Tagged <operator>.
6992         (single_type_import_declaration): Use REGISTER_IMPORT macro.
6993         (relational_expression:): Build binop for instanceof.
6994         (java_push_parser_context): Remember ctxp->gclass_list across
6995         contexts.
6996         (java_pop_parser_context): Simply return if no context
6997         exists. Remember gclass_list across contexts.
6998         (issue_warning_error_from_context): New function.
6999         (parse_error_context): Don't setup ctxp->elc here. Call
7000         issue_warning_error_from_context instead.
7001         (parse_warning_context): Likewise.
7002         (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
7003         setup. Link new class/interface to ctxp->gclass_list.
7004         (add_superinterfaces): Register interface as incomplete if not
7005         loaded.
7006         (create_class): Remember class unqualified name in
7007         ctxp->current_parsed_class_un. Check class deprecation.
7008         (register_fields): Check field deprecation. Remember static final
7009         field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
7010         processing INIT.
7011         (method_header): New local variable ORIG_ARG. Use unqualified
7012         current class name for check on constructor errors. Promote return
7013         type if of record type. Argument list fix moved in
7014         fix_method_argument_names, called here. Check method deprecation.
7015         (fix_method_argument_names): New function.
7016         (method_declarator): Promote record typed arguments.
7017         (safe_layout_class): Check class methods before layout.
7018         (java_complete_class): Compute field layout when patched.
7019         (do_resolve_class): Try to load class after having it renamed
7020         after the package name.
7021         (get_printable_method_name): Use DECL_CONTEXT.
7022         (reset_method_name): New function.
7023         (check_method_redefinition): Use reset_method_name.
7024         (java_check_regular_methods): New local variable
7025         SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
7026         names for error report. Check for compile-time error when method
7027         found has default (package) access.
7028         (java_check_abstract_methods): Now takes an interface DECL node as
7029         an argument. Also reinstall real name on unchecked
7030         overriding/hiding methods for error report.
7031         (java_check_methods): Fixed leading comment. Get classes to verify
7032         from ctxp->gclass_list. Use CHECK_METHODS macro and set
7033         CLASS_METHOD_CHECKED_P on class verification.
7034         (lookup_java_method2): Get real method name if necessary.
7035         (find_in_imports): Don't check package class access here.
7036         (resolve_package, lookup_package_type): New functions.
7037         (java_layout_classes): Fixed leading comment. Take classes to be
7038         laid out from ctxp->gclass_list.
7039         (java_complete_expand_methods): Don't expand native and abstract
7040         methods.
7041         (java_expand_classes): New function.
7042         (resolve_expression_name): Use additional argument ORIG.  Retrieve
7043         values of static final field of primitive types.
7044         (resolve_field_access): Handles static final field of promotive
7045         type.
7046         (resolve_qualified_expression_name): Handle STRING_CST as
7047         primaries and package name resolution. Check deprecation on found
7048         decls. Set where_found and type_found on non static field resolved
7049         during qualification. Layout non primitive field decl types.
7050         (check_deprecation): New function.
7051         (maybe_access_field): Simplified.
7052         (patch_method_invocation_stmt): Local variable CLASS_TYPE
7053         removed. Reverse method's argument when primary is a type. Don't
7054         use CLASS_TYPE to report problems, use IDENTIFIER_WFL
7055         instead. Include abstract class in the list of class searchable
7056         for constructors. Use DECL_CONTEXT of found method for access
7057         checks. Check method deprecation.
7058         (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
7059         converting arguments. Handle INVOKE_INTERFACE.
7060         (lookup_method_invoke): Search constructor using existing
7061         infrastructure (don't rely on lookup_java_constructor anymore).
7062         (find_applicable_accessible_methods_list): Extra argument flag
7063         LC. Now include constructor in the search.
7064         (qualify_ambiguous_name): Conditional expression are primaries.
7065         (not_initialized_as_it_should_p): static final are always
7066         initialized.
7067         (java_complete_tree): Pass extra NULL argument to
7068         resolve_expression_name. Stricter test to carry on patching
7069         assignments. New case for INSTANCEOF_EXPR.
7070         (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
7071         (check_final_assignment, maybe_build_primttype_type_ref): New
7072         functions.
7073         (patch_assignment): Detect resolved static finals and carry normal
7074         assignment error check on them. Inline PRIMTYPE.TYPE read access.
7075         (try_builtin_assignconv): Access constant 0 on all primitive
7076         types.
7077         (valid_builtin_assignconv_identity_widening_p): Accept identical
7078         types. Accept all promoted type on int type.
7079         (valid_ref_assignconv_cast_p): Accept a null pointer to be
7080         assigned to a reference.
7081         (valid_method_invocation_conversion_p): Accept to check null
7082         pointers.
7083         (build_binop): Merge declaration and initialization of local
7084         variable BINOP.
7085         (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
7086         numeric types. Improved validity test for qualify operators on
7087         references.
7088         (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
7089         and PREINCREMENT_EXPR. Also detect resolved static finals of a
7090         primitive type and issue the appropriate error message.
7091         (resolve_type_during_patch): Mark class loaded when resolved.
7092         (patch_cast): Allow null to be cased to reference types.
7093         (build_null_of_type): New function.
7094         (patch_array_ref): Handle array on references correctly.
7095         (patch_return): Removed unused local variable MODIFY. Force
7096         boolean to be returned as integers. Allows null to be returned by
7097         a function returning a reference.
7098         * typeck.c (convert_to_integer, convert_to_real,
7099         convert_to_pointer): Prototypes moved to convert.h
7100         (lookup_argument_method): Use method real name, if necessary.
7101
7102 1998-10-30  Tom Tromey  <tromey@cygnus.com>
7103
7104         * class.c (build_class_ref): Changed name of primitive classes to
7105         start with `_Jv_'.
7106
7107         * class.c (make_class_data): Renamed fields: nmethods to
7108         method_count, method_count to dtable_method_count.  Always set
7109         `state' field to 0.
7110         * decl.c (init_decl_processing): Likewise.
7111
7112 Wed Oct 28 08:03:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7113
7114         * class.c (layout_class): Don't mangle <finit>, produce
7115         __finit<class> instead. Don't verify artificial methods.
7116         * decl.c (finit_identifier_node): New declared global.
7117         (init_decl_processing): finit_identifier_node initialized.
7118         * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
7119         * java-tree.h (finit_identifier_node): Declared as extern.
7120         (struct lang_decl): New field called_constructor.
7121         (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
7122         (CLASS_HAS_FINIT_P): New macro.
7123         (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
7124         explicit constructor invocation.
7125         (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
7126         CALL_SUPER_CONSTRUCTOR_P): New macros.
7127         (write_classfile): Added prototype.
7128         * jcf-parse.c (jcf_parse_source): Parse and remember for
7129         generation if the file was seen on the command line.
7130         (parse_source_file): Don't write the class file here.
7131         (yyparse): Loop on files rewritten. Set current_jcf.
7132         (parse_zip_file_entries): Parse class file only if it was found.
7133         * lang.c (init_parse): Don't open command line provided filename
7134         here.
7135         (lang_parse): Don't set main_jcf anymore.
7136         * parse.h (ABSTRAC_CHECK): Capitalized arguments.
7137         (JCONSTRUCTOR_CHECK): New macro.
7138         (JBSC_TYPE_P): New macro.
7139         (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
7140         (COMPLETE_CHECK_OP_2): New macro.
7141         (struct parse_ctxt): New field explicit_constructor_p.
7142         (check_class_interface_creation): Fixed prototype indentation.
7143         (patch_method_invocation_stmt): Prototype reflects added argument.
7144         (patch_invoke): Likewise.
7145         (complete_method_declaration, build_super_invocation,
7146         verify_constructor_circularity,
7147         build_this_super_qualified_invocation, get_printable_method_name,
7148         patch_conditional_expr, maybe_generate_finit, fix_constructors,
7149         verify_constructor_super, create_artificial_method,
7150         start_artificial_method_body, end_artificial_method_body,
7151         generate_field_initialization_code): New function prototypes.
7152         * parse.y: Fixed leading comment
7153         (constructor_header:, constructor_body:, block_end:): Rules tagged
7154         <node>.
7155         (type_declaration:): Call maybe_generate_finit.
7156         (method_declaration:): Action for method_body: placed in new
7157         function complete_method_declaration, called here.
7158         (constructor_declaration:): Defined actions. Removed leading
7159         FIXME.
7160         (constructor_header:): New rule with action.
7161         (constructor_body:): Rule rewritten using block_begin: and
7162         block_end:. Defined actions.
7163         (constructor_declarator:, explicit_constructor_invocation:):
7164         Defined actions.
7165         (block:): Use new rules block_begin: block_end:.
7166         (block_begin:, block_end:): New rules and actions.
7167         (block_statements:): Fixed error message for explicit
7168         constructors.
7169         (method_invocation:): Call build_this_super_qualified_invocation
7170         if primary is `this' or `super' was seen.
7171         (conditional_expression:): Action defined.
7172         (extra_ctxp_pushed_p): New static global flag.
7173         (java_parser_context_save_global): Create parser context if
7174         necessary. Use extra_ctxp_pushed_p to remember it.
7175         (java_parser_context_restore_global): Pop extra parser context if
7176         one exists.
7177         (build_array_from_name): Array on primitive types are marked
7178         loaded.
7179         (register_fields): Restore new name in field initializer
7180         expression if type was altered. Non static fields initialized upon
7181         declaration marked initialized.
7182         (maybe_generate_finit): New function.
7183         (maybe_generate_clinit): Use create_artificial_method,
7184         start_artificial_method_body, end_artificial_method_body. Generate
7185         debug info for enclosed initialization statements.
7186         (method_header): Fixed leading comment. Check constructor
7187         flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
7188         accordingly.
7189         (complete_method_declaration, constructor_circularity_msg,
7190         verify_constructor_circularity): New functions.
7191         (get_printable_method_name): New function.
7192         (check_method_redefinition): Don't rename <finit> methods. Fix
7193         declared constructor names. Error message for
7194         constructors modified.
7195         (java_check_regular_methods): Local variable seen_constructor
7196         renamed saw_constructor. Skip verification on constructors. Create
7197         default constructor with create_artificial_method.
7198         (java_check_methods): Removed unnecessary empty line.
7199         (create_artificial_method, start_artificial_method_body,
7200         end_artificial_method_body): New functions.
7201         (java_layout_classes): Changed leading comment. Reverse fields
7202         list if necessary. Always layout java.lang.Object if being
7203         defined.
7204         (java_complete_expand_methods): Verify constructor circularity.
7205         (java_complete_expand_method): Call fix_constructor on
7206         constructors.  Local variable no_ac_found removed. Restore
7207         bindings if method body expansion failed.
7208         (fix_constructors, verify_constructor_super,
7209         generate_field_initialization_code): New function.
7210         (java_expand_classes): Fixed leading comment. Write class file
7211         here.
7212         (resolve_expression_name): Check for illegal instance variable
7213         usage within the argument scope of an explicit constructor
7214         invocation.
7215         (resolve_qualified_expression_name): Pass extra from_super flag
7216         when invoking patch_method_invocation_stmt. New case for
7217         conditional expression when used as a primary. Check for error
7218         when acquiring super.
7219         (patch_method_invocation_stmt): Added extra argument super. New
7220         local variable is_static_flag. Set class_to_search according to
7221         the nature of the constructor invocation. Don't add `this'
7222         argument when expanding NEW_CLASS_EXPR. Check for illegal method
7223         invocation within the argument scope of explicit constructor
7224         invocation. Set is_static according to is_static_flag. Provide
7225         extra `super' argument to patch_invoke invocation.
7226         (patch_invoke): New argument from_super. Loop on arguments
7227         indentation fixed. Pass from_super to invocation_mode. New switch
7228         case INVOKE_SUPER. Fixed error message in switch default case.
7229         Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
7230         value.
7231         (invocation_mode): Return INVOKE_SUPER mode when appropriate.
7232         (lookup_method_invoke): Fixed prototypes in candidates list. Error
7233         message takes constructors into account.
7234         (find_applicable_accessible_methods_list): Fixed indentation.
7235         (qualify_ambiguous_name): Take explicit constructor invocation
7236         into account. Deal with a conditional expression as a primary to
7237         a method call.
7238         (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
7239         case. Added extra argument to patch_method_invocation_stmt.
7240         Register calls made to explicit constructor `this'. Don't call
7241         save_expr in ARRAY_REF case when emitting class files. Check for
7242         illegal use of this when expanding explicit constructor invocation
7243         arguments.
7244         (complete_function_arguments): Set and reset parser context
7245         explicit_constructor_p field value when appropriate.
7246         (build_super_invocation, build_this_super_qualified_invocation):
7247         New functions.
7248         (patch_assignment): Fixed typo.
7249         (patch_unaryop): Check on final fields occurs only when a decl
7250         exits.
7251         (patch_return): Take constructors into account.
7252         (patch_conditional_expr): New function.
7253         * typeck.c (build_java_signature): Removed unnecessary empty line.
7254
7255 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
7256
7257         * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
7258
7259 1998-10-28  Tom Tromey  <tromey@cygnus.com>
7260
7261         * decl.c (init_decl_processing): Renamed fields.
7262         * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
7263         interface_len, msize fields.
7264
7265         * class.c (make_class_data): Removed subclass_head and
7266         subclass_next fields.
7267         * decl.c (init_decl_processing): Removed subclass_head and
7268         subclass_next fields.
7269
7270 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
7271
7272         * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
7273         * mangle.c (emit_unicode_mangled_name): Similarly.
7274
7275 Mon Oct 26 12:17:23 1998  Nick Clifton  <nickc@cygnus.com>
7276
7277         * jcf-parse.c (get_constant): Place braces around code to compute
7278         'd' when REAL_ARITHMETIC is not defined.
7279
7280 Sun Oct 25 14:58:05 1998  H.J. Lu  (hjl@gnu.org)
7281
7282         * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
7283         dependency.
7284
7285 1998-10-23  Tom Tromey  <tromey@cygnus.com>
7286
7287         * lang-specs.h: `.zip' files are input to jc1.
7288
7289 Thu Oct 22 23:01:54 1998  Per Bothner  <bothner@cygnus.com>
7290
7291         * jvspecs.c:  Add (but don't enable) support for combining multiple
7292         .class and .java input filenames to a single jc1 invocation.
7293         Add support for -C flag (copile to .class files).
7294         Translate -classpath and -CLASSPATH arguments.
7295         * lang-specs.h:  Don't set %2 spec.
7296
7297 1998-10-22  Tom Tromey  <tromey@cygnus.com>
7298
7299         * jcf-path.c (add_entry): Don't add trailing separator if entry is
7300         a .zip file.
7301         (add_path): Don't add trailing separator to non-empty path
7302         elements.
7303
7304         * lang.c (lang_decode_option): Check for -fclasspath and
7305         -fCLASSPATH before examining other `-f' options.
7306
7307         * java-tree.h (finalize_identifier_node): Don't declare.
7308         * class.c (make_class_data): Don't push "final" field.
7309         * decl.c (init_decl_processing): Don't push "final" field.
7310         (finalize_identifier_node): Removed.
7311         (init_decl_processing): Don't set finalize_identifier_node.
7312
7313         * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
7314
7315 Sun Oct 11 10:31:52 1998  Anthony Green  <green@cygnus.com>
7316
7317         * Make-lang.in (java): Depend on jcf-dump and jv-scan.
7318         (JV_SCAN_SOURCES): New macro.
7319         (JCF_DUMP_SOURCES): Likewise.
7320         (jcf-dump$(exeext)): New target.
7321         (jv-scan$(exeext)): New target.
7322
7323 1998-10-22  Tom Tromey  <tromey@cygnus.com>
7324
7325         * Makefile.in (LEX): Removed.
7326         (LEXFLAGS): Likewise.
7327         (SET_BISON): New macro.
7328         (BISON): Removed.
7329         ($(PARSE_C)): Use SET_BISON.  Run bison from srcdir to avoid
7330         spurious diffs in parse.c.
7331         ($(PARSE_SCAN_C)): Likewise.
7332         (PARSE_DIR): New macro.
7333         (PARSE_C): Use it.
7334         (PARSE_SCAN_C): Likewise.
7335         (PARSE_RELDIR): New macro.
7336
7337         * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
7338
7339         * jcf-io.c (find_class): Use saw_java_source to determine when to
7340         look for `.java' file.
7341         * jcf-parse.c (saw_java_source): New global.
7342         (yyparse): Set it if `.java' file seen.
7343
7344         * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
7345         (GCJH_SOURCES): Likewise.
7346         * Makefile.in (datadir): New macro.
7347         (libjava_zip): Likewise.
7348         (JAVA_OBJS): Added jcf-path.o.
7349         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
7350         (../gcjh$(exeext)): Likewise.
7351         (jcf-path.o): New target.
7352         * java-tree.h (fix_classpath): Removed decl.
7353         * jcf-parse.c (fix_classpath): Removed.
7354         (load_class): Don't call fix_classpath.
7355         * parse.y (read_import_dir): Don't call fix_classpath.
7356         * lex.h: Don't mention classpath.
7357         * lex.c (java_init_lex): Don't initialize classpath.
7358         * jcf-io.c (classpath): Removed global.
7359         (find_class): Use jcf_path iteration functions.  Correctly search
7360         class path for .java file.
7361         (open_in_zip): New argument `is_system'.
7362         * jcf-dump.c (main): Call jcf_path_init.  Recognize all new
7363         classpath-related options.
7364         * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
7365         and -I.
7366         (lang_init): Call jcf_path_init.
7367         * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
7368         * lang-specs.h: Handle -I.  Minor cleanup to -M options.
7369         Correctly put braces around second string in each entry.
7370         * gjavah.c (main): Call jcf_path_init.  Recognize all the new
7371         classpath-related options.
7372         (help): Updated for new options.
7373         * jcf.h: Declare functions from jcf-path.c.  Don't mention
7374         `classpath' global.
7375         * jcf-path.c: New file.
7376
7377         * jcf-depend.c: Include jcf.h.
7378
7379         * jcf-write.c (localvar_alloc): Returns `void'.
7380         (localvar_free): Removed unused variable.
7381
7382         * lang.c (OBJECT_SUFFIX): Define if not already defined.
7383         (init_parse): Use OBJECT_SUFFIX, not ".o".
7384
7385 Wed Oct 21 07:54:11 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7386
7387         * class.c (emit_register_classes): Renamed from
7388         emit_register_class.
7389         * java-tree.h (emit_register_classes): Prototype renamed from
7390         emit_register_class.
7391         * jcf-parse.c (yyparse): Call emit_register_classes once before
7392         returning.
7393         * parse.y (java_expand_classes): No longer register classes.
7394
7395 Tue Oct 20 09:15:38 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7396
7397         * class.c (is_compiled_class): New local variable
7398         seen_in_zip. Identify classes found in currently compiled source
7399         file(s).
7400         * decl.c (complete_start_java_method): Fixed typo.
7401         * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
7402         HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
7403         (CLASS_P): Moved around.
7404         (java_parse_abort_on_error): Macro moved from jcf-parse.c
7405         * jcf-parse.c (java_parse_abort_on_error): Macro moved to
7406         java-parse.h
7407         (jcf_parse_source): Changed leading comment. Removed unnecessary
7408         fclose and CLASS_FROM_SOURCE_P marking.
7409         (parse_source_file): New local variables remember_for_generation
7410         and filename. Mark parsed file name identifier node. Removed block
7411         executed when parse_only was null. Set remember_for_generation.
7412         Use it as an argument to java_pop_parser_context.
7413         (yyparse): New local variables several_files, list, next node and
7414         current_file_list. Split ampersand separated file names into
7415         current_file_list. Iterate through the list and parse accordingly.
7416         * parse.h (java_pop_parser_context): New function prototype.
7417         * parse.y (ctxp_for_generation): New static global variable.
7418         (java_pop_parser_context): New argument generate. Link popped ctxp
7419         to ctxp_for_generation list accordingly.
7420         (java_complete_expand_methods): Fixed indentation.
7421         (java_expand_classes): New function.
7422
7423 Sat Oct 17 11:25:21 1998  Per Bothner  <bothner@cygnus.com>
7424
7425         * Makefile.in:  Link with libiberty.a instead of memmove.o.
7426
7427 Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7428
7429         * lex.c (setjmp.h): No longer included.
7430         * lex.h (setjmp.h): Included.
7431         * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
7432         (duplicate_declaration_error_p): Renamed from
7433         duplicate_declaration_error.
7434         (build_array_from_name): New function prototype.
7435         * parse.y (setjmp.h): No longer included.
7436         (variable_declarator_id): Define action.
7437         (build_array_from_name): New function.
7438         (duplicate_declaration_error_p): Renamed from
7439         duplicate_declaration_error.  Fixed leading comment.
7440         (register_fields): Main `for' loop reorganized. Uses
7441         SET_TYPE_FOR_RESOLUTION and build_array_from_name.
7442         (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
7443         build_array_from_name.
7444         (resolve_class): Set CLASS_LOADED_P on newly build array dimension
7445         types.
7446         (read_import_dir): Don't try to skip `.' and `..'.
7447         (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
7448         build_array_from_name. Main `for' loop reorganized.
7449         (resolve_qualified_expression_name): When building access to a
7450         field, use the type where the field was found, not its own type.
7451         (maybe_access_field): Use field DECL_CONTEXT if the type where the
7452         field was found is null.
7453         (qualify_ambiguous_name): Sweep through all successive array
7454         dimensions.
7455
7456 Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7457
7458         * java-tree.h (pop_labeled_block, lang_printable_name,
7459         maybe_add_interface, set_super_info, get_access_flags_from_decl,
7460         interface_of_p, inherits_from_p, fix_classpath,
7461         complete_start_java_method, emit_handlers, init_outgoing_cpool,
7462         make_class_data, register_class, alloc_name_constant): New
7463         function prototypes.
7464         * lang.c (lang_decode_option): Set argc argument unused. Fixed
7465         indentation. Added cast to remove warning.
7466         (lang_printable_name): Set v argument unused.
7467         (lang_print_error): Added argument to lang_printable_name call.
7468         (java_dummy_print, print_lang_decl, print_lang_type,
7469         print_lang_identifier, lang_print_xnode): All argument marked
7470         unused.
7471         * lex.c (java_unget_unicode): Removed unnecessary argument.
7472         (java_allocate_new_line): Unused local variable is gone.
7473         (java_read_char): Added parenthesis in expressions to remove
7474         warnings.  Added final return statement.
7475         (java_read_unicode): Added parenthesis in expression to remove
7476         warning.
7477         (java_parse_end_comment): Fixed java_unget_unicode invocation.
7478         (java_parse_escape_sequence): Likewise.
7479         (java_lex): Unused local variables are gone. Fixed
7480         java_unget_unicode invocation.
7481         * lex.h (set_float_handler): Prototype added when JC1_LITE not
7482         defined.
7483         * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
7484         lang_printable_name invocation in macro.
7485         (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
7486         Likewise.
7487         (duplicate_declaration_error): Suppressed unused argument in
7488         prototype.
7489         (identical_subpath_p): Function declaration is gone.
7490         (patch_invoke): Suppressed unused argument in prototype.
7491         (patch_cast, build_labeled_block, check_thrown_exceptions):
7492         Likewise.
7493         * parse.y (setjmp.h): Included
7494         (toplev.h): Likewise.
7495         (field_declaration:): Suppressed unused local
7496         (label_decl:): Fixed build_labeled_block invocation.
7497         (java_pop_parser_context): Put extra parenthesis around assignment
7498         in if.
7499         (yyerror): Suppressed unused local variables.
7500         (variable_redefinition_error): Fixed lang_printable_name
7501         invocation.
7502         (create_interface): Suppressed unused local variables.
7503         (create_class): Likewise.
7504         (duplicate_declaration_error): Suppressed unused argument. Fixed
7505         lang_printable_name invocation.
7506         (register_fields): Suppressed unused local variable. Fixed
7507         duplicate_declaration_error invocation.
7508         (method_header): Suppressed unused local variable.
7509         (method_declarator, parser_check_super): Likewise.
7510         (java_complete_class): Suppressed unused local variable. Fixed
7511         fatal error message.
7512         (complete_class_report_errors): Added default: in switch.
7513         (java_check_regular_methods): Fixed lang_printable_name
7514         invocations.
7515         (check_throws_clauses): Likewise.
7516         (java_check_abstract_methods): Suppressed unused local
7517         variable. Fixed lang_printable_name invocation.
7518         (read_import_entry): Added supplemental return statement.
7519         (read_import_dir): Suppressed unused local variables.
7520         (check_pkg_class_access, declare_local_variables): Likewise.
7521         (source_start_java_method): Suppressed unused extern variable
7522         declarations
7523         (expand_start_java_method): Suppressed unused extern and local
7524         variable declarations.
7525         (java_complete_expand_methods): Likewise.
7526         (java_complete_expand_method): Suppressed unused local variables.
7527         (make_qualified_name): Likewise.
7528         (resolve_qualified_expression_name): Added default: in
7529         switch. Fixed lang_printable_name invocation.
7530         (class_instance_creation_expression): Added parenthesis around
7531         expressions.
7532         (patch_method_invocation_stmt): Fixed lang_printable_name and
7533         patch_invoke invocations.
7534         (check_for_static_method_reference): Fixed lang_printable_name
7535         invocation.
7536         (patch_invoke): Suppressed unused arguments and local variables.
7537         (lookup_method_invoke): Suppressed unused local variables.
7538         (qualify_ambiguous_name): Added default: in switch.
7539         (identical_subpath_p): Function removed.
7540         (patch_assignment): Suppressed unused local variables. Suppressed
7541         unnecessary if statement. Fixed lang_printable_name invocations.
7542         (try_builtin_assignconv): Fixed lang_printable_name invocations.
7543         (valid_ref_assignconv_cast_p): Parenthesis around
7544         expression. Suppressed unused local variables.
7545         (build_binop): Suppressed unused local variables. fixed
7546         lang_printable_name invocations.
7547         (string_constant_concatenation): Suppressed unused local
7548         variables.
7549         (patch_unaryop): Fixed lang_printable_name invocation.
7550         (patch_cast): Suppressed unnecessary argument. Fixed
7551         lang_printable_name invocation.
7552         (patch_array_ref): Fixed lang_printable_name invocation.
7553         (patch_newarray, patch_return, patch_if_else_statement): Likewise.
7554         (build_labeled_block): Suppressed unused argument.
7555         (generate_labeled_block): Fixed build_labeled_block invocation.
7556         (build_loop_body): Suppressed unused local variables.
7557         (patch_loop_statement): Likewise.
7558         (patch_exit): Fixed lang_printable_name invocation.
7559         (patch_switch_statement): Likewise.
7560         (case_identity): First argument marked unused.
7561         (patch_try_statement): Fixed lang_printable_name invocations.
7562         (patch_synchronized_statement, patch_throw_statement): Likewise.
7563         (check_thrown_exceptions): Fixed check_thrown_exceptions and
7564         lang_printable_name invocations.
7565         (check_thrown_exceptions_do): Suppressed unused argument.
7566
7567 1998-10-14  Tom Tromey  <tromey@cygnus.com>
7568
7569         * jcf-write.c (write_classfile): Add output class file as target.
7570         * lang-options.h: Added -MD, -MMD, -M, and -MM.
7571         * jcf.h: Added declarations for dependency-tracking functions.
7572         * lang-specs.h: Handle -M, -MM, MD, and -MMD.
7573         * lang.c (lang_decode_option): Recognize -MD and -MMD.
7574         (finish_parse): Call jcf_dependency_write.
7575         (dependency_tracking): New global.
7576         (DEPEND_SET_FILE): New define.
7577         (DEPEND_ENABLE): New define.
7578         (init_parse): Enable dependency tracking if required.
7579         Include "flags.h".
7580         * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
7581         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
7582         (../gcjh$(exeext)): Likewise.
7583         (jcf-depend.o): New target.
7584         * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
7585         (GCJH_SOURCES): Likewise.
7586         * jcf-io.c (open_class): Call jcf_dependency_add_file.  Added
7587         dep_name argument.
7588         (find_classfile): Added dep_name argument.
7589         (find_class): Compute name of dependency.
7590         (open_in_zip): Call jcf_dependency_add_file.
7591         * gjavah.c (output_file): No longer global.
7592         (usage): Don't mention "gjavah".
7593         (help): Likewise.
7594         (java_no_argument): Likewise.
7595         (version): Likewise.
7596         (main): Recognize and handle -M family of options.
7597         (print_mangled_classname): Return is void.
7598         (process_file): Handle case where output is suppressed.
7599         (HANDLE_END_FIELD): Likewise.
7600         (HANDLE_METHOD): Likewise.
7601         * jcf-depend.c: New file.
7602
7603 Tue Oct 13 23:34:12 1998  Jeffrey A Law  (law@cygnus.com)
7604
7605         * java-tree.def: Add missing newline at EOF.
7606
7607 1998-10-13  Tom Tromey  <tromey@cygnus.com>
7608
7609         * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
7610         (main): Likewise.  Exit with SUCCESS_EXIT_CODE at end of
7611         function.
7612         Include <config.h> and "system.h".
7613         (disassemble_method): Undefine RET to avoid clash with
7614         config/i386/i386.h.
7615
7616 Tue Oct 13 03:50:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7617
7618         * decl.c (runtime_exception_type_node, error_exception_type_node):
7619         New global variables.
7620         (init_decl_processing): Initialized.
7621         * expr.c (java_lang_expand_expr): Set caught exception type to
7622         null if catch handler argument doesn't exit.
7623         * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
7624         tree codes.
7625         * java-tree.h (runtime_exception_type_node,
7626         error_exception_type_node): Global variables declared.
7627         (DECL_FUNCTION_THROWS): New macro.
7628         (DECL_FUNCTION_BODY): Modified comment.
7629         (DECL_SPECIFIC_COUNT): Likewise.
7630         (struct lang_decl): New field throws_list.
7631         (IS_UNCHECKED_EXPRESSION_P): New macro.
7632         * lex.c (java_lex): Generate location information for THROW_TK.
7633         * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
7634         EXCEPTIONS_P): New macros.
7635         (enum jdep_code): New value JDEP_EXCEPTION.
7636         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
7637         BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
7638         PATCH_METHOD_RETURN_ERROR): New macros.
7639         (patch_method_invocation_stmt): Added new argument to prototype.
7640         (patch_synchronized_statement, patch_throw_statement,
7641         check_thrown_exceptions, check_thrown_exceptions_do,
7642         purge_unchecked_exceptions, check_throws_clauses): New function
7643         prototypes.
7644         * parse.y Fixed typo in keyword section.
7645         (throw:): Rule tagged <node>.
7646         (THROW_TK): Keyword tagged <operator>.
7647         (method_header:): Last argument to call to method_header passed
7648         from throws: rule.
7649         (throws:, class_type_list:, throw_statement:,
7650         synchronized_statement:, synchronized:): Defined actions.
7651         (method_header): New local variable current. Register exceptions
7652         from throws clause.
7653         (java_complete_tree): Complete and verify exceptions from throws
7654         clause.
7655         (complete_class_report_errors): Error message on exceptions not
7656         found
7657         (java_check_regular_methods): Fixed typo. Shortcut on private
7658         overriding methods. Changed error message on method
7659         redefinition. Check for throws clause compatibility.
7660         (check_throws_clauses): New function.
7661         (java_check_abstract_methods): Use DECL_NAME for wfl or current
7662         method. Changed error message on method redefinition.
7663         (currently_caught_type_list): New static variable.
7664         (java_complete_expand_methods): Purge unchecked exceptions from
7665         throws clause list. Call PUSH_EXCEPTIONS before walk and
7666         POP_EXCEPTIONS after.
7667         (resolve_qualified_expression_name): Pass new argument as NULL to
7668         patch_method_invocation_stmt.
7669         (patch_method_invocation_stmt): New argument ref_decl. Invoke
7670         PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
7671         argument list when appropriate. Use new argument if non null to
7672         store selected method decl.
7673         (patch_invoke): Convert if necessary args of builtin types before
7674         forming CALL_EXPR. Argument list no longer reversed here.
7675         (invocation_mode): Treat final methods as static methods.
7676         (java_complete_tree): New cases for THROW_EXPR: and
7677         SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
7678         function call.
7679         (complete_function_arguments): No more RECORD_TYPE
7680         conversion. Function parameter nodes no longer saved.
7681         (valid_ref_assignconv_cast_p): Avoid handling null type.
7682         (patch_binop): Fixed null constant reference handling.
7683         (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
7684         BUILD_THROW macros.
7685         (patch_try_statement): Fixed comments. Record caught types in
7686         list, push the list, expand try block and pop the list.
7687         (patch_synchronized_statement, patch_throw_statement,
7688         check_thrown_exceptions, check_thrown_exceptions_do,
7689         purge_unchecked_exceptions): New functions.
7690         * typeck.c (lookup_argument_method): Allow WFL in place of method
7691         DECL_NAME during method definition check
7692
7693 1998-10-09  Tom Tromey  <tromey@cygnus.com>
7694
7695         * gjavah.c (decode_signature_piece): New function.
7696         (print_c_decl): Use it.  Added `name_override' argument.
7697         (print_method_info): Use name_override argument to print_c_decl.
7698         (seen_fields): Removed.
7699         (print_field_info): Don't update seen_fields.
7700         (struct method_name): New structure.
7701         (method_name_list): New global.
7702         (print_method_info): Add new method to list of methods.
7703         (name_is_method_p): New function.
7704         (print_field_info): If field name has same name as method, then
7705         change field name.
7706         (process_file): Parse methods before fields.
7707         (field_pass): New global.
7708         (HANDLE_END_FIELD): Take field_pass into account.
7709
7710 Wed Oct  7 12:10:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7711
7712         * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
7713         (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
7714
7715 Sat Oct  3 13:29:46 1998  Anthony Green  <green@cygnus.com>
7716
7717         * jvspec.c: Fix bug in jvgenmain_spec patch.
7718
7719 Fri Oct  2 17:22:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7720
7721         * Makefile.in (lang.o:): Install dependency on java-tree.def.
7722         * decl.c (soft_exceptioninfo_call_node): New global variable.
7723         (init_decl_processing): Fixed indentation. soft_badarrayindex_node
7724         takes extra integer argument. soft_exceptioninfo_call_node
7725         initialized.
7726         * except.c (java_set_exception_lang_code): New function
7727         (method_init_exceptions): Called here.
7728         (prepare_eh_table_type): New function.
7729         (expand_end_java_handler): Called here.
7730         * expr.c (build_java_throw_out_of_bounds_exception): Now features
7731         one argument. Modified generation of call to
7732         soft_badarrayindex_node to use new argument.
7733         (build_java_arrayaccess): Pass faulty index value to
7734         build_java_throw_out_of_bounds_exception.
7735         (generate_name): New function.
7736         (java_lang_expand_expr): New local variables node, current,
7737         has_finally_p. Expand TRY_EXPR node.
7738         (process_jvm_instruction): Replace top of the stack with thrown
7739         object reference when entering exception handler.
7740         * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
7741         specific tree codes.
7742         * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
7743         global.
7744         (DECL_SPECIFIC_COUNT): New macro.
7745         (prepare_eh_table_type, java_set_exception_lang_code,
7746         generate_name): New function declarations.
7747         (match_java_method): Declaration deleted.
7748         (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
7749         macros.
7750         * lex.c (TRY_TK, CATCH_TK): Generate location information.
7751         * parse.h (redefinition_error, refine_accessible_methods_list,
7752         can_cast_to_p): Function declaration removed.
7753         (classitf_redefinition_error, variable_redefinition_error,
7754         parse_jdk1_1_error, find_applicable_accessible_methods_list,
7755         find_most_specific_methods_list, argument_types_convertible,
7756         enter_a_block, valid_builtin_assignconv_identity_widening_p,
7757         valid_cast_to_p, valid_method_invocation_conversion_p,
7758         try_reference_assignconv, add_stmt_to_compound,
7759         build_jump_to_finally, build_tree_list, patch_try_statement,
7760         java_get_catch_block): New function declarations.
7761         * parse.y (string_buffer_type): Global variable deleted.
7762         (group_of_labels, catches, catch_clause, catch_clause_parameter,
7763         finally): Rules tagged <node>.
7764         (TRY_TK, CATCH_TK): Token tagged <operator>.
7765         (class_body_declaration:, class_member_declaration:,
7766         formal_parameter:, explicit_constructor_invocation:,
7767         interface_member_declaration:, constant_declaration:,
7768         primary_no_new_array:, class_instance_creation_expression:,
7769         array_creation_expression:): Issue error on unsuported JDK1.1
7770         features.
7771         (try_statement:, catches:, finally:): Define actions.
7772         (catch_clause_parameter): New rule.
7773         (catch_clause:): Use new rule catch_clause_parameter.
7774         (parse_jdk1_1_error): New function.
7775         (redefinition_error): Renamed classitf_redefinition_error.
7776         (variable_redefinition_error): New function.
7777         (check_class_interface_creation): Call
7778         classitf_redefinition_error.
7779         (java_complete_tree): Added error message on JDEP_TYPE: case.
7780         (complete_class_report_errors): Fixed indentation.
7781         (declare_local_variables): Call variable_redefinition_error.
7782         (source_end_java_method): Call java_set_exception_lang_code and
7783         emit_handlers where appropriate.
7784         (java_method_add_stmt): Call add_stmt_to_block.
7785         (add_stmt_to_block): New function.
7786         (lookup_method_invoke): Fixed outside comment. new local variable
7787         candicates.  Call find_applicable_accessible_methods_list and
7788         find_most_specific_methods_list when searching for a
7789         method. Modified error report to list possible candidates when
7790         applicable.
7791         (find_applicable_accessible_methods_list,
7792         find_most_specific_methods_list, argument_types_convertible): New
7793         function.
7794         (refine_accessible_methods_list): Function deleted.
7795         (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
7796         expr (if applicable) before calling patch_array_ref.
7797         (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
7798         (enter_block): Fixed comment.
7799         (enter_a_block): New function.
7800         (patch_assignment): Reorganized. Call try_reference_assignconv for
7801         references. Call valid_cast_to_p instead of can_cast_to_p.
7802         (try_reference_assignconv,
7803         valid_builtin_assignconv_identity_widening_p): New functions.
7804         (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
7805         (valid_cast_to_p, valid_method_invocation_conversion_p): New
7806         functions.
7807         (build_string_concatenation): Don't resolve StringBuffer.
7808         (patch_cast): Fixed inverted arguments.
7809         (patch_array_ref): Code to save array expr deleted. Call
7810         valid_cast_to_p instead of can_cast_to_p.
7811         (generate_labeled_block): Call generate_name.
7812         (build_jump_to_finally, build_try_statement, java_get_catch_block,
7813         patch_try_statement): New functions.
7814         * typeck.c (match_java_method): Function deleted.
7815
7816 Fri Oct  2 13:48:36 1998  Anthony Green  <green@cygnus.com>
7817
7818         * jvspec.c: jvgenmain_spec uses different temporary file names.
7819
7820 Fri Oct  2 12:50:19 1998  Anthony Green  <green@cygnus.com>
7821
7822         * jvspec.c (lang_specific_driver): Fail if user specifies
7823         --main= when not linking.
7824
7825 Mon Sep 28 13:48:33 1998  Tom Tromey  <tromey@cygnus.com>
7826
7827         * class.c (make_class_data): Push value for `thread' field.
7828         * decl.c (init_decl_processing): Added `thread' field to class.
7829
7830         * class.c (add_field): Always make static fields externally
7831         visible.
7832
7833 Sat Sep 26 08:22:47 1998  Anthony Green  <green@cygnus.com>
7834
7835         * expr.c (build_java_athrow,
7836         build_java_throw_out_of_bounds_exception, expand_invoke,
7837         build_newarray, expand_java_multianewarray, build_java_monitor):
7838         Update comments to reflect _Jv_* function names.
7839
7840 Fri Sep 25 16:03:02 1998  Per Bothner  <bothner@cygnus.com>
7841
7842         * decl.c (complete_start_java_method):  DECL_RESULT is always promoted.
7843         * decl.c (start_java_method):  Handle PROMOTE_PROTOTYPES target macro.
7844         * parse.y (expand_start_java_method):  Likewise.
7845
7846 Thu Sep 24 12:20:35 1998  Per Bothner  <bothner@cygnus.com>
7847
7848         * expr.c (pop_arguments):  Handle PROMOTE_PROTOTYPES target macro.
7849
7850         * class.c (push_class):  IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
7851         (add_field):  No longer need to convert from RECORD_TYPE to pointer,
7852         * expr.c:  Remove no-longer-needed calls to promote_type.
7853         * decl.c (give_name_to_locals):  Liekwise.
7854         * jcf-parse.c (get_class_constant):  Compensate for new signatures.
7855         * parse.y:  Add/remove promote_type calls as appropriate.
7856         * typeck.c (parse_signature_type):  Returns POINTER_TYPE for objects.
7857         (parse_signature_string):  Likewise.
7858         (build_java_array_type):  Fix for now signature convenions.
7859
7860         * lex.c (java_lex):  Fix (from Alex) for JC1_LITE problem.
7861
7862 Wed Sep 23 14:49:35 1998  Tom Tromey  <tromey@cygnus.com>
7863
7864         * class.c (init_class_processing): libjava function renamed to
7865         _Jv_RegisterClass.
7866
7867 Tue Sep 22 12:00:02 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7868
7869         * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
7870         * java-tree.def: Fixed DEFTREECODE third argument.
7871         (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
7872         CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
7873         * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
7874         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
7875         JAVA_THIS_EXPR): Now replaced by tree code definitions.
7876         (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
7877         * lang.c (java_tree_code_type, java_tree_code_length,
7878         java_tree_code_name): New arrays.
7879         (lang_init): Append Java tree node definitions to Gcc ones.
7880         * lex.c (expression_obstack): Declared as extern when JC1_LITE
7881         defined.
7882         (java_init_lex): Initialize wfl_append, wfl_string_buffer,
7883         wfl_to_string.
7884         (java_lex): Allow declaration of empty string constants. Retain
7885         location information on CASE_TK and DEFAULT_TK.
7886         * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
7887         JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
7888         Modified to be more robust.
7889         (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
7890         (build_new_invocation, try_builtin_assignconv,
7891         patch_switch_statement, string_constant_concatenation,
7892         build_string_concatenation, patch_string_cst, patch_string,
7893         java_expand_switch): New function declarations.
7894         * parse.y: Rules related to switch and EH tagged <node>.
7895         (label_id): Set to NULL_TREE
7896         (wfl_string_buffer, wfl_append, wfl_to_string): New static global
7897         tree nodes.
7898         (this_or_super:): Fixed indentation.
7899         (statement:, statement_nsi:, statement_without_trailing_substatement:,
7900         statement_expression:): Removed call to RULE on all sub-rules.
7901         (switch_expression:, switch_labels:): New rules.
7902         (switch_statement:, switch_block:, switch_block_statement_groups:,
7903         switch_block_statement_group:, switch_labels:, switch_label:):
7904         Defined actions.
7905         (throw_statement:, synchronized_statement:, try_statement:):
7906         Defined temporary actions.
7907         (class_instance_creation_expression:): Call
7908         build_new_invocation. Fixed indentation.
7909         (field_access): Fixed indentation.
7910         (method_invocation): Likewise.
7911         (make_qualified_primary): Use THIS_EXPR.
7912         (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
7913         resolving from SUPER, set *type_found.
7914         (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
7915         (java_complete_tree): Removed unused local variable `location'. Case
7916         for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
7917         NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
7918         on MODIFY_EXPR: and all binary operator tree code cases. Removed
7919         STRING_CST: case. default: checks for patchable strings.
7920         (complete_function_arguments): Transform string constant or
7921         crafted StringBuffer if necessary.
7922         (build_method_invocation): Fixed comments.
7923         (build_new_invocation): New function.
7924         (patch_assignment): Call try_builtin_assignconv to figure a valid
7925         assignment conversion between builtin types.
7926         (try_builtin_assignconv): New function.
7927         (build_binop): Use URSHIFT_EXPR directly to call build.
7928         (operator_string): Use UNARY_PLUS_EXPR.
7929         (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
7930         operator.
7931         (do_merge_string_cste, merge_string_cste,
7932         string_constant_concatenation, build_string_concatenation,
7933         patch_string, patch_string_cst): New function.
7934         (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
7935         (patch_unaryop): Likewise. New test of valid ++/-- operands.
7936         (build_newarray_node): Use NEW_ARRAY_EXPR.
7937         (build_this): Use THIS_EXPR.
7938         (build_return): Enable debug information on return statement.
7939         (build_if_else_statement): Likewise.
7940         (complete_labeled_statement): Fixed related comment.
7941         (build_loop_body): Fixed comment.
7942         (build_bc_statement): Enable debug information on break/continue
7943         statements.
7944         (patch_bc_statement): Fixed typos. Handle SWITCH statement
7945         context.
7946         (patch_switch_statement, case_identity, java_expand_switch): New
7947         functions.
7948
7949 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
7950
7951         * buffer.h (BUFFER_INIT):  New macro.
7952         * jcf-write.c (struct jcf_partial):  New type.  Put global stuff here.
7953         Pass (struct jcf_partial *state) to most functions.
7954         (jcf_block, jcf_relocation):  New types.
7955         Support labels, branches, conditionals, loops.
7956
7957 Mon Sep 21 15:08:48 1998  Tom Tromey  <tromey@cygnus.com>
7958
7959         * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
7960
7961 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
7962
7963         * decl.c (integer_type_node):  Make it have INT_TYPE_SIZE.
7964         * verify.c (verify_jvm_instructions):  Use int_type_not (32 bits),
7965         not integer_type_node (INT_TYPE_SIZ bits).
7966
7967         * parse.y (patch_if_else_statement):  Accept promoted_boolean_type_node.
7968
7969         * jcf-reader.c (get_attribute):  New HANDLE_EXCEPTION_TABLE hook.
7970         * jcf-dump.c (print_exception_table):  New function.
7971         (disassemble_method):  Better handling of wide instructions.
7972         Make more robust for bad input.
7973
7974 Wed Sep 30 20:53:51 1998  Jeffrey A Law  (law@cygnus.com)
7975
7976         * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
7977         FreeBSD.
7978
7979 Thu Sep 17 19:45:01 1998  Jeffrey A Law  (law@cygnus.com)
7980
7981         * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
7982
7983 Thu Sep 17 16:21:52 1998  Tom Tromey  <tromey@cygnus.com>
7984
7985         * Makefile.in ($(PARSE_H)): Removed target.
7986
7987 Thu Sep 17 01:57:07 1998  Jeffrey A Law  (law@cygnus.com)
7988
7989         * Makefile.in (JAVA_OBJS): Add memmove.o
7990         (memmove.o): New target & rules.
7991
7992 Tue Sep 15 23:21:55 1998  Tom Tromey  <tromey@cygnus.com>
7993
7994         * expr.c (expand_invoke): Don't generate a call to the class init
7995         code.
7996
7997 Mon Sep 14 10:14:47 1998  Jeffrey A Law  (law@cygnus.com)
7998
7999         * Makefile.in: Add many missing dependencies.
8000         * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
8001         as appropriate.
8002         * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
8003         * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
8004
8005 Fri Sep 11 14:05:21 1998  Per Bothner  <bothner@cygnus.com>
8006
8007         * decl.c (complete_start_java_method):  If method is static (and
8008         not private) call _Jv_InitClass.
8009         * expr.c (expand_invoke):  Don't call build_class_init.
8010
8011         * jvspec.c (jvgenmain_spec):  Fix spec for generated .o file.
8012
8013 Thu Sep 10 10:33:31 1998  Jeffrey A Law  (law@cygnus.com)
8014
8015         * Make-lang.in (GCJ): Define before using.
8016
8017 Wed Sep  9 21:23:10 1998  Jeffrey A Law  (law@cygnus.com)
8018
8019         * gjavah.c (java_no_argument): Renamed from no_argument to avoid
8020         losing due to namespace pollution in GNU getopt.h
8021
8022 Wed Sep  9 13:33:39 1998  Tom Tromey  <tromey@cygnus.com>
8023
8024         * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
8025         (java.all.cross): Likewise.
8026         (java.rest.encap): Likewise.
8027
8028 Tue Sep  8 10:34:05 1998  Jeffrey A Law  (law@cygnus.com)
8029
8030         * gjavah.c (print_class_decls): Fix thinko in arglist
8031         * jcv-io.c (find_classfile): Similarly.
8032
8033 Mon Sep  7 13:59:49 1998  Jeffrey A Law  (law@cygnus.com)
8034
8035         * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
8036
8037 Sat Sep  5 16:08:01 1998  Tom Tromey  <tromey@cygnus.com>
8038
8039         * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
8040         (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
8041         * Makefile.in (PARSE_C): New macro.
8042         (PARSE_H): Likewise.
8043         (PARSE_SCAN_C): Likewise.
8044         ($(PARSE_C)): Target renamed from parse.c.
8045         ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
8046         (clean): Remove parse-scan.c as well.
8047         (parse.o): Depend on $(PARSE_C).
8048
8049 Sat Sep  5 08:48:40 1998  Anthony Green  <green@cygnus.com>
8050
8051         * README, license.terms: Removed.
8052
8053         * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
8054         decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
8055         javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
8056         jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
8057         keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
8058         lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
8059         verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
8060         and Java trademark attribution.
8061
8062 Fri Sep  4 10:42:05 1998  Tom Tromey  <tromey@cygnus.com>
8063
8064         * Makefile.in: Use gcjh, not gjavah.
8065         * config-lang.in (stagestuff): Use gcjh, not gjavah.
8066         * Make-lang.in: Changed gjavah to gcjh everywhere.
8067
8068 Thu Sep  3 18:04:09 1998  Per Bothner  <bothner@cygnus.com>
8069
8070         * gjavah.c:  Support new -prepend -add -append flags.
8071         (print_method_info):  Method is not virtual if class is final.
8072
8073 Thu Sep  3 12:03:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8074
8075         * jv-scan.c: Fixed copyright assignment.
8076         * keyword.gperf: Likewise.
8077         * keyword.h: Likewise.
8078         * lex.c: Fixed copyright assignment.
8079         (java_lex): Push unicode back when parsing '<'.
8080         * lex.h: Fixed copyright assignment.
8081         * parse-scan.y: Likewise.
8082         * parse.h: Fixed copyright assignment.
8083         (build_debugable_stmt, complete_for_loop): New function prototypes.
8084         * parse.y: Fixed copyright assignment.
8085         (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
8086         size_zero_node when completing a loop with no exit condition.
8087         (for_statement_nsi:): Define action.
8088         (for_init:, for_update:): Return size_zero_node when empty.
8089         (declare_local_variables): Call build_debugable_stmt.
8090         (build_debugable_stmt): New function.
8091         (build_loop_body): Build debugable statement around loop
8092         condition part.
8093         (complete_loop_body): Take into account the debugable statement
8094         around the EXIT_EXPR.
8095         (complete_loop_body): New function.
8096         (patch_exit_expr): Fixed condition inversion.
8097
8098 Wed Sep  2 11:53:58 1998  Tom Tromey  <tromey@cygnus.com>
8099
8100         * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
8101         name of thread define.
8102         * jvspec.c (THREAD_NAME): New macro.
8103         (GCLIB): Likewise.
8104         (THREADLIB): Likewise.
8105         (lang_specific_driver): Recognize attempt to link with thread
8106         library or gc library.  Recognize -ljava on command line so it
8107         isn't linked against more than once.
8108
8109 Wed Sep  2 11:28:35 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8110
8111         * parse-scan.y (report_main_declaration): Name of the class
8112         containing `main' can be a qualified name.
8113
8114 Mon Aug 31 13:25:58 1998  Tom Tromey  <tromey@cygnus.com>
8115
8116         * config-lang.in: Changed gjavac to gjc everywhere.
8117         * Make-lang.in: Changed gjavac to gjc everywhere.
8118
8119 Thu Aug 27 02:28:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8120
8121         * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
8122         (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
8123         and install the files.
8124         * Makefile.in (JAVA_OBJS_LITE): New variable.
8125         (compiler:): Now include jv-scan as a dependency.
8126         (../jv-scan$(exeext), parse-scan.c): New targets.
8127         (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
8128         * config-lang.in (compilers): Removed gcj, gjavah from the list.
8129         * jcf-parse.c (parse_source_file): Call java_layout_classes and
8130         check for errors even if parse_only.
8131         * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
8132         defined.
8133         (yylex): New function. Uses java_lex body.
8134         (java_lex): Removed commented out statement. Remove local variable
8135         literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
8136         appropriate.  Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
8137         DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
8138         SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
8139         if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
8140         SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
8141         where appropriate.
8142         (java_lex_error): Empty if JC1_LITE is defined.
8143         (java_get_line_col): Return 0 if JC1_LITE is defined.
8144         * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
8145         SET_MODIFIER_CTX): Moved into the section containing the macros
8146         conditionally defined by JC1_LITE.
8147         (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
8148         argument if JC1_LITE is defined.
8149         (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
8150         REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
8151         is defined.
8152         (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
8153         FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
8154         SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
8155         to different values according to JC1_LITE.
8156         * parse.h (int_fits_type_p, stabilize_reference): Prototype not
8157         declared if JC1_LITE set.
8158         (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
8159         defined if JC1_LITE not set.
8160         (struct parser_ctx): Reorganized and skip the jc1 front end part
8161         if JC1_LITE set.
8162         (java_layout_classes): New function definition.
8163         (java_push_parser_context, java_init_lex, yyparse, yylex,
8164         yyerror): Prototype always declared. All other static function
8165         prototypes declared only if JC1_LITE is not set.
8166         * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
8167         declared in parse.h.
8168         (java_layout_classes): New function.
8169         (java_complete_expand_methods): No longer layout the class here.
8170         * parse-scan.y: New file.
8171         * jv-scan.c: New file.
8172
8173 Tue Aug 25 10:17:54 1998  Tom Tromey  <tromey@cygnus.com>
8174
8175         * gjavah.c (main): Handle -friend option.
8176         (friend_specs): New global.
8177         (generate_access): Handle friend_specs.
8178         (process_file): Likewise.
8179         (MAX_FRIENDS): New macro.
8180         (friend_count): New global.
8181         (print_cxx_classname): Added `prefix' argument.  Ignore arrays.
8182         Changed all callers.
8183
8184 Mon Aug 24 20:19:27 1998  Per Bothner  <bothner@cygnus.com>
8185
8186         * jcf-dump.c (process_class):  Move JCF_FINISH use to main,
8187         (main):  Handle processing all the entries of a named .zip archive.
8188         * jcf-io.c (jcf_trim_old_input):  New function.
8189         * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le):  New macros.
8190
8191 Mon Aug 24 07:35:13 1998  Per Bothner  <bothner@cygnus.com>
8192
8193         * lang.c (flag_assume_compiled):  Make default be on.
8194
8195 Fri Aug 21 17:29:04 1998  Per Bothner  <bothner@cygnus.com>
8196
8197         * jcf-dump.c:  Add bunches of flags to control output more.
8198         (process_class):  New function;  support printing more than one class.
8199         (main): Support new --print-main and --javap flags.
8200         * jcf-reader.c (IGNORE_ATTRIBUTE):  New hook.
8201         * jcf.h (CPOOL_INDEX_IN_RANGE):  New macro.
8202
8203 Thu Aug 20 14:24:47 1998  Per Bothner  <bothner@cygnus.com>
8204
8205         Change mangling of dispatch table to match C++ vtable (w/thunks).
8206         * class.c (build_dtable_decl), java-tree.h:  New function.
8207         (make_class_data):  Call it.
8208         * decl.c (init_decl_processing):  Likewise.
8209
8210 Wed Aug 19 17:57:07 1998  Warren Levy  <warrenl@cygnus.com>
8211
8212         * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
8213         soft_anewarray; adjust args passed.
8214         * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
8215         match _Jv_NewObjectArray.
8216
8217 Wed Aug 19 09:33:23 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8218
8219         * decl.c (push_labeled_block, pop_labeled_block): New functions.
8220         * expr.c (loopup_label): Call create_label_decl.
8221         (create_label_decl): New function.
8222         (java_lang_expand_expr): Call expand_start_bindings with argument
8223         set to zero.
8224         * java-tree.h Added space after PROTO in function declarations
8225         when necessary.
8226         (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
8227         (create_label_decl, push_labeled_block): New function
8228         declarations.
8229         * lex.c (label_id): Initialize.
8230         (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
8231         switch.
8232         * parse.h Added space after PROTO in function declarations when
8233         necessary.
8234         (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
8235         LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
8236         LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
8237         PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
8238         macros.
8239         (struct parser_ctxt): New fields current_loop,
8240         current_labeled_block.
8241         (build_if_else_statement, patch_if_else_statement,
8242         add_stmt_to_compound, patch_exit_expr, build_labeled_block,
8243         generate_labeled_block, complete_labeled_statement,
8244         build_bc_statement, patch_bc_statement, patch_loop_statement,
8245         build_new_loop, build_loop_body, complete_loop_body): New function
8246         declarations.
8247         * parse.y (java_warning_count): New global variable.
8248         (label_id): New static variable.
8249         (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
8250         (block:): Return size_zero_node when block is empty.
8251         (empty_statement:): Return size_zero_node.
8252         (statement:): Implement supplemental action when for_statement: is
8253         reduced.
8254         (label_decl:): New rule.
8255         (labeled_statement:): Rewritten using label_decl. Actions
8256         implemented.
8257         (labeled_statement_nsi:): Likewise.
8258         (if_then_statement): Actions implemented.
8259         (while_expression): New rule.
8260         (while_statement:): Rewritten using while_expression. Actions
8261         implemented.
8262         (while_statement_nsi:): Likewise.
8263         (do_statement_begin:): New rule.
8264         (do_statement:): Rewritten using do_statement_begin. Actions
8265         implemented.
8266         (for_statement:): Rewritten using for_begin. Actions implemented.
8267         (for_statement_nsi:): Likewise.
8268         (for_header:, for_begin:): New rules.
8269         (for_init:): Actions implemented.
8270         (statement_expression_list:, break_statement:,
8271         continue_statement:): Likewise.
8272         (yyerror): Count number of issued warning(s).
8273         (java_report_errors): Report error(s) and/or warning(s).
8274         (java_complete_class): Use build_java_argument_signature to
8275         recompute completed method signature.
8276         (java_check_regular_methods): New locals method_wfl and aflags.
8277         Use method_wfl instead of lookup_cl during error reports. Fixed
8278         indentation and modified some error messages. Use
8279         lang_printable_name in method instead of the DECL_NAME. New code
8280         to issue warnings on methods not overriding corresponding methods
8281         private to a different package.
8282         (java_method_add_stmt): Call add_stmt_to_compound.
8283         (add_stmt_to_compound): New function.
8284         (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
8285         LOOP_EXPR, EXIT_EXPR and COND_EXPR.
8286         (build_if_else_statement, patch_if_else_statement,
8287         build_labeled_block, generate_labeled_block,
8288         complete_labeled_statement, build_new_loop, build_loop_body,
8289         complete_loop_body, patch_loop_statement, build_bc_statement,
8290         patch_bc_statement, patch_exit_expr): New functions.
8291         * typeck.c (build_java_signature): Build argument signature before
8292         enclosing it in between parenthesis.
8293
8294 Mon Aug 17 17:44:24 1998  Warren Levy  <warrenl@cygnus.com>
8295
8296         * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
8297         (JAVA_OBJS): Added reminder comment
8298
8299 Thu Aug 13 10:01:45 1998  Nick Clifton  <nickc@cygnus.com>
8300
8301         * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
8302         be interpreted as a long long.
8303
8304 Thu Aug 13 14:34:07 1998  Warren Levy  <warrenl@cygnus.com>
8305
8306         * decl.c (init_decl_processing): Use _Jv_InitClass, not
8307         soft_initialise_class.  Use _Jv_NewMultiArray, not
8308         soft_multianewarray.  Use _Jv_ThrowBadArrayIndex, not
8309         soft_badarrayindex.  Use _Jv_CheckCast, not soft_checkcast.  Use
8310         _Jv_CheckArrayStore, not soft_checkarraystore.  Use
8311         _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
8312
8313 Wed Aug 12 14:23:13 1998  Per Bothner  <bothner@cygnus.com>
8314
8315         * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
8316         length_identifier_node):  New global tree node constants.
8317         * parse.y (kw_super, kw_this, kw_length):  Removed globals.
8318         Replace uses by super_identifier_node etc.
8319         * lex.c (kw_super, kw_this, kw_length):  Don't initialize.
8320
8321         * parse.y (resolve_field_access):  Don't special-case ".length" if
8322         flag_emit_class_files.
8323         (patch_array_ref):  Leave as ARRAY_REF if flag_emit_class_files.
8324         * jcf-write.c (generate_bytecode_insns):  Handle ARRAY_REF opcode
8325         and ARRAY.length.
8326
8327 Tue Aug 11 11:31:55 1998  Per Bothner  <bothner@cygnus.com>
8328
8329         * decl.c (init_decl_processing): Remove unused method_type_node fields.
8330         * class.c (make_method_value):  Remove init for removed fields.
8331
8332         * class.c (layout_class):  Use build_java_argument_signature.
8333         * java-tree.h (TYPE_ARGUMENT_SIGNATURE):  New macro.
8334
8335         * typeck.c (push_java_argument_signature):  Removed.  Merged into ...
8336         (build_java_argument_signature):  Use TYPE_ARGUMENT_SIGNATURE cache.
8337         (build_java_signature):  Don't use push_java_argument_signature.
8338
8339         * typeck.c (lookup_argument_method):  New function.
8340         * parse.y (java_check_regular_methods):  Use lookup_argument_method
8341         instead of lookup_java_method2 followed by lookup_java_method.
8342
8343         * parse.y (check_method_redefinition):  Minor optimization.
8344
8345         * jcf-write.c (generate_bytecode_insns):  Handle RETURN_EXPR,
8346         MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
8347
8348 Mon Aug 10 09:57:15 1998  Tom Tromey  <tromey@cygnus.com>
8349
8350         * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
8351         c-pragma.o.
8352
8353         * gjavah.c (java_float_finite): Use K&R-style definition.
8354         (java_double_finite): Likewise.
8355         (generate_access): Now returns void.  Changed all callers.
8356         (last_access_generated): Removed.
8357         (process_file): Only make a single pass over the .class file.
8358
8359 Wed Jul 29 17:50:23 1998  Per Bothner  <bothner@cygnus.com>
8360
8361         * class.c (get_dispatch_table):  Add extra dummy vtable entry,
8362         for compatibility for G++ (with -fvtable-thunks).
8363         * expr.c (build_invokevirtual):  Add one for extra dummy vtable entry.
8364
8365         * gjavah.c (process_file):  Use public inheritance for super-class.
8366
8367 Wed Jul 29 13:19:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8368
8369         * lex.c (java_init_lex): Initialize ctxp->package.
8370         * parse.h (struct parser_ctxt): package and package_len replaced
8371         by tree package, an identifier node. Field method_decl_list is
8372         gone. Fixed comments.
8373         (lookup_field_wrapper, merge_qualified_name, not_accessible,
8374         class_in_current_package): New function prototypes.
8375         * parse.y (array_type:): Set class loaded flag on primitive type
8376         arrays.
8377         (package_declaration:): Assign ctxp->package to the
8378         identifier node.
8379         (method_invocation:): Handle invocation of method qualified by
8380         `super'.
8381         (single_type_import_declaration:): Removed ambiguity check.
8382         (java_pop_parser_context): New local variable `next'. Reset and
8383         set IMPORT_CLASSFILE_NAME flags on current and previous import
8384         list.
8385         (java_accstring_lookup): Use new local macro COPY_RETURN.
8386         (lookup_field_wrapper): New function.
8387         (parser_qualified_classname): Use merge_qualified_name.
8388         (parser_check_super_interface): Broaden error message.
8389         (do_resolve_class): Check for qualified class name in the current
8390         compilation unit if appropriate.
8391         (process_imports): Check for already defined classes.
8392         (check_pkg_class_access): Got rid of call to
8393         get_access_flags_from_decl.
8394         (java_complete_expand_methods): Call safe_layout_class based on
8395         the current class size.
8396         (make_qualified_primary): Build a WFL qualification on primary if
8397         none exists.
8398         (merge_qualified_name): New function.
8399         (make_qualified_name): Use merge_qualified_name.
8400         (resolve_expression_name): Use safe_lookup_field.
8401         (resolve_field_access): Got rid of call to get_access_flags_from_decl.
8402         (resolve_qualified_expression_name): Likewise. Check on resolved
8403         element accessibility.
8404         (not_accessible_p, class_in_current_package): New functions.
8405         (maybe_access_field): Got rid of call to get_access_flags_from_decl.
8406         (patch_method_invocation_stmt): Merged common pieces. Check
8407         accessibility of invoked method.
8408         (check_for_static_method_reference): Add returned type in error
8409         message.
8410         (invocation_mode): Get rid of bogus check on PRIVATE methods.
8411         (refine_accessible_methods_list): Merged two conditions in test.
8412         (java_complete_class): Sanity check on stabilize_ref gone.
8413         * zextract.c (read_zip_archive): Cast lseek second argument to long.
8414
8415 Tue Jul 28 21:39:22 1998  Per Bothner  <bothner@cygnus.com>
8416
8417         * class.c (hashUtf8String):  Fix - use new JavaSoft specification.
8418
8419 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8420
8421         * gjavah.c (F_NAN): Removed.
8422         (F_NAN_MASK): New macro.
8423         (F_POSITIVE_INFINITY): Removed.
8424         (F_NEGATIVE_INFINITY): Likewise.
8425         (java_float_finite): Rewrote.
8426         (D_NAN_MASK): Renamed.
8427         (java_double_finite): Rewrote.
8428         (D_POSITIVE_INFINITY): Removed.
8429         (D_NEGATIVE_INFINITY): Likewise.
8430
8431         * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
8432         If verbose, print underlying representation of value in hex.
8433
8434 Fri Jul 24 14:14:32 1998  Per Bothner  <bothner@cygnus.com>
8435
8436         * buffer.h, buffer.c:  New files.
8437         * Makefile.in (JAVA_OBJS):  Add buffer.o.
8438
8439         Support locals variables and writing their debug entries to .class.
8440         * jcf-write.c:  Simplify some by user new buffer type.
8441         (vode_buffer_grow):  Removed.
8442         (struct localvar_info):  New type.
8443         (localsvars, localvartable):  New buffers.
8444         (localvar_alloc, localvar_free):  New functions.
8445         (generate_bytecode_insns):  Handle local variables.
8446         (generate_classfile):  Write LocalVariableTable attribute.
8447
8448 Fri Jul 24 13:46:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8449
8450         * jcf-io.c (open_in_zip): Check the zipfile magic number.
8451         * zipfile.h (ZIPMAGIC): New macro.
8452
8453 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8454
8455         * Makefile.in (gjavah.o): Updated dependencies.
8456         (jcf-dump.o): Likewise.
8457         (all.indirect): Use ../gjavah.
8458         (../gjavah$(exeext)): Likewise.
8459         (clean): Don't remove gjavah.
8460         (clean): Remove parse.c, not java/parse.c.
8461         * Make-lang.in (java): Added gjavah.
8462         (gjavah$(exeext)): New target.
8463         (GJAVAH_SOURCES): New macro.
8464         (java.all.build): Added gjavah.
8465         (java.all.cross): Likewise.
8466         (java.rest.encap): Likewise.
8467         * config-lang.in (compilers, stagestuff): Added gjavah.
8468
8469 Thu Jul 23 18:33:56 1998  Tom Tromey  <tromey@cygnus.com>
8470
8471         * gjavah.c (java_float_finite): New function.
8472         (java_double_finite): Likewise.
8473         (F_POSITIVE_INFINITY): New macro.
8474         (F_NEGATIVE_INFINITY): Likewise.
8475         (F_NAN): Likewise.
8476         (D_POSITIVE_INFINITY): Likewise.
8477         (D_NEGATIVE_INFINITY): Likewise.
8478         (D_NAN): Likewise.
8479         (print_field_info): Use java_float_finite and java_double_finite.
8480
8481 Thu Jul 23 15:28:24 1998  Per Bothner  <bothner@cygnus.com>
8482
8483         * parse.y (method_header):  Name "this" implicit argument.
8484
8485 Wed Jul 22 15:47:30 1998  Per Bothner  <bothner@cygnus.com>
8486
8487         * jcf-write.c:  Write out LineNumberTable attribute in .class file.
8488         (linenumber_buffer, linenumber_ptr, linenumber_limit):  New statics.
8489         (put_linenumber):  New function.
8490         (generate_bytecode_insns, generate_classfile):  Write line numbers.
8491
8492 Wed Jul 22 14:39:00 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8493
8494         * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
8495         (lookup_name, build_known_method_ref, build_class_init,
8496         build_invokevirtual, invoke_build_dtable, match_java_method,
8497         build_field_ref, pushdecl_force_head, build_java_binop,
8498         binary_numeric_promotion, build_decl_no_layout,
8499         build_java_arrayaccess, build_newarray, build_anewarray,
8500         build_java_array_length_access, build_java_arraynull_check): New
8501         extern function prototypes.
8502         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8503         JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
8504         java-tree.h.
8505         * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
8506         to NULL
8507         * jcf.h (jcf_out_of_synch): New extern function prototype.
8508         * parse.h: Static/global function implemented in parse.y
8509         prototyped and declarations moved at the end of the file.
8510         (DECL_P): Check that the argument isn't null.
8511         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8512         JAVA_THIS_EXPR): No longer defined here. See java-tree.h
8513         (QUAL_DECL_TYPE): New macro.
8514         (PARAMS): Macro definition removed.
8515         * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
8516         (return_statement:): Call build_return.
8517         (field_access:): Call make_qualified_primary in sub rule.
8518         (method_invocation:): Build method invocation and call
8519         make_qualified_primary when processing primaries.
8520         (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
8521         get_type_from_signature.
8522         (java_check_regular_method): Extra integer 0 argument when calling
8523         lookup_java_method2.
8524         (lookup_java_interface_method2): Extra method DECL argument when
8525         calling lookup_java_interface_method2.
8526         (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
8527         COMPOUND_EXPR node.
8528         (java_complete_expand_method): Layout current class iff not
8529         already done. Don't process interface's methods.
8530         (java_complete_expand_method): Use super class only if it
8531         exists. Use current class otherwise.
8532         (make_qualified_primary): New function.
8533         (resolve_expression_name): Process qualified expression or
8534         expression from primary the same way.
8535         (resolve_expression_name): Two last arguments to
8536         resolve_field_access are now NULL_TREEs.
8537         (resolve_field_access): New variable is_static. Local field must
8538         be DECLs. is_static computed on field DECLs only. Append code in
8539         where_found to the field access if necessary. Use QUAL_DECL_TYPE
8540         to initialize field_type.
8541         (resolve_qualified_expression_name): New local variable,
8542         previous_call_static and is_static. Handle primaries with function
8543         calls, casts, array references and `this'. `super' now handled as
8544         `(super_class)this'. Use is_static to clarify boolean expressions.
8545         Added code to handle case where a proper handle is required to
8546         access a field. Use QUAL_DECL_TYPE where applicable.
8547         (maybe_access_field): New function.
8548         (patch_method_invocation_stmt): New arguments primary, where,
8549         is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
8550         deleted. Use `where' as a type to search from if specified. Check
8551         for static method reference where forbidden. Append primary or
8552         current_this to the argument list if not calling constructor nor
8553         static methods.
8554         (check_for_static_method_reference): New function.
8555         (patch_invoke): Layout the class on which new is done if
8556         necessary.
8557         (lookup_method_invoke): Changed format to report errors on
8558         methods.
8559         (qualify_ambiguous_name): New local variable this_found. Now
8560         handle things from primaries. Method call are considered
8561         expression names.
8562         (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
8563         changed into NULLs.
8564         (not_initialized_as_it_should_p): Comply with the new DECL_P.
8565         (java_complete_tree): New case fo RETURN_EXPR. Process function
8566         call arguments in separate function.
8567         (complete_function_arguments): New function.
8568         (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
8569         anymore.
8570         (patch_assignment): Take the return function slot into account as
8571         a RHS. Distinguish assignment from a return.
8572         (valid_ref_assignconv_cast_p): Use build_java_argument_signature
8573         when checking methods in interfaces.
8574         (resolve_type_during_patch): NULL argument to unresolve_type_p
8575         instead of NULL_TREE.
8576         (patch_newarray): Fixed typo in comment.
8577         (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
8578         (build_return, patch_return): New functions.
8579         * typeck.c (lookup_java_constructor): Fixed typo in comment.
8580
8581 Tue Jul 21 12:10:04 1998  Per Bothner  <bothner@cygnus.com>
8582
8583         * constants.c (find_name_and_type_constant, find_fieldref_index,
8584         find_methodref_index):  New methods.
8585         * expr.c (build_invoke_non_interface):  If flag_emit_class_files,
8586         just return given method.  Also, rename to build_known_method_ref.
8587         (expand_invoke):  Rename call to build_invoke_non_interface.
8588         * java-tree.h, parse.h:  Update prototype.
8589         * parse.y, decl.c, jcf-parse.c:  Suppress calls to back-end functions
8590         (such as expand_expr_stmt) if flag_emit_class_files.
8591         * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
8592         STACK_TARGET, IGNORE_TARGET):  New macros.
8593         (code_buffer, code_ptr, code_limit, code_S, code_SP_max):  New globals.
8594         (generate_bytecode_insn):  New function to generate method's bytecode.
8595         (generate_classfile):  Node generate Code attribute for a method.
8596         (code_buffer_grow, push_constant1, push_constant2, push_int_const,
8597         push_long_const, field_op, adjust_typed_op, maybe_wide):
8598         New functions used by generate_bytecode_insn.
8599
8600         * typeck.c (signature_include_return):  Remove variable.
8601         (push_java_argument_signature, build_java_argument_signature):  New.
8602         (build_java_signature):  Use push_java_argument_signature.
8603         * parse.y:  Use build_java_argument_signature instead of fiddling
8604         with signature_include_return.
8605
8606 Fri Jul 17 09:48:51 1998  Tom Tromey  <tromey@cygnus.com>
8607
8608         * gjavah.c (print_c_decl): Always generate JArray<>* for array
8609         types.
8610
8611         * Makefile.in (all.indirect): Added gjavah$(exeext).
8612         (gjavah$(exeext)): Added $(exeext).
8613         (clean): Likewise.
8614
8615 Thu Jul 16 15:29:20 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8616
8617         * class.c (layout_class): Call to java_layout_parsed_class replace
8618         by safe_layout_class.
8619         * expr.c (build_java_array_length_access): Removed static storage
8620         class in the function definition.
8621         (build_java_arraynull_check): Likewise.
8622         Also fixed typos in two comments.
8623         * lex.c (java_init_lex): Initialize static global kw_length.
8624         (java_lex): Use BUILD_OPERATOR on RETURN_TK.
8625         * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
8626         java_lex_error.
8627         (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
8628         * parse.h (resolve_no_layout): New static function declaration.
8629         (get_identifier_in_static): Declaration removed.
8630         (java_layout_parsed_class): Function name declaration changed to
8631         safe_layout_class.
8632         (build_newarray_node, patch_newarray, resolve_type_during_patch,
8633         not_initialized_as_it_should_p, build_this): New static function
8634         declarations.
8635         (pushdecl_force_head, build_java_binop, int_fits_type_p,
8636         binary_numeric_promotion, stabilize_reference,
8637         build_decl_no_layout, build_java_arrayaccess): Extern function
8638         declarations moved into their own section.
8639         (build_newarray, build_anewarray, build_java_array_length_access,
8640         build_java_arraynull_check): New extern function declarations.
8641         (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
8642         (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
8643         fake tree codes.
8644         (CALL_CONSTRUCTOR_P): New macro.
8645         * parse.y (kw_length): New static global tree node.
8646         (return_statement): Tagged <node>.
8647         (RETURN_TK): Tagged <operator>.
8648         (variable_declarator_id:): Build variable declaration with an
8649         empty initialization value if a syntax error was found in the
8650         initialization part of the variable declaration.
8651         (statement_without_trailing_substatement:): return_statement: now
8652         uses the default rule.
8653         (return_statement:): Temporarily fixed to return NULL_TREE.
8654         (primary_no_new_array:): Call build_this when THIS_TK was parsed.
8655         (class_instance_creation_expression:): Class creation rules now
8656         call build_method_invocation upon reduction.
8657         (array_creation_expression:): Rules call build_newarray_node upon
8658         reduction.
8659         (dim_exprs:): Build a list of dimension expressions.
8660         (dim_expr:): Store location of the OSB_TK in the dimension
8661         expression node.
8662         (method_invocation:): Added a new error rule.
8663         (build_unresolved_array_type): WFL argument may also be an array
8664         on a primitive type. Name of the argument changed to reflect this.
8665         (method_declarator): Insert argument type at the beginning of the
8666         argument type list and later reverse the list.
8667         (unresolved_type_p): Argument 'returned' may be optionally
8668         NULL_TREE.
8669         (java_layout_class_from_source): Function renamed
8670         safe_layout_class.
8671         (resolve_and_layout): Now call resolve_no_layout and
8672         safe_layout_class.
8673         (resolve_no_layout): New function.
8674         (purify_type_name): New function.
8675         (complete_class_report_errors): Call purify_type_name during error
8676         report on a type not found.
8677         (process_imports): error_found local variable doesn't need to be
8678         initialized to zero.
8679         (declare_local_variables): New local type_wfl. Fixed typo in error
8680         message. type_wfl assigned to unresolved type and used to register
8681         incomplete type. Build a WFL around the variable initialization
8682         statement so that debug info can be generated on it.
8683         (source_start_java_method): Reverse argument list after they've
8684         been processed.
8685         (current_this): New static global variable.
8686         (java_complete_expand_methods): Set current_this when appropriate.
8687         (resolve_expression_name): Build correct static and non static
8688         field access bearing a simple name.
8689         (resolve_field_access): Resolve the length field of arrays. Handle
8690         f.m() cases.
8691         (patch_method_invocation_stmt): Set the type of the method
8692         invocation to error_mark_node. This value is later overridden by a
8693         valid type, if any. Don't handle qualified constructor invocation
8694         as qualified method invocation. Call lookup_method_invoke with its
8695         new flag. It's no longer necessary to access the selected method
8696         as the value of a tree list. Handle constructor invocation.
8697         (patch_invoke): Reverse argument list when invoking non interface
8698         methods. Insert call to new as the first argument of the
8699         constructor.
8700         (invocation_mode): Return a INVOKE_STATIC is the invoked method is
8701         defined within a final class. Return INVOKE_STATIC if the invoked
8702         method is a constructor.
8703         (lookup_method_invoke): New lc argument is a flag to indicate a
8704         constructor lookup. Now handle constructor lookup. Choose the most
8705         specific method in case several were matching the invocation
8706         requirements. Return a method decl instead of a tree list featuring
8707         one single method decl element.
8708         (refine_accessible_methods_list): New lc flag argument to
8709         indicate that a constructor is being looked up.
8710         (not_initialized_as_it_should_p): New function.
8711         (java_complete_tree): Now process fake tree codes
8712         JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
8713         save_expr on resolved function call arguments. Case on
8714         UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
8715         (patch_assignment): LHS can be a field access expression. When
8716         dealing with reference, lhs_type is the promoted type of the
8717         rhs_type, not the RHS. Use not_initialized_as_it_should_p where
8718         applicable.
8719         (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
8720         (patch_binop): Use not_initialized_as_it_should_p where
8721         applicable.
8722         (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
8723         (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
8724         where applicable.
8725         (resolve_type_during_patch): New function.
8726         (patch_cast): Call resolve_type_during_patch to resolve type and
8727         report error accordingly.
8728         (patch_array_ref): Use not_initialized_as_it_should_p where
8729         applicable. Array base expression is saved before being
8730         used. Promote the type of an array elements if it contains non
8731         builtin types.
8732         (build_newarray_node, patch_newarray, build_this): New functions.
8733
8734 Thu Jul 16 10:46:47 1998  Tom Tromey  <tromey@cygnus.com>
8735
8736         * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
8737         increment it in `for' statement.
8738         (print_field_info): If number is inf or nan, don't print it.
8739         (print_method_info): If method name is `delete', just ignore it.
8740         (print_c_decl): Special-case jstringArray.
8741
8742         * gjavah.c (help): New function.
8743         (no_argument): New function.
8744         (usage): Changed text.
8745         (main): Rewrote argument handling.  Now handles -v, --help,
8746         --version.
8747         (version): New function.
8748         (found_error): New global.
8749         (main): Return found_error.
8750         (generate_access): Set found_error.
8751         (print_c_decl): Likewise.
8752
8753 Wed Jul 15 10:36:27 1998  Tom Tromey  <tromey@cygnus.com>
8754
8755         * gjavah.c (print_c_decl): Don't print "," when examining field.
8756         Skip type name when looking at "[L" types.
8757         (process_file): Now static.
8758         (generate_access): Now returns int.
8759         (last_access_generated): New global.
8760         (process_file): Clear last_access_generated; make multiple passes
8761         over the class.
8762         (print_field_info): Just return if generate_access returns true.
8763         (print_method_info): Likewise.  Also, allow <init> functions to
8764         pass through.
8765         (print_c_decl): Added is_init argument.  Print constructors
8766         properly.
8767         (print_cxx_classname): Use UTF8_GET to extract characters from
8768         string.
8769         (print_base_classname): New function.
8770         (print_class_decls): New function.
8771         (process_file): Use it.
8772         (utf8_cmp): New function.
8773
8774 Mon Jul 13 14:21:47 1998  Nick Clifton  <nickc@cygnus.com>
8775
8776         * lang-options.h: Format changed to match changes in gcc/toplev.c
8777         to implement a --help option.
8778
8779 1998-07-10  Brendan Kehoe  <brendan@cygnus.com>
8780
8781         * decl.c (init_decl_processing): Revert change to dtable_type.
8782
8783 Thu Jul  9 18:22:12 1998  Per Bothner  <bothner@cygnus.com>
8784
8785         * java-tree.h (CLASS_P):  Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
8786
8787 1998-07-08  Brendan Kehoe  <brendan@cygnus.com>
8788
8789         * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
8790
8791         * lang.c (lang_init): Default flag_exceptions to 1, without
8792         checking to see if it's 2 first.
8793
8794 Wed Jul  8 03:01:32 1998  Jeffrey A Law  (law@cygnus.com)
8795
8796         * constants.c: Include "system.h".
8797         * decl.c: Likewise.
8798         * lang.c (flag_new_exceptions): Get via extern now.
8799         (lang_init_options): New functions.  Turn on flag_new_exceptions.
8800
8801 Tue Jul  7 12:56:48 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8802
8803         * lex.c (java_lex): Return 0 when we see an invalid character in
8804         the input.
8805
8806         * lex.c (java_read_char): Specify extra argument when calling
8807         java_lex_error.
8808         (java_read_unicode, java_parse_end_comment,
8809         java_parse_escape_sequence): Likewise,
8810         (java_lex): Specify extra argument when calling
8811         java_lex_error. Test that IDs are beginning with a legal character
8812         for IDs. Handle invalid characters with an error message and a
8813         call to java_lex_error.
8814         (java_lex_error): Adjust column position by new argument
8815         `forward'. Issue an error even if in the middle of reporting an
8816         other error.
8817
8818 1998-07-07  Brendan Kehoe  <brendan@cygnus.com>
8819
8820         * jcf-io.c (find_class): Zero out BUFFER before we use it, since
8821         we don't explicitly put a null pointer when we're copying it.
8822
8823 Tue Jul  7 09:38:38 1998  Tom Tromey  <tromey@cygnus.com>
8824
8825         * gjavah.c (print_cxx_classname): New function.
8826         (super_class_name): Likewise.
8827         (print_super_fields): Removed.
8828         (in_super): Removed.
8829         (print_field_info): Never generate #defines.
8830         (print_c_decl): Changed generated types to match JNI.  No longer
8831         print class name before method name.
8832         (print_method_info): Print "static" before static methods.
8833         Print "virtual" before non-final methods.
8834         (usage): Use exit(1), not exit(-1).
8835         (main): Likewise.
8836         (print_field_info): Use %.17g to print a double.
8837         (last_access): New globals.
8838         (process_file): Initialize last_access.
8839         (usage): Now static.
8840         (ACC_VISIBILITY): New define.
8841         (generate_access): New function.
8842         (print_field_info): Call it.
8843         (print_method_info): Likewise.  Also, generate information for all
8844         methods, not just native methods.  Return void.
8845         (print_c_decl): Return void.
8846         (print_field_info): Return void.
8847
8848 Thu Jul  2 16:53:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8849
8850         * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
8851         processing the jc1 grammar file. Prefix bison functions and
8852         variables with java_.
8853         (parse.c): Dependencies on parse.h and lex.h
8854         * expr.c (build_java_arrayaccess): Function now global.
8855         * java-tree.h: Comment reorganized to carry on previous
8856         classification effort.
8857         (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
8858         RESOLVE_TYPE_NAME_P): New flags on WFLs.
8859         * jcf-parse.c (parse_source_file): java_parse_source_file renamed
8860         java_parse (new prefix java_ generated by bison).
8861         (java_layout_parsed_class, java_register_parsed_class): Function
8862         call removed.
8863         (yyparse): Removed unnecessary call to init_outgoing_cpool.
8864         * lex.c (static tree wfl_op): Variable deleted.
8865         (java_init_lex): Initialize kw_super and kw_this. Initialize more
8866         ctxp fields to NULL_TREE.
8867         (java_lex): No longer create WFL for operators. Filename caching
8868         mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
8869         created as STRING_CST and later expanded. Removed extra argument
8870         to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
8871         and SUPER.
8872         (build_wfl_node): Removed code in comments.
8873         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
8874         store token and location data in the current bison token.
8875         * parse.h: Removed pre-processor based symbol prefixes hack. Moved
8876         static/extern function declaration at the beginning of the file.
8877         (struct qualification): Data structure definition deleted.
8878         (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
8879         (qualify_ambiguous_name): Function declaration modified. Function
8880         now returns nothing.
8881         (build_array_ref, patch_array_ref, make_qualified_name,
8882         resolve_qualified_expression_name, maybe_generate_clinit,
8883         resolve_field_access): New static function declarations.
8884         (build_java_arrayaccess): New extern function declaration.
8885         (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
8886         (CALL_EXPR_PRIMARY): Macro deleted.
8887         (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
8888         (struct parser_ctxt): Field initialized_final
8889         removed. non_static_initialized, static_initialized: New fields.
8890         * parse.y (static tree kw_super, static tree kw_this): New global
8891         static.
8892         (%union): tree wfl field of operator member replaced by int
8893         location. WFLs are non longer created for operators.
8894         (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
8895         (qualified_name:): Now calls make_qualified_name to build the
8896         identifier.
8897         (type_declaration:): Consider generating <clinit> when class
8898         parsing completed.
8899         (variable_declarator:): Directly build an assignment node when the
8900         variable is initialized when declared.
8901         (this_or_super:): Build a WFL and set current location when THIS
8902         or SUPER are parsed.
8903         (expression_statement:): Wrap statement around a WFL.
8904         (primary_no_new_array:): Fixed typo. Changed value returned by
8905         THIS_TK because of its new type (temporary).
8906         (dim_exprs:): Temporary fix because of OSB_TK's new type.
8907         (field_access:): Build qualified name with SUPER.
8908         (method_invocation:): Fixed returned value because of SUPER's new
8909         type.
8910         (array_access:): Use OSB_TK location information.
8911         (post_increment_expression:, post_decrement_expression:,
8912         unary_expression:, pre_increment_expression:,
8913         pre_decrement_expression:, unary_expression_not_plus_minus:,
8914         cast_expression:, multiplicative_expression:,
8915         additive_expression:, shift_expression:, relational_expression:,
8916         equality_expression:, and_expression:, exclusive_or_expression:,
8917         inclusive_or_expression:, conditional_and_expression:,
8918         conditional_or_expression:, assignment:): Use new location/token
8919         information available on operators.
8920         (create_class): Set super_decl_type to NULL_TREE when processing
8921         java.lang.Object.
8922         (register_fields): Field initialization is now a MODIFY_EXPR
8923         node. Chain initialization code to the matching lists (according
8924         the the field declaration modifiers).
8925         (maybe_generate_clinit): New function.
8926         (method_header): Don't set method's DECL_NAME to a WFL when adding
8927         methods to java.lang.Object.
8928         (resolve_and_layout): Now can return NULL_TREE if the type
8929         resolution fails. Otherwise, return the class DECL instead of its
8930         TYPE.
8931         (check_method_redefinition): Don't patch method DECL_NAME if it
8932         belongs to java.lang.Object.
8933         (process_imports): Simply assign error_found to the value returned
8934         by check_pkg_class_access.
8935         (declare_local_variables): Don't use their init statements (if
8936         any) when parsing error were previously found. Reuse MODIFY_EXPR
8937         build during parsing as an init statement.
8938         (java_method_add_stmt): Now return the current method body.
8939         (java_layout_parsed_class, java_register_parsed_class): Functions
8940         removed.
8941         (java_complete_expand_methods): Initialize the constant pool on a
8942         per class basis. Layout the classes before expanding their method
8943         bodies. Don't try expand artificial constructor code if error were
8944         found. Make the classes data and register them if no error were
8945         found.
8946         (java_complete_expand_method): Retrieve an artificial constructor
8947         argument list before entering its body. Assign the top block to
8948         the artificial constructor function body and set types of declared
8949         blocks and compound statements to void. Walk method body if not an
8950         artificial constructor.
8951         (make_qualified_name, cut_identifier_in_qualified): New functions.
8952         (resolve_expression_name): Fixed comments. Save/restore the
8953         current class CLASS_LOADED_P flag value. Build non qualified
8954         static field access and handle qualified expression names.
8955         (resolve_field_access, resolve_qualified_expression_name): New
8956         functions.
8957         (patch_method_invocation_stmt): Use the new expression resolution
8958         scheme, calling resolve_field_access when the function call is
8959         resolved as an expression.
8960         (qualify_ambiguous_name): Function rewritten to work on qualified
8961         expression produced by make_qualified_name.
8962         (java_complete_tree): Promote type when function's argument are
8963         RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
8964         the assignment to discover further errors if RHS is a expression
8965         name that fails to evaluate. Declare LHS initialized even though
8966         the assignment failed. Don't use the location variable and removed
8967         extra argument in patch function calls. Now handle the ARRAY_REF
8968         case and build internal string representation when STRING_CSTs are
8969         walked.
8970         (build_method_invocation): Don't wrap function call around a WFL.
8971         (build_assignment): Likewise. Use the operator location
8972         information.
8973         (patch_assignment): Handle array access LHSs. Handle error
8974         provenance, resulting in a better error report.
8975         (build_binop): Use op_location from operator as binop location
8976         information.
8977         (build_unaryop, build_incdec, build_cast): Likewise.
8978         (patch_binop): Extract location information from the node. Fixed
8979         typo in error message.
8980         (patch_unary_op): Extract location information from the node.
8981         (build_array_ref, patch_array_ref): New functions.
8982
8983 Wed Jul  1 13:11:36 1998  Tom Tromey  <tromey@cygnus.com>
8984
8985         * expr.c (expand_java_INSTANCEOF): Changed calling convention to
8986         match _Jv_IsInstanceOf.
8987         * decl.c (init_decl_processing): Use _Jv_NewArray, not
8988         soft_newarray.  Use _Jv_IsInstanceOf, not soft_instanceof.
8989
8990 Tue Jun 30 14:12:54 1998  Tom Tromey  <tromey@cygnus.com>
8991
8992         * decl.c (init_decl_processing): Functions are now named
8993         _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
8994
8995 Mon Jun 29 14:47:10 1998  Per Bothner  <bothner@cygnus.com>
8996
8997         * java-tree.h (load_class):  Add prototype.
8998         * class.c (is_compiled_class):  Add missing arg to load_class.
8999         * expr.c (expand_java_NEW):  Call load_class.
9000         * parse.y (process_import):  Removed bogus use of void return value.
9001
9002 Thu Jun 25 11:50:48 1998  Per Bothner  <bothner@cygnus.com>
9003
9004         * decl.c, java-tree.h (soft_athrow_node):  Renamed to soft_node.
9005         Function name is "_Jv_Throw" instead of "soft_athrow".
9006         * decl.c, java-tree.h (soft_new_node):  Renamed to alloc_object_node.
9007         Function name is "_Jv_AllocObject" instead of "soft_new".
9008         Takes an extra parameter (object size).
9009         * expr.c:  Update calls.
9010
9011 Wed Jun 24 13:59:02 1998  Per Bothner  <bothner@cygnus.com>
9012
9013         * lex.c (java_get_line_col):  Handle end-of-file.
9014         * except.c (expand_end_java_handler):  Handle null type (i.e. finally).
9015
9016 Wed Jun 24 09:22:34 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
9017
9018         * lang.c (lang_init): Make -fexceptions the default.
9019         * except.c (maybe_start_try, maybe_end_try): Don't do anything if
9020         exception handling is not turned on.
9021
9022 Tue Jun 23 10:17:09 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
9023
9024         * lang.c (flag_new_exceptions): Make this this default.
9025         * decl.c (end_java_method): Call emit_handlers.
9026         * except.c (method_init_exceptions): Set language code and version.
9027         (expand_start_java_handler): Enable exception, and call
9028         expand_eh_region_start.
9029         (expand_end_java_handler): Enable exception, and set up catch blocks.
9030         (emit_handlers): New routine to generate the saved handlers.
9031         * java-except.h (emit_handlers): Add prototype.
9032
9033 Fri Jun 12 11:31:24 1998  Per Bothner  <bothner@cygnus.com>
9034
9035         We used to have three different representations of the constant pool:
9036         the CPool structure, the tree_constant_pool, and the constructures
9037         used to build the Class object (which may need class and string
9038         constants) in compiled code.  None were appropriate for compiling
9039         to .class files, so I did a major overhaul.
9040
9041         First, the tree_constant_pool array was removed.  Things were
9042         modified to the CPool structure in the JCF could be used.
9043         Second, a "capacity" field was added to the CPool, and functions
9044         written to search for a matching constant, adding one if not found.
9045         The code that generated the Class object was changed to use a CPool.
9046         The actual TREE_LISTs used to build the CONSTRUCTORs used for
9047         the static Class object are now only in build_constants_constructor.
9048         Finally, I wrote code which can generate a .class file (including its
9049         constant pool) from the RECORD_TYPE of a class.  This is a big step
9050         on the way to compiling Java source into .class files.
9051
9052         * jcf-write.c:  New file. Writes out a RECORD_TYPE as a .class file.
9053         * Makefile.in (JAVA_OBJS):  Added jcf-write.o.
9054
9055         * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
9056         CONSTANT_ResolvedString, CONSTANT_ResolvedClass):  New macros.
9057         (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
9058         COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
9059         (COMPONENT_REF_CLASS):  Replaced by COMPONENT_REF_CLASS_INDEX.
9060         (lang_type):  Removed constant_pool field.
9061         * jcf.h (CPool):  Renamed size to count.  Added field capacity.
9062         (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
9063         CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT):  New macros.
9064         Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
9065
9066         * constants.c (current_constant_pool_tags, current_constant_pool_data,
9067         current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
9068         * constants.c (build_constants_constructor):  Use new outgoing_cpool.
9069         (set_constant_entry, find_constant1, find_constant2,
9070         find_class_constant, count_constant_pool_bytes, write_constant_pool,
9071         find_utf8_constant, find_class_or_string_constant):  New functions.
9072
9073         * jcf-parse.c (load_class):  Don't save/restore tree-constant_pool.
9074         (get_constant):  Use current_jcf.cpool instead of tree_constant_pool.
9075         (give_name_to_class, get_class_constant):  Likewise.
9076         * jcf-parse.c, java-tree.h (tree_constant_pool):  Removed.
9077         (get_name_and_type_constant, get_ref_constant):  Removed.
9078         * parse.h (parser_ctxt):  Remove field tree_constant_pool.
9079         * parse.y:  Don't save/restore tree_constant_pool.
9080         * verify.c (verify_jvm_instructions):  Update for new approach.
9081         * expr.c (expand_invoke, expand_java_field_op): Likewise.
9082
9083         * lang-options.h:  Added -femit-class-file, -femit-class-files.
9084         * lang.c (flag_emit_class_files), java-tree.h:  New flag.
9085         (lang_f_options):  Added "emit-class-file(s)".
9086
9087         * expr.c (build_java_arrayaccess):  Generate more efficient array
9088         bounds checking, by using unsigned compare.
9089
9090         * expr.c (expand_invoke):  Re-arrange error checks to make more robust.
9091
9092 Wed Jun 10 17:34:42 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9093
9094         * parse.h: New comment on the handling of unresolved type
9095         identifiers. JDEPs are now part of the jdep_code enum.
9096         (typedef struct jdep): Now use enum jdep_code or int, depending on
9097         availability. Both are narrowed down to an 8 bits bitfield.
9098         (CALL_EXPR_PRIMARY): Fixed comment.
9099
9100 Wed Jun 10 10:54:39 1998  Tom Tromey  <tromey@cygnus.com>
9101
9102         * Make-lang.in (java): Added gjavac and jvgenmain.
9103         (java.start.encap): Depend on gjavac.
9104         (java.rest.encap): Depend on jvgenmain.
9105
9106         * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
9107         (JAVA_CROSS_NAME): Likewise.
9108         (java.all.build): Depend on jvgenmain and gjavac.
9109         (java.all.cross): Depend on jvgenmain and gjavac-cross.
9110         (jvgenmain$(exeext)): New target.
9111         (java.install-common): Wrote.
9112         * config-lang.in (compilers, stagestuff): Added gjavac and
9113         jvgenmain.
9114
9115 Wed Jun 10 12:19:04 1998  Dave Brolley  <brolley@cygnus.com>
9116
9117         * lang.c (lang_decode_option): New argc/argv interface.
9118
9119 Tue Jun  9 18:12:46 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9120
9121         * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
9122         * decl.c (build_decl_no_layout): New function.
9123         * expr.c (java_lang_expand_expr): Layout declarations found in
9124         blocks before they're pushed.
9125         * jcf-parse.c (load_class): Save current line when parsing class
9126         file.
9127         (parse_source_file): Register class before expanding their
9128         methods.
9129         * lang.c (put_decl_node): Produce `null' when `void *' is
9130         processed.
9131         * lex.c (static tree wfl_op): New static global, for error report
9132         on casts.
9133         (java_init_lex): wfl_operator and wfl_op initialized
9134         here. Filename caching added for wfl_op. Return wfl_op when `(' is
9135         parsed.
9136         * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
9137         patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
9138         build_unresolved_array_type): New static function definitions.
9139         (build_decl_no_layout): New extern function declared.
9140         (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
9141         faulty modifier exists.
9142         (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
9143         (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
9144         (UNARY_PLUS_EXPR): New fake operator.
9145         (struct parser_ctxt): New field osb_number.
9146         * parse.y (static tree wfl_operator): New static WFL for operator
9147         bound error messages.
9148         (DECR_TK, INCR_TK): Moved.
9149         (OP_TK): Tagged <operator>.
9150         (array_type:): Now call build_unresolved_array_type.
9151         (dim_expr:): Count the number of '[' seen.
9152         (post_increment_expression, post_decrement_expression,
9153         pre_increment_expression, pre_decrement_expression,
9154         unary_expression_not_plus_minus, unary_expression:): Actions are
9155         now building the corresponding unary expressions.
9156         (cast_expression:): Actions are now building cast expressions.
9157         (build_unresolved_array_type): New function.
9158         (create_interface): Reset the number of declared interfaces.
9159         (create_class): Likewise.
9160         (method_header): Methods declared within the scope of an interface
9161         are now implicitly set public and abstract.
9162         (java_complete_class): Variable's and parameter's type are patched
9163         with a promoted type.
9164         (declare_local_variables): Resolved non builtin types are promoted
9165         before being used to build a variable decl. Removed type patch
9166         posted on variable initialization statement.
9167         (source_start_java_method): Use build_decl_no_layout to build the
9168         decl of a parameter of incomplete type.
9169         (java_register_parsed_class): Process interfaces too. Call
9170         rest_of_decl_compilation on each processed class declarations.
9171         (java_complete_expand_methods): Don't attempt to expand things in
9172         interfaces.
9173         (java_complete_tree): Process CONVERT_EXPR, even though it always
9174         has a type. Propagate error_mark_node to node's type too. Promote
9175         method's call argument type and return error_mark_node if
9176         argument's completion didn't work. MODIFY_EXPR can have a WFL as a
9177         RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
9178         handle unary operator nodes.
9179         (build_assignment): Added comment.
9180         (print_int_node): New function.
9181         (patch_assignment): New second argument. New error handling. Use
9182         print_int_node. Handle references. Use can_cast_to_p to issue
9183         different error message according to the context and check upon
9184         the initialization of the RHS.
9185         (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
9186         (operator_string): Handle more operators.
9187         (patch_binop): No longer use a function static
9188         wfl_operator. Improved error message on shift distance.
9189         (build_unaryop, build_incdec, build_cast, patch_unaryop,
9190         patch_cast): New functions.
9191
9192 Fri Jun  5 18:03:07 1998  Per Bothner  <bothner@cygnus.com>
9193
9194         * jvspec.c:  New file.
9195         * Make-lang.in:  New rules to build gjavac from jvspec.c and ../gcc.c.
9196
9197         * java-tree.h (identifier_subst):  Add declaration.
9198
9199 Thu Jun  4 13:44:23 1998  Tom Tromey  <tromey@cygnus.com>
9200
9201         * jvgenmain.c (main): Generate call to JvRunMain.
9202
9203         * class.c (make_class_data): Push value for "sync_info" field.
9204         * decl.c (init_decl_processing): Push "sync_info" field.
9205
9206 Wed Jun  3 20:39:14 1998  Per Bothner  <bothner@cygnus.com>
9207
9208         * typeck.c (build_java_array_type):  Set TYPE_NAME to actual
9209         Java (source) name, not signature.
9210         Set TYPE_ALIGN to (at least) that of element_type.
9211
9212 Tue Jun  2 15:19:19 1998  Per Bothner  <bothner@cygnus.com>
9213
9214         * class.c:  Moved classname-mangling-rekated code to ...
9215         * mangle.c:  ... this new file.
9216         * jvgenmain.c:  New program (needs mangle.c) to generate main program.
9217         * Makefile.in:  Update for above changes.
9218
9219 Mon Jun  1 09:58:36 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9220
9221         * expr.c (truthvalue_conversion): Convert integer and floating
9222         point value to their truth value.
9223         * lex.c (java_lex): Handle the `null' literal.
9224         * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
9225         (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
9226         ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
9227         New macros.
9228
9229         * parse.y: Reorganization/documentation on token declaration.
9230         (binop_lookup[]): New added new tree codes.
9231         (relational_expression): Build corresponding binary operators.
9232         (equality_expression, conditional_and_expression,
9233         conditional_or_expression): Likewise.
9234         (java_complete_class): Fix crash in debug message.
9235         (java_complete_tree): Check initialization of method call
9236         arguments. Further bogus node evaluation to detect more error
9237         during assignments. Handles more binary operators.
9238         (patch_assignment): Use DECL_P.
9239         (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
9240         code.
9241         (operator_string): Handle more case. Compacted source.
9242         (patch_binop): Changed function comment. Checking for
9243         uninitialized first operand takes the compound assignment into
9244         account and uses DECL_P. Checking for uninitialized second operand
9245         delayed to routine's end. Use macros to issue type bound error
9246         messages and issue messages on both operands if their types are
9247         different. Force fixed type into node. Handle all binary
9248         operators.
9249
9250 Wed May 27 10:30:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9251
9252         * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
9253         * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
9254         build operator node and return tokens.
9255         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
9256         * parse.h (java_complete_tree): Changed returned type in prototype.
9257         (build_method_invocation, build_assignment, patch_assignment,
9258         patch_binop): New static function declarations.
9259         (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
9260         BUILD_EXPR_WFL): New macros.
9261         * parse.y (enum tree_code binop_lookup[]): New static for token to
9262         TREE_CODE lookup.
9263         (%union): Parser union has new sub-structure `operator'.
9264         (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
9265         PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
9266         ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
9267         ASSIGN_ANY_TK): Tokens tagged `operator'.
9268         (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
9269         AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
9270         MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
9271         REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
9272         (assignment_operator:): Rule tagged `operator'.
9273         (expression_statement:): Re-installed default rule.
9274         (method_invocation:): Sub rules call build_method_invocation.
9275         (postfix_expression:): Don't attempt to resolve name here. Just
9276         return an ID.
9277         (multiplicative_expression:): Sub-rules build corresponding binop
9278         expression node.
9279         (additive_expression:, shift_expression:, and_expression:,
9280         exclusive_or_expression:, inclusive_or_expression:): Likewise.
9281         (assignment:): Sub rule invoke build_assignment.
9282         (assignment_operator:): Default rules on sub rules.
9283         (force_error): Added documentation on this variable.
9284         (declare_local_variables): Build initialization calling
9285         build_assignment.
9286         (expand_start_java_method): Removed unused rtx declaration. Mark
9287         arguments as already initialized.
9288         (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
9289         (java_complete_expand_methods): Don't process next method if
9290         completion of the previous one triggered errors.
9291         (java_complete_expand_method): Call source_end_java_method if no
9292         error were found during completion.
9293         (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
9294         locals declaratilon. Handle names found within a class. Return
9295         error_mark_node when things aren't found.
9296         (patch_method_invocation_stmt): Return error_mark_node on failures.
9297         (patch_invoke): Removed unused local. Return the correct node.
9298         (java_complete_tree): Now returns a value. The BLOCK section binds
9299         local identifiers and the type of a BLOCK is now void. Assign the
9300         result of operand completion on COMPOUND_EXPR. Assign the
9301         encapsulated node of a WFL to the result of its completion, except
9302         when the node is an identifier. Now handle MODIFY_EXPR and several
9303         binary operators. Return error_mark_node on errors.
9304         (build_method_invocation, build_assignment, patch_assignment,
9305         build_binop, operator_string, patch_binop): New functions.
9306         * typeck.c (binary_numeric_promotion): New function.
9307
9308 Thu May 21 12:01:04 1998  Per Bothner  <bothner@cygnus.com>
9309
9310         * class.c (identifier_subst):  New convenience wrapper for ident_subst.
9311         Replace most uses of ident_subst by identifier_subst.
9312
9313         * class.c (push_class_static_dummy_field):  Removed function.
9314         (build_class_ref):  Find Class object decl by looking up "CNAME.class",
9315         instead of looking got "class" static field.  Create that decl here.
9316         (class_identifier_node):  Removed;  no longer needed.
9317         (init_class_processing):  Don't init class_identifier_node.
9318         * jcf-parse.c (jcf_parse):  Don't call push_class_static_dummy_field.
9319         Do nreverse 0 times (instead of twice) for Object and Class.
9320         * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
9321
9322 Wed May 20 16:35:04 1998  Per Bothner  <bothner@cygnus.com>
9323
9324         * jcf-parse.c (parse_class-file):  Set lino to smallest line number,
9325         while initializing linenumber_count and linenumber_table.
9326         Do it before init_function_start (which calls emit_line_note).
9327         * expr.c (expand_byte_code):  Don't need to clear lineno here.
9328
9329 Mon May 18 16:23:32 1998  Tom Tromey  <tromey@cygnus.com>
9330
9331         * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
9332         then mangle number as _N_.
9333
9334         * class.c (mangle_class_field): New function.
9335         (build_class_ref): Set assembler name of class reference using
9336         mangle_class_field.
9337         (push_class_static_dummy_field): Likewise.
9338
9339 Sun May 17 12:52:35 1998  Michael Tiemann <tiemann@cygnus.com>
9340
9341         * parse.y (source_start_java_method): Use TREE_SET_CODE instead
9342         of assigning to TREE_CODE.  The latter method exploits a feature
9343         of GCC that is not ANSI compliant.
9344
9345 Thu May 12 13:44:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9346
9347         * decl.c (pushdecl_force_head): New function.
9348         (pushlevel): Removed conditional printf.
9349         (complete_start_java_method): Don't enter local variable scope if
9350         function is compiled from source code.
9351         * expr.c: parse.h now included
9352         (java_lang_expand_expr): New function.
9353         * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
9354         printf. Terminate buffer when doing directories.
9355         * jcf-parse.c (parse_source_file): Call lang_init_source before
9356         parsing and before code generation.
9357         * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
9358         use printf if the macro is defined.
9359         * lang.c (lang_init): Install lang_expand_expr hook on
9360         java_lang_expand_expr.
9361         (java_dummy_print): New function.
9362         (lang_init_source): New function.
9363         * lex.c (java_lex): Remember location of an opening brace at the
9364         second nesting level.
9365         (java_is_eol): Unget character seen after a CR if it is EOF.
9366         * parse.h: Now includes lex.h
9367         (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
9368         printf if the macro is defined.
9369         (expand_start_java_method, build_expr_block, enter_block,
9370         exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
9371         New static function declarations.
9372         (pushdecl_force_head): New extern function declaration.
9373         (INCOMPLETE_TYPE_P): New macro.
9374         (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
9375         (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
9376         BLOCK_EXPR_ORIGIN): New macros.
9377         (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
9378         DECL_SOURCE_LINE_LAST): New macros.
9379         (struct parser_ctxt): Removed field current_method_decl, redundant
9380         with the field current_function_decl. Added fields
9381         first_ccb_indent1 and pending_block.
9382         * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
9383         BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
9384         tagged <node>
9385         (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
9386         (compilation_unit:): Cosmetic on sub rule.
9387         (type_declaration:): Cosmetic on sub rules. Added an error rule.
9388         (variable_initializer:): Installed default rule on expression:.
9389         (method_declaration:): method_header: starts a new
9390         method. method_body: installs the function body, absorbs blocks
9391         emitted for temporary variable scopings, pops function's body block
9392         and merges function's last statement lineno in DECL_SOURCE_LINE.
9393         (method_body:): Installed default rules.
9394         (block:): Call enter_block when an opening brace is seen.  Absorb
9395         scoping blocks and call exit_block when a closing brace is seen.
9396         (block_statement:): Cosmetic changes.
9397         (method_invocation:): Create WFL around CALL_EXPR node.
9398         (patch_stage): Added comment around definition.
9399         (method_header): Try to use first_ccb_indent1 as the first line of
9400         the method, so BP debug info are emitted at the first opening
9401         brace of the function. If the function has no body, use the
9402         location of the function's name. Override currently defined method
9403         name with the matching WFL so we can point redefinition errors
9404         using the location where the function's name was declared.
9405         (check_abstract_method_header): Interprets DECL_NAME as an
9406         identifier or as a WFL, accordingly.
9407         (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
9408         (check_method_redefinition): Use DECL_NAME as a WFL. Extract
9409         location and name information out of it and reinstall DECL_NAME to
9410         its original identifier node value.
9411         (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
9412         function's source code).
9413         (read_import_dir): Test the value returned by find_class and issue
9414         a fatal accordingly.
9415         (declare_local_variables): Push a new block for the scope of the
9416         new variable(s) if code has been already generated at that nesting
9417         level. Pinpoint redefinition errors using the variable id
9418         WFLs. Generate initialization code if necessary. If the variable
9419         type is incomplete, register a patch on its decl.
9420         (source_start_java_method): Rewritten. Define a new block for the
9421         function's parameters. Build parameter decl out of function's
9422         arguments and register them for a patch if their types are
9423         incomplete.
9424         (expand_start_java_method): Includes the part of
9425         source_start_java_method that was pushing the parameter decls and
9426         completing the method start code.
9427         (source_end_java_method): Removed call the expand_end_bindings and
9428         poplevel (already taken care of). Reinstall function's arguments
9429         and get function's last line of code before calling
9430         expand_function_end.
9431         (java_method_add_stmt): New comment before the function's
9432         code. Complement the second operand of the current COMPOUND_EXPR
9433         if necessary.
9434         (java_complete_expand_methods): Don't generate debug info on line
9435         zero when expanding a generated constructor.
9436         (java_complete_expand_method): Set start and end line numbers for
9437         a artificially generated constructor to one and manually call
9438         enter_block and exit_block when defining it. For all methods:
9439         expand function's start calling the new expand_start_java_method
9440         and invoke java_complete_tree on the effective method's body, if
9441         any.
9442         (resolve_expression_name): Now use lookup_name_in_blocks to search
9443         local variable decls and print out an error when variables are
9444         undefined.
9445         (patch_method_invocation_stmt): Inserted comment before the
9446         function's code.
9447         (lookup_method_invoke): Chain method's arguments using chainon
9448         with the current arg list as a second argument. Inserted missing
9449         IDENTIFIER_POINTER when reporting an error on methods not found.
9450         (refine_accessible_methods_list): Don't retain constructors.
9451         (patch_arguments): Function removed.
9452         (java_complete_tree): Inserted comment before the function's
9453         code. New case for BLOCKs. Moved the WFL case a bit
9454         further. Complete function's arguments.
9455         (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
9456         maybe_absorb_scoping_blocks): New functions.
9457
9458 Mon Apr 27 10:50:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9459
9460         * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
9461         previously set.
9462         * jcf-parse.c (parse_source_file, java_error_count): New forward
9463         and extern declarations.
9464         (java_parse_abort_on_error): Macro moved.
9465         (jcf_parse_source): fatal called if fopen fails. Now calls
9466         parse_source_file.
9467         (parse_source_file): New parse_only parameter. Reflects the
9468         elimination of the second pass.
9469         (yyparse): parse_source_file called with argument set to 0.
9470         * jcf.h (JCF_ZERO): Sets java_source to zero.
9471         * lex.c (java_init_lex): pass argument is gone. Function modified
9472         to be called once during the analysis of a file.
9473         (java_unget_unicode): Fixed typo in fatal message.
9474         (java_get_line_col): Likewise.
9475         (java_lval): Likewise. String literals no longer built during
9476         second pass.
9477         * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
9478         account.
9479         * parse.h (MODIFIER_WFL): New macro.
9480         (parse_check_super, parser_check_super_interface): Now return int.
9481         (parser_chain_incomplete_item, not_builtin_p,
9482         complete_method_decl): Declarations removed.
9483         (build_method_invocation_stmt, build_invoke): Renamed using the
9484         `patch' instead of `build'
9485         (register-incomplete_type, obtain_incomplete_type,
9486         java_complete_tree, java_complete_expand_method,
9487         unresolved_type_p, create_jdep_list): New function declarations.
9488         (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
9489         END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
9490         (jdep): New typedef on new struct _jdep.
9491         (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
9492         JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
9493         JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
9494         JDEP_RESOLVED_P): New macros.
9495         (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
9496         JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
9497         JDEP_VARIABLE): New enum values and jdep kinds.
9498         (jdeplist): New typedef on struct _jdeplist.
9499         (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
9500         macros.
9501         (CALL_EXPR_PRIMARY): New macro.
9502         (struct parser_ctxt): Fields java_pass, current_method_decl,
9503         method_decl_list deleted. New field jdeplist.
9504         (INCOMPLETE_P): Macro deleted.
9505         * parse.y (single_type_import_declaration:): Removed pass switch.
9506         (type_import_on_demand_declaration): Likewise.
9507         (field_declaration:): Removed pass switch on all sub rules.
9508         (class_declaration:): Call the complete_class_decl removed on
9509         class_body rules.
9510         (method_declaration:): Removed second pass switch. No longer chain
9511         methods decl when method_header reduced.
9512         (method_header:): Sub rules no longer depend on pass switch.
9513         (method_declarator:): Likewise.
9514         (method_body:): Likewise.
9515         (abstract_method_declaration:): Likewise.
9516         (block_statement:): Likewise.
9517         (local_variable_declaration:): Likewise.
9518         (argument_list:): Likewise.
9519         (method_invocation:): Likewise. Call to build_method_invocation_stmt
9520         removed. Partial CLASS_EXPR tree node built instead.
9521         (postfix_expression:): Removed pass switch on all sub rules.
9522         (java_pop_parser_context): Free classd_list content.
9523         (yyerror): Call obstrack_grow0 to finalize error message.
9524         (check_class_interface_creation): Comment modified to reflect new
9525         returned value meaning. Removed second pass switch. Return 1 if an
9526         error was found, 0 otherwise. Adjust pointer on filename if a
9527         leading path separator was found.
9528         (maybe_create_class_interface_decl): Removed first pass switch
9529         when linking the class decl to the class_list. Install a new
9530         jdep_list for the class.
9531         (add_superinterfaces): List of unresolved interfaces is
9532         gone. Unresolved interfaces are directly added to the current
9533         dependencies list.
9534         (create_interface): Second pass shortcut removed.
9535         ctpx->modifier_ctx access through MODIFIER_WFL.
9536         (create_class): Second pass shortcut removed. Call to
9537         register_incomplete_type replaces the call to
9538         parser_chain_incomplete_item.
9539         (complete_class_decl): Function removed.
9540         (duplicate_declaration_error): New way of retrieving redeclared
9541         item type.
9542         (register_fields): Call to lookup_modifier_cl replaced by
9543         MODIFIER_WFL. New way of handling unresolved type, using
9544         unresolved_type_p and obtain_incomplete_type.
9545         register_incomplete_type replaces call to parser_chain_incomplete_item.
9546         (patch_stage): New static global variable.
9547         (method_header): New way of handling unresolved type, using
9548         unresolved_type_p and obtain_incomplete_type. patch_stage used to
9549         indicates that the method decl needs to be patched.
9550         (check_abstract_method_header): Call to lookup_modifier_cl
9551         replaced by MODIFIER_WFL.
9552         (method_declarator): Incomplete argument type are registered
9553         calling register_incomplete_type. Patch on the declared method is
9554         issued in that case.
9555         (unresolved_type_p): New function.
9556         (parser_check_super_interface): New comment to reflect function's
9557         modified returned type (int). Function and has a new argument
9558         this_wfl. Call to parse_error_context uses this_wfl instead of
9559         relying on lookup_cl.
9560         (parser_check_super): Comment reflects function's new returned
9561         type (int). Function returns non zero value on error.
9562         (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
9563         register_incomplete_type, jdep_resolve_class): New functions to
9564         handle incomplete types in declarations.
9565         (java_complete_class): Rewritten to work with the new incomplete
9566         type handling scheme.
9567         (complete_class_report_errors): Likewise.
9568         (complete_method_decl): Removed: it jobs is now handled by
9569         java_complete_class.
9570         (do_resolve_class): Class loaded in not already loaded and not
9571         found in Java source code.
9572         (java_check_regular_methods, java_check_abstract_methods): Don't
9573         call complete_method_decl anymore.
9574         (lookup_modifier_cl, not_builtin_p): Functions deleted.
9575         (read_import_dir): Got rid of the pass number dependency.
9576         (declare_local_variables): New handling of unresolved types (patch
9577         issued).
9578         (source_start_java_method): New parameter level. Function called
9579         with level set to 1 when argument types are potentially
9580         unresolved.  Called to complete the job with level set to 2 once
9581         types are complete.
9582         (source_end_java_method): Call to permanent_allocation
9583         removed. Waiting to be replaced by a more suitable obstack
9584         management.
9585         (java_complete_expand_methods, java_complete_expand_method,
9586         java_expand_finals): New functions.
9587         (build_method_invocation_stmt): Renamed
9588         patch_method_invocation_stmt. Extracts function call expression
9589         (wfl) and arguments (args) from CALL_EXPR tree operands.
9590         (build_invoke): Renamed patch_invoke. Fixed typo in fatal
9591         call. Patch the function and argument operand of the CALL_EXPR
9592         tree argument.
9593         (patch_argument, java_complete_tree): New functions.
9594
9595 Mon Apr 20 18:26:57 1998  Per Bothner  <bothner@cygnus.com>
9596
9597         Recover from missing fields and methods (i.e. error instead of fatal).
9598         * decl.c, java-tree.h (TYPE_identifier_node):  New global constant.
9599         * expr.c (expand_invoke):  Recover from missing method.
9600         (expand_java_field_op):  Recover from missing field.
9601         Inline references to java.lang.{Integer,Char,...}.TYPE.
9602         * typeck.c (get_type_from_signature), java-tree.h:  New function.
9603         * class.c (add_method):  Use get_type_from_signature.
9604         (build_class_ref):  Handle a class that was not found.
9605         * typeck.c (convert):  Handle conversion to pointers (for convenience).
9606         * verify.c (verify_jvm_instructions):  Use get_type_from_signature
9607         instead of lookup_field to handle missing fields.
9608
9609         * jcf-parse.c (process_zip_dir):  Set java_source.
9610
9611 1998-04-20  Brendan Kehoe  <brendan@cygnus.com>
9612
9613         * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
9614
9615 Tue Apr 14 15:59:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9616
9617         * jcf-parse.c (load_class): Don't change input_filename before
9618         calling jcf_parse_source (but still do it before calling
9619         jcf_parse).
9620         (jcf_parse_source): Assign input_filename after having saved the
9621         parser context.
9622         * lex.c (java_init_lex): Chain a WFL node to the import on demand
9623         list. ctxp->modifier_ctx zeroed according to its new
9624         definition. ctxp->filename initialized. Removed
9625         JAVA_MODIFIER_CTX_UNMARK.
9626         (java_unget_unicode): Update the character based column position.
9627         (java_allocate_new_line): ref_count not used anymore. Always free
9628         ctxp->p_line. Initialize c_line->char_col to 0.
9629         (java_get_unicode): Update the character based column position.
9630         (java_lex): Use ctxp->elc to store current position in source
9631         file, at the beginning of the parsed token. Set modifier_ctx entry
9632         corresponding to the parse modifier to a WFL node. Return a WFL
9633         node when an identifier is parsed.
9634         (java_lex_error): Now uses ctxp->elc to store current position in
9635         source.
9636         (build_wfl_node, java_is_eol, java_get_line_col): New functions.
9637         * lex.h (build_wfl_node): New function definitions.
9638         (struct java_line): ref_count and next fields are gone. New field
9639         char_col.
9640         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
9641         JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
9642         (JAVA_COLUMN_DELTA): New macro.
9643         (java_lc): New typedef on new struct _java_lc.
9644         * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
9645         (parse_error_context, parse_warning_context): Changed prototypes.
9646         (java_get_line_col): Added as an available global function.
9647         (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
9648         (IC_DECL): Replaced by macro IC_TYPE
9649         (DEPEND_WFL): New macro.
9650         (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
9651         wrong modifier.
9652         (exit_java_complete_class): Removed a commented out statement.
9653         (struct parser_ctxt): Added comments on fields. modifier_ctx is
9654         now an array of tree nodes. Deleted fields line_list and
9655         e_line. New field elc, to replace e_line.
9656         * parse.y (array_type:): Build WFL node.
9657         (qualified_name:): Build a single WFL node out of two. Retain
9658         the location information of the first node in the resulting node.
9659         (package_declaration:): Use package name as a WFL node
9660         (single_type_import_declaration:): Use imported name as a WFL node.
9661         (type_import_on_demand_declaration:): Use root of the imported
9662         packages as a WFL node.
9663         (field_declaration:): Removed unused local variable cl.
9664         (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
9665         (yyerror): New static elc. Removed static error_line, error_pos.
9666         New local code_from_source. Save ctxp->elc into elc at the first
9667         pass. Call java_get_line_col to get a string of the line where
9668         the error occured.
9669         (debug_line): Removed static function.
9670         (parse_error_context, parse_warning_context): Parameter cl is now
9671         a WFL node. Use its value to initialize ctxp->elc.
9672         (redefinition_error): Parameter cl is now a WFL node.
9673         (parse_add_interface): New parameter wfl. No longer call
9674         lookup_cl, use wfl instead.
9675         (check_class_interface_creation): Parameter cl is now a WFL node.
9676         (maybe_create_class_interface_decl): Likewise.
9677         (add_superinterfaces): New function.
9678         (create_interface): Removed local cl, node, super_decl,
9679         super_decl_type.  Function now uses id as a WFL node. Better
9680         warning/error report on obsolete or forbidden mix of
9681         modifiers. Now calls add_superinterfaces to register interfaces.
9682         (create_class): Removed local cl, node. Local variable id is used
9683         as a WFL node. Better error report on forbidden modifier
9684         mix. Uses add_superinterfaces to register interfaces.
9685         (find_field): Argument cl is now a WFL node. Now store the WFL
9686         node of a fields that needs to be checked for their
9687         initialization.
9688         (method_header): Local variable node non longer used. Local
9689         variable id replaces cl.
9690         (check_modifiers_consistency): Local variable cl is now a WFL
9691         node.
9692         (method_declarator): Local variable cl replaced by parameter id.
9693         (parser_qualified_name): Now uses parameter name as a WFL node.
9694         (parser_check_super_interface): New parameter wfl, for achieve
9695         greater accuracy during error reports.
9696         (parser_chain_incomplete_item): New parameter named location. Used,
9697         along the decl, to construct the incomplete item node.
9698         (java_complete_class): resolve_class now uses WFL node extracted
9699         from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
9700         where appropriate.
9701         (complete_method_decl): Unresolved function's argument types are WFL.
9702         (resolve_class): Parameter cl is now a WFL node.
9703         (resolve_and_layout): Likewise.
9704         (do_resolve_class): Likewise. Try first to use cl and then do the
9705         lookup on the decl when calling check_pkg_class_access.
9706         (complete_class_report_errors): Use IC_TYPE in place of
9707         TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
9708         instead of doing a lookup over the decl.
9709         (java_check_final): Use WFL info from field tree list.
9710         (lookup_cl): Rewritten and returns a statically defined WFL node.
9711         (lookup_modifier_cl): Now uses information from WFL nodes.
9712         (process_imports): Likewise.
9713         (read_import_dir): name and cl arguments replaced by a single WFL
9714         node. Function modified accordingly.
9715         (find_in_imports_on_demand): Now uses WFL node.
9716         (check_pkg_class_access): cl argument is now a WFL node.
9717         (declare_local_variables): Fixed to use WFL nodes.
9718         (resolve_expression_name): Likewise.
9719         (build_method_invocation_stmt): name_combo argument renamed
9720         wfl. Function modified to use WFL nodes.
9721         (build_invoke): cl used as a WFL node when calling build_expr_wfl.
9722         (lookup_method_invoke): cl is now a WFL node. Added missing
9723         IDENTIFIER_POINTER to class type decl name.
9724
9725 Tue Apr 14 15:23:29 1998  Dave Brolley  <brolley@cygnus.com>
9726
9727         * lang.c (init_parse): Now returns char* containing the filename.
9728
9729 Fri Apr 10 11:36:04 1998  Per Bothner  <bothner@cygnus.com>
9730
9731         * class.c (layout_class):  Mangle repeated arg types to match cc1plus.
9732
9733         * decl.c, java-tree.h (integer_four_node):  New INTEGER_CST node.
9734         * class.c (make_class_data):  If flag_assume_compiled, initial class
9735         state is CSTATE_PREPARED; make superclass and interfaces direct
9736         references, rather than constant pool indexes.
9737
9738 Thu Apr  9 16:10:56 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9739
9740         * parser.y: Include flags.h. Removed debug variable pl.
9741         (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
9742         (block:): Likewise.
9743         (labeled_statement_nsi:): Generate debug info when reducing
9744         expression_statement:.
9745         (check_pkg_class_access): get_access_flags_from_decl invokation
9746         fixed for new CLASS_* flags location.
9747         (source_end_java_method): Save/restore parser context when
9748         entering/leaving this routine. Restore lineno to its right value
9749         before calling expand_end_bindings.
9750         (build_method_invocation_stmt): build_invoke called with the
9751         current line information.
9752         (build_invoke): New argument cl. Wrap the function call around a
9753         wfl node.
9754         (refine_accessible_methods_list): Changed comment, removed
9755         unnecessary code.
9756         * parse.h: Fixed typo in comments.
9757         (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
9758         (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
9759         (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
9760         parser_ccb_indent.
9761         * lex.c (java_lex): Record the last closing curly bracket of a
9762         function.
9763         * jcf-parse.c (jcf_parse_source): Now calls
9764         java_check_methods. Clarified comment, fixed typo.
9765
9766 1998-04-09  Dave Brolley  <brolley@cygnus.com>
9767
9768         * lang.c (init_parse): Expose for non USE_CPPLIB builds.
9769         (finish_parse): Expose for non USE_CPPLIB builds.
9770
9771 Wed Apr  8 13:06:23 1998  Jeffrey A Law  (law@cygnus.com)
9772
9773         * lang.c (lang_print_xnode): New function.
9774
9775 Fri Apr  3 13:22:41 1998  Per Bothner  <bothner@cygnus.com>
9776
9777         * decl.c (class_dtable_decl), java-tree.h:  New tree node.
9778         * class.c (get_dispatch_vector, get_dispatch_table):  New functions
9779         used to build a class's dispatch table.
9780         (make_class_data):  Generate dispatch table if flag_assume_compiled.
9781         Set dtable of class object to address of class_dtable_decl.
9782
9783         * decl.c (int_decl_processing):  Make soft_badarrayindex_node
9784         be volatile and have side effects - generates better code.
9785
9786         * class.c, expr.c, parse.y:  CLASS_INTERFACE, CLASS_FINAL, etc:
9787         These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
9788
9789         * expr.c (expand_invoke):  If class is final, method is
9790         effectively final, so can call it directly.
9791
9792         * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE):  New macros.
9793
9794         * Makefile.in, Make-lang.in:  Add missing $(exeext)s.
9795
9796 Thu Mar 19 16:59:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9797
9798         * parse.y (build_method_invocation_stmt): Removed extra argument
9799         to build_invoke.
9800
9801 Mon Mar 16 17:25:19 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9802
9803         * expr.c (dtable_indent): Now static global.
9804         (expand_invoke): Now call invoke_build_dtable and
9805         build_invokevirtual.
9806         (invoke_build_dtable, build_invokevirtual): New functions.
9807         * jcf-io.c (find_class): Defer issuing a warning by setting
9808         jcf->outofsynch to 1.
9809         * jcf-parse.c (jcf_out_of_synch): New function.
9810         (load_class): Test this_jcf.outofsynch flag and call
9811         jcf_out_of_synch accordingly.
9812         * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
9813         comment indentation.
9814         * lex.c (java_get_unicode): Fixed code indentation.
9815         (java_lex): Create string literal. Fixed typo. Removed several
9816         premature obstack_free.
9817         * parse.h: New enums for name resolution and invocation mode.
9818         (struct qualification): New data structure.
9819         (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
9820         (do_resolve_class, build_method_invocation_stmt,
9821         breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
9822         debug_line, identical_subpath_p, invocation_mode,
9823         refine_accessible_methods_list, build_invoke,
9824         lookup_method_invoke): New functions declared.
9825         (build_invokevirtual, invoke_build_dtable, match_java_method,
9826         build_field_ref, jcf_out_of_synch): New references to external
9827         functions.
9828         (struct parse_ctxt): Removed artificial_constructor field.
9829         * parse.y: (array_type:): Type defined for this rule.
9830         (class_type:): Installed default rule for interface_type:.
9831         (array_type:): Now build Java array type.
9832         (qualified_name:): Now use obstack_grow0.
9833         (method_declaration:): Skip the artificial constructor added to
9834         the list, if any.
9835         (abstract_method_declaration:): Execute the code only during pass 1.
9836         (block:): Installed default rule in block_statements:.
9837         (block_statement:): Add the statement to the method during pass 2.
9838         (statement_expression): Installed default rule for
9839         method_invocation:.
9840         (argument_list:): Added code to build the argument list.
9841         (method_invocation:): Added call to create the method invocation
9842         node.
9843         (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
9844         (debug_line): New function for debug.
9845         (complete_class_decl): No longer do something during pass 1.
9846         (method_header): Use BUILD_PTR_FROM_NAME.
9847         (parser_qualified_classname): Use obstack_grow0. Removed bogus
9848         obstack_free.
9849         (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
9850         function's main comment.
9851         (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
9852         classes.
9853         (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
9854         (resolve_class): Now works with arrays.
9855         (do_resolve_class, resolve_and_layout): New functions.
9856         (java_check_regular_methods): Reverse method list before and after
9857         having processed it. No longer set ctxp->artificial_constructor.
9858         (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
9859         accordingly. Fixed typo in issued error message. Now use
9860         obstack_grow0.
9861         (find_in_imports_on_demand): Now use obstack_grow0.
9862         (declare_local_variables): Use BUILD_PTR_FROM_NAME.
9863         (source_end_java_method): Call expand_expr_stmt instead of
9864         expand_expr. Calls it before calling expand_function_end.
9865         (java_method_add_stmt): Do nothing if errors were found during
9866         parsing.
9867         (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
9868         (build_method_invocation_stmt, build_invoke, invocation_mode,
9869         lookup_method_invoke, refine_accessible_methods_list,
9870         qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
9871         New functions.
9872         * typeck.c (build_java_signature): Properly end method signature
9873         if return type skipped.
9874         (match_java_method): New function.
9875
9876 Mon Mar 16 10:40:47 1998  Per Bothner  <bothner@cygnus.com>
9877
9878         * jcf-io.c (find_classfile):  If USE_JCF_STDIO, fopen in binary mode.
9879
9880 Wed Feb 25 08:55:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9881
9882         * expr.c (build_invoke_non_interface): New function.
9883         (methods_ident, ncode_ident): Now static globals.
9884         (expand_invoke): Use build_invoke_non_interface.
9885         * java-tree.h (struct lang_decl): New field function_decl_body.
9886         (DECL_FUNCTION_BODY): New macro.
9887         * jcf-parse.c (jcf_parse_source): Deeper check before setting
9888         CLASS_FROM_SOURCE_P.
9889         (parse_source_file): Fixed typos. Call java_layout_parsed_class
9890         before starting pass 2. Call to java_generate_parsed_class replaced
9891         by java_register_parsed_class.
9892         * lex.c: Fixed typo in header. Some line width related formating.
9893         * lex.h: Some line width related formating.
9894         * parse.h (source_end_java_method, resolve_expression_name,
9895         complete_class_decl, maybe_create_class_interface_decl,
9896         check_class_interface_creation): New static function declarations.
9897         (java_layout_parsed_class, java_method_add_stmt): New function
9898         declarations.
9899         (struct parser_ctxt): Field mark_class_generate removed. New
9900         fields class_list and artificial_constructor.
9901         * parse.y: Fixed typo in header.
9902         (class_declaration:): Call complete_class_decl when class body
9903         parsed.
9904         (method_declaration:): Call source_end_java_method in pass 2 when
9905         the method body is defined.
9906         (postfix_expression:): Do expression name resolution on sub-rule
9907         name during pass 2.
9908         (create_class, create_interface): Merged common pieces.
9909         (check_class_interface_creation, maybe_create_class_interface_decl):
9910         New functions.
9911         (complete_class_decl): New function.
9912         (register_fields): Fixed line width related typo.
9913         (method_header): Correctly skip first argument when fixing
9914         argument line. Changed the loop.
9915         (java_check_circular_reference): Now use ctxp->class_list.
9916         (java_complete_class): Removed start/stop marking.
9917         (java_check_regular_methods): Now takes a class decl as an
9918         argument.  Add default constructor if none were encountered.
9919         (java_check_methods): Now use ctxp->class_list. Changed call to
9920         java_check_regular_methods.
9921         (source_start_java_method): Set DECL_ARG_TYPE for each function
9922         arguments.
9923         (source_end_java_method, java_method_add_stmt): New functions.
9924         (java_generate_parsed_class): No longer exists.
9925         (java_layout_parsed_class, java_register_parsed_class): New functions.
9926         (resolve_expression_name): New function.
9927
9928 Thu Feb 12 11:54:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9929
9930         * jcf-parse.c: (parse_source_file): Check on errors after init lex.
9931         * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
9932         until pass initializations are done. Call read_import_dir with
9933         pass set to 0.
9934         * parse.h: (lookup_modifier_cl): New function declared.
9935         (INTERFACE_FIELD_MODIFIERS): New macro.
9936         (OBSOLETE_MODIFIER_WARNING): New macro.
9937         * parse.y: (register_fields): Class type and current field name in
9938         local variables. Check modifier(s) if adding field(s) to an interface.
9939         (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
9940         and report errors using the faulty modifier line context.
9941         (lookup_modifier_cl): New function.
9942         (read_import_dir): Detect and report default import processing
9943         failure.
9944
9945 1998-02-11  Brendan Kehoe  <brendan@cygnus.com>
9946
9947         Add a pair of -fassume-compiled/-fno-assume-compiled options.
9948         * class.c (is_compiled_class): Return 1 after making sure it
9949         qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
9950         * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
9951         * java-tree.h (flag_assume_compiled): Add decl.
9952         * lang.c (lang_f_options): Add the flag.
9953         (flag_assume_compiled): Add decl, default to 0.
9954
9955 Wed Feb 11 11:27:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9956
9957         * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
9958         (is_compiled_class): Likewise.
9959         (layout_class): Likewise.
9960         (layout_class): Detect and lay out classes defined in source code.
9961         (interface_of_p, add_interface_do, may_add_interface): New
9962         function.
9963         (add_interface): Now use add_interface_do.
9964         (add_method_1): New function.
9965         (add_method): Now use add_method_1.
9966         (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
9967         (complete_start_java_method): New function.
9968         (start_java_mehod): Now call complete_start_java_method.
9969         * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
9970         (expand_invoke): Likewise and fixed typo.
9971         *gjava.c: (print_super_field): Use new argument to find_class
9972         DO_CLASS_FILE.
9973         (main): Likewise.
9974         *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
9975         (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
9976         QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
9977         IDENTIFIER_NODE.
9978         (CLASS_COMPLETE_P): New flag on TYPE_DECL.
9979         (add_method_1, push_class): New prototypes.
9980         *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
9981         *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
9982         directory where the class was found.
9983         (find_class): New argument DO_CLASS_FILE. Function find_class
9984         modified accordingly.
9985         *jcf-parse.c: (fix_class_path): New function.
9986         (load_class): Use new VERBOSE argument. load_class now finds and
9987         loads/parses .class/.java files. Save read_state of current_jcf
9988         if necessary.
9989         (java_parser_abort_on_error): New macro.
9990         (jcf_parse_source, parse_source_file): New function.
9991         (jcf_parse): Fixed typo.
9992         (yyparse): Call parse_source_file () only.
9993         (process_zip_dir): Fixed typo, fix zdir->filename_length when
9994         writing the real class name back in the zip directory entry.
9995         (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
9996         (jcf_figure_file_type): Fixed bogus alloc and bcopy.
9997         *jcf.h: (typedef struct JCF): New fields java_source and zipd.
9998         (find_class): Prototype fixed.
9999         *lex.c: Added 1998 time stamp.
10000         Removed all static global variables, moved into the parser
10001         context data structure.. Now include unistd.h if SEEK_SET not
10002         defined.
10003         (java_init_lex): Rewritten.
10004         (java_sneak_unicode): Modified current unicode access in current line.
10005         (java_unget_unicode): Likewise.
10006         (java_allocate_new_line): New allocation management.
10007         (java_read_char): Modified access and storage of unget_utf8_value.
10008         New way of processing current unicode.
10009         (java_store_unicode, java_read_unicode): Fixed typo in declaration.
10010         (java_get_unicode): Now use the parser context.
10011         (java_lineterminator): Likewise.
10012         (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
10013         of the reentrant parser implementation. Function now use the
10014         parser context data structure and java_lval. Fixed production of
10015         the float and double constant "out of range" error message. Fixed
10016         obstack use. Return integer value when hitting a modifier. Now
10017         return type for TRUE, FALSE and other predefined types. Return
10018         identifier as a TREE_LIST list containing the current line context
10019         as the TREE_VALUE sub-node.
10020         (java_unicode_2_utf8): Fixed typo in declaration.
10021         (java_lex_error): Now use the parser context data structure.
10022         *lex.h: Added 1998 time stamp.
10023         (struct java_line): New fields ref_count and next.
10024         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
10025         JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
10026         (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
10027         *parse.h: Added 1998 time stamp.
10028         (java_parse_source_file): Renamed from parse_source_file.
10029         (YYERROR_NOW, YYNOT_TWICE): Fixed.
10030         (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
10031         INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
10032         JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
10033         THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
10034         END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
10035         CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
10036         (struct parser_ctxt): New data structure to keep the parser context.
10037         *parse.y: Added 1998 time stamp, got rid of static global variables.
10038         (java_error_count, ctxp): New global variables.
10039         (%union): New value field.
10040         (numeric_type, integral_type): Rules removed.
10041         (primitive_type): Rule defined to handle integral, float, double and
10042         boolean types.
10043         (qualified_name, package_declaration,
10044         single_type_import_declaration, type_import_on_demand_declaration,
10045         modifiers, class_declaration, super, interfaces,
10046         interface_type_list, class_body, field_declaration,
10047         field_declaration, variable_declarators, variable_declarator,
10048         variable_declarator_id, method_declaration, method_header,
10049         formal_parameter_list, formal_parameter, method_body, block,
10050         static, interface_declaration, extends_interfaces,
10051         abstract_method_declaration, local_variable_declarators): Rules now
10052         define actions.
10053         (force_error, do_warning): New global statics.
10054         (push_parser_context, parser_context_save_global,
10055         parser_context_restore_global, pop_parser_context): New functions.
10056         (yyerror): Now uses the global parser context. Fixed use of obstack.
10057         (parse_error, parse_error_context, parse_warning_context,
10058         java_accstring_lookup, redefinition_error, check_modifiers,
10059         parser_add_interface, create_interface, create_class, find_field,
10060         duplicate_declaration_error, register_fields, method_header,
10061         check_modifiers_consistency, check_abstract_method_header,
10062         method_declarator, parser_qualified_classname,
10063         parser_check_super_interface, parser_check_super,
10064         parser_chain_incomplete_item, java_check_circular_reference,
10065         layout_class_from_source, java_complete_class,
10066         complete_method_decl, resolve_class, complete_class_report_errors,
10067         java_check_final, check_method_redefinition,
10068         java_check_regular_methods, java_check_abstract_methods,
10069         java_check_methods, lookup_java_interface_method2,
10070         lookup_java_method2, lookup_cl, find_name_in_single_imports,
10071         process_imports, find_in_imports, read_import_entry,
10072         read_import_dir, find_in_imports_on_demand,
10073         check_pkg_class_access, not_builtin_p, declare_local_variables,
10074         source_start_java_method, java_generate_parsed_class): New
10075         functions.
10076         *typeck.c: (signature_include_return): New global variable.
10077         (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
10078         to add the function returned type in the signature.
10079
10080 1998-02-09  Brendan Kehoe  <brendan@cygnus.com>
10081
10082         * jcf-io.c (open_in_zip): Use strncmp and LEN.
10083
10084 Thu Jan 29 16:12:13 1998  Dave Brolley  <brolley@cygnus.com>
10085
10086         * Make-lang.in (java.info): Added.
10087         (java.install-info): Added
10088
10089 1998-01-27  Brendan Kehoe  <brendan@cygnus.com>
10090
10091         * Makefile.in (clean): Also remove java/parse.c.
10092
10093 1998-01-26  Brendan Kehoe  <brendan@cygnus.com>
10094
10095         Add a pair of -fbounds-check/-fno-bounds-check options.
10096         * lang.c (lang_decode_option): Add code to grok arguments.
10097         (flag_bounds_check): Add decl.
10098         (lang_f_options): New array w/ the option in it.
10099         * java-tree.h (flag_bounds_check): Add decl.
10100         * lang-options.h: New file.
10101         * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
10102         of a static macro value.
10103         (JAVA_ARRAY_EXCEPTION): Delete macro.
10104
10105 Fri Jan 23 14:19:47 1998  Per Bothner  <bothner@cygnus.com>
10106
10107         * typeck.c (build_java_array_type):  Fix two bugs in previous change.
10108         * expr.c (build_anewarray):  Add missing promote_type.
10109
10110 Thu Jan 22 17:43:45 1998  Per Bothner  <bothner@cygnus.com>
10111
10112         Add array types with known length to optimize bounds checking.
10113         * typeck.c (build_java_array_type):  Take length parameter.
10114         (java_array_type_length, build_prim_array_type):  New functions.
10115         * java-tree.h:  Update for new functions.
10116         * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
10117         * class.c:  Use build_prim_array_type.
10118         * expr.c (can_widen_reference_to):  Handle known-length array types.
10119         (verify_jvm_instructions):  Keep track of integer push instructions
10120         followed by newarray/anewarray, so we can build known-length arrays.
10121         (JAVA_ARRAY_DATA_OFFSET):  Replace by ...
10122         (java_array_data_offset):  New function.
10123         (build_java_array_length_access):  New function.  Optimize if constant.
10124         (build_java_arrayaccess):  Constant fold bounds check.
10125         (expand_java_newarray, expand_java_anewarray):  Replaced by ...
10126         (build_newarray, build_anewarray):  New functions.
10127         (ARRAY_NEW_NUM, ARRAY_NEW_PTR):  Use build_{a,}newarray.
10128         * verify.c (merge_types):  Handle known-lengh array types.
10129
10130 Mon Jan 19 13:09:25 1998  Per Bothner  <bothner@cygnus.com>
10131
10132         * expr.c (expand_byte_code):  Fix performace bug, which caused
10133         searching linenumber_table to be linear rather than constant.
10134
10135 Fri Dec 12 19:18:42 1997  Per Bothner  <bothner@cygnus.com>
10136
10137         * Makefile.in (BISON, BISONFLAGS):  Add missing macros.
10138
10139         * decl.c, java-tree.h (soft_fmod_node):  New global.
10140         * decl.c (init_decl_processing):  Define __builtin_fmod.
10141         * expr.c (build_java_binop):  Implement TRUNC_MOD_EXPR for REAL_TYPE
10142         using __builtin_fmod.
10143
10144 Thu Dec  4 13:22:59 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10145
10146         * keyword.h: New file, output of keyword.gperf as processed by
10147         gperf.
10148         * lex.c (java_lex_init): Initialize java_error_flag.
10149         * parse.c (YYERROR_NOW): Uses java_error_flag.
10150         * parse.y: New static java_error_flag. Useless definition of
10151         buffer_error gone.
10152         * parse.y (java_error): Portable error recovery using
10153         java_error_flag (not yet completely tuned).
10154
10155 1997-12-04  Brendan Kehoe  <brendan@lisa.cygnus.com>
10156
10157         * Makefile.in (parse.c): Use $(srcdir) for parse.y.
10158
10159 Wed Dec  3 18:37:42 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10160
10161         * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
10162         (parse.c, lex.c, keyword.h): New rules for Java source code
10163         front-end.
10164         * parse.c: Renamed into jcf-parse.c.
10165         * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
10166         * keyword.gperf: New file, Java keywords.
10167         * parse.y: New file, Java language grammar.
10168         * parse.h: New file, Java language grammar definitions.
10169         * lex.c: New file, Java language lexer.
10170         * lex.h: New file, Java language lexer definitions.
10171
10172 Wed Dec  3 17:00:17 1997  Per Bothner  <bothner@cygnus.com>
10173
10174         * decl.c (clinit_identifier_node), java-tree.h:  New global.
10175         * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P):  Removed.
10176         * verify.c (verify_jvm_instructions):  Inline use of removed macros.
10177         * expr.c (expand_java_field_op):  Check for invalid assignment
10178         to final field.
10179
10180         * jcf-reader.c (get_attribute):  Test for wrong attribute length.
10181
10182 Mon Oct 27 17:46:36 1997  Per Bothner  <bothner@cygnus.com>
10183
10184         * verify.c (verify_jvm_instructions):  When processing a handler,
10185         attempt to set the current_subr to the right value.
10186         (More complicated code combines Sep 17 and Oct 22 versions.)
10187
10188 Fri Oct 24 11:36:54 1997  Per Bothner  <bothner@cygnus.com>
10189
10190         * class.c (push_class):  Figure out (guess) name of source file.
10191         * parse.c  (set_source_filename):  Set DECL_SOURCE_FILE of class decl.
10192         (give_name_to_class):  Don't guess source name;  use DECL_SOURCE_FILE.
10193         (parse_class_file):  Change return type from int to void.
10194         Call debug_start_source_file/debug_end_source_file.
10195
10196         * expr.c (build_java_binop):  Fix masking 2nd operand.
10197         * decl.c (init_decl_processing):  Set sizetype first.
10198
10199 Wed Oct 22 19:39:05 1997  Per Bothner  <bothner@cygnus.com>
10200
10201         * verify.c (verify_jvm_instructions):  Don't set current_subr to NULL.
10202         (Revert Sep 17 change.)
10203
10204 Tue Oct 21 15:09:02 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10205
10206         * parse.c (process_zip_dir): Skip ZIP entries not bearing the
10207         .class extension in their name and fix thing so we don't process
10208         them parse_zip_file_entries().
10209         (parse_zip_file_entries): Cleaned unused local variables.
10210
10211 Mon Oct 20 14:52:42 1997  Per Bothner  <bothner@cygnus.com>
10212
10213         * expr.c (can_widen_reference_to):  Allows equal array element types.
10214         (expand_byte_code):  PRE_RET must expand OPERAND_VALUE (to get index).
10215         * jcf-dump.c (RET):  Get (and print) index.
10216
10217         * verify.c (verify_jvm_instructions case OPCODE_anewarray):
10218         Promote element type to POINTER_TYPE.
10219
10220 Mon Oct 20 13:40:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10221
10222         * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
10223         find_in_current_zip, jcf_figure_file_type): Moved from
10224         jcf-reader.c to parse.c.
10225         * zextract.c: (read_zip_archive): takes file_comment_length possible
10226         field into account.
10227
10228 Mon Oct 20 11:45:06 1997  Per Bothner  <bothner@cygnus.com>
10229
10230         * verify.c (verify_jvm_instructions):  Var can also be promoted to int.
10231
10232         * verify.c (merge_types):  Handle array types even better ...
10233
10234 Fri Oct 17 15:56:37 1997  Per Bothner  <bothner@cygnus.com>
10235
10236         * expr.c (java_stack_pop):  Fix use of NULL_TREE for TYPE_SECOND.
10237
10238         * java-tree.h (PUSH_FIELD):  Set DECL_ARTIFICIAL.
10239         * class.c (make_class_data):  Don't build fields_decl if no fields.
10240         When building fields_decl, skip if DECL_ARTIFICAL.
10241
10242         * expr.c (java_stack_swap):  Update stack_type_map.
10243         * verify.c (merge_types):  Handle array types better.
10244
10245 Wed Oct 15 18:09:45 1997  Per Bothner  <bothner@cygnus.com>
10246
10247         * class.c (add_field):  Don't promote short integral fields to
10248         int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
10249         * expr.c (push_value):  Promote and convert short integral values.
10250
10251         * decl.c, java-tree.h (integer_two_node):  New constant node.
10252         * verify.c (merge_types):  Check for TYPE_RETURN_ADDR.
10253
10254 Wed Oct 15 17:04:50 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10255
10256         * class.c (append_gpp_mangled_type): Use function argument
10257         unpromoted type to generate mangled name.
10258
10259 Mon Oct 13 16:52:55 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10260
10261         * constants.c (build_constant_data_ref): Now uses current_class
10262         instead of main_class.
10263         (build_constants_constructor): Now uses current_class instead of
10264         main_class.
10265         * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
10266         of the global variable SeepZipFiles done here.
10267         * zextract.c (read_zip_archive): extra_field optional field taken
10268         into account while computing the position of the class file in the
10269         archive.
10270         * verify.c (verify_jvm_instructions): Use current_jcf to search
10271         the constant pool.
10272         * parse.c (load_class): First search for the class to load in the
10273         current zip file. Saves current_jcf (restored before returning
10274         from that function). Don't call JCF_FINISH in the class was found
10275         in the current ZIP file.
10276         (jcf_parse): If the class was found in the current ZIP file, save
10277         its tree_constant_pool (for later reuse).
10278         (parse_class_file): New function. Process each method defined in
10279         the current class and record the class as to be later registered.
10280         (yyparse): Rewritten. Figure the type of the current file and switch
10281         accordingly.
10282         * lang.c: New global variable current_jcf.
10283         (lang_init): Removed compiling_from_source test (done later, in
10284         yyparse). Removed call the jcf_parse ().
10285         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
10286         (typedef struct JCF): New fields seen_in_zip (to mark a class found
10287         in the current ZIP file) and zip_offset (offset to the class data in
10288         the current zip file).
10289         * jcf-reader.c: zipfile.h included.
10290         localToFile: New ZipFileCache static global variable
10291         (parse_zip_file_entries): New function. Browse the current ZIP
10292         file directory and process each class found.
10293         (process_zip_dir): New function. Register each class found in the
10294         ZIP file directory. The class aren't parsed but a valid JCF is
10295         link to each of them.
10296         (find_in_current_zip): New function. Search for a class in the
10297         current ZIP file directory. If found, prepare the class so that it
10298         can be loaded.
10299         (jcf_figure_file_type): New function. Examine the file structure
10300         to figure a class file, a ZIP file. If none of these categories are
10301         matched, a source file is assumed.
10302         * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
10303         SeenZipFile: New global variable.
10304         (open_in_zip): Use zipmember's length to accelerate the search for
10305         a member. If zipmember was NULL and zip file successfully read,
10306         return 0.
10307         * java-tree.h: New global variable current_jcf declared.  Added
10308         declaration for current_constant_pool_tags, current_constant_pool_data,
10309         current_constant_pool_length, current_constant_pool_data_ref.
10310         (struct lang_type): Augmented with two fields. struct JCF *jcf (to
10311         store the JCF of classes seen in a zip file) and tree *constant_pool
10312         (to save a loaded class constant pool). current_class declared here.
10313         * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
10314         retrieve method_ref_constant.
10315         (PUSHC): java_push_constant_from_pool now uses current_jcf.
10316         (OBJECT): get_class_constant now uses current_jcf.
10317         (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
10318         (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
10319         (expand_invoke): Now uses current_class instead of main_class
10320         (build_class_init): Now uses current_class instead of main_class
10321         * class.c: New static global variable registered_class.
10322         (register_class): New function.
10323         (emit_register_class): Modified to use registered_class instead of
10324         main_class
10325         (is_compiled_class): Now take into account class seen in the archive.
10326
10327 Mon Oct  6 12:03:23 1997  Per Bothner  <bothner@cygnus.com>
10328
10329         * except.h:  Renamed to: java-except.h.
10330         * parse.c, except.c, expr.c, verify.c:  Update #include accordingly.
10331         * except.c:  Add semi-working (commented out) implementation.
10332
10333         * expr.c (expand_iinc):  Add needed flush_quick_stack.
10334         * parse.c (set_source_filename):  New function.
10335         (give_name_to_class):  Set input_filename from package.classname.java.
10336
10337         * jcf-io.c (find_class):  Don't look first in ".".
10338
10339 Wed Oct  1 11:26:10 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10340
10341         * zextract.c (read_zip_archive): Now takes into account the
10342         extra_field field.
10343         * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
10344
10345 Sat Sep 20 12:44:28 1997  Per Bothner  <bothner@cygnus.com>
10346
10347         * constants.c, java-tree.h (build_internal_class_name):  New function.
10348         (alloc_class_constant):  Re-implement using build_internal_class_name.
10349         * class.c (make_class_data):  Likewise.
10350         * class.c (hashUtf8String):  Make hash algorithm match String.hashCode.
10351
10352 Wed Sep 17 13:15:23 1997  Per Bothner  <bothner@cygnus.com>
10353
10354         * verify.c (verify_jvm_instructions):  Temporarily set current_subr
10355         to NULL before pushing an exception handler target.
10356
10357         * expr.c (flush_quick_stack):  Save from low stack indexes to high.
10358         (java_stack_swap, java_stack_dup):  Re-write to be safe from
10359         clobbering registers.
10360         (build_class_init):  New function.
10361
10362 Wed Sep 17 11:02:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10363
10364         * typeck.c (build_java_array_type): Temporary use
10365         permanent_obstack to create the array 'length' field.
10366         * expr.c (lookup_label): Temporay use permanent_obstack to create
10367         label if not found.
10368         * class.c (push_super_field): Tempory use permanent_obstack.
10369
10370 Mon Sep 15 11:33:31 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10371
10372         * typeck.c (type_for_mode): Now handles double_type_node and
10373         float_type_node.
10374         * verify.c (verify_jvm_instructions): The instruction following
10375         the wide bytecode is checked. OPCODE_ret added to the list of
10376         wide.
10377
10378 Thu Sep 11 19:45:18 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10379
10380         * class.c (make_class): Temporary use permanent_obstack. Set the
10381         class CLASS_P field to 1.
10382         (push_class): Temporary use permanent_obstack.
10383         (set_super_info): Temporary use permanent_obstack.
10384         (add_method): Temporary use permanent_obstack, set
10385         METHOD_TRANSIENT().
10386         (add_field): Temporary use permanent_obstack. Sets
10387         FIELD_VOLATILE() and FIELD_TRANSIENT().
10388         (build_class_ref): Temporary use permanent_obstack if the class
10389         isn't compiled.
10390         (build_static_field_ref): Temporary use permanent_obstack when
10391         creating field's rtl.
10392         (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
10393         ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
10394         and fields. Function finalized, as far as flag handling.
10395         (push_class_static_dummy_field): Temporary use permanent_obstack.
10396         (emit_register_class): Force generation of class registration at
10397         -O3 or deeper.
10398         * decl.c (end_java_method): Call permanent_allocation() before
10399         returning.
10400         * expr.c (can_widen_reference_to): Added comment to interface
10401         handling, fixed typo.
10402         (lookup_field): Now uses CLASS_P() to correct FIXME
10403         (expand_invoke): Verification on public && !static &&
10404         !abstract moved into soft_lookupinterfacemethod (kaffe).
10405         Use Object class dtable if objectref is an array when expanding
10406         invokeinterface.
10407         (java_push_constant_from_pool): Temporary use permanent_obstack
10408         for CONSTANT_string
10409         * parse.c (get_ref_constant): Temporary use permanent_obstack to
10410         create constant references.
10411         (get_constant): Temporary use permanent_obstack to create constant.
10412         (load_class): Temporary use permanent_obstack to load class.
10413         (jcf_parse): Temporary use permanent_obstack to perform class
10414         layout.
10415         * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
10416         (build_java_signature): Temporary use permanent_obstack.
10417         * verify.c: (verify_jvm_instruction): removed unecessary verification
10418         on ACC_SUPER flag.
10419         * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
10420         (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
10421         (CLASS_P): Defined
10422
10423 Thu Sep 11 11:57:32 1997  Per Bothner  <bothner@cygnus.com>
10424
10425         * class.c (append_gpp_mangled_type):  Fix typo.
10426         (emit_register_class):  Use main_class to get class object, rather
10427         than looking for no-longer-existing static decl starting with _CL.
10428         * typeck.c (parse_signature_type):  Promote array element type
10429         if it is a RECORD_TYPE.
10430
10431 Wed Sep 10 16:09:23 1997  Per Bothner  <bothner@cygnus.com>
10432
10433         * class.c (push_class_static_dummy_field):  New function.
10434         (mangle_static_field):  New. Do G++-style mangling of static fields.
10435         (layout_class):  Mandle static fields here, not in add_field.
10436         (build_class_ref):  The class object is now a dummy static field.
10437         * decl.c (find_local_variable):  Look for best, instead of first match.
10438         * expr.c (push_type):  Always promote_type, not just for RECORD_TYPE.
10439         (build_java_athrow):  Don't check here if exception is Throwable.
10440         * java-tree.h (TYPE_UNSET):  Renamed to TYPE_UNKNOWN.
10441         (TYPE_USED):  Removed.  No longer used ...
10442         * parse.c (jcf_parse):  Call push_class_static_dummy_field.
10443         * verify.c (push_pending_label):  New function.
10444         (push_pending_block):  Renamed to check_pending_block.
10445         (merge_types):  Remove unneeded suuport for TYPE_UNUSED.
10446         (verify_jvm_instructions):  Only reset prev_eh_ranges (to force
10447         re-checking possible handlers) after a store (less wasted work).
10448         Check for null handler (finally) before calling add_handler.
10449         Various changes to (finally?) correctly handle try/finally.
10450
10451 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
10452
10453         * class.c: Include stdio.h.
10454
10455 Thu Sep  4 21:30:55 1997  Per Bothner  <bothner@cygnus.com>
10456
10457         * expr.c (expand_invoke):  Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
10458         to make sure class is initialized before static/special invoke.
10459
10460         * verify.c (verify_jvm_instructions):  On a store instruction,
10461         call find_local_variable to force pre-allocation of decl and rtx.
10462         * decl.c (push_jvm_slot):  Set DECL_REGISTER on stack slots.
10463
10464 Wed Sep  3 16:13:23 1997  Per Bothner  <bothner@cygnus.com>
10465
10466         * class.c (build_class_ref):   Strip off "promoted_" if need be.
10467         (make_field_value): Call build_java_signature when needed.
10468         (layout_class):  Don't make_function_rtl if METHOD_ABSTRACT.
10469         * expr.c (build_java_athrow):  Don't push_value of exception.
10470         (build_java_binop):  Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
10471         match specification of [fd]cmp[lg] for NaNs.
10472         (expand_byte_code):  Add support for exception handler ranges.
10473         * except.c:  Add skeleton for EH code-generation.
10474         * verify.c (merge_types):  Treat all promoted integral types as equal.
10475         * constants.c (build_constants_constructor):  To force creation of
10476         current_constant_pool_data_ref, call build_constant_data_ref.
10477
10478         * javaop.def (lload):  Fix typo.
10479         * jcf-dump.c (main):  Clear filename to prevent possibly-bad free.
10480
10481 Tue Sep  2 17:37:25 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
10482
10483         * parse.c: Don't include function.h.
10484
10485 Wed Aug 27 18:33:04 1997  Per Bothner  <bothner@cygnus.com>
10486
10487         * except.[ch]:  New files.
10488         * Makefile.in (JAVA_OBJS):  Add except.o
10489         * expr.c:  Temporary warning about unimplemented exceptions.
10490         * verify.c:  Verify exception handlers.
10491
10492         * jcf-dump.c (disassemble_method):  Print exception table.
10493
10494 Wed Aug 27 13:26:58 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10495
10496         * expr.c (verify_jvm_instructions): Started a thorough
10497         verification of invoke* bytecodes.
10498         (expand_byte_code): flush quick stack if PC is the target of a
10499         branch.  and undef RET (conflicting with config/i386/i386.h).
10500         (expand_java_arrayload): Fixed bogus cast, when Boolean type is
10501         used.
10502         (expand_invoke): Now handles invokeinterface and do more
10503         verification according to the bytecode.
10504         (lookup_field): Don't try to load the class if processing
10505         dtable_type.
10506         (can_widen_reference_to): Now handles interfaces.
10507         * decl.c (init_decl_processing): New global variable
10508         soft_lookupinterfacemethod_node, declared in java-tree.h.
10509         Call set_super_info on string_type_node.
10510         * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
10511         defined.
10512         * class.c (set_super_info): Fills the CLASS_* flags according to
10513         access_flags.
10514         (get_access_flags_from_decl): Handles all class flags.
10515
10516 Tue Aug 26 18:54:34 1997  Per Bothner  <bothner@cygnus.com>
10517
10518         * class.c (add_method):  Zero out newly-allocated DECL_LANG_SPECIFIC.
10519         * parse.c (yyparse):  Check for abstract method, and missing code.
10520         * expr.c (expand_byte_code):  Change interface.
10521         * lang.c (put_decl_node):  Print promoted types prettier.
10522         * verify.c (verify_jvm_instruction):  Change interface.
10523         Partial support for scanning exception table.
10524         For load instructions, handle promoted integral types.
10525
10526 Thu Aug 21 13:48:01 1997  Per Bothner  <bothner@cygnus.com>
10527
10528         * verify.c:  New file, with contents moved from expr.c.
10529         * expr.c:  Bunch of stuff (mostly verification) moved to verify.c.
10530         * typeck.c (is_array_type_p):  Moved here from expr.c.
10531         * java-tree.h:  Add some now-needed function declarations.
10532         * Makefile.in (JAVA_OBJS): Added verify.o.
10533
10534 Wed Aug 20 14:34:34 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10535
10536         * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
10537         METHOD_ABSTRACT flag.
10538
10539         * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
10540         (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
10541         (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
10542
10543         * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
10544         variables.
10545         (start_java_method): Hook for SYNCHRONIZED methods.
10546
10547         * expr.c (build_java_jsr, build_java_ret): New functions
10548         (JSR,PRE): New macros
10549         (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
10550         (verify_jvm_instructions): tableswitch, lookupswitch,
10551         monitorenter, monitorexit, goto_w: verified.
10552         (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
10553         (build_java_monitor): New function.
10554         (MONITOR_OPERATION): Modified to call build_java_monitor()
10555         (verify_jvm_instructions): Started a thorough verification of
10556         invoke* bytecodes.
10557
10558 Tue Aug 19 13:35:49 1997  Per Bothner  <bothner@cygnus.com>
10559
10560         Support verification of jsr/ret subroutines (used for try/finally).
10561         * decl.c (return_address_type_node):  New type node.
10562         * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
10563         RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
10564         LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED):  New macros.
10565         (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
10566         TYPE_USED):  New macros for special types in type_map.
10567
10568         * java-tree.h (BCODE_JUMP_TARGET):  Renamed to BCODE_TARGET.
10569         (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET):  Replaced by
10570         BCODE_JUMP_TARGET.
10571         * expr.c (expand_byte_code):  Fix logic to warn of unused instructions.
10572
10573         * expr.c (can_widen_reference_to):  New function.
10574         (pop_type):  Use it.
10575         (merge_type_state):  Support handling start of subroutine.
10576         (push_pending_block):  Return char* error message, instead of calling
10577         fatal on an error.  Also handle subroutines.
10578         (verify_jvm_instructions):  Handle errors from push_poending_block.
10579         Support jsr and ret instructions.
10580
10581 Tue Aug 19 13:33:36 1997  Per Bothner  <bothner@cygnus.com>
10582
10583         * jcf-io.c (find_classfile):  Fix thinko.
10584         * jcf-dump.c:  Add CONVERT2 (to match changed javaop.def).
10585
10586 Tue Aug 12 20:14:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
10587
10588         * Makefile.in (BISON): Remove.
10589
10590 Thu Aug  7 23:08:24 1997  Per Bothner  <bothner@cygnus.com>
10591
10592         * Makefile.in:  Convert to autoconf.
10593         * config-lang.in (outputs):  Added java/Makefile.
10594
10595         * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
10596         Rename cc1java to jc1.
10597
10598         * lang.c (init_parse, finihs_parse):  New functions #ifdef USE_CPPLIB.
10599         * Makefile.in (INTERNAL_CFLAGS):  Add @extra_c_flags.
10600
10601         * class.c (class_depth):  Do load_class if needed.
10602
10603         Mostly better verification.
10604         * decl.c (pushdecl):  Set TYPE_STUB_DECL for a type.
10605         (init_decl_processing):  Change return type of soft_checkcast.
10606         * expr.c (expand_java_CHECKCAST):  Do push_value of the "casted" value.
10607         * lang.c (put_decl_string, put_decl_node, lang_printable_name,
10608         lang_print_error):  New functions.
10609         (lang_init):  Set global hook print_error_function to lang_print_error.
10610         * expr.c:  In the type_map ptr_type_node is only used for null now.
10611         (pop_type, merge_types):  Hence ptr_type_node matches any reference.
10612         (merge_types):  Dererence pointer to record types before comparing.
10613         (decode_newarray_type, merge_types):  On error just return NULL.
10614         (build_java_binop):  Add preliminary implementation (with warning)
10615         for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
10616         (lookup_label):  Set DECL_IGNORED_P (for dwarf2out).
10617         (expand_compare, expand_java_goto, expand_java_call):  Don't
10618         push_pending_block, since that only makes sense when verifying.
10619         (merge_type_state):  Different return codes.
10620         (push_pending_block):  A block may need to be verified more than once.
10621         (expand_byte_code):  Warn about unused code at code generation time.
10622         (verify_jvm_instruction):  Changed logic, since code may need to be
10623         re-verified if type-state has changed.  Also, better error handling.
10624         Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
10625         Improve newarray, anewarray, ?aload, athrow,
10626         * java-tree.h (LABEL_CHANGED):  New macro.
10627
10628 Tue Aug  5 12:21:27 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10629
10630         * decl.c (soft_athrow_node): New global variable initialized.
10631         * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
10632         * typeck.c (convert): Added support for REAL_TYPE.
10633         (convert_to_char): New function.
10634         (convert): Handle CHAR_TYPE.
10635         * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
10636         SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
10637         (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
10638         promoted type.
10639         (verify_jvm_instructions): Added break a the end of bogus unop: label.
10640         (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
10641         (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
10642         (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
10643         (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
10644         to Use The Right Things.
10645         (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
10646         compatible with INT. BOOLEAN is made equivalent to BYTE.
10647         (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
10648         OPCODE_ifnonnull): Now supported.
10649         (build_java_athrow): New function.
10650
10651 Mon Aug  4 15:46:45 1997  Per Bothner  <bothner@cygnus.com>
10652
10653         Rename method name <init> to match G++ (and fix mangling).
10654         * class.c (layout_class):  Replace method name of <init> by class name.
10655         (make_method_value):  Do inverse renaming of constructor from <init>.
10656         * java-tree.h (DECL_CONSTRUCTOR_P):  New macro.
10657         * typeck.c (lookup_java_constructor):  New function.
10658         * expr.c (expand_invoke):  If method_name is <init>, call
10659         lookup_java_constructor to find constructor.
10660
10661         * parse.c (get_constant):  Handle CONSTANT_Float and CONSTANT_Double.
10662
10663 Fri Aug  1 11:37:09 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10664
10665         * parse.c (get_class_constant): Modified to handle array "classes"
10666         * typeck.c (set_local_type): Bug fixed when filling type_map[] with
10667         wide type.
10668         (convert): Modified to handle real type.
10669         * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
10670         soft_multianewarray, soft_newarray_node, soft_throw_node): New global
10671         variables declared.
10672         * decl.c (soft_badarrayindex_node, soft_anewarray_node,
10673         soft_multianewarray, soft_newarray_node, soft_throw_node): New
10674         global variables initialized.
10675         (find_local_variable): Handles the case of a pointer
10676         (end_java_method): Restore the use of one more scope
10677         * expr.c (build_java_arraynull_check, build_java_arrayaccess,
10678         build_java_array_length_access, expand_java_arrayload,
10679         expand_java_arraystore, expand_java_array_length,
10680         expand_java_multianewarray, expand_java_anewarray,
10681         build_java_check_indexed_type, is_array_type_p,
10682         build_java_throw_out_of_bound_exception): New functions.
10683         (STORE_INTERNAL): Now forces type of the decl to be type of the value.
10684         (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
10685         OPCODE_<t>aload): Implemented code for verification.
10686         (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
10687         ARRAY_NEW_MULTI): Macro defined.
10688         (CONVERT): Modified to invoke convert().
10689         (case OPCODE_aload2): Fixed index typo from 2 to 1.
10690
10691 Thu Jul 31 12:48:18 1997  Per Bothner  <bothner@cygnus.com>
10692
10693         * class.c (push_class):  Set DECL_ARTIFICIAL (for dbxout.c).
10694         (build_class_ref, is_compiled_class):  Handle pointer-to-record types.
10695         (make_class_data):  Field name needs '/' as package prefix.
10696         * expr.c (type_stack_dup, java_stack_dup):  Fix fencepost errors.
10697
10698 Fri Jul 25 11:44:21 1997  Per Bothner  <bothner@cygnus.com>
10699
10700         Implement debug information for local variables.
10701         * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
10702         DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
10703         DECL_LOCAL_SLOT_CHAIN):  New macros.
10704         (struct lang_decl_var):  New type.
10705         * parse.c (give_name_to_locals):  Move to decl.c.
10706         * decl.c (give_name_to_locals):  Re-written to Do The Right Thing.
10707         (start_java_method):  Re-write parameter handling.
10708         (pending_local_decls):  New global variable.
10709         (push_jvm_slot, maybe_pushlevels, maybe_poplevels):  New functions.
10710         (find_local_variable):  Accept pc so we can skips decls not in range.
10711         (struct binding_level):  Add end_pc field.
10712         * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
10713         (various):  Change so current pc gets passed to find_local_variable.
10714
10715         * decl.c (init_decl_processing):  Re-arrange fields in
10716         class_type_node and and method_type_node to match kaffe 0.9.1.
10717         * class.c (make_method_value, make_class_data):  Update
10718         initializations to match.
10719
10720 Wed Jul 16 17:17:50 1997  Per Bothner  <bothner@cygnus.com>
10721
10722         * class.c (unicode_mangling_length, emit_unicode_mangled_name,
10723         append_gpp_mangled_name, append_gpp_mangled_type):  New functions.
10724         (push_super_field):  New function.
10725         (make_class_data):  Handle inheritance of class static initializer.
10726         (layout_class):  New name mangling.
10727         * constants.c (build_constant_data_ref):  Init type of data array
10728         to a one-element array.
10729         (build_constants_constructor):  Set DECL_SIZE from complete array type.
10730         * decl.c:  Rename class_type, object_type etc to class_type_node,
10731         object_type_node etc.  Make former inherit from latter.
10732         * expr.c (expand_invoke):  Add cast of function address.
10733         * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE):  New.
10734         * parse.c (yyparse):  Don't call layout_class here.
10735         * typeck.c (build_java_array_type):  Set TYPE_ARRAY_ELEMENT.
10736
10737 Sat Jun 14 12:06:57 1997  Per Bothner  <bothner@cygnus.com>
10738
10739         * decl.c, class.c:  Update method type to match latest Kaffe snapshot.
10740         * constants.c (lookup_name_constant):  Renamed to alloc_name_constant.
10741         (alloc_class_constant):  New.
10742         * expr.c (expand_invoke):  Make sure method's class is initialized.
10743         * class.c (interits_from_p, emit_register_class):  New functions.
10744         * parse.c (yyparse):  Call emit_register_class.
10745
10746 Mon Jun  9 18:08:06 1997  Per Bothner  <bothner@cygnus.com>
10747
10748         * constants.c:  New file, to handle constant pool.
10749         * Makefile.in (JAVA_OBJS):  Add constants.o.
10750         * decl.c (init_decl_processing):  Update, fix, finish various structs.
10751         (pushdecl_top_level):  New.
10752         * parse.c (layout_class):  Moved to class.c.
10753         * expr.c (java_push_constant_from_pool):  New function.
10754         * class.c (build_class_ref):  Make work fully
10755         (make_class_data):  Emit super-class, constant pool, interface vector.
10756
10757 Tue Jun  3 10:14:31 1997  Per Bothner  <bothner@cygnus.com>
10758
10759         java-tree.h (DECL_SIGNATURE, BCODE_EMITTED):  Remove.
10760         (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P):  New.
10761         * class.c (class_depth):  New function.
10762         (lookup_named_class):  Replaced by new function lookup_class.
10763         * decl.c (object_type_node, string_type_node):  New.
10764         Remove various types that we no longer need.
10765         * expr.c (verify_jvm_instructions):  New separate verifier pass.
10766         (push_type, pop_type):  New functions for verifier.
10767         (type_stack_dup, pop_argument_types, merge_types):  Likewise.
10768         (expand_byte_code):  Simplify, since we assume already verified.
10769         (expand_invoke):  Now mostly works.
10770         * javaop.def:  Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
10771         * lang.c (main_class):  Move to parse.c.  Don't make_class yet.
10772         * parse.c:  Wait to allocate class object until we know its name.
10773         (layout_class):  Calculate DECL_VINDEX for each virtual method.
10774         * typeck.c (get_array_type):  Rename to ...
10775         (build_java_array_type):  ... and provide working implementation.
10776         (build_java_signature):  New function - build Java signature of type.
10777         (set_java_signature):  New function - cache signature with type.
10778         (lookup_java_method):  New function.
10779
10780 Tue May  6 22:08:24 1997  Per Bothner  <bothner@deneb.cygnus.com>
10781
10782         * class.c (ident_subst):  Take extra SUFFIX parameter.
10783         (add_field):  Set DECL_ASSEMBLER_NAME of static fields;  more.
10784         (set_constant_value, build_static_field_ref, is_compiled_class):  New.
10785         (build_class_ref):  Actually implement.
10786         * decl.c, java-tree.h:  Renamed some xx_type to xx_type_node.
10787         * decl.c (builtin_function):  New.
10788         (init_decl_processing):  Update for current Kaffe.  Declare some
10789         builtin Kaffe functions.
10790         * expr.c (build_address_of):  New.
10791         (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
10792         Renamed (from expand_java_new etc), and added working implementations.
10793         (build_field_ref):  Now also handle static fields.
10794         (expand_invoke):  Implement invokestatic, and start implement rest.
10795         * java-opcodes.h:  Use javaop.def to avoid duplicated list.
10796         * javaop.def:  Rename invokevirt -> invokevirtual.
10797         * lang.c (use_handles):  Removed.
10798         * parse.c:  Add support for ConstantValue atribute.
10799         Handle nested loading of a class.  (JPOOL_UTF):  New.
10800
10801 Tue Mar 11 20:11:05 1997  Per Bothner  <bothner@deneb.cygnus.com>
10802
10803         * expr.c (expand_java_pushc):  Support #ifndef REAL_ARITHMETIC case.
10804
10805 Thu Feb 27 14:24:29 1997  Per Bothner  <bothner@deneb.cygnus.com>
10806
10807         * Make-lang.in (java.install-man):  New empty rule.
10808         * typeck.c (set_local_type):  New function.
10809         * expr.c (STORE_INTERNAL):  Call find_local_variable,
10810         not find_stack_slot.  Call set_local_type.
10811
10812 Wed Feb 12 16:11:05 1997  Per Bothner  <bothner@kalessin.cygnus.com>
10813
10814         * java-tree.h:  Various new macros for constructing RECORD_TYPEs,
10815         and building RECORD_TYPE CONSTRUCTORs.
10816         Also support for creating Utf8Const objects from an INDETIFIER_NODE.
10817
10818         * lang.c (use_handles):  Change the default to 0.
10819         * decl.c:  Define and build class_type, field_type, utf8const_type.
10820         * class.c (make_class_data, make_field_value,
10821         get_access_flags_from_decl, build_class_ref, build_utf8_ref,
10822         hashUtf8String, strLengthUtf8, mangled_classname:
10823         Functions to build reflective data structures.
10824         * parse.c (yyparse):  Call make_class_data.
10825
10826         * jcf-io.c (open_class, find_classfile):  New functions.
10827         * jcf-dump.c:  Support reading classfile from explicitly-named
10828         class file (without CLASSPATH searching).
10829
10830 Thu Oct 24 14:10:16 1996  Per Bothner  <bothner@deneb.cygnus.com>
10831
10832         * jcf-reader.c:  Add parameter list to HANDLE_CONSTANT_Utf8.
10833         * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
10834         Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
10835         (get_constant):  Now trivial for CONSTANT_Utf8.
10836
10837         * jcf.h:  Make NEW_CPOOL the default.
10838         * jcf.h, jcf-reader.c, parse.c:  Remove support for !NEW_CPOOL.
10839
10840 Thu Oct 24 13:52:45 1996  Per Bothner  <bothner@deneb.cygnus.com>
10841
10842         New directory.