OSDN Git Service

2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
[pf3gnuchains/gcc-fork.git] / gcc / java / ChangeLog
1 2001-03-21  Bryce McKinlay  <bryce@albatross.co.nz>
2
3         * gjavah.c (process_file): Mark interface definitions with 
4         "__attribute__ ((java_interface))".
5
6 2001-03-21  Alexandre Petit-Bianco  <apbianco@redhat.com>
7
8         * class.c (layout_class): Fixed push_super_field's second
9         argument. Fixes PR java/2333.
10         (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
11         too early to lay innerclasses out.
12
13 2001-03-20  Tom Tromey  <tromey@redhat.com>
14
15         * lex.c (java_read_unicode): Only accept leading `u's.
16
17 2001-03-20  Tom Tromey  <tromey@redhat.com>
18
19         * jcf-parse.c (read_class): Initialize `class'.
20
21 2001-03-20  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
22
23         * jcf_parse.c (jcf_parse): Eliminate unused variable.
24
25 2001-03-19  Mark Mitchell  <mark@codesourcery.com>
26
27         * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
28         (layout_class): Likewise.
29         (layout_class_method): Likewise.
30         (emit_register_classes): Likewise.
31         * decl.c (builtin_function): Likewise.
32         (give_name_to_locals): Likewise.
33
34 2001-03-19  Per Bothner  <per@bothner.com>
35
36         * jcf-parse.c (load_inner_classes):  Check CLASS_LOADED_P
37         before trying to load an inner class.
38
39         Fixes to process to command-line .class files in two passes.
40         * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P):  New flags.
41         (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P):  Rename to ..
42         (CLASS_FROM_CURRENTLY_COMPILED_P):  ... because it is more general now.
43         * class.c (is_compiled_class):  Fix for renamed flag.
44         * parse.y (maybe_create_class_interface_decl):  Likewise.
45         * jcf-parse.c (yyparse):  Also set if compiling .class files.
46         * jcf-parse.c (read_class);  Read current_class.
47         (jcf_parse):  Make static.
48         (load_inner_classes):  New function, with code moved from jcf_parse,
49         because we need to inner classes after the command-line files are read.
50         (yyparse):  Set finput to NULL when it doesn't need to be closed.
51         Reduce use of main_jcf (basically only for archive) and
52         use finput instead of main_jcf->read_state.
53         Inline jcf_figure_file_type into yyparse.
54         Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
55         Defer load_inner_classes and parse_class_file to a second pass,
56         after we've correctly mapped command-line .clas fiels to classes.
57         (jcf_figure_file_type):  Removed.
58         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE):  Removed flags.
59         (JCF_ZERO):  Also clear zipd field.
60         * zipfile.h:  Conditionalize on JCF_H insread of JCF_ZIP.
61
62 2001-03-18  Matt Kraai  <kraai@alumni.carnegiemellon.edu>
63
64         * jcf-parse.c (yyparse): Change ch from char * to char.
65
66 2001-03-19  Per Bothner  <per@bothner.com>
67
68         * jvspec.c (lang_specific_driver):  Check for .zip and .jar files.
69         Add constructed filelist-file at end, following -xjava.  Thus any .o
70         and library files are not affected by the -xjava.  Also wrap
71         explicit @FILE with -xjava and -xnone.
72
73 2001-03-19  Andrew Haley  <aph@cambridge.redhat.com>
74
75         * class.c (build_static_field_ref): Call make_decl_rtl() after
76         setting the DECL_EXTERNAL flag.
77
78 2001-03-17  Per Bothner  <per@bothner.com>
79
80         * decl.c (clear_binding_level):  Fix initializer (broke 03-15).
81
82         * jcf-write.c (generate_bytecode_insns):  Handle emitting iinc
83         when result is is needed (target is STACK_TARGET).
84
85         * parse.h (JDEP_SOLV):  Removed.
86         * parse.y (register_incomplete_type):  Use JDEP_TO_RESOLVE instead.
87
88         * parse.y (incomplete_class_list): Removed.
89         (obtain_incomplete_type): Don't use or set incomplete_class_list.
90         It doesn't work if resolve_class changes the name of an array type
91         that is on the list and then someone else looks for the modified name.
92         Also, seems liable to break when compiling multiple source files at
93         once.  So the simplest is to just remove incomplete_class_list -
94         it is only a minor space win and it is not even clear it saves time.
95
96         * parse.y (resolve_class):  Remove unneeded promote_type.
97
98 2001-03-15  Per Bothner  <per@bothner.com>
99
100         * java-tree.h (BLOCK_IS_IMPLICIT):  New flag.
101         * parse.h (BLOCK_EXPR_ORIGIN):  Removed macro.
102         * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
103         Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
104
105         * jcf-parse.c (yyparse):  Set/reset input_filename for source file.
106         * parse.y (java_expand_classes):  Likewise.
107
108         * parse.y (expand_start_java_method):  Was only called once and had a
109         misleading name, so inline in caller java_complete_expand_method.
110         (enter_a_block):  Likewise inline in enter_block and remove.
111
112         Remove junk from when gcc/java was created (by copying from C/C++).
113         * decl.c (keep_next_level_flag, keep_next_if_subblocks):  Remove.
114         (struct binding_level):  Remove fields keep, keep_if_subblocks,
115         more_cleanups_ok, have_cleanups (which have never been used).
116         (pushlevel, poplevel):  Remove related useless code.
117
118         * class.c (make_class_data):  The class_dtable_decl (i.e. the
119         vtable for Class) should be external, except when compiling Class.
120
121         * jvspec.c (lang_specific_driver):  Fix -C handling.
122         Check -save-temps to see if temp @FILE should be deleted.
123         Follow-up to/fix for February 16 patch.
124
125         * verify.c (verify_jvm_instructions):  Better error msgs for dup.
126         (type_stack_dup):  Remove no-longer neded error check.
127
128 2001-03-15  Bryce McKinlay  <bryce@albatross.co.nz>
129
130         * mangle.c (mangle_record_type): Rename 'from_pointer' argument
131         to 'for_pointer'. If this type is for a pointer (argument) mangling,
132         don't surround the element with 'N..E' if the type name is 
133         unqualified.
134
135 2001-03-14  Mark Mitchell  <mark@codesourcery.com>
136
137         * class.c (build_static_field_ref): Use COPY_DECL_RTL,
138         DECL_RTL_SET_P, etc.
139         (make_method_value): Likewise.
140         (get_dispatch_table): Likewise.
141
142         * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
143
144 2001-03-07  Tom Tromey  <tromey@redhat.com>
145
146         * config-lang.in (lang_requires): Define.
147
148 2001-03-07  Brad Lucier  <lucier@math.purdue.edu>
149
150         * typeck.c (convert): Check flag_unsafe_math_optimizations,
151         not flag_fast_math.
152
153 2001-03-05  Per Bothner  <per@bothner.com>
154
155         Fix a problem where rest_of_decl_compilation applied to
156         class_dtable_decl causes problems because it was done too early,
157         before output file was opened.
158         * decl.c (init_decl_processing):  Remove init of class_dtable_decl.
159         * class.c (class_dtable_decl):  Add macro - element of class_roots.
160         (make_class_data):  Define class_dtable_decl.
161         * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl):  Removed.
162
163 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
164
165         * java/class.c, java/decl.c, java/java-tree.h: Replace all
166         uses of 'boolean' with 'bool'.
167
168 2001-03-01  Zack Weinberg  <zackw@stanford.edu>
169
170         * lang-specs.h: Add zero initializer for cpp_spec field to all
171         array elements.
172
173 2001-02-16  Per Bothner  <per@bothner.com>
174
175         Handle compiling multiple input files at once, and @FILE syntax.
176         * gcj.texi:  Updated documentation to match.
177         * java-tree.h (flag_filelist_file, init_src_parse):  New declarations.
178         * jcf-parse.c (parse_source_file):  Split into ...
179         (parse_source_file_1):  New function - and:
180         (parse_source_file_2):  New function.
181         (yyparse):  On -ffilelist-file, open and scan named file.
182         On first pass over files, only do parse_source_file_1.
183         A new second pass calls parse_source_file_2 for each file to compile.
184         (init_jcf_parse):  Call init_src_parse.
185         * jvspec.c (INDIRECT_FILE_ARG):  New flag.
186         (lang_specific_driver):  Support @FILELIST-FILE syntax, as well
187         as multiple input file combined in one compilation.
188         * lang-options.h:  Add -ffilelist-file
189         * lang.c (flag_filelist_file):  New flag variable.
190         (lang_f_options):  Handle -ffilelist-file.
191         * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
192         * parse.h (struct parse_ctxt):  Remove fields incomplete_class and
193         gclass_list - use global fields of src_parse_roots instead.
194         * parse.y (src_parse_roots):  New array.
195         (incomplete_class_list, gclass_list):  New macros.
196         (push_parser_context, java_pop_parser_context,
197         java_parser_context_resume):  Don't fiddle with deleted fields.
198         (various):  Use incomplete_class gclass_list and global macros
199         instead of parse_ctxt fields - the lists are global.
200         (init_src_parse):  New function.
201
202 Fri Feb 23 15:28:39 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
203
204         * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
205
206 2001-02-20  Alexandre Petit-Bianco  <apbianco@redhat.com>
207
208         * parse.y (check_inner_class_access): Moved declaration of local
209         `enclosing_decl_type' to the right location.
210
211 2001-02-19  Bryce McKinlay  <bryce@albatross.co.nz>
212
213         * parse.y (parser_check_super_interface): Don't call 
214         check_pkg_class_access for an inner interface.
215         (parser_check_super): Don't call check_pkg_class_access for inner 
216         class.
217         (do_resolve_class): Simplify enclosing type loop. Don't call 
218         check_pkg_class_access if CL and DECL are not set.
219         (find_in_imports_on_demand): Set DECL if class_type needed to be
220         loaded. Don't call check_pkg_class_access for an inner class.
221         (check_inner_class_access): Rewritten to implement member access
222         rules as per spec 6.6.1.
223         (check_pkg_class_access): Handle the empty package correctly.
224         (in_same_package): New function. Determine if two classes are in the
225         same package.
226
227 2001-02-18  Bryce McKinlay  <bryce@albatross.co.nz>
228
229         * typeck.c (build_java_array_type): Don't try to poke a public `clone'
230         method into array types.
231         * parse.y (patch_method_invocation): Bypass access check on clone call
232         to array instance.
233         
234 2001-02-15  Alexandre Petit-Bianco  <apbianco@redhat.com>
235
236         * expr.c (build_instanceof): Check for arrays when trying fold to
237         false.
238
239 2001-02-15  Jim Meyering  <meyering@lucent.com>
240
241         * Make-lang.in (java.install-common): Depend on `installdirs'.
242         (java.install-info): Likewise.
243
244 2001-02-15  Bryce McKinlay  <bryce@albatross.co.nz>
245
246         * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
247
248 2001-02-14  Tom Tromey  <tromey@redhat.com>
249             Alexandre Petit-Bianco  <apbianco@cygnus.com>
250
251         Fix for PR java/1261.
252         * typeck.c (build_java_array_type): Add public `clone' method to
253         arrays.
254         * parse.y (resolve_qualified_expression_name): Use current_class
255         when checking for inaccessibility.
256         (patch_method_invocation): Fixed error message when accessibility
257         denied.  Added `from_super' argument.
258
259 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
260
261         * parse.y (resolve_class): Don't build a fake decl. Use the one
262         already built.
263         * typeck.c (build_java_array_type): Build and assign decl to array
264         type.
265
266 2001-02-14  Alexandre Petit-Bianco  <apbianco@redhat.com>
267
268         * parse.y (not_accessible_p): Changed leading comment. Added extra
269         `where' argument. Use it to enforce protected access rules.
270         (resolve_qualified_expression_name): Added extra argument to
271         not_accessible_p.
272         (patch_method_invocation): Use argument `primary' to provide
273         not_accessible_p with an extra argument.
274         (lookup_method_invoke): Added extra argument to not_accessible_p.
275         (search_applicable_method_list): Likewise.
276
277 2001-02-13  Alexandre Petit-Bianco  <apbianco@redhat.com>
278
279         * parse.y (resolve_qualified_expression_name): Try to resolve as
280         an inner class access only if `decl' is a TYPE_DECL.
281
282 2001-02-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
283
284         * decl.c (classdollar_identifier_node): Initialize.
285         * java-tree.h (enum java_tree_index): New entry 
286         `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
287         (classdollar_identifier_node): New macro.
288         (ID_CLASSDOLLAR_P): Likewise.
289         * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
290         (build_dot_class_method_invocation): Likewise.
291         (find_applicable_accessible_methods_list): `class$' can't be
292         inherited.
293
294 2001-02-09  Raja R Harinath  <harinath@cs.umn.edu>
295
296         * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
297
298 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
299
300         * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
301         * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
302         gone.
303
304 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
305
306         * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
307         outside of the `__U' sequence too.
308         (unicode_mangling_length): Count `_' or `U' outside of the `__U'
309         sequence too.
310
311 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
312
313         * jvgenmain.c (error): Reversed 2001-02-01 deletion.
314
315 2001-02-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
316
317         * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
318         (JVGENMAIN_OBJS): Likewise.
319         * java-tree.h (append_gpp_mangled_name): New prototype. 
320         * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
321         Removed cast calling `gcc_add_root.'
322         * jvgenmain.c (mangle_obstack): New global, initialized.
323         (main): Use it.
324         (do_mangle_class): Constify local `ptr.'
325         Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
326         append_gpp_mangle_name and update `count' if necessary.
327         Use `mangle_obstack.'
328         * mangle.c (append_unicode_mangled_name): Removed.
329         (append_gpp_mangled_name): Likewise.
330         (unicode_mangling_length): Likewise.
331         (mangle_member_name): Return type set to `void.'
332         (mangle_field_decl): Don't append `U' in escaped names.
333         (mangle_method_decl): Likewise.
334         (mangle_member_name): Just use `append_gpp_mangled_name.'
335         * mangle_name.c: New file.
336
337 2001-02-07  Per Bothner  <per@bothner.com>
338
339         * check-init.c (check_init):  Fix TRY_FINALLY_EXPR logic.
340
341         * check-init.c (check_init):  Don't call done_alternative after
342         processing loop code, as a LOOP_EXPR never terminates normally.
343
344 2001-02-08  Joseph S. Myers  <jsm28@cam.ac.uk>
345
346         * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
347
348 2001-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
349
350         * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
351         DECLs.
352
353 2001-02-06  Tom Tromey  <tromey@redhat.com>
354
355         * lex.c (java_new_lexer): Longer error message.
356
357 2001-02-05  Jeff Sturm  <jeff.sturm@commerceone.com>
358             Alexandre Petit-Bianco  <apbianco@cygnus.com>
359
360         * typeck.c (build_prim_array_type): Added leading comment.
361         (build_java_array_type): Moved locals out of
362         block. Always create the `data' field, fixed alignment to match
363         C++.
364
365 2001-02-04  Tom Tromey  <tromey@redhat.com>
366
367         * expr.c (java_lang_expand_expr): Don't bother recomputing
368         `length'.  Use rest_of_decl_compilation, not make_decl_rtl.
369         Fixes PR java/1866.
370
371 2001-02-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
372
373         * parse.y (process_imports): Save the original name of the import
374         for better error report.
375
376 2001-02-04  Bryce McKinlay  <bryce@albatross.co.nz>
377
378         * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
379         of macros used when compiling jvspec.c.
380         * jvspec.c (lang_specific_driver): Link with the shared
381         libgcc by default.
382
383 Sun Feb  4 15:52:44 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
384
385         * check-init.c (check_init): Call internal_error instead of fatal.
386         * expr.c (java_lang_expand_expr): Likewise.
387         * jcf-parse.c (get_constant): Likewise.
388         * mangle.c (java_mangle_decl): Likewise.
389         * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
390         (operator_string): Likewise.
391         * check-init.c (check_init): Call abort instead of fatal.
392         * class.c (build_class_ref): Likewise.
393         * constants.c (write_constant_pool): Likewise.
394         * decl.c (start_java_method): Likewise.
395         * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
396         (java_stack_dup, encode_newarray_type): Likewise.
397         (build_java_array_length_access): Likewise.
398         (build_java_check_indexed_type, expand_java_pushc): Likewise.
399         (build_java_soft_divmod, build_invokeinterface): Likewise.
400         * java-tree.h (INNER_CLASS_P): Likewise.
401         * jcf-parse.c (parse_signature, get_name_constant): Likewise.
402         (give_name_to_class, get_class_constant): Likewise.
403         * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
404         (find_constant_index, generate_bytecode_conditional): Likewise.
405         (generate_bytecode_insns, perform_relocations): Likewise.
406         * lex.c (java_unget_unicode, java_lex): Likewise.
407         * mangle.c (mangle_type, mangle_record_type): Likewise.
408         (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
409         (finish_mangling): Likewise.
410         * parse.h (MARK_FINAL_PARMS): Likewise.
411         * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
412         (obtain_incomplete_type, java_complete_class): Likewise.
413         (java_check_regular_methods, java_complete_expand_method): Likewise.
414         (cut_identifier_in_qualified, check_deprecation): Likewise.
415         (patch_invoke, find_applicable_accessible_methods_list): Likewise.
416         (java_complete_lhs, lookup_name_in_blocks): Likewise.
417         (check_final_variable_indirect_assignment, build_unaryop): Likewise.
418         * typeck.c (set_local_type, parse_signature_type): Likewise.
419         (parse_signature_string, build_java_signature): Likewise;
420         (set_java_signature): Likewise.
421         * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
422         * class.c (add_method): Call fatal_error instead of fatal.
423         (build_static_field_ref): Likewise.
424         * expr.c (build_known_method_ref, expand_invoke): Likewise.
425         * jcf-parse.c (get_constant, jcf_parse): Likewise.
426         * lex.c (java_new_new_lexer): Likewise.
427         * jv-scan.c (main): Likewise.
428         (fatal_error): Renamed from fatal.
429         * jcf-parse.c (yyparse): Call fatal_io_error instead of
430         pfatal_with_name.
431         * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
432         (yyparse): Likewise.
433         * jcf-write.c (make_class_file_name, write_classfile): Likewise.
434         * lex.c (java_get_line_col): Likewise.
435         * jcf-parse.c (load_class): Make errors non-fatal.
436         * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
437         
438 2001-02-01  Bryce McKinlay  <bryce@albatross.co.nz>
439
440         * jvgenmain.c (class_mangling_suffix): Remove unused string.
441         (error): Remove unused function.
442         (main): Don't use "__attribute__ alias" on generated class symbol.
443
444 2001-01-30  Alexandre Petit-Bianco  <apbianco@cygnus.com>
445
446         * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
447         argument.
448         * parse.y (finish_method_declaration): Code accounting for WFLed
449         method DECL_NAMEs deleted.
450         (check_abstract_method_definitions): Likewise.
451         (resolve_type_during_patch): Layout resolved type.
452         * typeck.c (lookup_do): Removed unused local.
453
454 2001-01-30  Bryce McKinlay  <bryce@albatross.co.nz>
455
456         * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
457         * decl.c (init_decl_processing): Use integer_minus_one_node, not
458         integer_negative_one_node.
459         * expr.c (build_java_binop): Likewise.
460
461 2001-01-24  Jeff Sturm  <jeff.sturm@commerceone.com>
462
463         * zextract.c (read_zip_archive): Read file_offset before writing
464         zipd and consequently clobbering the header contents.
465
466 2001-01-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
467
468         * Make-lang.in: Remove all dependencies on defaults.h.
469         * decl.c: Don't include defaults.h.
470         * expr.c: Likewise.
471         * parse.y: Likewise.
472
473 2001-01-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
474
475         * ChangeLog (2001-01-21): Fixed typo.
476         * class.c (layout_class_method): Code accounting for WFLed
477         method DECL_NAMEs deleted.
478         * constant.c (find_methodref_index): Likewise.
479         * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
480         * java-tree.h (DECL_FUNCTION_WFL): New macro.
481         (struct lang_decl): New field `wfl'.
482         (java_get_real_method_name): Prototype deleted.
483         * mangle.c (mangle_method_decl): Code accounting for WFLed
484         method DECL_NAMEs deleted.
485         * parse.h (GET_METHOD_NAME): Macro deleted.
486         * parse.y (reset_method_name): Deleted.
487         (method_header): Set DECL_FUNCTION_WFL.
488         (check_abstract_method_header): Code accounting for WFLed method
489         DECL_NAMEs deleted.
490         (java_get_real_method_name): Deleted.
491         (check_method_redefinition): Code accounting for WFLed method
492         DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
493         (java_check_regular_methods): Likewise.
494         (java_check_abstract_methods): Likewise.
495         (java_expand_classes): Don't call `reset_method_name.'
496         (search_applicable_method_list): Use DECL_NAMEs instead of
497         GET_METHOD_NAME.
498         * typeck.c (lookup_do): Code accounting for WFLed method
499         DECL_NAMEs deleted.
500
501 2001-01-25  Richard Earnshaw  <rearnsha@arm.com>
502
503         * lex.c (java_read_char): Check for EOF from getc first.
504
505 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
506
507         * class.c (layout_class): Don't lay the superclass out if it's
508         already being laid out.
509         * jcf-parse.c (handle_innerclass_attribute): New function.
510         (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
511         handle_innerclasses_attribute.
512         (jcf_parse): Don't load an innerclasses if it's already being
513         laid out.
514         * jcf-write.c (append_innerclass_attribute_entry): Static
515         `anonymous_name' and its initialization deleted. `ocii' and `ini'
516         to be zero for anonymous classes.
517
518 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
519
520         * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
521         necessary.
522         * jcf-parse.c (set_source_filename): Use
523         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
524
525 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
526
527         * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
528         gets a unique asm name.
529
530 2001-01-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
531
532         * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
533         (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
534         if necessary.
535         (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
536         * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
537         * parse.y (lookup_package_type_and_set_next): Deleted.
538         (resolve_package): Removed unnecessary code.
539         (find_applicable_accessible_methods_list): `finit$' can't be
540         inherited.
541         * verify.c (pop_argument_types): Added missing prototype.
542
543 2001-01-23  Bryce McKinlay  <bryce@albatross.co.nz>
544
545         * config-lang.in: Disable java by default.
546
547 2001-01-23  Tom Tromey  <tromey@redhat.com>
548
549         * gcj.texi (Copying): New node.
550         Added copyright information.
551
552 2001-01-21  Per Bothner  <per@bothner.com>
553
554         Various fixes to allow compiling a compressed .jar/.zip archive.
555         * zipfile.h (struct ZipFileCache):  Replace by struct ZipFile.
556         (struct ZipFile):  Add fields name and next (from  ZipFileCache).
557         (struct ZipDirectory):  New field zipf points to owning ZipFile.
558         * jcf.h (struct ZipDirectory):  Add forward declaration.
559         (struct JCF):   Declare zipd field to have type struct ZipDirectory.
560         Remove seen_in_zip and zip_offset fields.
561         (JCF_SEEN_IN_ZIP):  New macro.
562         * zextract.c (read_zip_archive):  Set ZipDirectory's zipf field.
563         * jcf-io.c:  Change all ZipFileCache to ZipFile.
564         (read_zip_member):  New function.
565         (open_in_zip):  Call read_zip_member.
566         * jcf-parse.c (find_in_current_zip):  Remove function.
567         (read_class):  Merge in find_in_current_zip functionality.
568         Call read_zip_member if needed.
569         (parse_zip_file_entries):  Use read_zip_member.
570         (process_zip_dir):  Update for removed and added JCF fields.
571         (jcf_figure_file_type):  Re-use, don't copy initial ZipFile struct.
572
573 2001-01-21  Per Bothner  <per@bothner.com>
574
575         Minor optimization of static ggc roots.
576         * jcf-parse.c (parse_roots):  New static field.
577         (current_field, current_method, current_file_list):  Replace by macros
578         naming fields of parse_roots.
579         (init_jcf_parse):  Combine 3 ggc_add_tree_root calls to 1.
580         * class.c (class_roots):  New static field.
581         (registered_class, fields_ident, info_ident, class_list):
582         New macros naming fields of parse_roots.
583         (build_static_field_ref):  Don't register roots here.
584         (layout_class):  Static field list replaced by macro class_list.
585         (init_class_processing):  Call ggc_add_tree_root for 4 roots.
586         Initialize fields_ident and info_ident here.
587
588 2001-01-21  Per Bothner  <per@bothner.com>
589
590         * jcf-parse.c (ggc_mark_jcf):  New function.
591         (init_jcf_parse):  Register current_jcf as ggc root.
592
593 2001-01-21  Per Bothner  <per@bothner.com>
594
595         * lang.c (put_decl_node):  Print method's name.
596
597 2001-01-21  Per Bothner  <per@bothner.com>
598
599         * verify.c (VERIFICATION_ERROR_WITH_INDEX):  New macro.
600         (verify_jvm_instructions):  Use it, for better error messages on loads.
601
602 2001-01-21  Per Bothner  <per@bothner.com>
603
604         * verify.c (merge_type_state):  Still may have to merge even if
605         LABEL_VERIFIED (label).
606
607 2001-01-21  Per Bothner  <per@bothner.com>
608
609         * parse.y (method_header):  Don't set the DECL_NAME of a FUNCTION_DECL
610         to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
611
612 2001-01-19  Per Bothner  <per@bothner.com>
613
614         * expr.c (pop_type_0):  Only return object_ptr_type_node on mismatch
615         if expeting an interface type.  Refines Tom's change of 2000-09-12.
616
617 2001-01-18  Per Bothner  <per@bothner.com>
618
619         * gcj.texi (Input Options): Mention .java files.
620
621 2001-01-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
622
623         * lang-options.h (-Wunsupported-jdk11): Removed.
624         * lang.c (flag_not_overriding): Deleted.
625         (flag_static_local_jdk1_1): Likewise.
626         (lang_W_options): Removed "unsupported-jdk11" entry.
627         * parse.y (java_check_methods): Removed dead code.
628
629 2001-01-17  Tom Tromey  <tromey@redhat.com>
630
631         Changes suggested by Per Bothner:
632         * gcj.texi (Input Options): Don't mention input files.
633         (Code Generation): Updated --main information.
634         (Invoking jcf-dump): Mention that --javap is incomplete.
635         From Alexandre Petit-Bianco:
636         (Warnings): Don't mention -Wunsupported-jdk11.
637         My stuff:
638         (Compatibility): Mention JDK 1.2-ness of libraries.
639         (Resources): Mention resources used when writing gcj.
640
641 2001-01-17  Tom Tromey  <tromey@redhat.com>
642
643         * gcj.texi: New file.
644         * Make-lang.in ($(srcdir)/java/gcj.info): New target.
645         (java.info): Depend on gcj.info.
646         (java/gcj.dvi): New target.
647         (java.dvi): Depend on gcj.dvi.
648         (java.install-info): Wrote.
649
650 2001-01-16  Jeff Sturm  <jeff.sturm@appnet.com>
651
652         * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
653         having called make_decl_rtl.
654
655 2001-01-14  Per Bothner  <per@bothner.com>
656
657         Various patches to emit better messages on verification errors.
658         * expr.c (push_type_0):  Return error indication on stack overflow,
659         instead of callinfg fatal.
660         (push_type):  Now just call push_type_0 (nd fatal on overflow).
661         (pop_type_0):  Return detailed error message (in a char** argument).
662         (pop_type):  If pop_type_0 fails, print error message.
663         (pop_argument_types):  Moved to verify.c.
664         * verify.c (pop_argument_types):  Moved from expr.c.
665         Return a (possible) error message, rather than void.
666         (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING):  New macros.
667         (verify_jvm_instruction):  Use new macros, improving error messages.
668         For case OPCODE_astore use object_ptr_type_node.
669         * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED):  New macros.
670         (pop_type_0, push_type_0, pop_argument_types):  Update accordingly.
671
672         * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
673         constant, return body without wrapper.  (Improves constant folding.)
674         * lex.c (build_wfl_node):  Clear TREE_TYPE from returned node.
675
676 2001-01-13  Per Bothner  <per@bothner.com>
677
678         * expr.c (expand_java_field_op):  Assigning to a final field outside
679         an initializer does not violate JVM spec, so should be warning, not
680         error.  (Sun's verifier does not complain - though MicroSoft's does.)
681         
682 2001-01-12  Joseph S. Myers  <jsm28@cam.ac.uk>
683
684         * gjavah.c (version), jcf-dump.c (version): Update copyright year
685         to 2001.
686
687 2001-01-11  Bryce McKinlay  <bryce@albatross.co.nz>
688
689         * parse.y (resolve_expression_name): Permit instance variables from
690         enclosing context in super constructor call.
691         (resolve_qualified_expression_name): Permit enclosing class's qualified
692         "this" in super constructor call.
693
694 2001-01-10  Mark Mitchell  <mark@codesourcery.com>
695
696         * class.c (build_utf8_ref): Remove last argument in call to
697         make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
698         (build_class_ref): Likewise.
699         (build_static_field_ref): Likewise.
700         (get_dispatch_table): Likewise.
701         (layout_class_method): Likewise.
702         (emit_register_classes): Likewise.
703         * constants.c (build_constant_data_ref): Likewise.
704         * decl.c (builtin_function): Likewise.
705         (create_primitive_vtable): Likewise.
706         * expr.c (build_known_method_def): Likewise.
707         (build_jni_stub): Likewise.
708         (java_lang_expand_expr): Likewise.
709         
710 2001-01-10  Tom Tromey  <tromey@redhat.com>
711
712         * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
713
714 2001-01-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
715
716         * java-tree.h (lang_printable_name_wls): New prototype.
717         * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
718         rather than `current_class' to print type name. Don't prepend type
719         names when printing constructor names.
720         (lang_printable_name_wls): New function.
721         * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
722         `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
723         * parse.y (patch_method_invocation): Message tuned for constructors.
724         (not_accessible_p): Grant `private' access from within
725         enclosing contexts.
726         
727 2001-01-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
728
729         All files with updated copyright when applicable.
730         * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
731         * class.c (mangle_class_field): Function removed.
732         (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
733         (utf8_cmp, cxx_keyword_p): Moved to lex.c.
734         (build_class_ref): Call `java_mangle_class_field' instead of
735         `mangle_class_field.'
736         (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
737         (layout_class): Call `java_mangle_decl' instead of 
738         `mangle_static_field.'
739         (cxx_keywords): Initialized static array moved to `lex.c.'
740         (layout_class_method): Changed leading comment. Simplified to
741         call `java_mangle_decl.' Local `ptr' moved in for loop body.
742         * decl.c (lang_mark_tree): Mark field `package_list.'
743         * java-tree.h (TYPE_PACKAGE_LIST): New macro.
744         (struct lang_type): New field `package_list.'
745         (unicode_mangling_length): Prototype removed.
746         (append_gpp_mangled_name, append_gpp_mangled_classtype,
747         emit_unicode_mangled_name): Likewise.
748         (cxx_keyword_p): New prototype.
749         (java_mangle_decl, java_mangle_class_field,
750         java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
751         * jcf-parse.c (jcf_parse_source): Constify `file' argument to
752         `build_expr_wfl.'
753         * jvgenmain.c (main_method_prefix): Global variable removed.
754         (main_method_suffix): Likewise.
755         (do_mangle_classname): New function.
756         (main): Call it. Format changed to accomodate new mangling scheme.
757         * lex.c: (utf8_cmp): Conditionally prototyped.
758         (cxx_keywords): Moved from class.c, conditionally defined.
759         (utf8_cmp, cxx_keyword_p): Likewise.
760         * mangle.c (obstack.h, ggc.h): Included.
761         (mangle_field_decl): New function.
762         (mangle_method_decl, mangle_type, mangle_pointer_type,
763         mangle_array_type, mangle_record_type,
764         find_compression_pointer_match, find_compression_array_match,
765         find_compression_record_match,
766         find_compression_array_template_match, set_type_package_list,
767         entry_match_pointer_p, emit_compression_string, init_mangling,
768         finish_mangling, compression_table_add, mangle_member_name): Likewise.
769         (mangle_obstack): New global.
770         (MANGLE_RAW_STRING): New macro.
771         (unicode_mangling_length): Turned static.
772         (append_unicode_mangled_name): Renamed from
773         `emit_unicode_mangled_name.'  Turned static. `mangle_obstack'
774         replaces `obstack', removed from the parameter list.
775         (append_gpp_mangled_name): Turned static. `mangle_obstack'
776         replaces parameter `obstack', removed from the parameter list. Call 
777         `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
778         (append_gpp_mangled_classtype): Removed.
779         (compression_table, compression_next): New static variables.
780         * parse.y (temporary_obstack): Extern declaration removed.
781
782 2001-01-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
783
784         * parse.y (patch_binop): Compute missing type in error situations.
785
786 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
787
788         * class.c (make_class_data): Push initial value for "arrayclass".
789         * decl.c (init_decl_processing): Add new class field "arrayclass".
790
791 2001-01-05  Bryce McKinlay  <bryce@albatross.co.nz>
792
793         From patha@softlab.ericsson.se:
794         * parse.y (switch_label): Use build, not build1, to construct 
795         DEFAULT_EXPR.
796
797 2001-01-04  Neil Booth  <neil@daikokuya.demon.co.uk>
798
799         * lang.c (lang_decode_option): Change -MA to -MP.
800         * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
801         Update to new prototype; do quote targets.
802         (jcf_dependency_write): Update.
803
804 2000-12-22  Bryce McKinlay  <bryce@albatross.co.nz>
805
806         Shorten primitive array allocation path:
807         * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
808         to create new primitive arrays.
809         * expr.c (build_newarray): If generating native code, call 
810         soft_newarray_node with a reference to the primitive TYPE identifier
811         instead of type_value.
812         
813 2000-12-17  Bryce McKinlay  <bryce@albatross.co.nz>
814
815         Fix for PRs gcj/312 and gcj/253:
816         * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
817         dest if they arn't already.
818         * class.c (layout_class): Call maybe_layout_super_class on 
819         superinterfaces also, but only if compiling from bytecode.
820
821         Fix for PR gcj/373:
822         * parse.y (create_class): Set ACC_STATIC if class is declared in an
823         interface.
824
825 2000-12-15  Tom Tromey  <tromey@redhat.com>
826
827         * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
828         set.
829
830 2000-12-14  Andrew Haley  <aph@redhat.com>
831
832         * boehm.c (mark_reference_fields): Change test to correctly detect
833         bitmap overflow.
834
835 2000-12-15  Andreas Jaeger  <aj@suse.de>
836
837         * config-lang.in (lang_dirs): Added.
838
839 2000-12-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
840
841         * parse.y (end_artificial_method_body): Fixed undefined behavior.
842         Credits go to rth for finding it.
843
844 2000-12-13  Mike Stump  <mrs@wrs.com>
845
846         * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
847
848 2000-11-07  Tom Tromey  <tromey@cygnus.com>
849
850         * Make-lang.in (JAVA_LEX_C): Added chartables.h.
851         * lex.c (java_ignorable_control_p): Removed.
852         (java_letter_or_digit_p): Removed.
853         (java_start_char_p): New function.
854         (java_read_char): Return `int', not `unicode_t'.  Changed
855         callers.
856         (java_read_unicode): Likewise.
857         (java_read_unicode_collapsing_terminators): Likewise.
858         (java_get_unicode): Likewise.
859         (java_new_lexer): Initialize hit_eof.
860         (java_parse_end_comment): Take `int' argument.
861         (java_parse_doc_section): Likewise.
862         (java_parse_escape_sequence): Don't allow backlash-newline.
863         Return `int'.
864         * lex.h (JAVA_DIGIT_P): Removed.
865         (_JAVA_LETTER_OR_DIGIT_P): Removed.
866         (_JAVA_IDENTIFIER_IGNORABLE): Removed.
867         (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
868         (JAVA_PART_CHAR_P): New macro.
869         (UEOF): Now -1.
870         (JAVA_CHAR_ERROR): Now -2.
871         (java_lexer): New field `hit_eof'.
872         * chartables.h: New file.
873         * gen-table.pl: new file.
874
875 2000-11-20  Tom Tromey  <tromey@cygnus.com>
876             Alexandre Petit-Bianco  <apbianco@cygnus.com>
877
878         * parse.y (java_complete_lhs): Only allow compound assignment of
879         reference type if type is String.
880
881 2000-12-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
882
883         * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
884         jcf-path.c: Likewise.
885
886 2000-12-09  Anthony Green  <green@redhat.com>
887
888         * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
889         filestart and filename_length as int values.
890
891 2000-12-07  Mo DeJong  <mdejong@redhat.com>
892
893         * jcf-io.c (find_class): Correct the logic that tests to see if a
894         .java file is newer than its .class file. The compiler was
895         incorrectly printing a warning when file mod times were equal.
896
897 2000-12-07  Zack Weinberg  <zack@wolery.stanford.edu>
898
899         * jvgenmain.c: Use ISPRINT not isascii.
900
901 2000-12-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
902
903         * parse.y (end_artificial_method_body): Fixed typo.
904
905 2000-12-04  Alexandre Petit-Bianco  <apbianco@cygnus.com>
906
907         * parse.y (patch_method_invocation): Pick the correct enclosing
908         context when creating inner class instances.
909         Fixes gcj/332.
910
911 2000-11-26  Joseph S. Myers  <jsm28@cam.ac.uk>
912
913         * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
914         Update copyright year to 2000.
915
916 2000-11-23  Anthony Green  <green@redhat.com>
917
918         * jcf-parse.c (init_jcf_parse): Register current_file_list root.
919         Move current_file_list out of yyparse and make it static.
920
921         * expr.c: Declare quick_stack and tree_list_free_list as static
922         (init_expr_processing): Register quick_stack and
923         tree_list_free_list roots.
924
925 2000-11-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
926
927         * parse.y (build_outer_field_access): New local `decl_ctx', use
928         it. Check for field's context and current class immediate outer
929         context inheritance.
930         (outer_field_access_p): Consider fields inherited from the last
931         enclosing context.
932         (build_access_to_thisn): Stop at the last enclosing context if
933         necessary.
934         Fixes gcj/367.
935
936 Thu Nov 23 02:19:14 2000  J"orn Rennecke <amylaar@redhat.com>
937
938         * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
939
940 2000-11-22  Bryce McKinlay  <bryce@albatross.co.nz>
941
942         * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
943         scratch buffer.
944
945 2000-11-20  Tom Tromey  <tromey@cygnus.com>
946
947         * jv-scan.c (help): Document --complexity.
948         (options): Added --complexity.
949         (flag_complexity): New global.
950         (main): Call `report'.
951         * parse-scan.y (complexity): New global.
952         (if_then_statement, if_then_else_statement,
953         if_then_else_statement_nsi, switch_block_statement_group,
954         while_expression, do_statement, for_begin, continue_statement,
955         throw_statement, catch_clause, finally, method_invocation,
956         conditional_and_expression, conditional_or_expression,
957         conditional_expression): Update complexity.
958         (reset_report): Reset complexity.
959         (report): New function.
960
961 2000-11-20  Tom Tromey  <tromey@cygnus.com>
962
963         * lex.c (yylex): Added STRICT_TK case.
964         * parse.y (STRICT_TK): Added.
965         * parse-scan.y (STRICT_TK): Added.
966         * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
967         `;'.  Use 4, not 3, with -k option.  Correctly rename resulting
968         file.
969         * keyword.h: Rebuilt.
970         * keyword.gperf (strictfp): Added.
971
972 2000-11-20  Tom Tromey  <tromey@cygnus.com>
973
974         * lex.c (yylex): Recognize floating point constants with leading
975         0.
976
977 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
978
979         * java-tree.h (cyclic_inheritance_report): Constify.
980         * parse.y (cyclic_inheritance_report): Likewise.
981
982 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
983
984         * parse.y (goal): Remove call to ggc_add_string_root.
985
986 2000-11-16  Zack Weinberg  <zack@wolery.stanford.edu>
987
988         * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
989         Create string in scratch buffer, then pass to build_string.
990
991 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
992
993         * parse.y (issue_warning_error_from_context): Add
994         ATTRIBUTE_PRINTF.
995
996 2000-11-11  Anthony Green  <green@redhat.com>
997
998         * jcf-parse.c (process_zip_dir): Add finput parameter.
999         (jcf_figure_file_type): Call process_zip_dir with appropriate
1000         argument.
1001
1002 2000-11-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1003
1004         * decl.c (copy_lang_decl): Use memcpy, not bcopy.
1005         * jcf-parse.c (jcf_figure_file_type): Likewise.
1006
1007 2000-11-09  Joseph S. Myers  <jsm28@cam.ac.uk>
1008
1009         * parse.y (create_new_parser_context): Use memset () instead of
1010         bzero ().
1011
1012 2000-11-08  Tom Tromey  <tromey@cygnus.com>
1013
1014         * gjavah.c (process_file): Only include gcj/cni.h when generating
1015         CNI stubs.
1016
1017 2000-11-07  Joseph S. Myers  <jsm28@cam.ac.uk>
1018
1019         * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
1020         (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
1021         instead of bzero ().
1022
1023 2000-11-05  Tom Tromey  <tromey@cygnus.com>
1024
1025         * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
1026         * lex.c (IS_ZERO): New define.
1027         (java_perform_atof): Error on floating point underflow.
1028
1029 2000-11-04  Tom Tromey  <tromey@cygnus.com>
1030
1031         * lex.c (java_parse_escape_sequence): Only read two octal
1032         characters if the first one is greater than 3.  Don't allow
1033         "octal" numbers to include the digits 8 or 9.
1034
1035 2000-11-05  Joseph S. Myers  <jsm28@cam.ac.uk>
1036
1037         * Make-lang.in (java.distdir): Remove.
1038
1039 2000-11-03  Tom Tromey  <tromey@cygnus.com>
1040
1041         * Make-lang.in (java.dvi): New target.
1042         Partial fix for PR other/567.
1043
1044         * lang-options.h: Mention -Wout-of-date.
1045         * jcf-dump.c (flag_newer): New global.
1046         * gjavah.c (flag_newer): New global.
1047         * jcf-io.c (find_class): Only warn when flag_newer set.
1048         * lang.c (flag_newer): New global.
1049         (struct string_option): New declaration.
1050         (lang_W_options): New global.
1051         (process_option_with_no): New function.
1052         (lang_decode_option): Use it.
1053
1054         * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
1055         * gjavah.c (cxx_keyword_subst): Handle any number of trailing
1056         `$'.
1057
1058         * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
1059         (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
1060         * lex.c (java_read_unicode): Removed `term_context' argument.
1061         Recognize any number of `u' in `\u'.
1062         (java_read_unicode_collapsing_terminators): New function.
1063         (java_get_unicode): Use it.
1064         (java_lineterminator): Removed.
1065         (yylex): Produce error if character literal is newline or single
1066         quote.  Return if eof found in middle of `//' comment.  EOF in
1067         `//' comment is only an error if pedantic.
1068         (java_ignorable_control_p): New function.
1069         (java_parse_end_comment): Return if eof found in middle of
1070         comment.
1071         Include flags.h.
1072         * jv-scan.c (pedantic): New global.
1073
1074 2000-10-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1075
1076         * parse.y (outer_field_access_p): Inherited fields aren't
1077         consider outer fields.
1078         (maybe_build_thisn_access_method): Use
1079         PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
1080         (resolve_expression_name): Trigger an error if a static field
1081         is being accessed as an outer field.
1082
1083 2000-10-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1084
1085         * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
1086         Fixes gcj/365.
1087
1088 2000-10-27  Zack Weinberg  <zack@wolery.stanford.edu>
1089
1090         * Make-lang.in: Move all build rules here from Makefile.in,
1091         adapt to new context.  Wrap all rules that change the current
1092         directory in parentheses.  Expunge all references to $(P).
1093         When one command depends on another and they're run all at
1094         once, use && to separate them, not ;.  Add OUTPUT_OPTION to
1095         all object-file generation rules.  Delete obsolete variables.
1096
1097         * Makefile.in: Delete.
1098         * config-lang.in: Delete outputs= line.
1099
1100 2000-10-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1101
1102         * parse.y (patch_method_invocation): NULLify this_arg when already
1103         inserted.
1104         (maybe_use_access_method): Handle call to methods unrelated to the
1105         current class. Fixed comment.
1106         Fixes gcj/361.
1107
1108 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1109
1110        * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
1111        scope.
1112
1113 2000-10-24  Tom Tromey  <tromey@cygnus.com>
1114
1115         * lex.c (java_new_lexer): Initialize new fields.  Work around
1116         broken iconv() implementations.
1117         (java_read_char): Swap bytes if required.  Use fallback decoder if
1118         required.
1119         (byteswap_init, need_byteswap): New globals.
1120         (java_destroy_lexer): Only close iconv handle if it is in use.
1121         * lex.h (java_lexer): New fields read_anything, byte_swap,
1122         use_fallback.
1123         Made out_buffer unsigned.
1124
1125 2000-10-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1126
1127         * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
1128         where an enclosing context can be set on the jdep.
1129         (do_resolve_class): Fixed identation.
1130
1131 2000-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1132
1133         * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
1134
1135         * jcf-reader.c (peek_attribute, skip_attribute): Only define
1136         when requested.
1137
1138         * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
1139
1140         * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
1141
1142 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1143
1144         * jcf-write.c (OP1): Update `last_bc'.
1145         (struct jcf_block): Fixed indentation and typo in comments.  New
1146         field `last_bc'.
1147         (generate_bytecode_insns): Insert `nop' if `jsr' immediately
1148         follows `monitorenter'.
1149         * parse.y (patch_synchronized_statement): New local `tmp'. Call
1150         `patch_string'.
1151         Fixes gcj/232.
1152
1153 2000-10-16  Tom Tromey  <tromey@cygnus.com>
1154
1155         * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
1156         * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
1157         * lang-options.h: Added -MA, -MT, -MF..
1158         * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
1159         (DEPEND_TARGET_SET): New macro.
1160         (DEPEND_FILE_ALREADY_SET): Likewise.
1161         (init_parse): Handle new flags.
1162         * jcf.h (jcf_dependency_print_dummies): Declare.
1163         * Make-lang.in (s-java): Added mkdeps.o.
1164         * Makefile.in (BACKEND): Added mkdeps.o.
1165         (../gcjh$(exeext)): Added mkdeps.o.
1166         (../jcf-dump$(exeext)): Added mkdeps.o.
1167         * jcf-depend.c: Include mkdeps.h.
1168         (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
1169         add_entry): Removed.
1170         (jcf_dependency_reset): Rewrote.
1171         (dependencies): New global.
1172         (jcf_dependency_set_target): Rewrote.
1173         (jcf_dependency_add_target): Likewise.
1174         (jcf_dependency_add_file): Likewise.
1175         (munge): Removed.
1176         (print_ents): Removed.
1177         (jcf_dependency_write): Rewrote.
1178         (print_dummies): New global.
1179         (jcf_dependency_print_dummies): New function
1180         (jcf_dependency_write): Call deps_dummy_targets if required.
1181
1182 2000-10-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1183
1184         * gjavah.c (add_class_decl): Removed unused variables `tname',
1185         `tlen' and `name_index'.
1186         * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
1187         * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
1188         in `wfl_operator' with value.
1189         (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
1190         (jcf_figure_file_type): Fixed identation.
1191         * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
1192         * parse.y (analyze_clinit_body): New function.
1193         (static_initializer:): Reset `current_static_block'.
1194         (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
1195         `wfl_operator' with new value.
1196         (lookup_cl): Use EXPR_WFL_FILENAME.
1197         (maybe_yank_clinit): Handle bogus <clinit> bodies, call
1198         analyze_clinit_body.
1199         (build_outer_field_access): Access to this$<n> built from
1200         current_class, not its outer context.
1201         (build_access_to_thisn): Fixed leading comment. Tidied things up.
1202         (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
1203         (patch_method_invocation): Use `is_static_flag' when already
1204         initialized.
1205         (patch_newarray): Removed assignment in ternary operator.
1206
1207 2000-10-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1208
1209         * except.c (free_eh_ranges): Don't free `whole_range'.
1210
1211 2000-10-15  Anthony Green  <green@redhat.com>
1212
1213         * decl.c (init_decl_processing): Call init_class_processing before
1214         anything else.
1215
1216 2000-10-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1217
1218         * check-init.c (check_init): Fixed leading comment. Use
1219         LOCAL_FINAL_P.
1220         * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
1221         (give_name_to_locals): Likewise.
1222         (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
1223         fields in lang_decl_var.
1224         * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
1225         DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
1226         (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
1227         (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
1228         DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
1229         (LOCAL_FINAL): Rewritten.
1230         (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
1231         MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
1232         (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
1233         `init_final' fields.
1234         (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
1235         `final_uid', `final_liic', `final_ierr' and `local_final' fields.
1236         (TYPE_HAS_FINAL_VARIABLE): New macro.
1237         (struct lang_type): Added `afv' field.
1238         * parse.y (check_static_final_variable_assignment_flag): New function.
1239         (reset_static_final_variable_assignment_flag): Likewise.
1240         (check_final_variable_local_assignment_flag): Likewise.
1241         (reset_final_variable_local_assignment_flag): Likewise.
1242         (check_final_variable_indirect_assignment): Likewise.
1243         (check_final_variable_global_assignment_flag): Likewise.
1244         (add_inner_class_fields): Use LOCAL_FINAL_P.
1245         (register_fields): Handle local finals and final variables.
1246         (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
1247         (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
1248         (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
1249         on local finals.
1250         (java_complete_expand_methods): Loop to set
1251         TYPE_HAS_FINAL_VARIABLE. Call
1252         `reset_final_variable_local_assignment_flag' and
1253         `check_final_variable_local_assignment_flag' accordingly before
1254         and after constructor expansion. Call
1255         `reset_static_final_variable_assignment_flag'
1256         before expanding <clinit> and after call
1257         `check_static_final_variable_assignment_flag' if the
1258         current_class isn't an interface. After all methods have been
1259         expanded, call `check_final_variable_global_assignment_flag' and
1260         `check_static_final_variable_assignment_flag' if the current class
1261         is an interface.
1262         (maybe_yank_clinit): Fixed typo in comment.
1263         (build_outer_field_access_methods): Removed old sanity check. Use
1264         FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
1265         Don't create access methods for finals.
1266         (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
1267         (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
1268         existing DECL_INIT has been processed.
1269         (java_complete_lhs): Likewise.
1270         (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
1271         Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
1272         logic.
1273         (patch_assignment): Use LOCAL_FINAL_P.
1274         (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
1275         DECL_INITIAL is nullified.
1276         Fixes gcj/163.
1277
1278 2000-10-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1279
1280         * Make-lang.in (parse.c, parse-scan.c): Create atomically.
1281
1282         * Makefile.in (parse.c, parse-scan.c): Likewise.
1283
1284 2000-10-12  Mark Mitchell  <mark@codesourcery.com>
1285
1286         * class.c (temporary_obstack): Remove.
1287         (make_class): Don't mess with obstascks.
1288         (push_class): Likewise.
1289         (set_super_info): Likewise.
1290         (add_method_1): Likewise.
1291         (add_method): Likewise.
1292         (add_field): Likewise.
1293         (build_utf8_ref): Likewise.
1294         (build_class_ref): Likewise.
1295         (build_static_field_ref): Likewise.
1296         (finish_class): Likewise.
1297         (push_super_field): Likewise.
1298         (layout_class): Likewise.
1299         (layout_class_methods): Likewise.
1300         (init_class_processing): Likewise.
1301         * constants.c (get_tag_node): Likewise.
1302         (build_constant_data_ref): Likewise.
1303         * decl.c (ggc_p): Remove.
1304         (copy_lang_decl): Use ggc_alloc.
1305         (complete_start_java_method): Don't mess with obstacks.
1306         (start_java_method): Likewise.
1307         (end_java_method): Likewise.
1308         * except.c (link_handler): Use xmalloc.
1309         (free_eh_ranges): New function.
1310         (method_init_exceptions): Use it.
1311         (add_handler): Use xmalloc.
1312         (expand_start_java_handler): Don't mess with obstacks.
1313         (prepare_eh_table_type): Likewise.
1314         (expand_end_java_handler): Likewise.
1315         * expr.c (push_value): Likewise.
1316         (create_label_decl): Likewise.
1317         (build_jni_stub): Likewise.
1318         (java_lang_expand_expr): Likewise.
1319         (note_instructions): Use xrealloc.
1320         (java_push_constant_from_pool): Don't mess with obstacks.
1321         (process_jvm_instruction): Likewise.
1322         * java-tree.h (cyclic_inheritance_report): Remove duplicate
1323         declaration.
1324         * jcf-parse.c (get_constant): Don't mess with obstacks.
1325         (read_class): Likewise.
1326         (jcf_parse): Likewise.
1327         * lex.c (expresion_obstack): Remove.
1328         (java_lex): Don't use obstack_free.
1329         * parse.h (exit_java_complete_class): Don't mess with obstacks.
1330         (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
1331         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
1332         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
1333         * parse.y (gaol): Add more GC roots.
1334         (add_inner_class_fields): Adjust calls to MANGLE_* macros.
1335         (lookup_field_wrapper): Likewise.
1336         (obtain_incomplete_type): Don't mess with obstacks.
1337         (build_alias_initializer_paramter_list): Adjust calls to MANGLE_*
1338         macros.
1339         (craft_constructor): Don't mess with obstacks.
1340         (safe_layout_class): Likewise.
1341         (java_complete_class): Likewise.
1342         (source_end_java_method): Likewise.
1343         (build_outer_field_access_methods): Likewise.
1344         (build_outer_method_access_method): Likewise.
1345         (maybe_build_thisn_access_method): Likewise.
1346         (build_dot_class_method_invocation): Likewise.
1347         (java_complete_tree): Likewise.
1348         (java_complete_lhs): Likewise.
1349         (do_merge_string_cste): Likewise.
1350         (patch_string_cst): Likewise.
1351         (array_constructor_check_entry): Likewise.
1352         * typeck.c (build_java_array_type): Likewise.
1353         (parse_signature_string): Likewise.
1354         (build_java_signature): Likewise.
1355
1356 2000-10-12  Tom Tromey  <tromey@cygnus.com>
1357
1358         Fix for PR gcj/356:
1359         * gjavah.c (add_class_decl): Don't special-case inner classes.
1360         (add_namelet): Likewise.
1361
1362 2000-10-11  Rodney Brown  <RodneyBrown@mynd.com>
1363
1364         * java-tree.h: Constify current_encoding.
1365         * lang.c: Constify current_encoding.
1366
1367 2000-10-10  Jeff Sturm  <jeff.sturm@appnet.com>
1368
1369         * jvgenmain.c (class_mangling_suffix): Omit `.'.
1370         (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
1371
1372 2000-10-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1373
1374         * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
1375         patch. Fixes gcj/340.
1376
1377 2000-10-10  Tom Tromey  <tromey@cygnus.com>
1378
1379         * lex.c (java_new_lexer): Initialize out_first and out_last
1380         fields.
1381         * lex.h (java_lexer): Added out_buffer, out_first, out_last.
1382
1383 2000-10-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1384
1385         * parse.y (pop_current_osb): New function.
1386         (array_type:): Use `dims:', changed actions
1387         accordingly. Suggested by Anthony Green.
1388         (array_creation_expression:): Used pop_current_osb.
1389         (cast_expression:): Likewise.
1390         (search_applicable_method_list): Fixed indentation.
1391
1392 2000-10-08  Anthony Green  <green@redhat.com>
1393
1394         * parse.y (array_type_literal): Remove production.
1395         (type_literals): Refer to array_type, not array_type_literal.
1396
1397 2000-10-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1398
1399         Patch contributed by Corey Minyard.
1400         * decl.c (check_local_named_variable): New function.
1401         (tree check_local_unnamed_variable): Likewise.
1402         (find_local_variable): Splitted. Call check_local_{un}named_variable.
1403
1404 2000-10-07  Anthony Green  <green@redhat.com>
1405
1406         * class.c (layout_class): Handle case where superclass can't be
1407         layed out yet.
1408
1409 2000-10-07  Joseph S. Myers  <jsm28@cam.ac.uk>
1410
1411         * Makefile.in (keyword.h): Refer to GNU FTP site for updated
1412         gperf.
1413
1414 2000-10-05  Tom Tromey  <tromey@cygnus.com>
1415
1416         * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
1417         * jvgenmain.c (class_mangling_prefix): Removed.
1418         (class_mangling_suffix): New global.
1419         (main): Use it.
1420         * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
1421         `$'.
1422         (print_method_info): Handle overrides for static and final
1423         methods.
1424         (process_file): Generate declaration for class object field.
1425         * class.c (cxx_keywords): New array.
1426         (utf8_cmp): New function.
1427         (cxx_keyword_p): New function.
1428         (layout_class_method): Mangle C++ keywords by appending `$'.
1429         (mangle_field): New function.
1430         (mangle_class_field): Use mangle_field.  Mangle class name as
1431         `class$'.
1432         (mangle_static_field): Use mangle_field.
1433
1434 Tue Oct  3 13:44:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1435
1436         * decl.c (find_local_variable): Removed uncessary type check and
1437         fixed range check typo. From Corey Minyard.
1438
1439 Wed Sep 13 16:06:52 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1440
1441         * decl.c (give_name_to_locals): New local `code_offset'. Call
1442         `maybe_adjust_start_pc'.
1443         * expr.c (note_instructions): New function.
1444         (expand_byte_code): Don't collect insn starts here.
1445         (peek_opcode_at_pc): New function.
1446         (maybe_adjust_start_pc): Likewise.
1447         * java-tree.h (maybe_adjust_start_pc): Declare.
1448         (note_instructions): Likewise.
1449         * jcf-parse.c (parse_class_file): Call `note_instructions'.
1450
1451 Wed Sep 13 11:50:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1452
1453         * parse.y (field_access:): Fixed indentation.
1454         (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
1455
1456 2000-09-07  Tom Tromey  <tromey@cygnus.com>
1457
1458         Fix for PR gcj/307:
1459         * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
1460         JPRIMITIVE_TYPE_P, for arithmetic operators.
1461         (patch_method_invocation): Indentation fix.
1462         (try_builtin_assignconv): Handle boolean specially.  Fixed typo.
1463         (valid_builtin_assignconv_identity_widening_p): Handle boolean.
1464         (do_unary_numeric_promotion): Cleaned up code.
1465         (valid_cast_to_p): Handle boolean correctly.
1466
1467 2000-09-27  Tom Tromey  <tromey@cygnus.com>
1468
1469         * lex.c (java_read_unicode): Reset bs_count when finished with
1470         `\u' sequence.
1471
1472 2000-10-01  Mark Mitchell  <mark@codesourcery.com>
1473
1474         Convert to GC.
1475         * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
1476         * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
1477         (typeck.o): Depend on ggc.h.
1478         * class.c (add_method_1): Use GC functions for allocation.
1479         (init_class_processing): Register roots.
1480         * decl.c (ggc_p): Set to 1.
1481         (pending_local_decls): Make it static.
1482         (push_jvm_slot): Use GC functions for allocation.
1483         (init_decl_processing): Register roots.
1484         (give_name_to_locals): Use GC functions for allocation.
1485         (lang_mark_tree): New function.
1486         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
1487         functions for allocation.
1488         * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
1489         * lex.c (java_lex): Use build_string, rather than replicating it
1490         inline.
1491         * parse.y (goal): Add more roots.
1492         (mark_parser_ctxt): New function.
1493         * typeck.c: Include ggc.h.
1494
1495 2000-09-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1496
1497         * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
1498         contains something else than MODIFY_EXPR.
1499
1500 2000-09-23  Mark Mitchell  <mark@codesourcery.com>
1501
1502         * Make-lang.in (JAVA_SRCS): Include java-tree.h.
1503         * Makefile.in (parse.o): Depend on ggc.h.
1504         (class.o): Likewise.
1505         (constants.o): Likewise.
1506         (decl.o): Likewise.
1507         (expr.o): Likewise.
1508         (jcf-parse.o): Likewise.
1509         (jcf-write.o): Likewise.
1510         (mangle.o): Likewise.
1511         * class.c: Include ggc.h.
1512         (build_static_field_ref): Register GC roots.
1513         (layout_class): Likewise.
1514         (init_class_processing): Likewise.
1515         * constants.c: Include ggc.h.
1516         (current_constant_pool_data_ref): Remove.
1517         (tag_nodes): Move it to ...
1518         (get_tag_node): ... here.  Register GC roots.
1519         * decl.c: Include ggc.h.  Remove many global tree definitions.
1520         (throw_node): Define.
1521         (java_global_trees): Likewise.
1522         (predef_filenames): Make the size a constant.
1523         (init_decl_processing): Adjust accordingly.
1524         (init_decl_processing): Call init_jcf_parse.  Register GC roots.
1525         * expr.c: Include ggc.h.
1526         (init_expr_processing): Register GC roots.
1527         (build_invokeinterface): Likewise.
1528         * java-tree.h: Replace extern tree declarations with macros.
1529         (java_global_trees): New variable.
1530         (java_tree_index): New enumeration.
1531         (init_jcf_parse): Declare.
1532         * jcf-parse.c: Include ggc.h.
1533         (current_class): Remove declaration.
1534         (main_class): Likewise.
1535         (all_class_list): Likewise.
1536         (predefined_filename_p): Adjust for constant size of
1537         predef_filenames.
1538         (init_jcf_parse): New function.
1539         * jcf-write.c: Include ggc.h.
1540         (generate_classfile): Register GC roots.
1541         (append_synthetic_attribute): Likewise.
1542         (append_innerclass_attribute_entry): Likewise.
1543         * lang.c: Include ggc.h.
1544         (lang_print_error): Register GC roots.
1545         * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
1546         with macros.
1547         * parse.y: Include ggc.h.
1548         (wfl_operator): Remove.
1549         (goal): Register GC roots.
1550         (java_pop_parser_context): Adjust for new field names.
1551         (java_parser_context_save_global): Likewse.
1552         (java_parser_context_restore_global): Likewise.
1553         (java_parser_context_suspend): Likewise.
1554         (java_parser_context_resume): Likewise.
1555         (verify_constructor_circularity): Register GC roots.
1556         (lookup_cl): Likewise.
1557         (java_reorder_fields): Likewise.
1558         (build_current_this): Likewise.
1559         (class_in_current_package): Likewise.
1560         (argument_types_convertible): Likewise.
1561         (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
1562
1563 2000-09-14  Tom Tromey  <tromey@cygnus.com>
1564
1565         * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
1566
1567 2000-09-13  Tom Tromey  <tromey@cygnus.com>
1568
1569         * jcf-parse.c: Include <locale.h>.
1570         * jv-scan.c: Include <locale.h>.
1571
1572 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1573
1574         * expr.c (pop_type_0): Return `Object' if trying to merge two
1575         interface types.
1576         * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
1577         interface types; `Object' is always a valid supertype.
1578
1579 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1580
1581         Fix for PR gcj/33:
1582         * jv-scan.c (help): Document --encoding.
1583         (options): Added `encoding' entry.
1584         (OPT_ENCODING): New define.
1585         (main): Handle --encoding.
1586         Include <langinfo.h> if nl_langinfo exists.
1587         * lang-options.h: Document --classpath, --CLASSPATH, --main, and
1588         --encoding.
1589         * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
1590         (parse_source_file): Correctly call java_init_lex.  Added `finput'
1591         argument.  Use nl_langinfo to determine default encoding.
1592         * java-tree.h (current_encoding): Declare.
1593         * parse.y (java_parser_context_restore_global): Don't restore
1594         `finput'.
1595         (java_parser_context_save_global): Don't set `finput' field.
1596         (java_pop_parser_context): Don't restore `finput'.  Free old lexer
1597         if required.
1598         * lang.c (current_encoding): New global.
1599         (lang_decode_option): Recognize `-fencoding='.
1600         (finish_parse): Don't close finput.
1601         * parse.h (struct parser_ctxt): Removed `finput' and
1602         `unget_utf8_value' fields.  Added `lexer' field.
1603         (java_init_lex): Fixed declaration.
1604         * lex.c (java_new_lexer): New function.
1605         (java_destroy_lexer): Likewise.
1606         (java_read_char): Added `lex' argument.  Handle iconv case.
1607         (java_read_unicode): Added `lex' argument.  Count backslashes in
1608         lexer structure.
1609         (java_init_lex): Added `finput' and `encoding' arguments.  Set
1610         `lexer' field in ctxp.
1611         (BAD_UTF8_VALUE): Removed.
1612         (java_lex): Handle seeing UEOF in the middle of a string literal.
1613         * lex.h: Include <iconv.h> if HAVE_ICONV defined.
1614         (java_lexer): New structure.
1615         (UNGETC): Removed.
1616         (GETC): Removed.
1617         (DEFAULT_ENCODING): New define.
1618         (java_destroy_lexer): Declare.
1619
1620 2000-09-12  Tom Tromey  <tromey@cygnus.com>
1621
1622         Fix for PR gcj/343:
1623         * lex.c (java_init_lex): Initialize java_io_serializable.
1624         * parse.y (java_io_serializable): New global.
1625         (valid_ref_assignconv_cast_p): An array can be cast to
1626         serializable.
1627
1628 2000-09-10  Zack Weinberg  <zack@wolery.cumb.org>
1629
1630         * decl.c, expr.c: Include defaults.h if not already included.
1631         Don't define the *_TYPE_SIZE macros.
1632
1633 2000-09-09  Geoffrey Keating  <geoffk@cygnus.com>
1634
1635         * typeck.c (build_java_array_type): Correct first parameter
1636         in ADJUST_FIELD_ALIGN invocation.
1637
1638 2000-09-06  Tom Tromey  <tromey@cygnus.com>
1639
1640         * lang-specs.h: Also recognize `-femit-class-files'.
1641
1642 2000-09-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1643
1644         * verify.c (merge_types): Load the types to merge if necessary.
1645
1646 2000-09-02  Anthony Green  <green@redhat.com>
1647
1648         * jcf-io.c: Include zlib.h.
1649         (open_in_zip): Read compressed class file archives.
1650         * zipfile.h (ZipDirectory): Add uncompressed_size and
1651         compression_method fields.
1652         * zextract.c (read_zip_archive): Collect file compression info.
1653
1654 2000-08-15  Bryce McKinlay  <bryce@albatross.co.nz>
1655
1656         * parse.y (do_resolve_class): Also explore superclasses of
1657         intermediate enclosing contexts when searching for inner classes.
1658
1659 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1660
1661         * parse.y (variable_declarator_id:): Better error message.
1662         (expression_statement:): Use YYNOT_TWICE.
1663         (cast_expression:): Likewise.
1664         (assignment:): Likewise.
1665
1666 2000-08-11  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1667
1668         * parse.y (do_merge_string_cste): New locals. Create new
1669         STRING_CSTs each time, use memcpy. Fixes gcj/311.
1670
1671 2000-08-07  Hans Boehm  <boehm@acm.org>
1672
1673         * boehm.c (mark_reference_fields): Set marking bits for all words in
1674         a multiple-word record.
1675         (get_boehm_type_descriptor): Use the procedure marking descriptor for
1676         java.lang.Class.
1677
1678 2000-08-31  Mike Stump  <mrs@wrs.com>
1679
1680         * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
1681         jcf-dump$(exeext)): Make parallel safe.
1682
1683 2000-08-29  Zack Weinberg  <zack@wolery.cumb.org>
1684
1685         * jcf-parse.c (set_source_filename): Constify a char *.
1686         * jcf-write.c (append_innerclasses_attribute,
1687         make_class_file_name): Constify a char *.  Don't recycle a
1688         variable for an unrelated purpose.
1689         * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
1690         (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
1691
1692 2000-08-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1693
1694         * expr.c (can_widen_reference_to): Fixed indentation.
1695         * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
1696         * parse.y: `finit$' replaces `$finit$' in comments.
1697         (try_builtin_assignconv): Fixed leading comment.
1698
1699 2000-08-25  Greg McGary  <greg@mcgary.org>
1700
1701         * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
1702
1703 2000-08-24  Greg McGary  <greg@mcgary.org>
1704
1705         * lang.c (lang_decode_option): Use ARRAY_SIZE.
1706         * parse.y (BINOP_LOOKUP): Likewise.
1707
1708 2000-08-22  Andrew Haley  <aph@cygnus.com>
1709
1710         * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
1711         sign extending. Fixes gcj/321.
1712         * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
1713         combining to make a jlong. Fixes gcj/321.
1714
1715 2000-08-21  Nix  <nix@esperi.demon.co.uk>
1716
1717         * lang-specs.h: Do not process -o or run the assembler if
1718         -fsyntax-only.
1719
1720 2000-08-16  Andrew Haley  <aph@cygnus.com>
1721
1722         * typeck.c (build_java_array_type): Rewrite code to do array
1723         alignment.  Take into account back-end macros when aligning array
1724         data.  Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
1725         user to set alignment. Fixes gcj/252 and 160.
1726
1727 2000-08-09  Tom Tromey  <tromey@cygnus.com>
1728
1729         * parse.y (check_abstract_method_definitions): Now return `int'.
1730         Check implemented interfaces.  Fixes PR gcj/305.
1731
1732         * parse.y (patch_switch_statement): Disallow `long' in switch
1733         expressions.  Fixes PR gcj/310.
1734
1735 2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1736
1737         * decl.c (finit_leg_identifier_node): New global.
1738         (init_decl_processing): Use `finit$' to initialize
1739         finit_identifier_node. Use `$finit$' to initialize
1740         finit_leg_identifier_node.
1741         * expr.c (expand_java_field_op): Use ID_FINIT_P.
1742         * java-tree.h (finit_identifier_node): Changed attached comment.
1743         (finit_leg_identifier_node): New declaration.
1744         (ID_FINIT_P): Take finit_identifier_node and
1745         finit_leg_identifier_node into account. This is a backward
1746         compatibility hack.
1747
1748 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1749
1750         * jcf-write.c (generate_bytecode_conditional): Re-installed lost
1751         Jan 6 2000 patch.
1752         (generate_bytecode_insns): Check `nargs' before emitting it.
1753         * verify.c (merge_type_state): Fixed typo.
1754         * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
1755         generate_bytecode_{conditional,insns}.
1756
1757 Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
1758
1759         * check-init.c (check_init): Add case for BIT_FIELD_REF (required
1760         for -pg builds).
1761
1762 2000-08-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1763
1764         * class.c (maybe_layout_super_class): Fixed indentation.
1765         * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
1766         (java_check_methods): New function declaration.
1767         * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
1768         instead of `str_ptr'.
1769         * jcf-write.c (generate_bytecode_insns): Emit number the of args
1770         of a `invokeinterface' at the right time.
1771         * parse.h (WFL_STRIP_BRACKET): New macro.
1772         (SET_TYPE_FOR_RESOLUTION): Use it.
1773         * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
1774         (check_class_interface_creation): Don't check for cross package
1775         innerclass name clashes.
1776         (method_header): Behave properly if MDECL is `error_mark_node'.
1777         (method_declarator): Return `error_mark_node' if bogus current
1778         class.
1779         (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
1780         (resolve_and_layout): New local `decl_type', set and used. Call
1781         java_check_methods.
1782         (java_check_methods): New method.
1783         (java_layout_classes): Use it.
1784         (resolve_qualified_expression_name): No EH check necessary in
1785         access$<n>.
1786         (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
1787         `case' statement.
1788         (patch_assignment): Set DECL_INITIAL on integral final local.
1789
1790 2000-08-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1791
1792         * java-tree.h (flag_extraneous_semicolon): New extern.
1793         * lang-options.h: (-Wextraneous-semicolon): New option.
1794         * lang.c (flag_redundant): Fixed typo in leading comment.
1795         (flag_extraneous_semicolon): New global.
1796         (lang_decode_option): Set `flag_extraneous_semicolon' when
1797         -Wall. Decode `-Wextraneous-semicolon'.
1798         * parse.y (type_declaration:): Removed `SC_TK' hack, added
1799         `empty_statement' rule.
1800         (class_body_declaration): Likewise.
1801         (method_body:): Accept `;' as a method body.
1802         (static_initializer:): Removed `SC_TK' hack.
1803         (constructor_block_end:): Likewise.
1804         (empty_statement:): Report deprecated empty declaration. Fixes
1805         gcj/295
1806
1807 2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1808
1809         * parse.y (build_dot_class_method_invocation): Changed parameter
1810         name to `type'. Build signature from `type' and convert it to a
1811         STRING_CST if it's an array.
1812         (patch_incomplete_class_ref): `build_dot_class_method_invocation'
1813         to use `ref_type' directly.
1814
1815 Sun Aug  6 00:47:24 2000  Ovidiu Predescu  <ovidiu@cup.hp.com>
1816
1817         * lang-options.h: Added a comma after the last element to avoid
1818         syntax errors when other languages define additional options.
1819
1820 2000-08-04  Zack Weinberg  <zack@wolery.cumb.org>
1821
1822         * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
1823         * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
1824         (jc1): Link with $(BACKEND).
1825         (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
1826
1827 2000-08-02  Zack Weinberg  <zack@wolery.cumb.org>
1828
1829         * jvspec.c: Adjust type of second argument to
1830         lang_specific_driver, and update code as necessary.
1831
1832         * class.c (build_dtable_decl): Initialize dummy.
1833
1834 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1835
1836         * parse.y (maybe_yank_clinit): When generating bytecode: non empty
1837         method bodies not to rule out discarding `<clinit>'; don't use
1838         <clinit> to initialize static fields with constant initializers.
1839
1840 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1841
1842         * gjavah.c (print_method_info): Added `synth' parameter. Skip
1843         synthetic methods.
1844         (method_synthetic): New global.
1845         (HANDLE_METHOD): Recognize synthetic method and tell
1846         `print_method_info' about it.
1847         (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
1848         processing a synthetic method.
1849         * jcf-reader.c (skip_attribute): New function.
1850         ( skip_attribute): Likewise.
1851
1852 2000-08-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1853
1854         * parse.y (build_outer_field_access): Fixed comments.
1855         (fix_constructors): Emit the initialization of this$<n> before
1856         calling $finit$.
1857         (resolve_qualified_expression_name): Build an access to `decl' if
1858         necessary.
1859
1860 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1861
1862         * parse-scan.y (curent_class): Non longer const.
1863         (inner_qualifier, inner_qualifier_length): Deleted.
1864         (current_class_length): New global.
1865         (bracket_count): Fixed typo in leading comment.
1866         (anonymous_count): New global.
1867         (class_instance_creation_expression:): Handle anonymous classes.
1868         (anonymous_class_creation:): New rule.
1869         (push_class_context): Rewritten.
1870         (pop_class_context): Likewise.
1871         (INNER_QUALIFIER): Macro deleted.
1872         (report_class_declaration): call `push_class_context' when
1873         entering the function. `fprintf' format modified not to use
1874         INNER_QUALIFIER.
1875         (report_class_declaration): Assign `package_name' and
1876         `current_class' to NULL separatly.
1877
1878 2000-07-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1879
1880         * expr.c (build_invokeinterface): Call layout_class_methods on
1881         target interface.
1882
1883 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1884             Anthony Green  <green@cygnus.com>
1885             Alexandre Petit-Bianco  <apbianco@cygnus.com>
1886
1887         * class.c (make_class_data): Create vtable for abstract classes.
1888         (get_dispatch_table): Changed to cope with abstract classes.
1889
1890 2000-07-27  Tom Tromey  <tromey@cygnus.com>
1891
1892         * parse.y (patch_method_invocation): Don't reverse the argument
1893         list when dealing with anonymous class constructors. Fixed typo in
1894         comment.
1895
1896 2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1897
1898         * parse.y (build_alias_initializer_parameter_list): Reverse
1899         crafted list when building aliases for anonymous class
1900         constructors.
1901
1902 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1903
1904         * parse.y (jdep_resolve_class): Don't bother checking potential
1905         innerclass access if `decl' is NULL.
1906         (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
1907         WFL.
1908
1909 2000-07-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1910
1911         * parse.c: Remove (again.)
1912
1913 2000-07-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1914
1915         * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
1916         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
1917         outside the `if' statement, alias to innerclass removed, `decl'
1918         used to mark the class complete.
1919
1920 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1921
1922         * parse.y (simple_name:): Fixed typo in error message.
1923
1924 2000-07-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1925
1926         * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
1927         or its first operand can be error marks.
1928
1929 2000-07-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1930
1931         * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
1932         * parse.y (method_header): Likewise.
1933
1934 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1935
1936         * parse.y (process_imports): Consider that one might be trying to
1937         import an innerclass. Fixes gcj/254
1938
1939 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1940
1941         * parse.y (find_as_inner_class): Handle the case where the
1942         enclosing context of an innerclass has been loaded as bytecode.
1943
1944 2000-07-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1945
1946         * parse.y (simple_name:): Reject `$' in type names.
1947         (resolve_type_during_patch): Use `type' as a second
1948         argument to resolve_no_layout. Fixes gcj/257.
1949
1950 2000-07-18  Bryce McKinlay  <bryce@albatross.co.nz>
1951
1952         * parse.y (find_most_specific_methods_list): Select the only
1953         non-abstract method even if max has been set.
1954         Fixes gcj/285, gcj/298.
1955
1956 2000-07-18  Jeff Sturm  <jeff.sturm@appnet.com>
1957
1958         * lang-specs.h: Added %(jc1) to java compiler options.
1959
1960 2000-07-14  Zack Weinberg  <zack@wolery.cumb.org>
1961
1962         * .cvsignore: New file.
1963
1964 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1965
1966         * parse.y (not_accessible_p): Access granted to innerclasses
1967         (indirectly) extending the reference type. Fixes gcj/249.
1968
1969 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1970
1971         * parse.y (patch_method_invocation): Fixed comment.
1972         (maybe_use_access_method): Build this$<n>s to the context of the
1973         target method, or a type that extends it. Fixes gcj/242.
1974
1975 2000-07-13  Mark Mitchell  <mark@codesourcery.com>
1976
1977         * parse.c: Remove.
1978
1979 2000-07-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1980
1981         * parse.y (fold_constant_for_init): Avoid bullish conversion.
1982
1983 2000-07-13  Tom Tromey  <tromey@cygnus.com>
1984
1985         * lang-specs.h: Added %{I*}.
1986
1987 2000-07-13  Zack Weinberg  <zack@wolery.cumb.org>
1988
1989         * lang-specs.h: Use the new named specs.  Remove unnecessary braces.
1990
1991 2000-07-12  Mark Mitchell  <mark@codesourcery.com>
1992
1993         * parse-scan.c: Remove.
1994
1995 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
1996
1997         * class.c (set_super_info): Handled protected inner classes.
1998         (common_enclosing_context_p): Bail early if arguments aren't both
1999         inner classes.
2000         (get_access_flags_from_decl): Handle private and protected inner
2001         classes.
2002         * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
2003         (CLASS_PROTECTED): Likewise.
2004         (struct lang_type): New bitfield `poic'.
2005         * parse.y (jdep_resolve_class): Call check_inner_class_access on
2006         inner classes only.
2007         (check_inner_class_access): Renamed arguments, added
2008         comments. Handles protected inner classes (fixes gcj/225)
2009         (not_accessible_p): Fixed comments. Avoid handling inner classes.
2010
2011 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2012
2013         * parse.y (resolve_qualified_expression_name): Verify qualified
2014         access to `this'. Fixes gcj/239.
2015
2016 2000-07-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2017
2018         * jcf-write.c (generate_classfile): Don't install ConstantValue
2019         for null pointers.
2020
2021 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2022
2023         * parse.y (resolve_qualified_expression_name): Handle inner class
2024         access. Fixes gcj/256.
2025
2026 2000-07-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2027
2028         * jcf-write.c (generate_classfile): Properly install the
2029         ConstantValue attribute and the initial value constant pool index
2030         on string constants.
2031         * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
2032         class files.
2033
2034 2000-07-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2035
2036         * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
2037         construct.
2038         * parse.y (find_as_inner_class): Fixed typo.
2039         (do_resolve_class): Explore enclosing contexts when searching for
2040         innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
2041         (check_inner_class_access): Check `decl' which can be null in case
2042         of previous errors.
2043
2044 2000-07-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2045
2046         * java-tree.h (java_debug_context): Declared `extern'.
2047         (safe_layout_class): Likewise.
2048         * parse.y (resolve_field_access): Field must be `static' in order
2049         to be replaced by its initial value. Added comments.
2050         (find_applicable_accessible_methods_list): Fixed typo.
2051         (find_most_specific_methods_list): Methods found in innerclasses
2052         take over methods founds in the enclosing contexts.
2053         (java_complete_tree): Loosen restrictions on the type of DECLs
2054         that can be replaced by their initialization values.
2055         (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
2056
2057 2000-07-05  Tom Tromey  <tromey@cygnus.com>
2058
2059         * Make-lang.in (PARSE_DIR): New macro.
2060         (PARSE_RELDIR): Likewise.
2061         (PARSE_C): Likewise.
2062         (PARSE_SCAN_C): Likewise.
2063         ($(PARSE_C)): New target.
2064         ($(PARSE_SCAN_C)): Likewise.
2065         (SET_BISON): New macro.
2066         (BISONFLAGS): Likewise.
2067         (JAVABISONFLAGS): Likewise.
2068
2069 2000-07-02  Bryce McKinlay  <bryce@albatross.co.nz>
2070
2071         * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
2072         argument on the first pass for CNI as well as JNI.
2073         (print_method_info): Set up method name on the first pass only.
2074
2075 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2076
2077         * parse.y (parser_qualified_classname): Removed parameter
2078         `is_static'.
2079         (create_interface): Removed first passed parameter to
2080         parser_qualified_classname.
2081         (create_class): Likewise. Don't install alias on static
2082         innerclasses. Fixes gcj/275.
2083
2084 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2085
2086         * parse.y (maybe_generate_pre_expand_clinit): Don't build a
2087         debugable statement with empty_stmt_node. Fixes gcj/272
2088
2089 2000-07-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2090
2091         * expr.c (build_instanceof): Layout type after it's loaded. Fixes
2092         gcj/271.
2093
2094 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2095
2096         * jcf-write.c (push_long_const): Appropriately cast short negative
2097         constant to jword.
2098
2099 2000-06-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2100
2101         * parse.y (verify_constructor_super): Use loop variable
2102         `m_arg_type' initialized with `mdecl_arg_type'.
2103
2104 2000-06-29  Tom Tromey  <tromey@cygnus.com>
2105
2106         * parse.y (resolve_field_access): Handle case where `type_found'
2107         is NULL.
2108
2109 2000-06-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2110
2111         * expr.c (lookup_field): The same field can be found through two
2112         different interface. Don't declare it ambiguous in that case.
2113
2114 2000-06-27  Tom Tromey  <tromey@cygnus.com>
2115
2116         * lex.c (java_lineterminator): Don't recognize \r after \n.  If \r
2117         follows \r, then unget it at a lower level.
2118
2119 2000-06-26  Tom Tromey  <tromey@cygnus.com>
2120
2121         * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
2122         java_complete_tree.
2123
2124 2000-06-25  Tom Tromey  <tromey@cygnus.com>
2125
2126         * parse.y (for_statement): Wrap expression in a WFL if it is a
2127         constant.  For PR gcj/268.
2128
2129 2000-06-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2130
2131         * parse.y (do_resolve_class): Minor optimiztion in the package
2132         list search. Removed unecessary test and return statement.
2133         (valid_ref_assignconv_cast_p): Order of arguments to
2134         enclosing_context_p fixed.
2135
2136 2000-06-24  Tom Tromey  <tromey@cygnus.com>
2137
2138         * expr.c (lookup_field): Print error and return error_mark_node if
2139         field reference is ambiguous.
2140
2141         * parse.y (check_abstract_method_definitions): Also check if
2142         `other_method' is abstract.
2143
2144 2000-06-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2145
2146         * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
2147         classes.
2148         * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
2149         (struct lang_type): New field `pic'.
2150         (CLASS_PRIVATE): New macro.
2151         * parse.y (check_inner_class_access): New function.
2152         (jdep_resolve_class): Call it.
2153
2154 2000-06-23  Tom Tromey  <tromey@cygnus.com>
2155
2156         * parse.y (patch_incomplete_class_ref): Initialize the returned
2157         class.  For PR gcj/260.
2158
2159 2000-06-21  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2160
2161         * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
2162
2163 2000-06-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2164
2165         * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
2166         Java specific checks.
2167         * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
2168         screened by DECL_P.
2169         * java-tree.def (CASE_EXPR): Marked 'e'.
2170         (DEFAULT_EXPR): Likewise.
2171         * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
2172         screened by DECL_P.
2173         * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
2174         Java specific checks.
2175         (generate_bytecode_insns): Test try_block for BLOCK before using
2176         BLOCK_EXPR_BODY.
2177         * parse.y (build_wfl_wrap): Added `location' argument. Set
2178         EXPR_WFL_LINECOL accordingly.
2179         (dim_expr:): Wrap constants with WFLs.
2180         (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
2181         (resolve_package): Check for `stmt' not being a BLOCK before
2182         building a debuggable statement with it.
2183         (make_qualified_primary): Added extra parameter to build_wfl_wrap
2184         invocation.
2185         (resolve_field_access): Make sure `decl' is a DECL before treating
2186         it as such.
2187         (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
2188         IDENTIFIER_NODE before treating it as such.
2189         (patch_new_array_init): Make sure `elt' is a TREE_LIST before
2190         treating it as such.
2191         (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
2192         to be applied only on non array types.
2193
2194 2000-06-16  Per Bothner  <per@bothner.com>
2195
2196         * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN):  Don't
2197         define in terms of DECL_RESULT, as that fails when --enable-checking.
2198
2199 2000-06-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2200
2201         * jcf-write.c (CHECK_PUT): Add static prototype.  Make pointer
2202         types the same in comparison.
2203         (CHECK_OP): Add static prototype.
2204
2205 2000-06-13  Jakub Jelinek  <jakub@redhat.com>
2206
2207         * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
2208         * parse.y (java_complete_class): Set DECL_USER_ALIGN.
2209         * parse.c: Rebuilt.
2210
2211 2000-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2212
2213         * decl.c (create_primitive_vtable): Prototype.
2214
2215         * jcf-write.c (generate_bytecode_insns): Initialize variable
2216         `saved_context'.
2217
2218         * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
2219
2220 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
2221
2222         * parse.y (find_applicable_accessible_methods_list): Use a hashtable
2223         to track searched classes, and do not search the same class more than
2224         once. Call find_applicable_accessible_methods_list on immediate
2225         superclass, instead of search_applicable_method_list on all ancestors.
2226         Fix for PR gcj/238.
2227
2228 2000-06-09  Bryce McKinlay  <bryce@albatross.co.nz>
2229
2230         * parse.y (register_fields): Permit static fields in inner classes
2231         if they are final. Fix for PR gcj/255.
2232
2233 2000-06-06  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2234
2235         * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
2236         * parse.y (find_in_imports): Returned type changed to void,
2237         leading comment fixed.
2238         (register_package): New function.
2239         (qualify_and_find): Likewise.
2240         (package_declaration:): Use `register_package'.
2241         (single_type_import_declaration:): Removed local variable
2242         `node'. Added missing `;' for consistency.
2243         (type_import_on_demand_declaration:): Use `chainon' to link new
2244         entries.
2245         (lookup_field_wrapper): Lookup local variables defined in outer
2246         contexts first.
2247         (java_complete_class): Don't reverse the list of imported on demand.
2248         (do_resolve_class): Reorganized. Removed local variable
2249         `original_name'. Call `qualify_and_find' with the current package
2250         name, invoke `find_in_imports_on_demand' right after. Call
2251         `qualify_and_find' with the packages we've seen so far. Fixed
2252         operations numbering in comments.
2253         (java_expand_class): Don't reverse `package_list'.
2254         (find_most_specific_methods_list): New local variables `abstract'
2255         and `candidates'. Use them to pick the right method.
2256
2257 Tue Jun  6 11:39:05 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
2258
2259         * parse.y (check_modifiers_consistency): Don't subtract out
2260         `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
2261
2262 2000-06-04  Philipp Thomas  <pthomas@suse.de>
2263
2264         * Makefile.in (INTLLIBS): New.
2265         (LIBS): Add above.
2266         (DEPLIBS): Ditto.
2267
2268 Fri Jun  2 16:48:55 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2269
2270         * class.c (get_dispatch_table): Build the vtable dummy entry list
2271         element with a null purpose. Fixed leading comment.
2272         (build_dtable_decl): Build an accurate dtable type when appropriate
2273         and use it.
2274
2275 2000-06-02  Richard Henderson  <rth@cygnus.com>
2276
2277         * lang.c (lang_get_alias_set): New.
2278
2279 2000-05-31  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2280
2281         * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
2282         before using it as the accessed field.
2283
2284 2000-05-31  Tom Tromey  <tromey@cygnus.com>
2285
2286         * java-tree.h (boolean_array_vtable, byte_array_vtable,
2287         char_array_vtable, short_array_vtable, int_array_vtable,
2288         long_array_vtable, float_array_vtable, double_array_vtable):
2289         Declare.
2290         * expr.c (get_primitive_array_vtable): New function.
2291         (create_primitive_vtable): New function.
2292         (java_lang_expand_expr): Enable code to statically generate
2293         arrays.
2294         * decl.c (init_decl_processing): Create primitive vtables.
2295         (boolean_array_vtable, byte_array_vtable, char_array_vtable,
2296         short_array_vtable, int_array_vtable, long_array_vtable,
2297         float_array_vtable, double_array_vtable): Define.
2298
2299 2000-05-26  Zack Weinberg  <zack@wolery.cumb.org>
2300
2301         * java/parse.y (find_applicable_accessible_methods_list):
2302         Don't add an uninitialized value to the list.
2303
2304 2000-05-25  Tom Tromey  <tromey@cygnus.com>
2305
2306         * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
2307         when trying to see if field's class should be initialized.  Always
2308         initialize field's declaring class, not qualified class.
2309         For PR gcj/162.
2310
2311         * parse.y (array_constructor_check_entry): Pass `wfl_value', not
2312         `wfl_operator', to maybe_build_primttype_type_ref.
2313         Fixes PR gcj/235.
2314
2315 2000-05-23  Bryce McKinlay  <bryce@albatross.co.nz>
2316
2317        * parse.y (patch_method_invocation): Don't try to lookup methods
2318        in primitive types.
2319
2320 2000-05-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2321
2322         * parse.y (resolve_field_access): Call the appropriate <clinit>
2323         before accessing the length of a static array. Craft a decl for
2324         the field while its time. Fixes PR gcj/129.
2325
2326 2000-05-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2327
2328         * parse.y (resolve_package): Correctly set `*next' (was off by
2329         one.)
2330         (resolve_qualified_expression_name): Fixed comment.
2331
2332 Thu Apr 27 17:47:34 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2333
2334         * jcf-parse.c (jcf_parse_source): Reset current_class and
2335         current_function_decl to NULL before parsing a new file.
2336
2337 Thu Apr 27 17:25:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2338
2339         * parse.y (block_end:): If the collected block doesn't feature a
2340         statement, insert an empty statement.
2341
2342 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2343
2344         * parse.y (maybe_yank_clinit): New function.
2345         (maybe_generate_pre_expand_clinit): Always link <clinit> at the
2346         end of the list of methods belonging to a class.
2347         (java_complete_expand_method): Check whether <clinit> is really
2348         necessary and expand it accordingly.
2349
2350 2000-04-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2351
2352         * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
2353         processed by the method's switch statement.
2354
2355 2000-05-19  Tom Tromey  <tromey@cygnus.com>
2356
2357         * java-tree.h: Added init state enum.
2358         * decl.c (emit_init_test_initialization): Initialize class
2359         initialization check variable by looking at class' state.
2360
2361 2000-05-19  Tom Tromey  <tromey@cygnus.com>
2362
2363         * java-tree.h (build_instanceof): Declare.
2364         (build_get_class): Declare.
2365         * parse.y (patch_binop): Use build_instanceof.
2366         * expr.c (build_instanceof): New function.  If class is final,
2367         don't make a function call.
2368         (expand_java_INSTANCEOF): Use it.
2369         (build_get_class): New function.
2370
2371 2000-05-18  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
2372
2373         * jcf-write.c (generate_classfile): Scan the source_file for
2374         slashes with the right pointer variable.
2375
2376 Wed May 17 17:27:44 2000  Andrew Cagney  <cagney@b1.cygnus.com>
2377
2378         * lang.c (lang_decode_option): Update -Wunused flags by calling
2379         set_Wunused.
2380         * decl.c (poplevel): Replace warn_unused with warn_unused_label.
2381
2382 2000-05-09  Zack Weinberg  <zack@wolery.cumb.org>
2383
2384         * check_init.c (check_init): Constify local char *.
2385         * class.c (push_class): Constify local char *.
2386         * java_tree.h: Update prototypes.
2387         * jcf-io.c (open_class): Constify filename parameter and
2388         return value.
2389         (find_class): Remove redundant string copy.  Cast return from
2390         open_class.
2391         * jcf-parse.c (read_class, parse_class_file, yyparse):
2392         Constify local char *.
2393         * jcf-write.c (generate_bytecode_insns, generate_classfile):
2394         Constify local char *.
2395         * jcf.h (JCF): Constify filename and classname.
2396         (JCF_FINISH): Cast args to FREE to char * when appropriate.
2397         * lang.c (init_parse): Constify parameter and return value.
2398         * lex.c (java_get_line_col): Constify filename parameter.
2399         * parse.h: Constify parser_ctxt.filename.  Update prototypes.
2400         * parse.y (java_parser_context_suspend,
2401         issue_warning_error_from_context, safe_layout_class): Constify
2402         local char *.
2403         * parse.c: Regenerate.
2404
2405 2000-05-08  Tom Tromey  <tromey@cygnus.com>
2406
2407         * expr.c (build_jni_stub): Cache the result of
2408         _Jv_LookupJNIMethod.
2409
2410 2000-05-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2411
2412         * decl.c (predef_filenames_size): Now 7.
2413         (predef_filenames): New seventh entry.
2414
2415 2000-05-04  Tom Tromey  <tromey@cygnus.com>
2416
2417         * boehm.c (mark_reference_fields): Don't mark RawData fields.
2418         Keep track of when we've seen a reference field after a
2419         non-reference field.
2420         (get_boehm_type_descriptor): Handle case where we see
2421         non-reference fields but no trailing reference field.
2422         * decl.c (rawdata_ptr_type_node): Define.
2423         (init_decl_processing): Initialize rawdata_ptr_type_node.
2424         * java-tree.h (rawdata_ptr_type_node): Declare.
2425
2426 2000-05-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2427
2428         * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
2429         specifiers in calls to fprintf.
2430
2431 2000-05-03  Andrew Haley  <aph@cygnus.com>
2432
2433         * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
2434
2435         * javaop.h (WORD_TO_INT): New function.
2436         (IMMEDIATE_s4): Use WORD_TO_INT.
2437         * jcf.h (JPOOL_INT): Ditto.
2438
2439         * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
2440         separator.
2441
2442 2000-04-19  Tom Tromey  <tromey@cygnus.com>
2443
2444         * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
2445         on native function.
2446         * jcf-parse.c (parse_class_file): Call build_jni_stub for native
2447         JNI methods.
2448         * expr.c (build_jni_stub): New function.
2449         * lang-specs.h: -fjni and -femit-class-file are incompatible.
2450         * parse.c: Rebuilt.
2451         * parse.y (java_complete_expand_methods): Expand a native method
2452         and call build_jni_stub if -fjni given.
2453         * lang-options.h: Document -fjni.
2454         * lang.c (flag_jni): New global.
2455         (lang_f_options): Added `jni' entry.
2456         * java-tree.h (soft_lookupjnimethod_node,
2457         soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
2458         Declare.
2459         (flag_jni): Declare.
2460         (build_jni_stub): Declare.
2461         (struct lang_decl): Added `native' flag.
2462         (METHOD_NATIVE): Redefined to use `native' field of lang specific
2463         structure.
2464         * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
2465         soft_jnipopsystemframe_node): New globals.
2466         (init_decl_processing): Set them.  _Jv_InitClass only takes one
2467         argument.
2468
2469         * java-tree.def: Put into `C' mode.
2470
2471 2000-04-27  Tom Tromey  <tromey@cygnus.com>
2472
2473         Fix for PR gcj/2:
2474         * expr.c (expand_invoke): Generate check to see if object pointer
2475         is null in nonvirtual invocation case.
2476         * java-tree.h (soft_nullpointer_node): Declare.
2477         * decl.c (soft_nullpointer_node): New global.
2478         (init_decl_processing): Initialize soft_nullpointer_node.
2479         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
2480         or `private' methods.
2481         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
2482
2483 Wed Apr 26 14:29:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2484
2485         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
2486         from <clinit>
2487
2488 2000-04-26  Tom Tromey  <tromey@cygnus.com>
2489
2490         * zextract.c (find_zip_file_start): New function.
2491         (read_zip_archive): Use it.
2492
2493 2000-04-25  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2494
2495         * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
2496
2497 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2498
2499         * class.c (common_enclosing_context_p): New function.
2500         * java-tree.h (common_enclosing_context_p): Added prototype.
2501         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
2502         classes sharing an outer context with the current instance.
2503         * parse.y (build_access_to_thisn): Fixed leading comment.
2504         (verify_constructor_super): New local `supper_inner'. Skip
2505         enclosing context argument in the case of inner class constructors.
2506         (patch_method_invocation): Insert proper context as second
2507         parameter to pure inner class constructor super invocations.
2508
2509 Mon Apr 24 14:59:36 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2510
2511         * parse.y (end_class_declaration): Reset the interface number
2512         counter.
2513
2514 2000-04-24  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2515
2516         * parse.y (source_start_java_method): Deleted unecessary code.
2517         (patch_method_invocation): Fixed comment.
2518
2519 2000-04-24  Robert Lipe <robertlipe@usa.net>
2520
2521         * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
2522
2523 2000-04-23  Tom Tromey  <tromey@cygnus.com>
2524
2525         * boehm.c (mark_reference_fields): Use int_byte_position.
2526
2527 2000-04-22  Tom Tromey  <tromey@cygnus.com>
2528
2529         * boehm.c (mark_reference_fields): Only call byte_position on
2530         non-static fields.
2531
2532 2000-04-22  Tom Tromey  <tromey@cygnus.com>
2533
2534         * boehm.c (mark_reference_fields): Added `last_view_index'
2535         argument.  Use DECL_FIELD_OFFSET to determine field's offset.
2536
2537 Thu Apr 20 17:41:28 2000  Mo DeJong  <mdejong@cygnus.com>
2538
2539         * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
2540         * parse.y (check_class_interface_creation): Fixed comments. Select
2541         permitted modifiers for (inner) interfaces. Changed error message
2542         to report rejected modifiers used with local classes.
2543
2544 2000-04-20  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2545
2546         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
2547         of directly inherited type considered in scope.
2548         * parse.y (do_resolve_class): Search inherited classes for inner
2549         classes.
2550
2551 2000-04-20  Tom Tromey  <tromey@cygnus.com>
2552
2553         * parse.y (not_accessible_p): Use member's class, not current
2554         class, when doing inheritance check for protected reference.
2555         Fixes PR gcj/124.
2556
2557 Thu Apr 20 18:20:58 2000  Jason Schroeder  <shrode@subnature.com>
2558
2559         * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
2560
2561 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2562
2563         * parse.y (lookup_field_wrapper): Search for final local aliases.
2564         (resolve_expression_name): Let lookup_field_wrapper search for
2565         final local aliases. Force the value of `name' if one is found.
2566         (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
2567         an expression name. Fixed comments.
2568
2569 2000-04-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2570
2571         * parse.y (yyerror): `msg' can be null, don't use it in that case.
2572
2573 2000-04-19  Tom Tromey  <tromey@cygnus.com>
2574
2575         * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
2576
2577 2000-04-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2578
2579         * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
2580
2581 2000-04-18  Tom Tromey  <tromey@cygnus.com>
2582
2583         PR gcj/211:
2584         * gjavah.c (utf8_cmp): Changed return value.
2585         (cxx_keyword_subst): Handle all C++ keywords.  Allocate new return
2586         result.
2587         (cxx_keywords): New global.
2588         (get_field_name): Handle new result of cxx_keyword_subst.
2589         (print_method_info): Likewise.
2590
2591 2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
2592
2593         * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
2594         with a newline, for CNI.
2595         (print_stub_or_jni): Print a space or newline before method name for
2596         CNI as well as JNI.
2597         (print_cxx_classname): Don't write leading "::" in CNI stub method.
2598         (process_file): Include gcj/cni.h if generating CNI stubs.
2599
2600 2000-04-16  Tom Tromey  <tromey@cygnus.com>
2601
2602         * gjavah.c (decompile_method): Use print_field_name.
2603         Fixes PR gcj/205.
2604
2605 2000-04-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2606
2607         * parse.y (java_expand_classes): Reverse the package list once.
2608         (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
2609         reduction.
2610         (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
2611         the `==' and `!=' operators.
2612
2613 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2614
2615         * jcf-write.c (generate_bytecode_insns): At invokation time,
2616         always relate an interface method to the type of its selector.
2617
2618 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2619
2620         Fix for PR gcj/2:
2621         * expr.c (expand_invoke): Generate check to see if object pointer
2622         is null in nonvirtual invocation case.
2623         * java-tree.h (soft_nullpointer_node): Declare.
2624         * decl.c (soft_nullpointer_node): New global.
2625         (init_decl_processing): Initialize soft_nullpointer_node.
2626         * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
2627         or `private' methods.
2628         (patch_invoke): Handle INVOKE_NONVIRTUAL case.
2629
2630 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2631
2632         Fix for PR gcj/140:
2633         * parse.y (check_final_assignment): Recognize assignments to the
2634         `length' field of an array when generating class files.
2635
2636 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2637
2638         * class.c (decl_hash): Prototype removed.
2639         (decl_compare): Likewise.
2640
2641 2000-04-05  Tom Tromey  <tromey@cygnus.com>
2642
2643         * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
2644         * parse.y (check_modifiers_consistency): Check for final/volatile
2645         clash.  Fixes PR gcj/164.
2646
2647 2000-04-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2648
2649         * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
2650         made global.
2651         (java_hash_compare_tree_node): Renamed from `decl_compare, made
2652         global.
2653         (add_method_1): Use `java_hash_hash_tree_node' and
2654         `java_hash_compare_tree_node'.
2655         * java-tree.h: (java_hash_hash_tree_node): Prototyped.
2656         (java_hash_compare_tree_node): Likewise.
2657         * parse.y (find_applicable_accessible_methods_list): Create,
2658         delete and use a hash table to remember already searched interfaces.
2659
2660 2000-04-03  Matt Welsh  <mdw@cs.berkeley.edu>
2661
2662         * jcf-depend.c (add_entry): Fixed bug where list was always replaced
2663         with latest entry.
2664
2665 2000-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2666
2667         * boehm.c (mark_reference_fields, set_bit): Prototype.
2668         (set_bit): Un-ANSI-fy definition.
2669
2670         * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
2671         Prototype.
2672
2673         * decl.c (emit_init_test_initialization): Likewise.
2674
2675         * gjavah.c (jni_print_char): Likewise.
2676
2677         * parse.y (create_new_parser_context): Likewise.
2678
2679 Thu Mar 30 15:26:56 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2680
2681         * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
2682         patch missing hunk. Fixed indentation.
2683
2684 2000-03-30  Tom Tromey  <tromey@cygnus.com>
2685
2686         * gjavah.c (D_NAN_MASK): Only define as word-reversed when
2687         HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
2688
2689 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2690
2691         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
2692         when negative *before* using it as an array index.
2693         * ChangeLog: Fixed typo.
2694
2695 2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2696
2697         * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
2698         to 0 when it reaches -1.
2699
2700 2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2701
2702         * jcf-parse.c (get_constant): Properly cast `num' during the
2703         invocation of `add_double'.
2704         * jcf-write.c (push_long_const): Properly cast `lo' before
2705         comparing it to short bounds.
2706         * parse-scan.y (interface_declaration:): Rule re-arrange so that
2707         `interface_body:' is reduced after the current interface is
2708         pushed.
2709
2710 2000-03-26  Tom Tromey  <tromey@cygnus.com>
2711
2712         * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
2713         Java-specific `-f' option.
2714
2715 Sun Mar 26 11:37:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2716
2717         * decl.c (init_decl_processing): Only call initialize_sizetypes once.
2718         Adjust order of making types.
2719         Make bitsize_*_node values.
2720
2721 Sat Mar 25 09:12:10 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2722
2723         * class.c (make_field_value): Use byte_position.
2724         * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
2725         (java_array_data_offset): Likewise.
2726         * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
2727         bzero call.
2728
2729 2000-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2730
2731         * parse.y (check_abstract_method_definitions): New local
2732         `end_type_reached'. Make sure we also consider `end_type'.
2733         (java_check_abstract_method_definitions): Make sure we eventually
2734         consider `java.lang.Object'.
2735         (maybe_use_access_method): Don't use access method if not in the
2736         context of a pure inner class or if the method's context is right.
2737         (find_applicable_accessible_methods_list): New static flag
2738         `object_done'. Don't search abstract classes as interfaces. Fixed
2739         indentation. Fixed the `java.lang.Object' only search. Search
2740         class interface(s) first, then fully search enclosing contexts.
2741         (find_most_specific_methods_list): Pick the closest candidate when
2742         they're all abstract.
2743
2744 Mon Mar 20 08:58:51 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2745
2746         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
2747         properly initialize `finished_label'. Don't emit gotos for empty
2748         try statements.
2749
2750 2000-03-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
2751
2752         * except.c (emit_handlers): Clear catch_clauses_last.
2753
2754 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2755
2756         * parse.y (check_method_types_complete): New function.
2757         (create_class): Reset anonymous class counter only when seeing an
2758         non inner classe.
2759         (java_complete_class): JDEP_METHOD: Don't recompute signature
2760         if incomplete.
2761
2762 2000-03-17  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2763
2764         * class.c (build_static_ref): Fixed indentation in comment.
2765         * java-tree.def (TRY_EXPR): Fixed typo in name.
2766         (CLASS_LITERAL): Likewise.
2767         * java-tree.h: (TYPE_DOT_CLASS): New macro.
2768         (struct lang_type): New field `dot_class'.
2769         * jcf-write.c (generate_bytecode_insns): Fixed error message.
2770         (generate_classfile): Method `class$' is synthetic.
2771         * parse.y (build_do_class_method): New function.
2772         (build_dot_class_method_invocation): Likewise.
2773         (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
2774         (resolve_qualified_expression_name): Handle CLASS_LITERAL.
2775         (qualify_ambiguous_name): Likewise.
2776         (patch_incomplete_class_ref): Invoke synthetic method if necessary.
2777         (build_try_statement): Fixed leading comment.
2778
2779 Fri Mar 17 08:09:14 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2780
2781         * class.c (make_field_value): Properly handle sizes.
2782         (get_dispatch_vector): Use tree_low_cst and host_integerp.
2783         (layout_class_method): Count using trees.
2784         * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
2785         * expr.c (java_array_data_offset): Use int_bit_position.
2786         (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
2787         (build_invokevirtual): Use tree_low_cst and do computations with trees.
2788
2789 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2790
2791         * lang.c (flag_hash_synchronization): New global.
2792         (lang_f_options): Added `hash-synchronization'.
2793         * lang-options.h: Mention -fhash-synchronization.
2794         * java-tree.h (flag_hash_synchronization): Declare.
2795         * expr.c (java_lang_expand_expr): Only push `sync_info' value when
2796         hash table synchronization is disabled.
2797         * decl.c (init_decl_processing): Only push `sync_info' value when
2798         hash table synchronization is disabled.
2799         * class.c (make_class_data): Only push `sync_info' field when hash
2800         table synchronization is disabled.  Removed dead code.
2801
2802 2000-03-16  Tom Tromey  <tromey@cygnus.com>
2803
2804         * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
2805
2806 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2807
2808         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
2809         classes.
2810         * parse.y (patch_method_invocation): Handle anonymous classes
2811         creation in static context.
2812
2813 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2814
2815         * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
2816         * parse.y (resolve_qualified_expression_name): Use it.
2817         (patch_method_invocation): Likewise.
2818
2819 2000-03-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2820
2821         * parse.y (register_incomplete_type): JDEP_ENCLOSING set
2822         depending on the type of dependency which dictates what the
2823         current class is.
2824         (unresolved_type_p): Resolved types limited to the current class.
2825
2826 2000-03-15  Tom Tromey  <tromey@cygnus.com>
2827
2828         * decl.c (init_decl_processing): Set type of `sync_info' to be
2829         pointer to Object.
2830
2831         * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
2832         Correctly compute bit number for current slot.  Zero `high' and
2833         `low' in DS_LENGTH case.  Don't skip inherited fields.  Use
2834         mark_reference_fields.
2835         (mark_reference_fields): New function.
2836
2837 Tue Mar 14 17:15:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2838
2839         * parse.y (register_incomplete_type): Fixed initialization of
2840         JDEP_ENCLOSING.
2841
2842 2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2843
2844         * parse-scan.y (inner_qualifier, inner_qualifier_length): New
2845         static globals.
2846         (push_class_context, pop_class_context): New function.
2847         (class_body:): Call pop_class_context.
2848         (interface_body:): Likewise.
2849         (INNER_QUALIFIER): New macro.
2850         (report_class_declaration): Changed output format and use
2851         INNER_QUALIFIER. Call push_class_context.
2852
2853 2000-02-14  Andrew Haley  <aph@cygnus.com>
2854
2855         * check-init.c (check_init): Add new cases for unary and binary
2856         tree nodes.
2857
2858 2000-03-13  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2859
2860         * parse.y (resolve_package): Set `next' once a type name has been
2861         progressively discovered.
2862         (resolve_qualified_expression_name): Propagate resolution only if
2863         there are remaining qualifiers. Take into account `q' might have
2864         been cleared after re-qualification.
2865         * parse.y (patch_method_invocation): New local `resolved'.
2866         Section dealing with qualified expression rewritten to use
2867         resolve_field_access.
2868
2869 Mon Mar 13 12:21:13 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2870
2871         * parse.h (PUSH_CPC): Fixed indentation.
2872         (DEBUG_CPC): New macro.
2873         (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
2874         SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
2875         * parse.y (class_body_declaration:): Use
2876         SET_CPC_INSTANCE_INITIALIZER_STMT.
2877         (method_declaration:): Check for null current_function_decl.
2878         (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
2879         (java_parser_context_pop_initialized_field): Better handling of
2880         empty lists.
2881         (maybe_make_nested_class_name): Mark nested class name as
2882         qualified when necessary.
2883         (end_class_declaration): Don't call java_parse_context_resume when
2884         one or more error occured.
2885         (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
2886         (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
2887         SET_CPC_INITIALIZER_STMT.
2888         (method_header): Check for inner classes declaring static methods.
2889         (resolve_qualified_expression_name): Handle situation where `this'
2890         is implied.
2891
2892 Mon Mar 13 11:36:51 2000  Hans Boehm <boehm@acm.org>
2893
2894         * typeck.c (build_prim_array_type): Correctly set the high word too.
2895
2896 2000-03-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2897
2898         * parse.y (java_complete_expand_methods): Leave <clinit> out of
2899         ordinary methods.
2900         (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
2901         list of methods for interfaces.
2902
2903 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2904
2905         * parse.y (qualify_ambiguous_name): Properly handle expressions
2906         using `null'.
2907
2908 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2909
2910         * parse.y (check_final_assignment): Extended to process
2911         COMPOUND_EXPR.
2912         (patch_assignment): Have check_final_assignment called only once.
2913
2914 2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2915
2916         * java-tree.h (IS_INIT_CHECKED): New flag.
2917         * check-init.c (check_init): Test and set IS_INIT_CHECKED.
2918         * parse.y (patch_string): Call force_evaluation_order on the
2919         completed string concatenation tree.
2920         * expr.c (force_evaluation_order): Call force_evaluation_order on
2921         function's arguments too.
2922
2923 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2924
2925         * decl.c (emit_init_test_initialization): Mark KEY as unused.
2926         * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
2927         (build_anewarray): Likewise.
2928         * parse.y (patch_newarray): Likewise.
2929         * parse.c: Regenerated.
2930
2931 2000-03-06  Bryce McKinlay  <bryce@albatross.co.nz>
2932
2933         * decl.c (init_decl_processing): Added new class fields `depth',
2934         `ancestors', and `idt' to class_type_node. Use
2935         _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
2936         * class.c (make_class_data): Push initial values for new fields.
2937         * java-tree.h: Updated prototype for `build_invokeinterface'.
2938         * expr.c (build_invokeinterface): Changed parameters to accept
2939         `method' tree. Calculate index of `method' in its declaring
2940         interface. Build call to _Jv_LookupInterfaceMethodIdx.
2941         (expand_invoke): Call `build_invokeinterface' with new parameters.
2942         * parse.y (patch_invoke): Call `build_invokeinterface' with new
2943         parameters.
2944
2945 2000-03-06  Bryce McKinlay <bryce@albatross.co.nz>
2946
2947         * typeck.c (lookup_do): Search superinterfaces first
2948         when looking up an interface method. From Godmar Back
2949         <gback@cs.utah.edu>
2950
2951 2000-03-06  Tom Tromey  <tromey@cygnus.com>
2952
2953         * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
2954
2955 2000-03-02  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2956
2957         * java-tree.h (lookup_argument_method2): Declared.
2958         (safe_layout_class): Prototype moved from parse.h.
2959         * parse.h (safe_layout_class): Prototype moved to java-tree.h.
2960         * parse.y (java_check_regular_methods): Local `super_class' gone.
2961         Call lookup_argument_method2 instead of lookup_argument_method.
2962         Perform modifier match for methods found declared in implemented
2963         interfaces. Fixed indentation problem. Overriding/hiding error
2964         report to take place only for methods found in classes.
2965         * typeck.c (lookup_argument_method): Changed leading
2966         comment. Re-written by calling lookup_do.
2967         (lookup_argument_method2): New function.
2968         (lookup_java_method): Re-written by calling lookup_do.
2969         (lookup_do): New function.
2970
2971 Thu Mar  2 15:18:33 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2972
2973         * check-init.c (check_init): Removed dead code. Handle (blank)
2974         final variables.
2975         * parse.y (declare_local_variables): New local `final_p', set it
2976         and use it to initialize LOCAL_FINAL.
2977         (check_final_assignment): Only check FIELD_DECLs.
2978
2979 2000-02-17  Tom Tromey  <tromey@cygnus.com>
2980
2981         * Makefile.in (JAVA_OBJS): Added boehm.o.
2982         (boehm.o): New target.
2983         * Make-lang.in (JAVA_SRCS): Added boehm.c.
2984         * java-tree.h (flag_use_boehm_gc): Declare.
2985         (get_boehm_type_descriptor): Declare.
2986         * lang.c (lang_f_options): Added `use-boehm-gc'.
2987         (flag_use_boehm_gc): New global.
2988         * lang-options.h: Added -fuse-boehm-gc.
2989         * boehm.c: New file.
2990         * class.c (get_dispatch_table): If class uses a Boehm type
2991         descriptor, put it in the vtable.
2992         (make_class_data): Removed dead code.
2993
2994 2000-03-03  Per Bothner  <per@bothner.com>
2995
2996         * decl.c (init_decl_processing):  Initialize sizetype properly.
2997
2998 2000-03-01  Alexandre Petit-Bianco  <apbianco@cygnus.com>
2999
3000         * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
3001         (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
3002         * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
3003         * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
3004         (jcf_parse): New local `current'. Load innerclasses seen in outer
3005         context being processed.
3006         * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
3007         * jcf-write.c (append_innerclasses_attribute): New function.
3008         (append_innerclasses_attribute_entry): Likewise.
3009         (get_access_flags): Handle static classes. Set anonymous and local
3010         classes to be private.
3011         (generate_classfile): Attribute count adjusted. Call
3012         append_innerclasses_attribute.
3013         * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
3014         PURE_INNER_CLASS_TYPE_P.
3015         * parse.y (parser_qualified_classname): New parameter `is_static',
3016         produce non qualified name accordingly.
3017         (block_statement:): Set LOCAL_CLASS_P when declaring local class.
3018         (create_interface): Added argument to parser_qualified_classname.
3019         (create_class): Added argument to parser_qualified_classname. Setup
3020         alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
3021         (add_inner_class_fields): Fixed indentation.
3022         (method_declarator): Use PURE_INNER_CLASS_DECP_P.
3023         (method_declarator): Fixed typo in comment.
3024         (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
3025         (build_current_thisn): Likewise.
3026         (patch_method_invocation): Likewise.
3027
3028 2000-03-01  Martin von Loewis  <loewis@informatik.hu-berlin.de>
3029
3030         * decl.c (current_function_decl): Move to toplev.c.
3031
3032 Mon Feb 28 08:20:42 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3033
3034         * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
3035         (DECL_BIT_INDEX): Use underlying representation.
3036         * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
3037
3038 Sun Feb 27 16:40:33 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3039
3040         * expr.c (build_java_ret): Pass proper type to size_binop.
3041
3042 2000-02-25  Anthony Green  <green@cygnus.com>
3043
3044         * expr.c (build_class_init): Mark the decl to be ignored by
3045         check_init.
3046         * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
3047         * check-init.c: Move DECL_BIT_INDEX to java-tree.h
3048         * class.c (init_test_hash_newfunc): New function.
3049         (decl_hash): New function.
3050         (decl_compare): New function.
3051         * decl.c (emit_init_test_initialization): New function.
3052         (complete_start_java_method): Traverse the init test hashtable,
3053         calling emit_init_test_initialization.
3054         (always_initialize_class_p): Define.
3055         * expr.c (build_class_init): Use initialization tests when
3056         emitting class initialization code.
3057         (always_initialize_class_p): Declare.
3058         * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
3059         1.
3060         * java-tree.h: Include hash.h.
3061         (DECL_FUNCTION_INIT_TEST_TABLE): Define.
3062         (struct lang_decl): Add init_test_table field.
3063         (init_test_hash_entry): Define.
3064
3065 Fri Feb 25 18:41:31 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3066
3067         * gjavah.c (main): Avoid using `argi' to report unimplemented
3068         options.
3069
3070 Fri Feb 25 18:47:25 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3071
3072         * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
3073         initialize locals to avoid warnings. Local `exception_type' moved
3074         into if statement.
3075
3076 Fri Feb 25 18:00:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3077
3078         * parse.y (resolve_expression_name): Use `orig' as a second
3079         argument to resolve_field_access.
3080         (resolve_field_access): Removed unecessary code when dealing with
3081         static fields.
3082
3083 Wed Feb 23 17:41:50 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3084
3085         * class.c (push_super_field): Don't push the field twice.
3086         * jcf-parse.c (parse_source_file): Call java_reorder_fields.
3087         * parse.h (java_reorder_fields): Prototyped.
3088         * parse.y (java_reorder_fields): New function.
3089         (java_layout_class): Simplified not to worry about re-ordering.
3090
3091 2000-02-23  Tom Tromey  <tromey@cygnus.com>
3092
3093         * gjavah.c (print_name): In JNI case, correctly quote string.
3094         (print_method_info): Don't handle overrides in JNI mode.
3095
3096 2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3097
3098         * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
3099         value type set to `boolean_type_node'.
3100
3101 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
3102
3103         * jcf-dump.c (main): Test for correct condition after
3104         output file creation.
3105
3106 2000-02-19  Anthony Green  <green@cygnus.com>
3107
3108         * jcf-depend.c (add_entry): Fix test for first list entry.
3109
3110 Sat Feb 19 18:43:13 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3111
3112         * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
3113         * constants.c (build_constants_constructor): Likewise.
3114
3115 2000-02-19  Anthony Green  <green@cygnus.com>
3116
3117         * jcf-depend.c (add_entry): Add entries to the end of the list.
3118
3119 Wed Nov 03 02:16:00 PST 1999  Pekka Nikander  <pekka.nikander@hut.fi>
3120
3121         * decl.c (INT_TYPE_SIZE): Define if necessary.
3122         (expand_java_return): Handle the case of a native integer smaller
3123         than a JVM integer.
3124
3125 2000-02-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
3126
3127         * gjavah.c (help): Use GCCBUGURL.
3128         * jv-scan.c (help): Likewise.
3129         * jcf-dump.c (help): Likewise.
3130
3131 Thu Feb 17 14:30:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3132
3133         * jcf-write.c (generate_bytecode_insns): Don't generate empty
3134         `finally' clauses.
3135
3136 Thu Feb 17 13:20:58 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3137
3138         * jcf-parse.c (load_class): Call `fatal' if no file containing
3139         the target class are found.
3140
3141 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
3142
3143         * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
3144         lex.c, lex.h, and PARSE_H to...
3145         (parse.o, parse-scan.o): ...here, respectively.
3146
3147         * lex.c: Split out code that may trigger SIGFPE from yylex()
3148         to its own function.
3149         * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
3150
3151 2000-02-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3152
3153         * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
3154
3155 2000-02-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3156
3157         * parse.y (outer_field_access_p): Stop in time when outer contexts
3158         are exhausted.
3159         (resolve_qualified_expression_name): Properly qualify *everything*
3160         after a package.type to be resoled as expression names.
3161         (find_applicable_accessible_methods_list): Save/restore `class' to
3162         isolate it from a possible outer context search.
3163
3164 2000-02-15  Tom Tromey  <tromey@cygnus.com>
3165
3166         * gjavah.c (jni_print_char): New function.
3167         (print_full_cxx_name): Use it.
3168         (decode_signature_piece): Likewise.
3169         (print_cxx_classname): Likewise.
3170
3171 2000-02-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3172
3173         * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
3174         version.o.
3175         (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
3176
3177         * gjavah.c: Include version.h.
3178
3179         * jcf-dump.c: Likewise.
3180
3181         * jv-scan.c: Likewise.
3182
3183 Sat Feb 12 04:34:04 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3184
3185         * parse.y (outer_field_access_fix): First parameter now a tree
3186         node. Check for assignement to final. First argument to
3187         build_outer_field_access_fix modified to accomodate prototype.
3188         (build_outer_field_access): Don't check for assignment to final
3189         here.
3190         (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
3191         possibly returned by outer_field_access_fix. Changed
3192         outer_field_access_fix's first argument.
3193         (check_final_assignment): $finit$'s context is OK.
3194         (patch_unaryop): Use node instead of its line/column value when
3195         calling outer_field_access_fix.
3196
3197 Fri Feb 11 17:38:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3198
3199         * parse.y (interface_declaration:): No longer tagged
3200         <node>. Re-installed default action.
3201         (class_member_declaration:): Handle inner interfaces.
3202         (interface_member_declaration): Handle inner interfaces and
3203         classes.
3204         (create_interface): Push error if one seen. Suspend parsing
3205         context when processing an inner interface.
3206         (register_fields): Inner class static field limitations not to
3207         apply to inner interfaces.
3208
3209 Thu Feb 10 22:07:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3210
3211         * jcf-parse.c (load_class): Update `java_error_count' when a
3212         class' file can't be found.
3213         (parse.y): Avoid (byte)code generation when errors seen.
3214
3215 Thu Feb 10 20:10:43 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3216
3217         * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
3218         decodes a valid node.
3219         (patch_binop): Handle TRUNC_DIV_EXPR.
3220
3221 Thu Feb 10 16:04:26 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3222
3223         * parse.y (resolve_package): New local `acc'. Try to progressively
3224         build and guess a package and type name.
3225
3226 Thu Feb 10 12:52:09 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3227
3228         * parse.y (find_applicable_accessible_methods_list): Load and
3229         layout the search class if necessary.
3230         (java_complete_tree): Keep to original type of the folded initial
3231         value.
3232
3233 2000-02-09  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3234
3235         * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
3236         Generate error message if circularity is detected. New static
3237         local `list'.
3238         * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro.  *
3239         * jcf-write.c (generate_bytecode_insns): Very simply handle
3240         SAVE_EXPR.
3241         * parse.y (java_check_circular_reference): Use
3242         `cyclic_inheritance_report' during report, if necessary.
3243         (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
3244         walking NEW_ARRAY_INIT twice.
3245
3246 2000-02-09  Tom Tromey  <tromey@cygnus.com>
3247
3248         * parse.y (check_class_interface_creation): Allow inner classes to
3249         be `private' or `protected', check modifiers' consistency. Prevent
3250         block local classes from bearing any modifiers.
3251
3252 2000-02-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3253
3254         * except.c (check_start_handlers): Re-add prototype lost in last
3255         patch.
3256         (maybe_start_try): Remove excess argument to `check_start_handlers'.
3257
3258 2000-02-09  Andrew Haley  <aph@cygnus.com>
3259
3260         * decl.c (clear_binding_level): Remove excess initializer.
3261         (maybe_poplevels): Remove unused variable.
3262         (force_poplevels): Ditto.
3263         (struct binding_level): Add comment.
3264
3265 2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3266
3267         * jcf-write.c (generate_classfile): Don't consider
3268         pre-initialization with reference value (use <clinit> instead.)
3269         * parse.y (java_fix_constructors): No generated constructor for
3270         interfaces.
3271         (build_outer_field_access): Removed debug message.
3272         (outer_field_expanded_access_p): Adapted to bytecode generation.
3273         (build_outer_field_access_method): Use fix_method_argument_names.
3274         (build_outer_method_access_method): Fixed indentation. Added
3275         comment. Handle access method generation for static and also void
3276         methods.
3277         (build_access_to_thisn): Inserted debug message.
3278         (maybe_build_thisn_access_method): Use fix_method_argument_names.
3279         (resolve_qualified_expression_name): Fixed comment.
3280         (not_accessible_p): Adapted to bytecode generation. Added comment.
3281         (patch_method_invocation): Added comment.
3282         (maybe_use_access_method): Fixed leading comment. Handle static
3283         methods.
3284         (java_complete_lhs): Don't shortcut handling of initialized upon
3285         declaration String type static fields when generating bytecode.
3286         (patch_unaryop): Handle outer field access when generating
3287         bytecode.
3288
3289 Thu Feb  3 20:23:19 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3290
3291         * java-tree.h (FIELD_THISN): New macro.
3292         * jcf-write.c (append_synthetic_attribute): New function.
3293         (generate_classfile): Set "Synthetic" attribute on this$<n>,
3294         val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
3295         * parse.y (add_inner_class_fields): Set FIELD_THISN for created
3296         this$<n> fields.
3297         (build_outer_field_access): Turned on access functions usage and
3298         generation when compiling to bytecode.
3299         (maybe_use_access_method): Likewise.
3300
3301 2000-01-25  Andrew Haley  <aph@cygnus.com>
3302
3303         * java-except.h (struct eh_range): Add `expanded' field.
3304         (maybe_start_try): Add end_pc arg.
3305         (maybe_end_try): Ditto.
3306         * java-tree.h (force_poplevels): new function.
3307         * expr.c (expand_byte_code): Don't call maybe_start_try or
3308         maybe_end_try.
3309         * except.c (add_handler): Reset expanded.
3310         (expand_start_java_handler): Set expanded.
3311         (check_start_handlers): Don't expand a start handler that's
3312         already been expanded.
3313         (maybe_start_try): Add end_pc arg.  Only expand a handler which
3314         ends after end_pc.
3315         (expand_end_java_handler): call force_poplevels.
3316         (force_poplevels): new function.
3317         * decl.c (binding_level): Add start_pc of binding level.
3318         (maybe_pushlevels): Call maybe_start_try when pushing binding
3319         levels.
3320         (maybe_poplevels): Call maybe_end_try when popping binding levels.
3321         (LARGEST_PC): Define.
3322         (clear_binding_level): Use LARGEST_PC.
3323
3324         * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
3325         * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
3326         (binding_depth, is_class_level, current_pc): new variables.
3327         (struct binding_level): ditto.
3328         (indent): new function.
3329         (push_jvm_slot): add debugging info.
3330         (maybe_pushlevels): ditto.
3331         (maybe_poplevels): ditto.
3332         (pushlevel): ditto.
3333         (poplevel): ditto.
3334         (start_java_method): ditto.
3335         (give_name_to_locals): comment only.
3336         * except.c (binding_depth, is_class_level, current_pc):
3337         new variables.
3338         (expand_start_java_handler): add debugging info.
3339         (expand_end_java_handler): ditto.
3340
3341 2000-02-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3342
3343         * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
3344         (print_name_for_stub_or_jni, process_file): Constify a char*.
3345
3346 2000-02-03  Tom Tromey  <tromey@cygnus.com>
3347
3348         * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
3349
3350 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
3351
3352         * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
3353         assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
3354         defined to be 1.
3355
3356 Wed Feb  2 18:43:37 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3357
3358         * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
3359         * java-tree.h (TYPE_II_STMT_LIST): New macro.
3360         (struct lang_type): New field `ii_block'.
3361         * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
3362         CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
3363         * parse.h (struct parser_ctxt): New field `instance_initializers'.
3364         (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
3365         CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
3366         CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
3367         macros.
3368         * parse.y (add_instance_initializer): New function.
3369         (in_instance_initializer): New static global.
3370         (class_body_declaration:): Link instance initializer block.
3371         (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
3372         (array_creation_expression:): Remove unused local.
3373         (java_parser_context_push_initialized_field): Fixed leading
3374         comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
3375         CPC_INSTANCE_INITIALIZER_LIST.
3376         (java_parser_context_pop_initialized_field): Likewise.
3377         (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
3378         (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
3379         CPC_INITIALIZER_STMT.
3380         (fix_constructors): New local `class_type'. Use it. Call
3381         add_instance_initializer.
3382         (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
3383         (patch_return): Forbid return in instance initializers.
3384         (patch_throw_statement): Enforce exception handling in the context
3385         of instance initializers.
3386
3387 2000-02-03  Tom Tromey  <tromey@cygnus.com>
3388
3389         * Make-lang.in (java.mostlyclean): Remove executables in
3390         `mostlyclean'.
3391
3392 2000-01-31  Scott Bambrough  <scottb@netwinder.org>
3393
3394         * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
3395         HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
3396         (java_float_finite): Convert to use union Word from javaop.h.
3397         (java_double_finite): Convert to use union DWord from javaop.h.
3398
3399 2000-02-02  Tom Tromey  <tromey@cygnus.com>
3400
3401         * gjavah.c (options): Added `jni' entry.
3402         (help): Document -jni.
3403         (flag_jni): New global.
3404         (process_file): Handle JNI output.  Don't print text from
3405         -prepend, -add, etc, when generating stubs.  Only remove `.class'
3406         suffix if it actually exists.
3407         (main): Create a `.c' file when run with `--jni --stubs'.  Create
3408         correct output file name with `--jni'.
3409         (print_include): Mangle header name differently in JNI case.
3410         (HANDLE_METHOD): In JNI mode, call print_method_info to generate
3411         method list.
3412         (print_method_info): Handle JNI case.  Put signature info into
3413         method name.  Handle case when STREAM is NULL.
3414         (print_name_for_stub_or_jni): New function.
3415         (print_stub_or_jni): Renamed from `print_stub'.  Handle JNI.
3416         (print_cxx_classname): Handle JNI.
3417         (print_full_cxx_name): Likewise.
3418         (decode_signature_piece): Likewise.
3419         (overloaded_jni_method_exists_p): New function.
3420         (struct method_name): Added `signature' and `sig_length' fields.
3421         (HANDLE_END_FIELD): Do nothing in JNI mode.
3422
3423 2000-02-02  Tom Tromey  <tromey@cygnus.com>
3424
3425         * jv-scan.c: Include version.c, <getopt.h>.
3426         (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
3427         (options): New array.
3428         (usage): New function.
3429         (version): New function.
3430         (main): Use getopt_long to parse command line.
3431         * jcf-dump.c: Include version.c, <getopt.h>.
3432         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
3433         OPT_JAVAP): New macros.
3434         (options): New array.
3435         (usage): Return `void'.  Changed message.
3436         (help): New function.
3437         (version): New function.
3438         (main): Use getopt_long_only to parse command line.
3439         * gjavah.c: Include <getopt.h>.
3440         (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
3441         OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
3442         OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
3443         (options): New array.
3444         (java_no_argument): Removed.
3445         (help): Updated with missing options.
3446         (main): Use getopt_long_only to parse command line.
3447         (usage): Changed message.
3448
3449 Tue Feb  1 22:23:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3450
3451         * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
3452         * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
3453         ANONYMOUS_ARRAY_INITIALIZER): New access macros.
3454         * parse.y (array_creation_expression:): Handle anonymous arrays.
3455         (build_array_from_name): Don't set `ret_name' if null.
3456         (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
3457         (qualify_ambiguous_name): Likewise.
3458         (java_complete_expand_class): Likewise.
3459
3460 Tue Feb  1 14:59:35 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3461
3462         * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
3463         * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
3464         (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
3465         (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
3466         (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
3467         AIPL_FUNCTION_COMPLETED_INVOCATION.
3468         (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
3469         AIPL_FUNCTION_INVOCATION_READY.
3470         (AIPL_FUNCTION_DECLARATION): New enum entry.
3471         * parse.y (reorder_static_initialized): New function.
3472         (java_parser_context_pop_initialized_field): Use it.
3473         (add_inner_class_fields): Use
3474         MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
3475         augmented. Install marker after last alias initializer, if any.
3476         (generate_finit): Fixed typo. Don't try to retain only the used
3477         fields.
3478         (method_header): Compute and set DECL_FUNCTION_NAP.
3479         (method_declarator): Fixed comment. Insert alias initializer in
3480         parameter list.
3481         (build_alias_initializer_parameter_list): Fixed leading
3482         comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
3483         replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
3484         (java_complete_expand_class): Code to retain only used aliases
3485         removed.
3486         (java_complete_expand_methods): New local `first_decl'. Generate
3487         $finit$ first, then expand the constructors, regular methods and
3488         <clinit>.
3489         (java_complete_expand_method): Don't report error on missing
3490         return statement if previously detected bogus.
3491         (fix_constructors): Don't patch constructor parameters list.
3492         (patch_method_invocation): Use new AIPL enum values. Reverse
3493         alias initializer list for anonymous classes.
3494
3495 2000-01-30  Anthony Green  <green@redhat.com>
3496
3497         * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
3498         determine how many stack slots to pop.
3499
3500 2000-01-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3501
3502         * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
3503         error handling/recovery.
3504         * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
3505
3506 Fri Jan 28 20:10:57 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3507
3508         * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
3509         FIELD_LOCAL_ALIAS_USED): New macros.
3510         (DECL_FUNCTION_NAP): New macro.
3511         (struct lang_decl): New field `nap'.
3512         (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
3513         (struct lang_type): New fields `finit_stmt_list' and
3514         `clinit_stmt_list'.
3515         (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
3516         * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
3517         (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
3518         UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
3519         (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
3520         AIPL_FUNCTION_INVOCATION_READY): New enum fields.
3521         (BUILD_THROW): Macro line separator re-indented.
3522         * parse.y (end_class_declaration): New function.
3523         (maybe_generate_pre_expand_clinit): New name for
3524         java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
3525         pre-expand static fields.
3526         (maybe_generate_clinit): Function deleted.
3527         (check_for_static_method_reference): Prototype's parameter list
3528         indented.
3529         (generate_finit): New name for maybe_generate_finit. Changed
3530         leading comment. Function rewritten to use
3531         TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
3532         (build_alias_initializer_parameter_list): New function.
3533         (java_parser_context_pop_initialized_field): Likewise.
3534         (add_inner_class_fields): Likewise.
3535         (type_declaration:): Call end_class_declaration.
3536         (class_member_declaration:): Likewise.
3537         (formal_parameter_list:): Fixed typos.
3538         (formal_parameter:): Use ARG_FINAL_P to mark created tree list
3539         element. Improved error handling.
3540         (block_statement:): Call end_class_declaration.
3541         (anonymous_class_creation:): Likewise.
3542         (create_anonymous_class): Fixed comments.
3543         (create_class): Call add_inner_class_fields.
3544         (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
3545         (method_header): Use MARK_FINAL_PARMS.
3546         (finish_method_declaration): Use UNMARK_FINAL_PARMS.
3547         (method_declarator): Propagate final argument flag.
3548         (craft_constructor): New local `artificial'. Call
3549         build_alias_initializer_parameter_list. Use
3550         CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
3551         (source_start_java_method): Mark parm decls with LOCAL_FINAL if
3552         necessary.
3553         (complete_expand_class): Get rid of unused outer context local
3554         alias fields.
3555         (java_complete_expand_methods): Fixed leading
3556         comment. Generate/pre-expand <clinit> first. Changed method
3557         expansion order to regular, $finit$, constructors, <clinit>.
3558         (java_complete_expand_method): Set current_function_decl.
3559         (fix_constructors): Fix constructor parameter list to account for
3560         outer context local alias initializers.
3561         (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
3562         (resolve_expression_name): Lookup outer context local aliases. New
3563         local `access', use it.
3564         (patch_method_invocation): Patch inner class ctor invocation with
3565         outer context local aliases initialization values. $finit$
3566         invocation patching now includes things generated with
3567         build_alias_initializer_parameter_list.
3568         (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
3569         (build_super_invocation): Likewise.
3570         (patch_assignment): Changed comment.
3571
3572 2000-01-27  Andrew Haley  <aph@cygnus.com>
3573
3574         * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
3575         (emit_if): Ditto.
3576         (emit_jsr): Ditto.
3577
3578 2000-01-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3579
3580         * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
3581         concatenation.
3582         (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
3583
3584         * parse.y (register_fields): Don't pass a format specifier to
3585         OBSOLETE_MODIFIER_WARNING.
3586         (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
3587         instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
3588         specifier.
3589         (check_modifiers): Change function into a macro.
3590         (check_class_interface_creation): Pass a literal format string.
3591
3592 2000-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3593
3594         * buffer.h: PROTO -> PARAMS.
3595         * check-init.c: Likewise.
3596         * class.c: Likewise.
3597         * constants.c: Likewise.
3598         * convert.h: Likewise.
3599         * decl.c: Likewise.
3600         * except.c: Likewise.
3601         * expr.c: Likewise.
3602         * gjavah.c: Likewise.
3603         * java-except.h: Likewise.
3604         * java-tree.h: Likewise.
3605         * jcf-depend.c: Likewise.
3606         * jcf-dump.c: Likewise.
3607         * jcf-parse.c: Likewise.
3608         * jcf-path.c: Likewise.
3609         * jcf-reader.c: Likewise.
3610         * jcf-write.c: Likewise.
3611         * jcf.h: Likewise.
3612         * jv-scan.c: Likewise.
3613         * jvgenmain.c: Likewise.
3614         * jvspec.c: Likewise.
3615         * lang.c: Likewise.
3616         * lex.c: Likewise.
3617         * lex.h: Likewise.
3618         * parse-scan.y: Likewise.
3619         * parse.h: Likewise.
3620         * parse.y: Likewise.
3621         * typeck.c: Likewise.
3622         * verify.c: Likewise.
3623         * xref.c: Likewise.
3624         * xref.h: Likewise.
3625         * zextract.c: Likewise.
3626         * zipfile.h: Likewise.
3627
3628 2000-01-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3629
3630         * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
3631         (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
3632         * constants.c (build_constant_data_ref): Check for cached
3633         current_constant_pool_data_ref. Cache current_constant_pool_data_ref
3634         in TYPE_CPOOL_DATE_REF.
3635         * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
3636         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
3637         (struct lang_type): New fields `cpool' and `cpool_data_ref'.
3638         (LOCAL_FINAL): New macro.
3639         * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
3640         constant pool -- don't try to reuse.
3641         (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
3642         TYPE_LANG_SPECIFIC.
3643         (find_in_current_zip): Use TYPE_JCF.
3644         * parse.h (java_check_final): Prototype removed.
3645         * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
3646         (maybe_create_class_interface_decl,
3647         check_class_interface_creation): Likewise.
3648         (java_expand_finals): Function removed.
3649         (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
3650         (block_statement:): Fixed comment.
3651         (anonymous_class_creation:): Likewise.
3652         (check_class_interface_creation): Reversed Jan 12, 2000 extra
3653         argument patch.
3654         (check_class_interface_creation): Loosened error report on (inner)
3655         public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
3656         (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
3657         (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
3658         argument patch.
3659         (create_interface): Likewise.
3660         (anonymous_class_counter): New static global.
3661         (create_anonymous_class): Reversed Jan 12, 2000 extra argument
3662         patch. Fixed comments.
3663         (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
3664         anonymous_class_counter when declaring a toplevel class.
3665         (craft_constructor): Fixed constructor name when handling
3666         anonymous classes. Anonymous class constructors to feature hidden
3667         this$<n> parameter.
3668         (java_fix_constructors): Added comment.
3669         (java_check_final): Function removed.
3670         (java_complete_expand_methods): Fixed comment. Don't generate
3671         class data, save its outgoing constant pool instead.
3672         (verify_constructor_super): Skip anonymous class constructor
3673         hidden this$<n> parameter.
3674         (java_expand_classes): New local `saved_ctxp'. Removed call to
3675         java_expand_finals and java_check_final. Expand anonymous class
3676         constructors. Generate class data.
3677         (build_super_invocation): Skip anonymous class hidden this$<n>
3678         parameter.
3679         * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
3680         MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
3681         (set_java_signature): Likewise.
3682
3683 Mon Jan 18 14:30:09 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
3684
3685         * gjavah.c: Delete ACC_VISIBILITY define.
3686         * jcf.h: Add ACC_VISIBILITY define.
3687         * parse.y: final: rule tagged <value>.
3688         (java_check_regular_methods): Use ACC_VISIBILITY define for
3689         default package access check.
3690         (local_variable_declaration_statement): Use final: rule.
3691
3692 Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>
3693
3694         * parse.y (format_parameter:): Use final: rule instead of modifiers:.
3695         (final:): New rule.
3696
3697 2000-01-17  Tom Tromey  <tromey@cygnus.com>
3698
3699         * gjavah.c (print_field_info): Allow non-static final fields.
3700
3701 Fri Jan 14 18:03:41 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3702
3703         * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
3704         * parse.y (patch_anonymous_class): New function.
3705         (create_anonymous_class): Register incomplete type when the
3706         class/interface to extends/implement isn't known yet.
3707         (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
3708         (verify_constructor_super): Tuned error message.
3709
3710 Fri Jan 14 00:14:24 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3711
3712         * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
3713         (ANONYMOUS_CLASS_P): New macro.
3714         (TYPE_SIGNATURE, TYPE_JCF): New macros.
3715         (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
3716         * parse.y (create_class): Added leading argument.
3717         (maybe_create_class_interface_decl,
3718         check_class_interface_creation): Likewise.
3719         (craft_constructor): New function.
3720         (verify_constructor_super): Added argument in prototype.
3721         (class_declaration:): Inserted leading argument.
3722         (for_begin:): Use FOR_LOOP_P.
3723         (anonymous_class_creation): Create WFL of the anonymous class to
3724         instantiate. Call build_new_invocation. Added comments.
3725         (check_class_interface_creation): Handle parameter `anonymous' in
3726         verbose mode class creation announce.
3727         (link_nested_class_to_enclosing): Exclude anonymous classes.
3728         (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
3729         anonymous class, even though they appear to have an enclosing
3730         context.
3731         (create_interface): Pass extra argument to
3732         check_class_interface_creation.
3733         (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
3734         (create_class): Call check_class_interface_creation and
3735         maybe_create_class_interface_decl with extra new argument. Don't
3736         add private this$<n> to anonymous classes.
3737         (method_declarator): Insert hidden this$<n> to anonymous class
3738         constructors.
3739         (java_fix_constructors): Deleted code creating default
3740         constructor. Call craft_constructor instead.
3741         (java_check_regular_methods): Set `saw_constructor' to 1 for
3742         anonymous classes.
3743         (fix_constructors): Pass extra argument to verify_constructor_super.
3744         (verify_constructor_super): New local `sdecl', use it. Search for
3745         matching constructor (possibly featuring arguments) in super
3746         class.
3747         (lookup_method_invoke): Craft constructor according to arguments
3748         list when dealing with anonymous class constructors.
3749         (build_super_invocation): Pass arguments to anonymous class super
3750         constructors.
3751         (search_loop): Use FOR_LOOP_P.
3752         (labeled_block_contains_loop_p): Likewise.
3753
3754 Wed Jan 12 00:38:47 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3755
3756         * class.c (set_super_info): Set CLASS_STATIC when appropriate.
3757         (enclosing_context_p): New function.
3758         (get_access_flags_from_decl): Handle CLASS_STATIC.
3759         (maybe_layout_super_class): Extra first argument passed to
3760         do_resolve_class.
3761         (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
3762         ID_INIT_P.
3763         * decl.c (access0_identifier_node): New global.
3764         (init_decl_processing): access0_identifier_node initialized.
3765         (pushdecl): Set DECL_CONTEXT only on non type decls.
3766         * expr.c (lookup_field): Lookup inner class fields in enclosing
3767         contexts.
3768         (expand_invoke): Use ID_INIT_P.
3769         (expand_java_field_op): Use DECL_CLINIT_P.
3770         * java-tree.def (CLASS_LITERAL): New tree code.
3771         * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
3772         DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
3773         (struct lang_decl): New field `inner_access'.
3774         (enclosing_context_p): Prototyped.
3775         (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
3776         ID_CLINIT_P): New macros.
3777         (CLASS_STATIC): New macro.
3778         (CLASS_ACCESS0_GENERATED_P): New macro.
3779         (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
3780         TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
3781         INNER_CLASS_P): New macros.
3782         (DECL_INNER_CLASS_LIST): New macro.
3783         * jcf-parse.c (yyparse): Avoid the use of ANSI string
3784         concatenation.
3785         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3786         the shift value to int. Fixed typo in comment.
3787         * lex.c (inst_id, wpv_id): Initialize.
3788         * mangle.c (unicode_mangling_length): Take `$' into account.
3789         * parse.h (DRECOVER, RECOVER): Terminate properly.
3790         (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
3791         (typedef struct _jdep): New field `enclosing'.
3792         (JDEP_ENCLOSING): New macro.
3793         (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
3794         (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
3795         (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
3796         GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
3797         GET_ENCLOSING_CPC_CONTEXT): New macros.
3798         (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
3799         (do_resolve_class): Added extra argument in prototype.
3800         * parse.y (resolve_class): Added extra argument in prototype.
3801         (maybe_create_class_interface_decl): Likewise.
3802         (maybe_use_access_method, build_wfl_wrap): New functions.
3803         (java_complete_expand_classes, java_complete_expand_class):
3804         Likewise.
3805         (java_parser_context_push_initialized_field,
3806         java_parser_context_suspend, java_parser_context_resume):
3807         Likewise.
3808         (maybe_make_nested_class_name, make_nested_class_name,
3809         set_nested_class_simple_name_value,
3810         link_nested_class_to_enclosing, find_as_inner_class,
3811         find_as_inner_class_do, check_inner_class_redefinition,
3812         build_thisn_assign, build_current_thisn, build_access_to_thisn,
3813         maybe_build_thisn_access_method, build_outer_field_access,
3814         build_outer_field_access_methods, build_outer_field_access_expr,
3815         build_outer_method_access_method, build_new_access_id,
3816         build_outer_field_access_method, outer_field_access_p,
3817         outer_field_expanded_access_p, outer_field_access_fix,
3818         build_incomplete_class_ref, patch_incomplete_class_ref,
3819         create_anonymous_class): Likewise.
3820         (inst_id, wpv_id): New static global variables.
3821         (synchronized:): New rule, tagged <node>.
3822         (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
3823         rules.
3824         (anonymous_class_creation:): New rule, tagged <node>.
3825         (NEW_TK): Tagged <node>.
3826         (type_literals, array_type_literal): New rules, tagged <node>.
3827         (class_declaration:): Removed action when reducing by class_body:
3828         (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
3829         using GET_CPC in sub-rules.
3830         (class_member_declaration): Handle inner classes.
3831         (method_declaration): When reducing method_header:, reset
3832         current_function_decl when appropriate.
3833         (method_declarator:): Set the number of formal parameter to 0 for
3834         method declared without arguments.
3835         (constructor_declarator:): Likewise.
3836         (static_initializer:): List of elements kept in a list.
3837         (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
3838         use of the keyword `static' for type declarations.
3839         (block_statement:): Handle inner class declarations.
3840         (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
3841         type qualified `this'.
3842         (class_instance_creation_expression): Use anonymous_class_creation:
3843         to handle inner class instances creation. Handle qualified `new'.
3844         (something_dot_new): Added appropriate actions.
3845         (create_new_parser_context): New function.
3846         (java_push_parser_context, java_parser_context_save_global,
3847         java_parser_context_suspend): Use create_new_parser_context.
3848         (check_modifiers): Changed leading comment.
3849         (check_class_interface_creation): Handle interclasses.
3850         (add_superinterfaces): Fixed comment.
3851         (create_interface): Build qualified name from the raw_name instead
3852         of its matching WFL. Push the initialized fields list. raw_name added
3853         as an extra argument to maybe_create_class_interface_decl.
3854         (create_class): Build qualified name from the raw_name instead of
3855         its matching WFL. Removed assignment to current_parsed_class_un.
3856         Call PUSH_ERROR before returning an error. Suspend the current
3857         parser context when processing an inner class. Push the
3858         initialized fields list. raw_name added as an extra argument to
3859         maybe_create_class_interface_decl. Add the private this$<n>
3860         field.
3861         (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
3862         (register_fields): Get the class type from GET_CPC and handle
3863         previous errors.  Added code to handle the creation of static
3864         fields in inner classes. Initialized fields initialization
3865         statements kept in a list of lists.
3866         (maybe_generate_finit): Initialized fields initialization
3867         statements kept in a list of lists. Use GET_CPC.
3868         (maybe_generate_clinit): Likewise.
3869         (method_header): Use GET_CPC and GET_CPC_UN.
3870         (parser_qualified_classname): Handle inner classes.
3871         (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
3872         (java_fix_constructors): Hide pointer to enclosing context
3873         instance in constructor list when dealing with inner classes.
3874         (jdep_resolve_class): Call resolve_class with extra first argument
3875         JDEP_ENCLOSING.
3876         (resolve_class): Add enclosing context as a first extra argument
3877         to do_resolve_class.
3878         (do_resolve_class): Call find_as_inner_class. Handle WFLs
3879         properly.
3880         (resolve_no_layout): Extra argument added to resolve_class
3881         invocation.
3882         (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
3883         (java_get_real_method_name): Use GET_CPC_UN.
3884         (check_abstract_method_definitions): Use DECL_CLINIT_P.
3885         (java_check_abstract_methods): Handle static method declared in
3886         inner classes by an error.
3887         (java_check_regular_methods): Use DECL_CLINIT_P.
3888         (source_start_java_method): Also set DECL_MAX_LOCALS.
3889         (create_artificial_method): Call java_parser_context_save_global
3890         and java_parser_context_restore_global instead of saving/restoring
3891         the context by hand.
3892         (expand_start_java_method): Improved verbose mode message.
3893         (java_complete_expand_methods): Fixed leading comment. Use
3894         DECL_CLINIT_P.
3895         (fix_constructors): Added assignment to this$<n> if necessary.
3896         (java_expand_classes): Call java_complete_expand_classes instead
3897         of java_complete_expand_methods.
3898         (make_qualified_primary): Simplified.
3899         (merge_qualified_name): Optimized for missing left or right parts.
3900         (resolve_expression_name): Handle access to outer class fields from
3901         interclasses.
3902         (resolve_qualified_expression_name): New macro
3903         RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
3904         classes. Report error on non appropriate qualification of
3905         `new'. Handle qualified `this'.
3906         (not_accessible_p): Allow access to outer class private fields from
3907         inner classes.
3908         (patch_method_invocation): Handle method invocations through
3909         access methods and inner class constructor invocations.
3910         (find_applicable_accessible_methods_list): Search enclosing
3911         contexts of an inner class.
3912         (search_applicable_methods_list): Fixed typo.
3913         (argument_types_convertible): Handle inner class constructors'
3914         hidden outer context reference argument.
3915         (qualify_ambiguous_name): Handle qualified `this'.
3916         (java_complete_lhs): Handle use of field accessed through
3917         artificial access methods in various cases of assignments. Handle
3918         CLASS_LITERAL node.
3919         (check_final_assignment): Use DECL_CLINIT_P.
3920         (valid_ref_assignconv_cast_p): Handle the destination being an
3921         enclosing context of the source.
3922         (patch_unaryop): Handle use of field accessed through artificial
3923         access methods.
3924         (patch_return): Use DECL_CLINIT_P.
3925         (patch_throw_statement): Use DECL_CLINIT_P.
3926         (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
3927         * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
3928         ID_INIT_P.
3929
3930 2000-01-16  Anthony Green  <green@cygnus.com>
3931
3932         * parse.y (build_string_concatenation): Only use
3933         StringBuffer(String) shortcut if String arg is constant.
3934
3935 Wed Jan 12 20:20:11 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3936
3937         * jcf-write.c (generate_bytecode_insns): binop: Change the type of
3938         the shift value to int. Fixed typo in comment.
3939
3940 2000-01-11  Mumit Khan  <khan@xraylith.wisc.edu>
3941
3942         * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
3943         * jcf-write.c: Likewise.
3944         * parse.y: Likewise.
3945         * parse.c: Regenerate.
3946
3947 2000-01-09  Anthony Green  <green@cygnus.com>
3948
3949         * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
3950         bytecodes in the correct order.
3951
3952 2000-01-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3953
3954         * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
3955
3956 Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>
3957
3958         * expr.c (java_lang_expand_expr): Switch to permanent obstack
3959         before building constant array decl.
3960
3961 Thu Jan  6 00:54:10 2000  Alexandre Petit-Bianco  <apbianco@cygnus.com>
3962
3963         * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
3964         method invocation and typo in conditional expression.
3965         (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
3966         the appropriate NOTE_POP.
3967         * parse.y (patch_binop): Shift value mask to feature the right
3968         type.
3969
3970 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3971
3972         * class.c (assume_compiled, assume_compiled_node): Add static
3973         prototype.
3974         (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
3975
3976         * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
3977
3978         * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
3979
3980         * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
3981         to `__modifier' to avoid stringifying it.
3982
3983         * parse.y (verify_constructor_circularity): Don't call a variadic
3984         function with a non-literal format string.
3985         (java_check_abstract_methods): Move unreachable code inside
3986         `continue' statement.
3987         (lookup_method_invoke): Call xstrdup, not strdup.
3988
3989         * expr.c (expand_java_field_op): Avoid the use of ANSI string
3990         concatenation.
3991
3992         * jcf-parse.c (yyparse): Likewise.
3993
3994         * jv-scan.c (main): Likewise.
3995
3996 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3997
3998         * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
3999         ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
4000         ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
4001         concatenation.
4002
4003         * parse.y (synchronized, variable_redefinition_error,
4004         check_class_interface_creation, create_interface, create_class,
4005         method_header, finish_method_declaration,
4006         check_modifiers_consistency, method_declarator,
4007         complete_class_report_errors, check_abstract_method_definitions,
4008         java_check_regular_methods, check_throws_clauses,
4009         java_check_abstract_methods, read_import_dir,
4010         check_pkg_class_access, declare_local_variables, fix_constructors,
4011         cut_identifier_in_qualified, resolve_expression_name,
4012         resolve_qualified_expression_name, patch_method_invocation,
4013         java_complete_lhs, patch_assignment, try_builtin_assignconv,
4014         patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
4015         patch_exit_expr, patch_exit_expr, patch_switch_statement,
4016         patch_try_statement, patch_synchronized_statement,
4017         patch_throw_statement, check_thrown_exceptions,
4018         patch_conditional_expr): Likewise.
4019
4020 Fri Dec 24 00:25:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4021
4022         * Makefile.in (LIBDEPS): Added gcc's errors.o
4023         (../jcf-dump$(exeext):): Link with gcc's errors.o
4024         (../gcjh$(exeext):): Likewise.
4025         * expr.c (expand_java_NEW): Layout the entire target type instead of
4026         laying out its methods only.
4027         (lookup_field): Layout the class after having loaded it.
4028         * java-tree.h (java_debug_context): Declared.
4029         * jcf-io.c (toplev.h): Included.
4030         (find_class): Removed assignment to jcf's outofsynch
4031         field. Force source file to be read if newer than its matching
4032         class file. Tweaked debug messages.
4033         * jcf-parse.c (jcf_out_of_synch): Deleted.
4034         (read_class): Call to jcf_out_of_synch removed.
4035         * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
4036         (jcf_out_of_synch): Prototype deleted.
4037         * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
4038         `deprecated' and `class_err': integer turned into bit fields.
4039         New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
4040         * parse.y (package_list): New global.
4041         (package_declaration:): Record newly parsed package name.
4042         (extra_ctxp_pushed_p): Static global deleted.
4043         (java_parser_context_save_global): Create buffer context for the
4044         purpose of saving globals, if necessary.
4045         (java_parser_context_restore_global): Pop context pushed for the
4046         purpose of saving globals, if necessary.
4047         (java_debug_context_do): New prototype and function.
4048         (java_debug_context): Likewise.
4049         (do_resolve_class): Use already parsed package names to qualify
4050         and lookup class candidate.
4051         (java_pre_expand_clinit): Removed unnecessary local variable.
4052
4053 1999-12-17  Tom Tromey  <tromey@cygnus.com>
4054
4055         * gjavah.c (decode_signature_piece): Print "::" in JArray<>.  This
4056         fixes PR gcj/119.
4057         (process_file): Use `\n\' at end of each line in string.
4058
4059 Thu Dec 16 00:09:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4060
4061         * expr.c (expand_invoke): Layout the loaded class before
4062         attempting to use it.
4063         (expand_java_field_op): Allow final field assignments to take
4064         place in $finit$.
4065         * typeck.c (convert): Return error_mark_node if expr is null.
4066
4067 1999-12-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4068
4069         * class.c (class_depth): Return -1 if the class doesn't load
4070         properly.
4071         * expr.c (can_widen_reference_to): Check for errors during depth
4072         computation and return 0 accordingly.
4073         * jcf-parse.c (parse_source_file): Call java_fix_constructors to
4074         create default constructors and add an other error check.
4075         * parse.h (java_fix_constructors): Prototyped.
4076         * parse.y (java_pre_expand_clinit): Likewise.
4077         (build_super_invocation): Re-prototyped to feature one argument.
4078         (java_check_circular_reference): Directly use `current'.
4079         (java_fix_constructors): New function.
4080         (java_check_regular_methods): Don't create default constructors
4081         here, but abort if none were found.
4082         (java_complete_expand_methods): Pre-process <clinit> calling
4083         java_pre_expand_clinit.
4084         (java_pre_expand_clinit): New function.
4085         (fix_constructors): build_super_invocation invoked with the
4086         current method declaration as an argument.
4087         (build_super_invocation): Use the context of the processed method
4088         decl argument instead of current_class.
4089         * typeck.c (lookup_java_method): Take WFLs in method names into
4090         account.
4091
4092 Tue Dec 14 14:20:16 1999  Per Bothner  <per@bothner.com>
4093
4094         * class.c (make_class_data): flag_keep_inline_functions to keep
4095         private methods in the method array.
4096
4097 1999-12-15  Anthony Green  <green@cygnus.com>
4098
4099         * check-init.c (check_init): Take into account both types of
4100         `throw's when checking for uninitialized variables.
4101
4102 Fri Dec 10 21:53:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4103
4104         * parse.y (java_complete_lhs): Force convertion of array
4105         dimensions to int_type_node, that's what runtime's ABI expects.
4106
4107 Fri Dec 10 16:13:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4108
4109         * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
4110         operand of a WFL, until the Java front-end gets fixed with regard
4111         to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
4112
4113 1999-12-10  Andrew Haley  <aph@cygnus.com>
4114
4115         * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
4116         decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
4117         expr.c (build_java_athrow): Add support for sjlj-exceptions.
4118         java-tree.h: Ditto.
4119         jcf-write.c: Ditto.
4120
4121 Wed Dec  8 15:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4122
4123         * expr.c (java_lang_expand_expr): Switch to permanent obstack
4124         before calling expand_eh_region_start and expand_start_all_catch.
4125         * except.c (expand_start_java_handler): Switch to permanent
4126         obstack before calling expand_eh_region_start.
4127         (expand_end_java_handler): Switch to permanent obstack before
4128         calling expand_start_all_catch.
4129
4130 1999-12-5  Anthony Green  <green@cygnus.com>
4131
4132         * decl.c (init_decl_processing): Mark throw_node as a noreturn
4133         function with side effects.
4134         (init_decl_processing): Mark all memory allocating DECLs with
4135         DECL_IS_MALLOC.
4136
4137 Wed Dec  1 04:25:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4138
4139         * except.c (expand_end_java_handler): Call
4140         expand_resume_after_catch and end_catch_handler.
4141
4142 Tue Nov 30 12:36:15 1999  Anthony Green  <green@cygnus.com>
4143
4144         * verify.c (verify_jvm_instructions): Create new return label
4145         chain if non existant (don't rely on the verified state of the jsr
4146         target.)
4147
4148 Tue Nov 30 12:28:34 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4149
4150         * jcf-write.c (generate_bytecode_insns): Fixed indentation for
4151         COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
4152
4153         * parse.y (patch_assignment): Removed bogus final class test on
4154         lhs when checking on whether to emit an ArrayStoreException runtime
4155         check.
4156         * expr.c (expand_java_arraystore): Likewise.
4157
4158 1999-11-28 Anthony Green <green@cygnus.com>
4159
4160         * decl.c (find_local_variable): Reuse single slot decls when
4161           appropriate.
4162
4163 Wed Nov 24 17:33:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4164
4165         * jcf-parse.c (saw_java_source): Global variable removed.
4166         (read_class): Don't use `saw_java_source'. Added extra braces.
4167         (yyparse): Code setting `saw_java_source' removed.
4168
4169 1999-11-24  Mark Mitchell  <mark@codesourcery.com>
4170
4171         * except.c (emit_handlers): Zero catch_clauses after emitting them.
4172
4173 Tue Nov 23 17:29:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4174
4175         * verify.c (merge_type_state): Non verified subroutines being
4176         considered more than once to trigger passive type merge.
4177
4178 Tue Nov 23 10:55:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4179
4180         * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
4181         in case of error. Error message tuned.
4182
4183 1999-11-21  Anthony Green  <green@cygnus.com>
4184
4185         * constants.c (find_methodref_index): Unwrap method names before
4186         inserting them in the constant pool.
4187
4188         * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
4189
4190         * class.c (assume_compiled_node): New typedef.
4191         (assume_compiled_tree): New static data.
4192         (find_assume_compiled_node): New function.
4193         (add_assume_compiled): New function.
4194         (assume_compiled): New function.
4195         * class.c (make_class_data): Use assume_compiled.
4196         (is_compiled_class): Use assume_compiled.
4197
4198         * java-tree.h (add_assume_compiled): Declare.
4199
4200         * lang.c (lang_decode_option): Parse new options.
4201
4202 Wed Nov 17 21:09:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4203
4204         * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
4205         int_type_node: that's what `_Jv_AllocObject' expects.
4206
4207 Thu Nov 11 01:57:14 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4208
4209         * parse.y (lookup_method_invoke): Use lang_printable_name to
4210         reliably build the type name during error report. Fixes PR gcj/97.
4211
4212 1999-11-09  Tom Tromey  <tromey@cygnus.com>
4213
4214         * jcf-path.c: Include <sys/stat.h>.
4215         (jcf_path_init): Search for libjava.zip.  Fixes PR gcj/84.
4216         (DIR_UP): New macro.
4217
4218 Tue Nov  9 12:12:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4219
4220         * parse.y (source_end_java_method): Resume permanent allocation,
4221         reversing Apr 27 1998 patch.
4222         (patch_string_cst): Pop obstacks after having pushed the permanent
4223         ones.
4224
4225 1999-11-05  Tom Tromey  <tromey@cygnus.com>
4226
4227         * class.c (finish_class): Emit inlined methods if any native
4228         methods exist in the class.  Fixes PR gcj/85.
4229
4230 Thu Nov  4 16:27:01 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4231
4232         * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
4233         (qualify_ambiguous_name): Likewise.
4234
4235 Wed Nov  3 15:20:02 MST 1999  Godmar Back <gback@cs.utah.edu>
4236
4237         * typeck.c: (lookup_java_method):  search all inherited
4238         interfaces when looking up interface method.
4239
4240 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4241
4242         * parse.y (method_header:): Issue error message for rule `type
4243         error'.
4244         (synchronized:): Error report when not using synchronized.
4245
4246 Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4247
4248         * parse.y (resolve_qualified_expression_name): Prevent `this' from
4249         being used before the superclass constructor has been called.
4250         (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
4251         instead of `CALL_THIS_CONSTRUCTOR_P'.
4252
4253 Sat Oct 30 21:35:13 1999  Todd T. Fries <todd@lighthouse.fries.net>
4254
4255         * check-init.c: Fix typo in comment.
4256
4257 Fri Oct 29 14:35:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4258
4259         * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
4260         and final method.
4261
4262 Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4263
4264         * parse.y (expression_statement:): Call function to report
4265         improper invocation of a constructor.
4266         (parse_ctor_invocation_error): New function.
4267
4268 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
4269
4270         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
4271         remember_end_note.
4272
4273 1999-10-21  Tom Tromey  <tromey@cygnus.com>
4274
4275         * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
4276         in generated `main'.
4277
4278 Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4279
4280         * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
4281         (qualify_ambiguous_name): Likewise.
4282
4283 Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4284
4285         * parse.y (java_complete_tree): fold_constant_for_init to work on
4286         permanent_obstack.
4287         (java_complete_lhs): Likewise.
4288         (array_constructor_check_entry): Complete an initializer element
4289         on permanent_obstack.
4290
4291 1999-10-19  Tom Tromey  <tromey@cygnus.com>
4292
4293         * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
4294         From Mike Moreton <mike@pillim.demon.co.uk>.
4295
4296 1999-10-15  Greg McGary  <gkm@gnu.org>
4297
4298         * java-tree.h (flag_bounds_check): Remove extern decl.
4299         * lang.c (flag_bounds_check): Remove global variable.
4300         (lang_f_options): Remove "bounds-check" entry.
4301         (lang_init_options): Default flag_bounds_check to "on".
4302
4303 1999-10-14  Tom Tromey  <tromey@cygnus.com>
4304
4305         * jvgenmain.c (usage): New function.
4306         (main): Use it.  Also, handle `-D' options.
4307         * jvspec.c (lang_specific_driver): Recognize -D.
4308         (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
4309
4310         * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
4311
4312 1999-10-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4313
4314         * jcf-dump.c (print_constant, disassemble_method): Don't call a
4315         variadic function with a non-literal format string.
4316
4317         * parse-scan.y (report_main_declaration): Likewise.
4318
4319         * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
4320
4321         * parse.y (read_import_dir, patch_assignment, patch_binop,
4322         patch_array_ref): Likewise.
4323
4324         * typeck.c (build_java_array_type): Likewise.
4325
4326         * verify.c (verify_jvm_instructions): Likewise.
4327
4328 Tue Oct 12 22:28:10 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4329
4330         * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
4331
4332 1999-10-07  Anthony Green  <green@cygnus.com>
4333
4334         * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
4335         where CHECK_PUT may fail for valid reasons.
4336
4337         * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
4338         UNSAFE_PUTN): New macros.
4339
4340 1999-10-04  Tom Tromey  <tromey@cygnus.com>
4341
4342         * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
4343         well.  Fixes Java PR gcj/59.
4344         * parse-scan.y (yyerror): Report errors.
4345
4346 Fri Sep 24 12:23:05 1999  Glenn Chambers  <GChambers@provsol.com>
4347
4348         * decl.c (insert_block): Remove unconditional `abort'.
4349
4350 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
4351
4352         * decl.c (builtin_function): No longer static.  New arg CLASS.  Arg
4353         FUNCTION_CODE now of type int.  All callers changed.
4354         Set the builtin's DECL_BUILT_IN_CLASS.
4355
4356 1999-09-23  Tom Tromey  <tromey@cygnus.com>
4357
4358         * jvspec.c (lang_specific_driver): Don't read spec file if
4359         -fsyntax-only given.
4360
4361 1999-09-22  Tom Tromey  <tromey@cygnus.com>
4362
4363         * lang-specs.h: Added `%(jc1)' to the jc1 spec.
4364
4365         * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
4366         (WORDS_TO_LONG): Likewise.
4367         (WORDS_TO_DOUBLE): Likewise.
4368
4369 Tue Sep 14 16:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4370
4371         * jcf-write.c (RELOCATION_VALUE_0): New macro.
4372         (RELOCATION_VALUE_1): Likewise.
4373         (emit_iinc, emit_reloc, push_constant1, push_constant2,
4374         push_in_const, push_long_const): Prototyped.
4375         (push_constant1): Argument `index' is of type HOST_WIDE_INT.
4376         (push_constant2): Likewise.
4377         (push_int_const): Cast find_constant1's integer arguments to `jword'.
4378         (find_constant_wide): Cast find_constant2's integer arguments to
4379         `jword'.
4380         (find_constant_index): Cast find_constant2's and find_constant2's
4381         integer arguments to `jword'.
4382         (emit_pop): Argument `value' is of type HOST_WIDE_INT.
4383         (emit_switch_reloc): Use RELOCATION_VALUE_0.
4384         (emit_if): Use RELOCATION_VALUE_1.
4385         (emit_goto): Likewise.
4386         (emit_jsr): Likewise.
4387         (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
4388         argument to push_long_const to HOST_WIDE_INT.
4389
4390 1999-09-15  Andreas Schwab  <schwab@suse.de>
4391
4392         * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
4393
4394 1999-09-20  Nick Clifton  <nickc@cygnus.com>
4395
4396         * lang.c (lang_decode_option): Extend comment.
4397
4398 Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4399
4400         * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
4401         instead of fndecl.
4402
4403 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4404
4405         * gjavah.c (get_field_name, print_method_info, print_include,
4406         add_namelet): Use xmalloc, not malloc.
4407
4408         * jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
4409         (munge): Use xrealloc, not realloc, trust xrealloc to handle a
4410         NULL pointer.
4411
4412         * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
4413
4414         * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
4415
4416         * jcf-path.c (add_entry): Likewise.
4417
4418         * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
4419
4420         * jv-scan.c (xmalloc): Remove definition.
4421
4422         * jvgenmain.c (xmalloc): Likewise.
4423
4424         * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
4425
4426         * lex.c (java_store_unicode): Use xrealloc, not realloc.
4427
4428         * parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
4429         concat, not xmalloc/sprintf.
4430         (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
4431         (xstrdup): Remove definition.
4432
4433         * parse.y (duplicate_declaration_error_p,
4434         constructor_circularity_msg, verify_constructor_circularity,
4435         check_abstract_method_definitions, java_check_regular_methods,
4436         java_check_abstract_methods, patch_method_invocation,
4437         check_for_static_method_reference, patch_assignment, patch_binop,
4438         patch_cast, array_constructor_check_entry, patch_return,
4439         patch_conditional_expr): Use xstrdup, not strdup.
4440
4441         * zextract.c (ALLOC): Use xmalloc, not malloc.
4442
4443 Sun Sep 12 23:30:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4444
4445         * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
4446
4447         * jvspec.c: Include gcc.h.  Don't include gansidecl.h.
4448         (do_spec, lang_specific_pre_link, lang_specific_driver,
4449         input_filename, input_filename_length): Don't declare.
4450         (main_class_name, jvgenmain_spec, lang_specific_driver):
4451         Constify a char*.
4452         (lang_specific_driver): All calls to the function pointer
4453         parameter now explicitly call `fatal'.
4454
4455 Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4456
4457         * parse.y (find_applicable_accessible_methods_list): Search
4458         abstract classes as interfaces.
4459
4460 Thu Sep  9 17:33:28 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4461
4462         * class.c (finish_class): We're now outside a valid method
4463         declaration. Tell the rest of gcc so.
4464
4465 1999-09-08  Bruce Korb  autogen@linuxbox.com
4466
4467         * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
4468
4469 1999-09-07  Tom Tromey  <tromey@cygnus.com>
4470
4471         * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
4472         java-array.h.
4473         (decode_signature_piece): Don't emit "::" in JArray<>.
4474         (print_namelet): Only print trailing `;' when printing a class.
4475
4476 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
4477
4478         * java-tree.h: Delete declarations for all tree nodes now moved to
4479         global_trees.
4480         * decl.c: Delete their definitions.
4481
4482 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
4483
4484         * Make-lang.in (jc1): Depend on ggc-callbacks.o.
4485         * Makefile.in (OBJS): Add ggc-callbacks.o.
4486         (OBJDEPS): Likewise.
4487
4488 1999-09-03  Tom Tromey  <tromey@cygnus.com>
4489
4490         * parse.y (strip_out_static_field_access_decl): Return operand if
4491         it satisfies JDECL_P.
4492
4493 1999-09-02  Tom Tromey  <tromey@cygnus.com>
4494
4495         * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
4496         Handle nested arrays, like `[[I'.
4497
4498 1999-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4499
4500         * class.c (finish_class): Remove unused parameter, all callers
4501         changed.
4502
4503         * expr.c (build_java_athrow): Change return type to void.
4504         (java_lang_expand_expr): Make sure each case in switch returns a
4505         value.
4506
4507         * java-tree.h (finish_class): Fix prototype to take void args.
4508
4509         * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
4510         (main): Issue return from main, not exit.
4511
4512         * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
4513
4514         * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
4515
4516         * jv-scan.c (main): Issue return from main, not exit.
4517
4518         * parse.y (check_abstract_method_definitions,
4519         java_check_abstract_method_definitions): Add static prototypes.
4520         (java_complete_expand_methods): Fix call to `finish_class'.
4521
4522         * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
4523         and `prevpc'.
4524
4525 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4526
4527         * lang.c (language_string): Constify.
4528
4529 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4530
4531         * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
4532         Remove hacks for stuff which comes from libiberty.
4533
4534         * Make-lang.in: Likewise.
4535
4536 Mon Aug 30 16:41:41 1999  Hans-Peter Nilsson  <hp@axis.se>
4537
4538         * Makefile.in (xref.o): Depend on xref.c explicitly.
4539
4540 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4541
4542         * java-tree.h (lang_printable_name): Constify a char*.
4543
4544         * lang.c (lang_printable_name): Likewise.
4545
4546 Fri Aug 27 23:31:57 1999  Jeffrey A Law  (law@cygnus.com)
4547
4548         * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
4549         comments in C code.
4550
4551 1999-08-26  Tom Tromey  <tromey@cygnus.com>
4552
4553         * gjavah.c (print_cxx_classname): Print "::" before qualified
4554         name.
4555
4556 Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4557
4558         * parse.y (lookup_cl): Changed leading comment. Now does its best
4559         to set the column number.
4560         (qualify_ambiguous_name): Take WFL wrappers into account.
4561
4562 Wed Aug 25 15:37:15 1999  Gregg Townsend  <gmt@cs.arizona.edu>
4563
4564         * verify.c (verify_jvm_instructions): Don't check instruction
4565         validity beyond end of method.
4566
4567 1999-08-25  Tom Tromey  <tromey@cygnus.com>
4568
4569         * jvspec.c (lang_specific_driver): Correctly handle --help again.
4570
4571 1999-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4572
4573         * gjavah.c (print_name, print_base_classname, utf8_cmp,
4574         cxx_keyword_subst, generate_access, name_is_method_p,
4575         get_field_name, print_field_name, super_class_name, print_include,
4576         decode_signature_piece, print_class_decls, usage, help,
4577         java_no_argument, version, add_namelet, print_namelet): Add static
4578         prototype.
4579         (print_base_classname, utf8_cmp, cxx_keyword_subst,
4580         name_is_method_p): Constify a char*.
4581         (get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
4582         Provide a final else clause in an if-else-if.
4583         (print_field_info): Add missing final arg in function call to
4584         `print_field_name'.
4585         (print_method_info, decompile_method, decode_signature_piece,
4586         print_c_decl, print_full_cxx_name, print_stub,
4587         print_mangled_classname, super_class_name, print_include,
4588         add_namelet, add_class_decl, print_class_decls, process_file,
4589         help): Constify a char*.
4590
4591         * jcf-write.c (jcf_handler, push_constant1, push_constant2,
4592         push_int_const, find_constant_wide, find_constant_index,
4593         push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
4594         emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
4595         emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
4596         emit_if, emit_goto, emit_jsr, call_cleanups,
4597         make_class_file_name): Add static prototypes.
4598         (generate_bytecode_return, generate_bytecode_insns): Pass a
4599         NULL_PTR, not a NULL_TREE.
4600
4601         * jv-scan.c: Include "jcf.h".
4602         (main): Declare using DEFUN macro.
4603
4604         * jvspec.c (find_spec_file, lang_specific_pre_link,
4605         lang_specific_driver): Add prototypes.
4606         (find_spec_file): Constify a char*.
4607
4608         * keyword.gperf (hash, java_keyword): Add prototypes.
4609
4610         * lang.c (lang_print_error): Add static prototype.
4611         (lang_init): Prefer memcpy over bcopy to avoid casts.
4612
4613         * lex.c (yylex): Add static prototype.
4614
4615         * parse-scan.y: Include "lex.c" earlier.
4616
4617         * parse.h: Remove redundant declaration for `yylex'.
4618
4619         * parse.y (java_decl_equiv, binop_compound_p, search_loop,
4620         labeled_block_contains_loop_p): Add static prototypes.
4621         (not_accessible_p): Make static to match prototype.
4622
4623         * verify.c (start_pc_cmp): Don't needlessly cast away const.
4624
4625 Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4626
4627         * parse.y (check_method_redefinition): Changed leading comment.
4628         (check_abstract_method_definitions): New function.
4629         (java_check_abstract_method_definitions): New function.
4630         (java_check_regular_methods): Call it.
4631         (verify_constructor_super): Fixed indentation.
4632         (lookup_method_invoke): Likewise.
4633
4634 Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4635
4636         * parse.y (method_header): Return a null pointer if the current
4637         class node is null.
4638         (finish_method_declaration): Return if the current function decl
4639         is null.
4640         (source_start_java_method): Likewise.
4641         (java_method_add_stmt): Likewise.
4642
4643 Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4644
4645         * class.c (emit_register_class): Removed unnecessary call to
4646         start_sequence.
4647         * parse.y (labeled_block_contains_loop_p): Removed unused local
4648         variable.
4649
4650 Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4651
4652         * parse.y (java_refold): Added prototype.
4653
4654 Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4655
4656         * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
4657         (java_stabilize_reference): Removed unnecessary `else'.
4658         (java_complete_lhs): Set flag to remember boolean. Call
4659         java_refold. Added comments.
4660         (java_decl_equiv): New function.
4661         (binop_compound_p): Likewise.
4662         (java_refold): Likewise.
4663         (patch_unaryop): Striped static field access assigned to decl and
4664         op. Changed promotion scheme for ++/-- operators.
4665         (search_loop): New function.
4666         (labeled_block_contains_loop_p): Likewise.
4667         (patch_loop_statement): Call labeled_block_contains_loop_p. Added
4668         comment.
4669         (patch_bc_statement): Call search_loop. Fixed comment.
4670
4671 1999-08-14  Anthony Green  <green@cygnus.com>
4672
4673         * expr.c (java_lang_expand_expr): Mark static array data as
4674         referenced.
4675
4676 Tue Aug 10 00:28:31 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4677
4678         * jvgenmain.c (main): NUL-terminate name_obstack.
4679
4680 1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4681
4682         * check-init.c (check_bool2_init, done_alternative): Add static
4683         prototypes.
4684
4685         * class.c (add_interface_do, maybe_layout_super_class): Likewise.
4686         (add_method, build_utf8_ref, build_class_ref,
4687         append_gpp_mangled_type, layout_class_method): Constify a char*.
4688
4689         * decl.c (push_promoted_type, make_binding_level): Add static
4690         prototypes.
4691         (push_promoted_type, pushdecl): Constify a char*.
4692
4693         * except.c (find_handler_in_range, link_handler,
4694         check_start_handlers): Add static prototypes.
4695
4696         * expr.c (process_jvm_instruction): Constify a char*.
4697
4698         * gjavah.c (main): Constify a char*.
4699
4700         * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
4701         Constify a char*.
4702
4703         * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
4704         static prototypes.
4705         (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
4706         munge, print_ents): Constify a char*.
4707
4708         * jcf-dump.c (disassemble_method): Constify a char*.
4709         (print_constant_pool, print_exception_table): Add static prototypes.
4710         (print_constant, print_exception_table, main, disassemble_method):
4711         Constify a char*.
4712
4713         * jcf-io.c (find_classfile, find_class): Likewise.
4714
4715         * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
4716         (set_source_filename, predefined_filename_p): Add static prototypes.
4717         (set_source_filename, get_constant, get_class_constant,
4718         find_in_current_zip): Constify a char*.
4719
4720         * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
4721         static prototypes.
4722         (add_entry, add_path, jcf_path_classpath_arg,
4723         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
4724
4725         * jcf-reader.c (get_attribute, jcf_parse_preamble,
4726         jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
4727         jcf_parse_one_method, jcf_parse_methods,
4728         jcf_parse_final_attributes): Add static prototypes.
4729         (get_attribute): Constify a char*.
4730
4731         * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
4732         jcf_dependency_add_target, jcf_path_classpath_arg,
4733         jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
4734
4735         * jv-scan.c (main): Constify a char*.
4736         (gcc_obstack_init): Add prototype arguments.
4737
4738         * jvgenmain.c (gcc_obstack_init): Likewise.
4739         (main): Constify a char*.
4740
4741         * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
4742         static prototypes.
4743         (put_decl_string, lang_print_error): Constify a char*.
4744         (lang_init): Remove redundant extern prototype.
4745
4746         * mangle.c (emit_unicode_mangled_name): Constify a char*.
4747
4748         * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
4749         Add static prototypes.
4750         (get_type_from_signature): Constify a char*.
4751
4752         * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
4753         Add static prototypes.
4754         (start_pc_cmp): Prefer PTR over GENERIC_PTR.
4755         (verify_jvm_instructions): Constify a char*.
4756
4757         * xref.c (xref_flag_value): Likewise.
4758
4759         * xref.h (xref_flag_value): Likewise.
4760
4761         * zextract.c (makeword, makelong): Add static prototypes.
4762         (makeword, makelong): Constify a uch*.
4763
4764 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4765
4766         * lang.c (java_dummy_print): Constify a char*.
4767         (lang_print_error): Likewise.
4768         (lang_init): Remove redundant prototype for `print_error_function'.
4769         (lang_init_source): Likewise.
4770         (lang_identify): Constify a char*.
4771
4772 1999-08-09  Tom Tromey  <tromey@cygnus.com>
4773
4774         * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
4775         (WORDS_TO_LONG): Likewise.
4776         (WORDS_TO_DOUBLE): Likewise.
4777
4778 1999-08-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4779
4780         * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
4781
4782         * expr.c (java_stack_pop, java_array_data_offset,
4783         build_java_throw_out_of_bounds_exception, case_identity,
4784         build_java_check_indexed_type): Add static prototypes.
4785         (linenumber_table, expand_invoke, expand_java_field_op,
4786         build_primtype_type_ref, expand_byte_code): Constify a char*.
4787
4788         * java-tree.h (build_primtype_type_ref, linenumber_table):
4789         Constify a char*.
4790         (java_lang_expand_expr): Add prototype.
4791
4792         * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
4793         `java_lang_expand_expr'.
4794
4795         * lex.c (java_lex_error): Constify a char*.
4796         (java_get_unicode, java_read_char, java_allocate_new_line,
4797         java_unget_unicode, java_sneak_unicode): Prototype.
4798
4799         * parse-scan.y (current_class, package_name, method_declarator,
4800         report_class_declaration, yyerror): Constify a char*.
4801
4802         * parse.h (java_report_errors): Prototype.
4803         (yyerror): Constify a char*.
4804
4805         * parse.y (classitf_redefinition_error, check_modifiers,
4806         parse_jdk1_1_error, lookup_package_type,
4807         lookup_package_type_and_set_next, get_printable_method_name,
4808         purify_type_name): Constify a char*.
4809         (build_super_invocation, maybe_generate_finit,
4810         verify_constructor_super, parser_add_interface,
4811         add_superinterfaces, jdep_resolve_class, note_possible_classname,
4812         java_complete_expand_methods, java_expand_finals,
4813         cut_identifier_in_qualified, java_stabilize_reference,
4814         do_unary_numeric_promotion, operator_string, do_merge_string_cste,
4815         merge_string_cste): Prototype.
4816         (single_type_import_declaration, yyerror,
4817         variable_redefinition_error, build_array_from_name,
4818         build_unresolved_array_type, check_class_interface_creation,
4819         resolve_class, complete_class_report_errors,
4820         note_possible_classname, read_import_dir,
4821         find_in_imports_on_demand, resolve_package, fix_constructors,
4822         check_deprecation, lookup_method_invoke,
4823         maybe_build_primttype_type_ref, array_constructor_check_entry):
4824         Constify a char*.
4825         (java_complete_expand_methods, java_expand_finals): Make static.
4826         (convert_narrow): Remove static prototype.
4827
4828 Tue Aug  3 20:21:20 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
4829
4830         * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
4831
4832 1999-08-02  Richard Henderson  <rth@cygnus.com>
4833
4834         * decl.c: Include defaults.h instead of expr.h.
4835         * parse.y: Likewise.
4836
4837 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
4838
4839         * java/decl.c (start_java_method): Change all uses of
4840         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
4841         Ensure expr.h is included.
4842         * java/expr.c (pop_arguments): Ditto.
4843         * java/parse.y (expand_start_java_method): Ditto.
4844
4845 1999-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4846
4847         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4848
4849 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
4850
4851         * decl.c: Include "function.h".
4852         * except.c: Likewise.
4853         * parse.y: Likewise.
4854         * Makefile.in: Update dependencies.
4855
4856 1999-07-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4857
4858         * expr.c (build_java_soft_divmod): Provide a default case in switch.
4859         (java_lang_expand_expr): Mark parameters `target', `tmode' and
4860         `modifier' with ATTRIBUTE_UNUSED.
4861
4862         * gjavah.c (process_file): Add braces around ambiguous `else'.
4863
4864         * jcf-dump.c (print_access_flags, localvar_free): Change return
4865         type to void.
4866
4867         * parse.y (java_complete_expand_method): Initialize variable
4868         `exception_copy'.
4869         (resolve_qualified_expression_name): Likewise for `field_decl'.
4870         (patch_method_invocation): Likewise for `class_to_search'.
4871         (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
4872         (patch_assignment): Likewise for `lhs_type'.
4873
4874         * verify.c (verify_jvm_instructions): Remove unused variable
4875         `caller'.
4876
4877 1999-07-25  Richard Henderson  <rth@cygnus.com>
4878
4879         * decl.c (va_list_type_node): New.
4880
4881 1999-07-25  Anthony Green  <green@cygnus.com>
4882
4883         * gjavah.c (print_stub): New function.
4884         (METHOD_IS_NATIVE): New macro.
4885         (print_mangled_classname): Make static.
4886         (HANDLE_END_FIELD): Don't emit fields during stub generation.
4887         (process_file): Perform stub generation.
4888         (HANDLE_METHOD): Don't emit class decls during stub
4889         generation.
4890         (HANDLE_END_METHOD): Take into account stub generation.
4891         (print_method_info): Handle stub generation.
4892         (print_stub): New function.
4893         (print_cxx_classname): Make signature consistant with others.
4894         (help): Describe -stubs option.
4895         (main): Create stub file.
4896         (version): Use version.c.
4897         (print_full_cxx_name): New function.
4898         (print_c_decl): Use print_full_cxx_name.
4899
4900 Thu Jul 22 12:41:12 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4901
4902         * check-init.c (check_init): Handle MAX_EXPR.
4903
4904 1999-07-15  Andrew Haley  <aph@cygnus.com>
4905
4906         * lang.c (flag_use_divide_subroutine): New variable.
4907         * typeck.c: (convert_ieee_real_to_integer): Bounds check
4908         fp-to-integer conversion.
4909         (convert): Call convert_ieee_real_to_integer when flag_fast_math
4910         is not set.
4911
4912         * expr.c (build_java_soft_divmod): New function.
4913         (build_java_binop): Call build_java_soft_divmod if
4914         flag_use_divide_subroutine is set.
4915         * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4916         soft_lrem_node: new builtin functions.
4917         (init_decl_processing) Initialize the new builtins.
4918         * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
4919         soft_lrem_node: new builtin functions.
4920         (build_java_soft_divmod): New function.
4921         * parse.y: Call build_java_soft_divmod if
4922         flag_use_divide_subroutine is set.
4923         * parse.c: Rebuilt.
4924
4925         * jvspec.c (lang_specific_driver): Always allow an extra arg (for
4926         a --specs= arg) even if not linking.
4927         * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
4928         -fuse-divide-subroutine
4929
4930 Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4931
4932         * parse.y (resolve_and_layout): Check methods only once.
4933         (resolve_qualified_expression_name): Verify thrown exceptions
4934         compatibility.
4935         (check_thrown_exceptions): Reject exceptions thrown in
4936         initializer. Error message tuned.
4937
4938 1999-07-14  Andrew Haley  <aph@cygnus.com>
4939
4940         * expr.c (expand_expr): Do not return the last statement in a
4941         block as the block's value.
4942
4943 Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4944
4945         * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
4946         CALL_EXPR, to avoid order of evaluation changes.
4947
4948 Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4949
4950         * parse.y (qualify_ambiguous_name): Do not use
4951         IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
4952
4953 Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4954
4955         * check-init.c (check_init): Handle MAX_EXPR.
4956         * expr.c (force_evaluation_order): Force method call arguments to
4957         be evaluated in left-to-right order.
4958         * parse.y (qualify_ambiguous_name): Loop again to qualify
4959         NEW_ARRAY_EXPR properly.
4960
4961 Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4962
4963         * parse.y (patch_invoke): Resolve unresolved invoked method
4964         returned type.
4965         (qualify_ambiguous_name): STRING_CST to qualify expression for
4966         type name resolution.
4967
4968 1999-06-24  Andrew Haley  <aph@cygnus.com>
4969
4970         * class.c (finish_class): Whenever a deferred method is
4971         output, rescan the list of methods to see if a new candidate for
4972         output can be found.
4973
4974 1999-06-28  Tom Tromey  <tromey@cygnus.com>
4975
4976         * jvspec.c (lang_specific_driver): Recognize --help.
4977
4978 Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4979
4980         * parse.y (resolve_package): Fixed bogus return statement.
4981         (patch_method_invocation): Resolve method invocation beginning with
4982         a package name qualifier.
4983
4984 1999-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4985
4986         * Make-lang.in (java.stage1): Depend on stage1-start.
4987         (java.stage2): Likewise for stage2-start.
4988         (java.stage3): Likewise for stage3-start.
4989         (java.stage4): Likewise for stage4-start.
4990
4991 Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4992
4993         * parse.y (java_complete_lhs): When doing cross referencing, don't
4994         try to keep file location on a WFL expanded as a CALL_EXPR.
4995
4996 Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
4997
4998         * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
4999         compiling to class file a void method with an empty method body.
5000         As a side effect, the bytecode backend will generate the
5001         appropriate `return' instruction.
5002
5003 Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5004
5005         * parse.y (lookup_package_type_and_set_next): New function prototype.
5006         (resolve_package): Search current and imported packages.
5007         (lookup_package_type_and_set_next): New function.
5008
5009 1999-06-22  Andrew Haley  <aph@cygnus.com>
5010
5011         * verify.c (verify_jvm_instructions): Check for pending blocks
5012         before invalid PC test and opcode switch, not after.
5013
5014 1999-06-21  Andrew Haley  <aph@cygnus.com>
5015
5016         * except.c (find_handler_in_range): The upper limit for exception
5017         ranges is exclusive, not inclusive: (start <= pc < end).
5018         (link_handler): find child pointer which points to outer by
5019         searching sibling list: previous code incorrectly assumed that
5020         outer->outer->first_child must point to outer.
5021         * verify.c (verify_jvm_instructions): FIXME added to code for
5022         `athrow'.
5023         (verify_jvm_instructions): Do not assume that the last block
5024         processed in a subroutine is a block which ends with a `ret'
5025         instruction.  With some control flows it is possible that the last
5026         block ends with an `athrow'.
5027
5028 Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5029
5030         * parse.y (qualify_ambiguous_name): Reorganized the post
5031         evaluation of non WFL leading expression nodes.
5032
5033 Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5034
5035         * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
5036         CONVERT_EXPR.
5037
5038 Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5039
5040         * parse.y (qualify_ambiguous_name): Handle qualified expression
5041         beginning with a STRING_CST.
5042
5043 Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5044
5045         * parse.y (register_fields): Set DECL_INITIAL on both
5046         pre-initialized static and public fields.
5047         (resolve_field_access): Static field access expressions to always
5048         use pointer types.
5049         (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
5050         qualification. CONVERT_EXPR to be resolved as an expression name.
5051         (java_complete_lhs): Identify and access qualified final
5052         initialized field in switch statement case expression.
5053         (fold_constant_for_init): Pre-initialized field decl constant to
5054         be folded.
5055
5056 Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5057
5058         * parse.y (note_possible_classname): Mark returned node with
5059         QUALIFIED_P only if the original class name contained a '/'.
5060
5061 Sat Jun  5 11:46:59 1999  Anthony Green  <green@cygnus.com>
5062
5063         * Make-lang.in (gcjh): More parallel build fixes.
5064
5065 1999-06-03  Mike Stump  <mrs@wrs.com>
5066
5067         * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
5068
5069 Wed Jun  2 10:44:38 1999  Anthony Green  <green@cygnus.com>
5070
5071         * except.c (link_handler): Chain exception handlers in order.
5072
5073 Wed Jun  2 10:41:24 1999  Anthony Green  <green@cygnus.com>
5074
5075         * expr.c (expand_byte_code): Fill unreachable bytecode regions
5076         with nops and process as usual in order to always set correct EH
5077         ranges.  Emit detailed warnings about unreachable bytecodes.
5078
5079 Wed Jun  2 10:35:13 1999  Anthony Green  <green@cygnus.com>
5080
5081         * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
5082         constant.
5083
5084 Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5085
5086         * parse.y (lookup_field_wrapper): Unified returned value to NULL
5087           or the searched field decl.
5088
5089 Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5090
5091         * parse.y (fold_constant_for_init): Convert numerical constant
5092         values to the type of the assigned field.
5093
5094 Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5095
5096         * expr.c (lookup_field): Relaxed the test on class loading error
5097         detection.
5098         * parse.y (fold_constant_for_init): Enabeled old code.
5099
5100 Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5101
5102         * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
5103         decide the validity of the cast of a java.lang.Cloneable reference
5104         to an array.
5105         (patch_conditional_expr): Fixed first argument passed to
5106         binary_numeric_promotion.
5107
5108 Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5109
5110         * parse.y (qualify_ambiguous_name): Take into account that a
5111         CONVERT_EXPR might specify a type as a WFL.
5112
5113 Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5114
5115         * parse.y (patch_assignment): Save the rhs before using it as an
5116         argument to _Jv_CheckArrayStore.
5117
5118 Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5119
5120         * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
5121
5122 Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5123
5124         * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
5125         floating point litteral only when the exponent indicator has been
5126         parsed.
5127
5128 Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5129
5130         * parse.y (formal_parameter:): Construct argument tree list
5131         element even if a yet unsupported final parameter was encountered.
5132
5133 Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5134
5135         * parse.y (finish_method_declaration): Issue errors for native or
5136         abstract methods declared with a method body, as well as for non
5137         native or non abstract methods with no method body.
5138
5139 1999-05-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5140
5141         * class.c (build_utf8_ref): Initialize variable `field'.
5142
5143         * decl.c (init_decl_processing): Initialize variable `field'.
5144
5145         * expr.c (build_known_method_ref): Mark parameters `method_type',
5146         `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
5147         (process_jvm_instruction): Likewise for parameter `length'.
5148
5149         * jvspec.c (lang_specific_driver): Mark variables `saw_math',
5150         `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
5151         ATTRIBUTE_UNUSED.
5152
5153         * parse.y (maybe_generate_clinit): Remove unused variable
5154         `has_non_primitive_fields'.
5155         (find_in_imports_on_demand): Initialize variables `node_to_use'
5156         and `cl'.
5157         (patch_binop): Likewise for variable `prom_type'.
5158         (patch_unaryop): Likewise for variable `prom_type'.
5159
5160         * verify.c (verify_jvm_instructions): Likewise for variable `last'.
5161
5162         * xref.c (xref_table): Add missing initializer.
5163
5164 1999-05-14  Tom Tromey  <tromey@cygnus.com>
5165
5166         * java-except.h (struct eh_range): Removed unused `next' member.
5167         * verify.c (verify_jvm_instructions): Call check_nested_ranges
5168         after adding all exception handlers.  Sort exception ranges in
5169         order of start PC.
5170         (struct pc_index): New structure.
5171         (start_pc_cmp): New function.
5172         * except.c (add_handler): Return `void'.  Don't call link_handler;
5173         instead construct an ordinary linked list and do range
5174         coalescing.
5175         (check_nested_ranges): New function.
5176         (link_handler): Changed interface to allow merging of eh_ranges.
5177         Split overlapping ranges.  Return `void'.
5178
5179 Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5180
5181         * parse.y (constructor_block_end:): New rule, tagged <node>.
5182         (constructor_body:): Use `constructor_block_end' instead of
5183         `block_end'.
5184
5185 Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5186
5187         * parse.y (statement_nsi:): Pop `for' statement block.
5188         (java_complete_lhs): Labeled blocks containing no statement are
5189         marked as completing normally.
5190
5191 Fri May 14 12:31:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5192
5193         * xref.c (xref_set_current_fp): New function, defined.
5194         * xref.h (xref_set_current_fp): New function, prototyped.
5195
5196 Fri May 14 11:57:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5197
5198         * check-init.c (check_init): Take into account that
5199         LABELED_BLOCK_STMT can be empty.
5200
5201 Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5202
5203         * parse.y (java_check_regular_methods): Warning check on not
5204         overriding methods with default access in other packages does not
5205         apply to `<clinit>'.
5206         (java_complete_lhs): If block body is an empty_stmt_node, replace
5207         it by NULL_TREE. This prevents gcc from generating an irrelevant
5208         warning.
5209
5210 Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5211
5212         * check-init.c (check_init): Removed code accepting to see things
5213         falling through default:, when doing xrefs.
5214         * java-tree.h (do_not_fold): New global variable, declared.
5215         * parse.y (do_not_fold): New global variable, defined.
5216         (java_complete_expand_method): Set `do_not_fold' to the value of
5217         `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
5218         and reinstall them after them have been purged; do not check for
5219         initializations; do not issue missing return errors.
5220         (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
5221         when doing xrefs.
5222         (patch_binop): Skip the fold part when doing xrefs.
5223         (build_string_concatenation): Skip the concatenation part when
5224         doing xrefs.
5225         (patch_synchronized_statement): Do not generate a try-finally when
5226         doing xrefs.
5227         (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
5228         and keep the location where the throw was seen.
5229         * typeck.c (convert): When `do_not_fold' is set, do not attempt
5230         any treatment on the converted node an simply return a NOP_EXPR of
5231         the targeted type.
5232         * xref.c (xref_get_data): New function, defined.
5233         * xref.h (xref_get_data): New function, declared.
5234         (XREF_GET_DATA): Use xref_get_data.
5235
5236 1999-05-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5237
5238         * gjavah.c (print_include): Cast the result of `strlen' to int
5239         when comparing against a signed value.
5240         (add_namelet): Likewise.
5241
5242 1999-05-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5243
5244         * expr.c (expand_invoke): Mark parameter `nargs' with
5245         ATTRIBUTE_UNUSED.
5246         (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
5247
5248         * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
5249         ATTRIBUTE_UNUSED.
5250
5251         * jcf-reader.c (get_attribute): Cast a value to long
5252         when comparing against a signed expression.  Likewise.
5253
5254         * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
5255         HOST_BITS_PER_CHAR.
5256
5257 1999-05-11  Andrew Haley  <aph@cygnus.com>
5258
5259         * parse.y (source_end_java_method): If the current method contains
5260         any exception handlers, force asynchronous_exceptions: this is
5261         necessary because signal handlers in libjava may throw exceptions.
5262         * decl.c (end_java_method): Ditto.
5263
5264 1999-05-11  Tom Tromey  <tromey@cygnus.com>
5265
5266         * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
5267         flags.
5268         * jvspec.c (THREAD_NAME): Removed.
5269         (GC_NAME): Likewise.
5270         (MATHLIB): Likewise.
5271         (WITHLIBC): Likewise.
5272         (GCLIB): Likewise.
5273         (THREADLIB): Likewise.
5274         (MATH_LIBRARY): Likewise.
5275         (lang_specific_driver): Don't add `-l' options to command line.
5276         Instead, add a single --specs option.  Recognize `-L' options and
5277         use them to search for spec file.
5278         (find_spec_file): New function.
5279         (SPEC_FILE): New define.
5280
5281 Tue May 11 11:46:36 1999  Dave Brolley  <brolley@cygnus.com>
5282
5283         * lang-options.h: -MD, -MMD, -M and -MM not needed here for
5284         cpplib-enabled build.
5285
5286 1999-05-05  Per Bothner  <bothner@cygnus.com>
5287
5288         * class.c (make_field_value):  DECL_INITIAL may be a string literal;
5289         temporarily zero it while calling rest_of_decl_compilation.
5290
5291         * java-tree.h (string_ptr_type_node):  Add declaration.
5292         * decl.c:  Define and initialize string_ptr_type_node.
5293         * parse.y (patch_string_cst):  Use string_ptr_type_node.
5294
5295         * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
5296         * parse.y (for_statement):  Now unconditionally exit_block.
5297         (finish_labeled_statement):  No longer exit_block if for-loop.
5298         (patch_loop_statement):  Check harder if the loop is already labeled.
5299
5300         * parse.y (patch_initialized_static_field):  Removed function.
5301         (maybe_generate_clinit):  Removed special handling for interfaces.
5302         (java_complete_expand_methods):  Do a preliminary java_complete_tree
5303         on <clinit> to determine if it can be removed.
5304         (java_complete_expand_method):  Remove special handling for <clinit>.
5305         (java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
5306         optimize if we get back empty_stmt_node.
5307         For MODIFY_EXPR, re-do checking of static initializers.
5308         (fold_constant_for_init):  Don't return immediate if VAR_DECL.
5309         For VAR_DECL, pass correct context.
5310
5311         * verify.c (verify_jvm_instructions):  Better error messages.
5312
5313 1999-05-03  Tom Tromey  <tromey@cygnus.com>
5314
5315         * parse-scan.y (interface_declaration): Call
5316         report_class_declaration for interfaces.
5317
5318 1999-04-30 20:54 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
5319
5320         * Makefile.in: Remove -v from bison command lines.
5321
5322 Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5323
5324         * check-init.c (check_init): Exclude a case of error when doing
5325         xrefs.
5326         * class.c (layout_class_method): Don't generate the error message
5327         twice when compiling from source.
5328         * lang-options.h: Added `-Wredundant-modifers' and
5329         `-Wunusupported-jdk11' flags and help text.
5330         * lang.c (lang_decode_option): Added support for
5331         `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
5332         flag_static_local_jdk11 and flag_redundant set accordingly.
5333         * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
5334         * parse.h (EXPR_WFL_ADD_COL): New macro.
5335         (DECL_END_SOURCE_LINE): Likewise.
5336         (DECL_INHERITED_SOURCE_LINE): Likewise.
5337         * parse.y (static_ref_err): New function, prototyped.
5338         (CCB_TK): Now tagged <operator>.
5339         (class_body:): Remember the location of the closing '}' of a class
5340         definition when doing xrefs.
5341         (block:): Likewise.
5342         (block_end:): Likewise.
5343         (create_class): Remember the location of the inherited class
5344         identifier when doing xrefs.
5345         (register_fields): Added test on first operand of `init' before
5346         testing it TREE_CODE.
5347         (method_header): Store the location of the class identifier in the
5348         class decl when doing xrefs.
5349         (finish_method_declaration): Don't combine first/last method line
5350         when doing xref.
5351         (java_check_regular_methods): Warning check on not overriding
5352         methods with default access on other packages move before check on
5353         static methods. Initialization of `aflags' also moved up.
5354         (resolve_expression_name): Call static_ref_err to report the error.
5355         (static_ref_err): New function, implemented.
5356         (resolve_field_access): Returned simplified static field access
5357         when doing xrefs.
5358         (resolve_qualified_expression_name): Check for illegal use of
5359         static fields in a non static context. Call static_ref_err to
5360         report error in various places.
5361         (java_complete_tree): Do not fold initialized static fields when
5362         doing xrefs.
5363         (java_complete_lhs): Likewise.
5364
5365 1999-04-29  Anthony Green  <green@cygnus.com>
5366
5367         * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
5368         create internal labels.
5369         (lookup_label): Ditto.
5370
5371 Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5372
5373         * class.c (layout_class_method): Generate <clinit>'s rtl for
5374         interfaces.
5375         * decl.c (complete_start_java_method): Don't call _Jv_InitClass
5376         for interfaces' <clinit>.
5377         * expr.c (lookup_field): Search for fields in interfaces.
5378         (expand_invoke): Fixed indentation.
5379         (expand_java_field_op): Likewise. Use IS_CLINIT.
5380         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
5381         (IS_CLINIT): New macro.
5382         * parse.y (type_declaration:): Call maybe_generate_clinit after an
5383         interface was parsed.
5384         (maybe_generate_clinit): Don't generate if the current class is an
5385         interface with only fields of primitive types.
5386         (reset_method_name): Use IS_CLINIT.
5387         (java_complete_expand_method): Expand <clinit> when it exists for
5388         interfaces. Use IS_CLINIT.
5389         (resolve_expression_name): Use DECL_CONTEXT instead of
5390         current_class to build static field references.
5391         (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
5392         ARRAY_REF when doing xreferencing.
5393         (check_final_assignment): Fixed typo in leading comment. Use
5394         IS_CLINIT.
5395         (patch_array_ref): Don't fully expand array references when
5396         xreferencing.
5397         (patch_return): Use IS_CLINIT.
5398         (patch_throw_statement): Likewise.
5399
5400 1999-04-22  Tom Tromey  <tromey@cygnus.com>
5401
5402         * Make-lang.in (JAVA_SRCS): Added check-init.c.
5403
5404 Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5405
5406         * decl.c (predef_filenames, predef_filenames_size): New globals
5407         (init_decl_processing): predef_filenames and predef_filenames_size
5408         initialized.
5409         * java-tree.h (predef_filenames, predef_filenames_size): Declared
5410         extern.
5411         * jcf-parse.c (predefined_filename_p): New function.
5412         (yyparse): Check that files on the command line are specified only
5413         once and issue a warning otherwise.
5414         * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
5415         * parse.y (source_end_java_method): Nullify NOP method bodies, to
5416         avoid a gcc warning with -W -Wall turned on.
5417         (java_expand_classes): Abort if errors were encountered.
5418         (java_complete_lhs): If the cross reference flag is set, wrap
5419         field DECL node around a WFL when resolving expression name.
5420
5421 Mon Apr 19 14:44:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5422
5423         * lang.c (lang_decode_option): Fixed returned value when parsing
5424         `-fxref=...' and `-Wall'.
5425         * parse.y (source_end_java_method): Do not generate code when
5426         flag_emit_xref is set.
5427         (resolve_expression_name): Do not build static field access when
5428         flag_emit_xref is set.
5429         (resolve_field_access): No special treatment on `length' when
5430         flag_emit_xref is set. Do not build qualified static field access
5431         when flag_emit_xref is set.
5432         (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
5433         when flag_emit_xref is set.
5434         (patch_assignment): Do not generate array store runtime check when
5435         flag_emit_xref is set.
5436         * xref.c (xref_flag_value): Fixed function declaration
5437         indentation.
5438         (xset_set_data): New function.
5439         * xref.h (xref_set_data): Added prototype for new function.
5440         (typedef struct xref_flag_table): New field data.
5441         (XREF_GET_DATA): New macro.
5442
5443 1999-04-19  Tom Tromey  <tromey@cygnus.com>
5444
5445         * xref.h (enum): Removed trailing comma.
5446
5447         * parse.y (resolve_qualified_expression_name): Added missing
5448         `break'.
5449
5450 Thu Apr 15 13:08:03 1999  Anthony Green  <green@cygnus.com>
5451
5452         * gjavah.c: New prototypes for java_float_finite and
5453         java_double_finite.
5454
5455 Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5456
5457         * parse.y (patch_unaryop): Fixed ++/-- operator check on array
5458         references.
5459
5460 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
5461
5462         * Makefile.in (TREE_H): Add tree-check.h.
5463         (RTL_H): Add genrtl.h.
5464
5465 Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5466
5467         * parse.y (patch_assignment): Added ArrayStoreException runtime
5468         check.
5469
5470 1999-04-06  Per Bothner  <bothner@cygnus.com>
5471
5472         * expr.c (pop_type_0):  New function.
5473         (pop_type):  Use pop_type_0.
5474         * java-tree.h (pop_type_0):  New declaration.
5475         * verify.c (verify_jvm_instructions):  Check return instructions.
5476
5477         * parse.y (patch_binop):  Don't fold if non-constant and emiting
5478         class files.
5479
5480 Mon Apr  5 16:06:09 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5481
5482         * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
5483
5484         * gjavah.c: Include math.h earlier.  Include tree.h/java-tree.h.
5485         (main_jcf): Don't define.
5486         (process_file): Don't set `main_jcf'.
5487
5488         * java-tree.h (main_jcf): Don't declare.
5489
5490         * jcf-parse.c (main_jcf): Add static definition.
5491
5492         * lang.c (main_jcf): Don't define.
5493
5494 Mon Apr  5 15:43:51 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5495
5496         * class.c (add_method_1): Cast the argument of `bzero' to PTR.
5497
5498         * decl.c (copy_lang_decl): Likewise for `bcopy'.
5499
5500         * jcf-depend.c: Include "config.h", not <config.h>.
5501
5502         * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
5503         `bcopy' to PTR.
5504
5505         * jcf-path.c: Include "config.h", not <config.h>.
5506
5507         * lex.c: Don't include various system header files.
5508         (java_init_lex): Cast the argument of `bzero' to PTR
5509
5510         * parse-scan.y (java_push_parser_context): Likewise.
5511
5512         * parse.y (java_push_parser_context): Likewise.
5513         (patch_bc_statement): Match format specifier to variable argument.
5514
5515         * xref.c: Don't include <stdio.h>.
5516
5517 Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5518
5519         * parse.y (struct parser_ctxt *ctxp): Now global.
5520         (declare_local_variables): Use WFL compound value for the
5521         declaration source line value, when doing cross-referencing.
5522
5523 1999-03-31  Tom Tromey  <tromey@cygnus.com>
5524
5525         * gjavah.c (print_field_info): Allow constants of other types.
5526         (print_include): Generate include when new name is proper prefix
5527         of already printed name.
5528         (add_namelet): Likewise.
5529         (cxx_keyword_subst): New function.
5530         (print_method_info): Use it.
5531         (print_field_name): New function.
5532         (get_field_name): New function.
5533         (print_field_info): Use get_field_name and print_field_name.
5534
5535 Wed Mar 31 11:00:32 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5536
5537         * Makefile.in (keyword.h): Generate using gperf language 'C', not
5538         'KR-C', so gperf uses the `const' keyword on strings.
5539
5540         * keyword.gperf (java_keyword): Const-ify a char*.
5541
5542 Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5543
5544         * parse.y (patch_bc_statement): Fixed identation and a bogus
5545         `printf' format.
5546
5547 Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5548
5549         * parse.y (patch_assignment): Allow static variables in other
5550         classes to be assigned.
5551
5552 Sun Mar 28 22:12:10 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5553
5554         * class.c (maybe_add_interface): Remove unused variable
5555         `interface_binfo'.
5556         (make_class_data): Use = for assignment, not ==.  Likewise.
5557         (emit_register_classes): Remove unused variable `decl'.
5558
5559         * lex.c: Fix comment so as not to contain an embedded `/*'.
5560
5561         * verify.c (verify_jvm_instructions): Remove unused variable
5562         `self_type'.
5563
5564 Sat Mar 27 15:49:18 1999  Per Bothner  <bothner@cygnus.com>
5565
5566         * parse.y (complete_loop_body):  Rename to finish_loop_body.
5567         (complete_labeled_statement):  Rename to finish_labeled_statement.
5568         (complete_for_loop):  Rename to finish_for_loop.
5569         (complete_method_declaration):  Rename to finish_method_declaration.
5570
5571         * java-tree.h (continue_identifier_node):  New global node.
5572         * decl.c:  Define and initialize continue_identifier_node.
5573         * parse.y (generate_labeled_block):  Remove - no longer needed.
5574         (build_loop_body):  Use continue_identifier_node for continue block.
5575         (finish_labeled_statement):  Also do pop_labeled_block actions.
5576         (java_complete_lhs):  POP_LOOP even if error.
5577         (build_labeled_block):  Special handling for continue_identifier_node.
5578         (patch_loop_statement):  Re-organize.
5579         (patch_bc_statement):  Re-write.
5580
5581 Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5582
5583         * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
5584         using a WFL compound value.
5585         * parse.y (xref.h): Include.
5586         (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
5587         WFL compound value.
5588         (register_fields): Set WFL compound value to lineno if doing
5589         xrefs.
5590         (java_complete_expand_method): Call expand_xref if flag_emit_xref
5591         is set.
5592         * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
5593         * xref.h (expand_xref): Prototype renamed from xref_generate.
5594
5595 Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5596
5597         * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
5598         (GET_CURRENT_BLOCK): New macro.
5599         * parse.y (current_static_block): New global variable.
5600         (method_body:): Define action.
5601         (complete_method_declaration): Set current_function_decl to NULL
5602         when work on the current method is done.
5603         (declare_local_variables): Use GET_CURRENT_BLOCK.
5604         (java_method_add_stmt): Likewise.
5605         (java_complete_expand_method): Disable the use of `this' when
5606         expanding <clinit>.
5607         (enter_a_block): If no current method exist, use
5608         current_static_block to link static initializer blocks.
5609         (exit_block): Rewritten to use current_static_block when no current
5610         method decl exists.
5611         (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
5612         (patch_return): Forbid the use of `return' in static initializers.
5613         (patch_throw_statement): Fixed indentation. Issue specific error
5614         for uncaught thrown checked exception in static initializer
5615         blocks. Removed FIXME.
5616
5617 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
5618
5619         * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
5620         Link gcj from gcc.o.
5621
5622 Tue Mar 23 10:48:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5623
5624         * parse.y (find_applicable_accessible_methods_list): When dealing
5625         with interface: ensure that a given interface or java.lang.Object
5626         are searched only once.
5627
5628 Tue Mar 23 10:05:27 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5629
5630         * gjavah.c (print_c_decl): Remove unused argument `flags'.
5631
5632         * jcf-dump.c (print_access_flags): Add braces around if-else.
5633
5634         * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
5635         COMBINE_INPUTS.
5636
5637         * lex.c (build_wfl_node): Add static prototype.
5638
5639         * lex.h (build_wfl_node): Remove static prototype.
5640
5641         * parse.y: Include lex.c early enough to declare everything needed.
5642         Ensure calls to `build_wfl_node' pass the proper arguments.
5643         (create_class): Remove unused variable `super_decl'.
5644         (get_printable_method_name): Initialize variable `name'.
5645
5646 Mon Mar 22 20:14:26 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5647
5648         * Changelog: Fixed 1999-03-22 typos.
5649         * lang.c (lang_decode_option): Fixed typo in error string in the
5650         XARG section.
5651
5652 1999-03-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5653
5654         * Makefile.in (JAVA_OBJS): Added entry xref.o.
5655         (xref.o): New rule.
5656         * java-tree.h (flag_emit_xref): Declared extern.
5657         * lang.c (xref.h): Included.
5658         (flag_emit_xref): New global variable.
5659         (lang_decode_option): Added support for -fxref.
5660         * xref.c: Created.
5661         * xref.h: Likewise.
5662
5663 1999-03-21  Manfred Hollstein  <manfred@s-direktnet.de>
5664
5665         * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
5666         linked with.
5667
5668 Sun Mar 21 08:30:30 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5669
5670         * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
5671         $(srcdir)/../system.h and $(JAVA_TREE_H).
5672         (jcf-io.o): Depend on $(JAVA_TREE_H).
5673         (mangle.o): Likewise.
5674
5675         * check-init.c (check_cond_init): Add static prototype.
5676
5677         * class.c (build_java_method_type, hashUtf8String,
5678         make_field_value, get_dispatch_vector, get_dispatch_table,
5679         append_gpp_mangled_type, mangle_static_field): Likewise.
5680         (strLengthUtf8): Hide unused definition.
5681         (hashUtf8String): Const-ify.
5682         (make_field_value): Un-ANSI-fy.
5683
5684         * constants.c: Move inclusion of jcf.h above java-tree.h.
5685         (set_constant_entry, find_class_or_string_constant,
5686         find_name_and_type_constant, get_tag_node,
5687         build_constant_data_ref): Add static prototype.
5688
5689         * decl.c (push_jvm_slot, builtin_function,
5690         lookup_name_current_level): Likewise.
5691         (builtin_function): Const-ify.
5692
5693         * except.c (expand_start_java_handler, expand_end_java_handler):
5694         Add static prototype.
5695
5696         * expr.c (flush_quick_stack, push_value, pop_value,
5697         java_stack_swap, java_stack_dup, build_java_athrow,
5698         build_java_jsr, build_java_ret, expand_java_multianewarray,
5699         expand_java_arraystore, expand_java_arrayload,
5700         expand_java_array_length, build_java_monitor, expand_java_pushc,
5701         expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
5702         expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
5703         expand_compare, expand_test, expand_cond, expand_java_goto,
5704         expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
5705         expand_java_field_op, java_push_constant_from_pool): Likewise.
5706
5707         (decode_newarray_type, expand_iinc): Un-ANSI-fy.
5708         (build_java_arraynull_check): Mark parameters `node' and `type'
5709         with ATTRIBUTE_UNUSED.
5710         (note_label): Likewise for parameter `current_pc'.
5711         (expand_java_call, expand_java_ret): Hide unused definition.
5712
5713         * java-tree.h (make_class, build_constants_constructor,
5714         java_set_exception_lang_code, pop_labeled_block, emit_handlers,
5715         init_outgoing_cpool, register_class, emit_register_classes,
5716         java_layout_seen_class_methods): Prototype.
5717         (unicode_mangling_length): Const-ify.
5718         (append_gpp_mangled_name, append_gpp_mangled_classtype,
5719         emit_unicode_mangled_name, format_int, format_uint,
5720         jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
5721         jcf_print_utf8_replace, open_class): Prototype.
5722
5723         * jcf-dump.c: Include "config.h", not <config.h>.  Don't include
5724         <stdio.h>.  Include tree.h/java-tree.h.
5725         (utf8_equal_string usage, process_class): Add static prototype.
5726         (open_class): Don't prototype this here.
5727         (utf8_equal_string): Match arguments to format specifiers.
5728         (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
5729         TABLE_SWITCH, disassemble_method): Likewise.
5730
5731         * jcf-io.c: Include tree.h/java-tree.h.
5732         (open_class, find_classfile, jcf_print_utf8,
5733         jcf_print_utf8_replace): Const-ify.
5734
5735         * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
5736         parse_class_file): Add static prototype.
5737         (find_in_current_zip): Match definition to existing static
5738         prototype.
5739
5740         * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
5741         (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
5742         finish_jcf_block, define_jcf_label, get_jcf_label_here,
5743         put_linenumber, localvar_alloc, localvar_free, get_access_flags,
5744         write_chunks, adjust_typed_op, generate_bytecode_conditional,
5745         generate_bytecode_return, perform_relocations, init_jcf_state,
5746         init_jcf_method, release_jcf_state, generate_classfile):
5747         Add static prototype.
5748         (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
5749         (make_class_file_name): Const-ify.
5750
5751         * jcf.h (find_classfile): Const-ify.
5752
5753         * jv-scan.c (reset_report): Remove prototype.
5754
5755         * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
5756         (error): Rewrite to allow varargs.
5757
5758         * lang.c (lang_f_options): Const-ify.
5759
5760         * lex.c (java_parse_escape_sequence): Add static prototype.
5761         (java_allocate_new_line): Match definition to existing static
5762         prototype.
5763
5764         * mangle.c Include tree.h/java-tree.h.
5765         (unicode_mangling_length, emit_unicode_mangled_name,
5766         append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
5767
5768         * parse.h (jdep_code): Remove trailing comma in enumeration.
5769         (java_get_line_col): Move prototype outside of !JC1_LITE test.
5770         (reset_report): Add prototype.
5771
5772         * verify.c (push_pending_label, merge_types): Add static
5773         prototypes.
5774
5775         * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
5776
5777 1999-03-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5778
5779         * parse.y (find_applicable_accessible_methods_list): Extend the
5780         search to superinterfaces when relevant.
5781         (search_applicable_methods_list): New function.
5782
5783 1999-03-18  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5784
5785         * class.c (unmangle_classname): Implemented stricter testing
5786         before setting the QUALIFIED_P flag on an identifier.
5787
5788 Tue Mar 16 15:15:41 1999  Per Bothner  <bothner@cygnus.com>
5789
5790         * parse.y (java_complete_lhs):  Call force_evaluation_order
5791         after patch_newarray.
5792         (patch_binop):  Don't call fold if there are side effects.
5793
5794 1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5795
5796         * parse.y (java_stabilize_reference): Use save_expr instead of
5797         building a SAVE_EXPR node.
5798         (java_complete_lhs): Patch the resulting string of the `+='
5799         operator (if necessary) and complete the RHS after having built
5800         the cast.
5801
5802 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
5803
5804         * class.c (make_class):  Don't set CLASS_P here (because
5805         this function is also called by build_java_array_type).
5806         (push_class):  Set CLASS_P here instead.
5807         * parse.h (TYPE_CLASS_P):  Check for TYPE_ARRAY_P is redundant.
5808
5809         * jcf-dump.c (print_access_flags):  Take extra parameter to indicate
5810         context.  If the context is class, perfer "super" over "synchronized".
5811         * jcf-write.c (generate_classfile):  Don't add ACC_SUPER if interface.
5812
5813         * parse.y (create_class):  Don't call parser_check_super here;
5814         it is not robust.  Always wait until later.
5815
5816         * parse.y (method_header):  For interfaces, set ACC_ABSTRACT (to
5817         match what JDK 1.2 does), but don't set ACC_PUBLIC.
5818
5819 Sat Mar 13 18:16:34 1999  Per Bothner  <bothner@cygnus.com>
5820
5821         * lex.c (java_read_char):  UNGET invalid non-initial utf8 character.
5822         * lex.h (UNGETC):  Change misleading macro.
5823
5824 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5825
5826         * parse.y (java_stabilize_reference): Return NODE when patching a
5827         COMPOUND_EXPR.
5828         (java_complete_lhs): Put parenthesis around truth values.
5829
5830 1999-03-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5831
5832         * class.c (layout_class_method): Don't make rtl for interface
5833         methods.
5834         * parse.h (GET_TYPE_NAME): New macro.
5835         * parse.y (if_then_statement:): Fixed indentation.
5836         (if_then_else_statement:): Likewise.
5837         (for_statement:): Fixed spacing.
5838         (try_statement:): Fixed indentation.
5839         (create_interface): Don't force interfaces to be abstract.
5840         (method_header): Abstract methods are OK in interfaces.
5841         (declare_local_variables): Fixed typo in comment.
5842         (java_complete_expand_method): Fixed indentation.
5843         (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
5844         non accessible fields.
5845         (java_stabilize_reference): New function.
5846         (java_complete_lhs): Fixed indentation. Use
5847         java_stabilize_reference in compound assignement. Insert the
5848         cast. If not processing `+' fix string constants before processing
5849         binop.
5850
5851 Fri Mar 12 19:42:55 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5852
5853         * constants.c (find_class_or_string_constant): Cast variable `j'
5854         to a `jword' when comparing against one.
5855
5856         * expr.c (java_lang_expand_expr): Remove unused variables
5857         `has_finally_p' and `op0'.
5858
5859         * gjavah.c (print_field_info): Cast a value to jint when comparing
5860         against one.  Likewise for a jlong.
5861         (add_namelet): Likewise cast a `sizeof' to an int when comparing
5862         against a signed quantity.
5863
5864         * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
5865         (print_signature): Don't needlessly dereference variable `str'
5866
5867         * jcf-reader.c (get_attribute): Mark variables `max_stack' and
5868         `max_locals' with ATTRIBUTE_UNUSED.
5869         (jcf_parse_class): Likewise for variable `index'.
5870
5871         * parse.h (reverse_jdep_list): Remove static prototype.
5872
5873         * parse.y (build_jump_to_finally): Remove prototype and definition.
5874         (reverse_jdep_list): Add static prototype.
5875
5876         * typeck.c (convert_ieee_real_to_integer): Remove unused variables
5877         `assignment' and `expr_decl'.
5878
5879         * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
5880
5881 1999-03-12  Andrew Haley  <aph@cygnus.com>
5882
5883         * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
5884         we'll need a directory separator and a null character.
5885
5886 Wed Mar 10 23:20:11 1999  Per Bothner  <bothner@cygnus.com>
5887
5888         * jcf-write.c (generate_bytecode_insns):  Handle __builtin_fmod, for %.
5889
5890   Tue Mar  9 11:52:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
5891
5892         * parse.y (method_header): Don't set ACC_ABSTRACT flags on
5893         interfaces.
5894
5895 Fri Mar  5 15:17:29 1999  Per Bothner  <bothner@cygnus.com>
5896
5897         * lex.c (java_parse_end_comment):  Take extra parameter (next char).
5898
5899         * class.c (build_utf8_ref):  Fix possible name class/ambiguity.
5900
5901         * class.c (layout_class_method):  A static method in a base class
5902         is never overridden, so treat it like it doesn't exist.
5903         However, do complain about private non-static method overriding
5904         public static method.
5905
5906         * parse.y:  Don't set unused INITIALIZED_P flag.
5907         * java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
5908
5909         * parse.y (find_expr_with_wfl):  Optimize tail-calls.
5910         (build_array_from_name):  Re-order &index[string] to &string[index].
5911
5912         * parse.y (java_complete_lhs):  Don't call patch_assignment if rhs is
5913         error_mark (it might catch more errors, but it is more likely to lose).
5914
5915 Sat Mar  6 11:17:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5916
5917         * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
5918         (parse-scan.o): Depend on toplev.h.
5919
5920         * class.c (make_method_value): Add prototype.  Make it static.
5921         Remove unused second argument, caller changed.
5922
5923         * expr.c (java_lang_expand_expr): Remove unused variable
5924         `return_label'.
5925
5926         * java-tree.h: Don't prototype find_in_current_zip.
5927         Add prototypes for verify_constant_pool, start_java_method,
5928         end_java_method, give_name_to_locals, expand_byte_code,
5929         open_in_zip, set_constant_value, find_constant1, find_constant2,
5930         find_utf8_constant, find_string_constant, find_class_constant,
5931         find_fieldref_index, find_methodref_index, write_constant_pool,
5932         count_constant_pool_bytes and encode_newarray_type.
5933
5934         * jcf-dump.c: Remove unused variable `LONG_temp'.
5935
5936         * jcf-parse.c: Include parse.h.
5937         (jcf_parse_source): Remove unused parameter, all callers changed.
5938         (jcf_figure_file_type): Add static prototype.
5939         (find_in_current_zip): Likewise.  Also remove unused parameter,
5940         all callers changed.
5941         (read_class): Initialize variable `saved_pos'.
5942
5943         * jcf-reader.c (jcf_parse_preamble): Mark variables
5944         `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
5945
5946         * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
5947         (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
5948         (java_parse_doc_section): Initialize variable `seen_star'.
5949         (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
5950         (java_lex_error): Mark parameters `msg' and `forward' with
5951         ATTRIBUTE_UNUSED.
5952         (java_get_line_col): Mark parameters `filename' and `line' with
5953         ATTRIBUTE_UNUSED.
5954
5955         * parse-scan.y: Include toplev.h.
5956         (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
5957
5958         * parse.h: use `struct JCF', not plain `JCF'.
5959         (java_parser_context_save_global, java_expand_classes
5960         java_parser_context_restore_global, java_parse): Add prototypes.
5961
5962         * typeck.c (convert_ieee_real_to_integer): Remove unused variable
5963         `node'.
5964
5965 Wed Feb 24 16:13:59 1999  Per Bothner  <bothner@deneb.cygnus.com>
5966
5967         *  check-init.c (check_init):  COPYN takes word count, not bit count.
5968
5969 Fri Feb 26 14:06:21 1999  Per Bothner  <bothner@cygnus.com>
5970
5971         * typeck.c (convert_ieee_real_to_integer):  Use save_expr instead of
5972         explicit build_decl.  (Avoids crash in reload when optimizing.)
5973
5974 Thu Feb 25 21:05:04 1999  Per Bothner  <bothner@cygnus.com>
5975
5976         * decl.c (complete_start_java_method):  Handle synchronized method
5977         even when compiling from bytecode.
5978
5979 1999-02-26  Tom Tromey  <tromey@cygnus.com>
5980
5981         * gjavah.c (add_class_decl): Only generate `#include' if outer
5982         class is not the name of the class we are processing.  Correctly
5983         append `.h' in #include.
5984         (process_file): Clean up newlines around generated `#include's.
5985         (decode_signature_piece): Correctly handle inner classes.
5986         (struct include): New structure.
5987         (all_includes): New global.
5988         (print_include): New function.
5989         (add_class_decl): Use it.
5990         (process_file): Likewise.
5991         (add_class_decl): Generate include for java-array.h if array
5992         seen.
5993         (process_file): Don't generate java-array.h include.
5994
5995         * gjavah.c (add_namelet): Check for standard package names here.
5996         (add_class_decl): Don't check for standard package names here.
5997
5998 1999-02-25  Tom Tromey  <tromey@cygnus.com>
5999
6000         * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
6001         When reading a zip file, only use strncmp if both strings are
6002         bigger than the buffer length.  Initialize `k' when looping
6003         through zip file.
6004
6005 1999-02-24  Tom Tromey  <tromey@cygnus.com>
6006
6007         * gjavah.c (struct namelet): New structure.
6008         (add_namelet): New function.
6009         (print_namelet): New function.
6010         (print_class_decls): Use add_namelet and print_namelet to generate
6011         namespaces and not classes.
6012         (method_printed): New global.
6013         (HANDLE_END_METHOD): Examine method_printed.
6014         (print_method_info): Set method_printed when required.  Print
6015         error if function to be ignored is marked virtual.  Handle $finit$
6016         method.
6017         (METHOD_IS_FINAL): New macro.
6018         (print_field_info): Use it.
6019         (HANDLE_METHOD): Clear method_printed.
6020         (method_pass): New global.
6021         (HANDLE_END_FIELD): Call add_class_decl on the first pass.
6022         (process_file): Do two passes over both fields and methods.
6023         (HANDLE_METHOD): Examine method_pass.
6024         (root): New global.
6025         (add_class_decl): New function.
6026         (print_class_decls): Don't scan over entire constant pool.
6027
6028 1999-02-23  Tom Tromey  <tromey@cygnus.com>
6029
6030         * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
6031         disable linking in that case.
6032
6033 1999-02-20  Tom Tromey  <tromey@cygnus.com>
6034
6035         * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
6036         not 0x1f.
6037
6038 Sun Feb 21 14:56:11 1999  Per Bothner  <bothner@cygnus.com>
6039
6040         * decl.c (build_result_decl), java-tree.h:  New method.
6041         (complete_start_java_method):  Handle synchronized methods.
6042         Don't build DECL_RESULT here.  (Ordering dependency problem.)
6043         (start_java_method):  Call build_result_decl here instead  ...
6044         * parse.y (java_complete_expand_method):  ... and here.
6045         (expand_start_java_method): Don't call complete_start_java_method here.
6046         (java_complete_expand_method):  Call it here instead.
6047         * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT):  Moved to ..
6048         * java-tree.h:  ... here.
6049
6050         * expr.c (force_evaluation_order):  Fix typo, don't handle ARRAY_REF.
6051         * parse.y (java_complete_lhs):  Don't call force_evaluation_order
6052         for ARRAY_REF - it doesn't work when array bounds are checked.
6053         (patch_array_ref):  Handle it here instead.
6054
6055         * jcf-write.c (generate_classfile):  Emit "Exceptions" attribute.
6056
6057 Fri Feb 19 15:35:01 1999  Per Bothner  <bothner@cygnus.com>
6058
6059         Force left-to-right evaluation of binary operations etc.
6060         * expr.c (force_evaluation_order), java-tree.h:  New function.
6061         * parse.y (java_complete_lhs):  Pass binary operations, procedure
6062         calls, and ARRAY_REFs to force_evaluation_order.
6063         (various):  Set TREE_SIDE_EFFECTS more carefully.
6064
6065         Tolerate random (non-UTF8) encoding in comments without complaining.
6066         * lex.c (java_read_char):  Return 0xFFFE if bad UTF8 encoding.
6067         (java_is_eol):  Handle '\r' followed by '\n' instead of vice versa.
6068
6069         * parse.y (resolve_qualified_expression_name):  Handle error_mark.
6070         (java_complete_node case EXPR_WITH_FILE_LOCATION):  Likewise.
6071
6072         * parse.y (java_complete_lhs):  Ignore an empty statement in a
6073         COMPOUND_EXPR.  Don't complain about empty statement after return.
6074
6075 Fri Feb 19 13:00:56 1999  Per Bothner  <bothner@cygnus.com>
6076
6077         * parse.y (obtain_incomplete_type):  Don't wrap unknown types
6078         in TREE_LIST - just chain the POINTER_TYPEs together.
6079         (resolve_class):  If type already resolved, return decl.
6080         After resolving, update TREE_TYPE(class_type), and name (if array).
6081         * parse.h (do_resolve_class), parse.y:  Make non-static.
6082         * class.c (maybe_layout_super_class):  Take this_class argument.
6083         Do do_resolve_class if necessary.
6084         (layout_class, layout_class_methods): Adjust calls appropriately.
6085         * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
6086         JDEP_RESOLVED_P):  Redefined for new TREE_LIST-less convention.
6087         * typeck.c (build_java_array_type):  Don't call layout_class.
6088
6089 Wed Feb 17 15:47:20 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6090
6091         * parse.y (check_pkg_class_access): Allow private class access
6092         within the same package.
6093         (strip_out_static_field_access_decl): New function.
6094         (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
6095         operator argument before testing its nature.
6096
6097 Wed Feb  3 12:38:43 1999  Per Bothner  <bothner@cygnus.com>
6098
6099         * java-tree.def (FINALLY_EXPR):  Removed.  (Now uses TRY_FINALLY_EXPR.)
6100         (TRY_EXPR):  Simplify - it no longer has a finally clause.
6101         * check-init.c (check_init):  Handle TRY_FINALLY_EXPR.
6102         Simpler handling of TRY_EXPR, which no longer has a finally clause.
6103         * expr.c (java_lang_expand_expr):  Likewise.
6104         * java-tree.h (CATCH_EXPR_GET_EXPR):  Removed - no longer needed.
6105         * parse.h (java_get_catch_block), parse.y:  Removed - no longer needed.
6106         * parse.y (java_complete_lhs):  Add support for TRY_FIANLLY_EXPR.
6107         (build_try_statement):  Remove finally parameter and handling.
6108         (build_try_finally_statement):  New function.
6109         (patch_try_statement):   No longer need to support finally clause.
6110         (try_statement):  Update grammar action rules.
6111         * jcf-write.c (generate_bytecode_insns):  Handle TRY_FINALLY_EXPR.
6112         Simpler handling of TRY_EXPR, which no longer has a finally clause.
6113
6114 1998-11-26  Andrew Haley  <aph@viagra.cygnus.co.uk>
6115
6116         * jcf-parse.c (get_constant): Add braces around computation of 'd'
6117         when REAL_ARITHMETIC is not defined.  [Oct 26 fix got overwritten -PB]
6118
6119 1999-02-17  Andrew Haley  <aph@cygnus.com>
6120
6121         * class.c (build_utf8_ref): Back out broken patch which was
6122         intended to to output signatures using '.' as a separator.
6123
6124         * class.c (make_class_data): Output signatures using '.' as a
6125         separator, rather than '/'.
6126         (mangled_classname): Likewise.
6127         (make_field_value): Likewise.
6128         (make_method_value): Likewise.
6129         * constants.c (alloc_class_constant): Likewise.
6130         * expr.c (build_invokeinterface): Likewise.
6131
6132 Thu Feb 11 21:25:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6133
6134         * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
6135         of an ancient workaround.
6136
6137 Wed Feb 10 23:27:33 1999  Jeffrey A Law  (law@cygnus.com)
6138
6139         * jvspec.c (xmalloc): Kill the prototype.  It does not belong
6140         here anymore.
6141
6142 1999-02-10  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6143
6144         * lex.c (yylex): Encode \0 as UTF8.
6145
6146 1999-02-10  Tom Tromey  <tromey@cygnus.com>
6147
6148         * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
6149         * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
6150         (libgcj_zip): Renamed.
6151         * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
6152         LIBJAVA_ZIP_FILE.
6153         (jcf_path_init): Use LIBGCJ_ZIP_FILE.
6154
6155         * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
6156         (GC_NAME): Renamed -lgc to -lgcjgc.
6157
6158 Tue Feb  9 19:31:09 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6159
6160         * lex.c (java_lang_cloneable): Initialize.
6161         * parse.y (java_lang_cloneable): New static variable.
6162         (qualify_ambiguous_name): Take CONVERT_EXPR into account when
6163         doing one more qualification round.
6164         (valid_ref_assignconv_cast_p): Reject null source or
6165         destination. Allow an array to be cast into java.lang.Cloneable.
6166         (patch_cast): Swapped two first arguments to first call to
6167         valid_ref_assignconv_cast_p.
6168
6169 Mon Feb  8 11:50:50 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6170
6171         * parse.h: DECL_P renamed JDECL_P.
6172         * parse.y: DECL_P replaced by JDECL_P.
6173         (build_array_from_name): Always use pointer's type.
6174         (patch_bc_statement): Extra code to search continue target in a
6175         for loop. Fixed comments. Continue target is current loop when
6176         unlabeled.
6177
6178 1999-02-05  Andrew Haley  <aph@cygnus.com>
6179
6180         * class.c (make_class_data): The superclass of an interface should
6181         be null, not class Object.
6182
6183         * lex.c (java_lex): Sign extend hex literals.
6184
6185 1999-02-04  Andrew Haley  <aph@cygnus.com>
6186
6187         * class.c (build_utf8_ref): Output signatures using '.' as a
6188         separator, rather than '/'.
6189         (make_class_data): Likewise.
6190
6191 Wed Feb  3 22:50:17 1999  Marc Espie <Marc.Espie@liafa.jussieu.fr>
6192
6193         * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
6194         mkstemp.o.  Get them from libiberty now.
6195
6196 Tue Feb  2 19:49:12 1999  Jeffrey A Law  (law@cygnus.com)
6197
6198         * jcf-io.c: Do not include sys/stat.h or sys/wait.h
6199
6200 Tue Feb  2 20:04:50 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6201
6202         * jvspec.c (xmalloc): Fix the prototype to match the one obtained
6203         from libiberty.h
6204
6205 Tue Feb  2 10:39:47 1999  Per Bothner  <bothner@cygnus.com>
6206
6207         Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
6208         * jcf-write.c (generate_bytecode_return):  New function.
6209         (generate_bytecode_insns):  Use it, for RETURN_EXPR.
6210
6211         * jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
6212         generate special [fd]const_[01] instructions.
6213
6214         * jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
6215
6216         * verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
6217         handling OPCODE_lookupswitch or OPCODE_tableswitch.
6218
6219 Mon Feb  1 20:44:47 1999  Per Bothner  <bothner@cygnus.com>
6220
6221         * parse.y (patch_method_invocation):  Handle calling static methods,
6222         even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
6223
6224         * parse.y (java_complete_lhs):  Don't complain about unreachable
6225         exit condition in a do-while statement.
6226
6227 Fri Jan 29 18:19:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6228
6229         * lex.c (java_read_char): Fixed utf8 decoding.
6230         (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
6231         range.
6232         * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
6233         comments. Local variable `all_primitive' is gone. Broadened
6234         acceptance of `0' to floating point targets. `long' can now be
6235         widened to `double' or `float'.
6236         (valid_method_invocation_conversion_p): Added leading
6237         comment. Fixed tabulation.
6238         (build_string_concatenation): Optimize out left or right empty
6239         string constants.
6240
6241 Thu Jan 28 18:51:26 1999  Per Bothner  <bothner@cygnus.com>
6242
6243         * jcf-write.c (localvar_alloc):  Only emit entry for
6244         LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
6245         (generate_bytecode_insns):  Only call put_linenumber if
6246         debug_info_level > DINFO_LEVEL_NONE.
6247         * jvspec.c (lang_specific_driver):  If no -O* or -g* option
6248         is specified, add -g1 (for compatibility wih javac).
6249
6250 Thu Jan 28 09:17:51 1999  Hans-Peter Nilsson  <hp@axis.se>
6251
6252         * java/Makefile.in: Add missing dependencies for jcf-dump.o,
6253         gjavah.o, check-init.o, jv-scan.o
6254
6255 Mon Feb  1 09:50:48 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6256
6257         * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
6258
6259         * gjavah.c: Include config.h and system.h.
6260
6261         * javaop.h (inline): Don't define, its handled by system.h.
6262         (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
6263         from `inline' to `static inline'.
6264
6265         * jcf.h (inline): Don't define, its handled by system.h.
6266
6267         * lex.c (inline): Likewise.
6268
6269 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
6270
6271         * lang-specs.h: Map -Qn to -fno-ident.
6272
6273 Fri Jan 29 16:51:56 1999  Richard Henderson  <rth@cygnus.com>
6274
6275         * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
6276
6277 1999-01-29  Tom Tromey  <tromey@cygnus.com>
6278
6279         * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
6280         then cast it to Object before calling `append' method.
6281
6282 Thu Jan 28 14:45:39 1999  Per Bothner  <bothner@cygnus.com>
6283
6284         * check-init.c (check_bool2_init, check_bool_init, check_init):
6285         Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
6286         * jcf-write.c (generate_bytecode_insns):  Likewise.
6287
6288 Thu Jan 28 11:50:11 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6289
6290         * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
6291         * parse.y (patch_cast): Allow a boolean to be cast into a
6292         boolean.
6293
6294 Wed Jan 27 10:19:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6295
6296         * parse.y: (class_declaration:): Fixed indentation.
6297         (class_member_declaration:): Extra `;' after field declaration now
6298         accepted.
6299         (interface_declaration:): Removed debug messages in error reports.
6300         (patch_binop): Nodes created and returned inherit the orignal
6301         node's COMPOUND_ASSIGN_P flag value.
6302         (patch_cast): Fix cast from char to floating point.
6303
6304 Mon Jan 25 17:39:19 1999  Andrew Haley  <aph@cygnus.com>
6305
6306         * except.c, java-except.h (expand_resume_after_catch): new
6307         function.
6308         * expr.c (java_lang_expand_expr): call expand_resume_after_catch
6309         to branch back to main flow of control after a catch block.
6310
6311 Sat Jan 23 23:02:43 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6312
6313         * Makefile.in (parse.o): Depend on $(CONFIG_H) and
6314         $(srcdir)/../system.h.
6315         (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
6316         (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
6317         (jcf-write.o): Likewise.
6318         (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
6319         (mangle.o): Depend on $(srcdir)/../toplev.h.
6320         (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
6321         (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
6322
6323         * class.c: Include output.h and parse.h.
6324         (mangled_classname): Add the `const' keyword to a char*.
6325         (find_named_method): Hide unused function definition.
6326         (build_utf8_ref): Change type of variable `c' to unsigned char.
6327         Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
6328         (build_class_ref): Add the `const' keyword to a char*.
6329         (layout_class_method): Remove unused variable `buf'.
6330
6331         * decl.c (find_local_variable): Remove unused variable `rtl'.
6332         (pushdecl): Likewise for variables `different_binding_level' and
6333         `oldglobal'.
6334         (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
6335         (maybe_build_cleanup): Likewise for parameter `decl'.
6336
6337         * except.c (expand_start_java_handler): Mark parameter `range'
6338         with ATTRIBUTE_UNUSED.
6339
6340         * expr.c: Include except.h.
6341         (pop_type): Remove unused variable `i'.
6342         (pop_value): Likewise for variables `n_words' and `i'.
6343         (expand_java_arrayload): Likewise for variable `convert'.
6344         (java_lang_expand_expr): Likewise for variables `op0', `type',
6345         `mode', `unsignedp', `node' and `elements'.
6346         (expand_byte_code): Likewise for variables `prev_eh_ranges' and
6347         `eh_ranges'.
6348         (process_jvm_instruction): Add a `const' qualifier to a char*.
6349
6350         * gjavah.c (output_directory): Add the `const' keyword to a char*.
6351         (temp_directory): Likewise.
6352         (print_c_decl): Likewise.
6353         (print_method_info): Likewise.
6354         (decode_signature_piece): Likewise.
6355         (print_mangled_classname): Likewise.
6356
6357         * java-except.h: Provide prototypes for maybe_start_try,
6358         maybe_end_try and add_handler.
6359
6360         * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
6361         (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
6362         (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
6363         init_expr_processing, push_super_field, init_class_processing,
6364         can_widen_reference_to, class_depth, verify_jvm_instructions,
6365         maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
6366         set_local_type, merge_type_state, push_type, load_type_state,
6367         add_interface, find_in_current_zip, append_gpp_mangled_classtype,
6368         emit_unicode_mangled_name): Add prototypes.
6369
6370         * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
6371         (print_signature_type): Use ISDIGIT, not isdigit.
6372         (print_signature): Remove unused variable `j'.
6373
6374         * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
6375         int when comparing against one.
6376
6377         * jcf-parse.c: Include toplev.h.
6378
6379         * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
6380         (localvar_free): Remove unused variable `i'.
6381         (generate_bytecode_conditional): Likewise for variable `kind'.
6382
6383         * jv-scan.c: Include config.h and system.h.  Remove redundant
6384         OS header and gansidecl.h includes.
6385         (warning): Add the `const' keyword to a char*.  Also add
6386         ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
6387         __STDC__, when determining whether to use ANSI-isms.
6388         (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
6389         (xmalloc): Don't redundantly prototype here.
6390         (main): Remove unused parameter `envp'.  Also fix the arguments
6391         passed to function `fatal' to match the format specifier.
6392
6393         * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
6394
6395         * mangle.c: Include toplev.h.
6396         (emit_unicode_mangled_name): Declare parameter `len'.
6397
6398         * parse.y (parse_warning_context): Add the `const' keyword to a
6399         char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
6400         `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
6401         (issue_warning_error_from_context): Add the `const' keyword to
6402         a char*.
6403         (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
6404         not `__STDC__' for whether to use ANSI-isms.
6405
6406         * typeck.c (incomplete_type_error): Mark parameters `value' and
6407         `type' with ATTRIBUTE_UNUSED.
6408         (parse_signature_type): Use ISDIGIT, not isdigit.
6409
6410         * verify.c (check_pending_block): Add the `const' keyword to a char*.
6411         (verify_jvm_instructions): Likewise.  Remove unused variables
6412         `field_name' and `default_val'.
6413
6414         * zextract.c: Include config.h and system.h.  Remove redundant
6415         OS header includes.
6416
6417         * zipfile.h: Prototype `read_zip_archive'.
6418
6419 Thu Jan 21 16:00:06 1999  Andrew Haley  <aph@cygnus.com>
6420
6421         * typeck.c (convert): Allow conversions to void type: some
6422         optimizations in gcc do this.
6423
6424 Thu Jan 21 15:21:49 1999  Andrew Haley  <aph@cygnus.com>
6425
6426         * typeck.c (convert_ieee_real_to_integer): New function.
6427         (convert): When not using fast-math and using hardware fp, convert
6428         an IEEE NaN to zero.
6429
6430 1999-01-18  Andrew Haley  <aph@cygnus.com>
6431
6432         * parse.y (patch_binop): Do a type conversion from signed to
6433         unsigned and then back to signed when a ">>>" is found.
6434
6435 Sun Jan 17 22:34:22 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6436
6437         * java-tree.h: (check_for_initialization): Added prototype.
6438         * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
6439         * parse.y (do_resolve_class): Removed unused locals.
6440         (read_import_dir): Likewise.
6441         (resolve_qualified_expression_name): Array creation
6442         expressions are valid primary expressions.
6443         (qualify_ambiguous_name): Likewise.
6444         (patch_synchronized_statement): Removed unused local.
6445
6446 Sun Jan 17 21:55:42 1999  Jeffrey A Law  (law@cygnus.com)
6447
6448         * Makefile.in (zextract.o): Add dependencies.
6449
6450         * Makefile.in: Do not put ^Ls at the start of a line.
6451
6452 Fri Jan 15 20:16:20 1999  Per Bothner  <bothner@cygnus.com>
6453
6454         * expr.c (process_jvm_instruction):  Coerce to correct Throwable
6455         sub-type the result of the call that gets the exception value.
6456
6457         * parse.y (java_complete_expand_methods):  If flags_syntax_only,
6458         don't call finish_class.
6459
6460         * parse.y (java_check_regular_methods):  If METHOD_PRIVATE,
6461         clear found before continuing.
6462
6463         * verify.c (verify_jvm_instructions):  On an array load, allow
6464         and handle top of stack to be TYPE_NULL.
6465
6466         * gjavah.c (generate_access):  Translate Java package private or
6467         protected access to C++ public, but with a comment.
6468
6469 1999-01-13  Andrew Haley  <aph@cygnus.com>
6470
6471         * expr.c (generate_name): Name prefix changed to avoid clashes
6472         with assembler temp labels.
6473
6474         * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
6475         MODIFY_EXPR.  Without this, code for the assignement may not be
6476         generated at all and the synchronized statement will read an
6477         uninitialized variable.
6478
6479 Wed Jan 13 01:24:54 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6480
6481         * class.c (maybe_layout_super_class): Fixed returned value.
6482         * lex.c: Added 1999 to the copyright.
6483         (java_init_lex): Initialize java_lang_imported.
6484         * lex.h: Added 1999 to the copyright.
6485         * parse.h: Added 1999 to the copyright.
6486         (REGISTER_IMPORT): Fixed typo in trailing macro.
6487         (CURRENT_OSB): New macro.
6488         (struct parser_ctxt): New fields osb_depth, osb_limit.
6489         * parse.y (java_lang_id): New global variable.
6490         (type_import_on_demand_declaration): Don't import java.lang.* twice.
6491         (array_creation_expression:): Use CURRENT_OSB.
6492         (dims:): Uses a stack to keep track of array dimensions.
6493         (cast_expression:): Use CURRENT_OSB.
6494         (find_expr_with_wfl): Return NULL if node found doesn't meet the
6495         conditions.
6496         (register_fields): Fixed typos in comment.
6497         (check_method_redefinition): Fixed comment indentation.
6498         (java_check_regular_methods): Set saved found wfl to NULL after
6499         having reinstalled it in the previously found DECL_NAME.
6500
6501 Sun Jan 10 13:36:14 1999  Richard Henderson  <rth@cygnus.com>
6502
6503         * gjavah.c (java_float_finite): Use a union to do type punning.
6504         (java_double_finite): Likewise.
6505
6506 Sat Jan  9 11:25:00 1999  Per Bothner  <bothner@cygnus.com>
6507
6508         * parse.y (build_new_array_init):  Don't set EXPR_WFL_LINECOL
6509         on CONSTRUCTOR (since that trashes TREE_CST_RTL).
6510         (patch_new_array_init):  Clear TREE_CONSTANT also if INDIRECT_REF.
6511         (register_fields):  Set TREE_STATIC on NEW_ARRAY_INIT, not on
6512         CONSTRUCTOR (which causes expand_expr to call output_constant_def).
6513         * expr.c (java_lang_expand_expr):  Check TREE_STATIC of NEW_ARRAY_INIT.
6514
6515 Fri Jan  8 15:48:03 1999  Per Bothner  <bothner@cygnus.com>
6516
6517         * check-init.c (check_init):  If compiling to native, we don't
6518         see THROW_EXPR.  Instead, look for a call to throw_node (_Jv_Throw).
6519
6520 1999-01-08  Tom Tromey  <tromey@cygnus.com>
6521
6522         * parse-scan.y (variable_declarator_id): Set or increment
6523         bracket_count.
6524         (bracket_count): New global.
6525         (formal_parameter): Handle case where bracket pairs trail variable
6526         declarator id.
6527
6528 1999-01-07  Andrew Haley  <aph@viagra.cygnus.co.uk>
6529
6530         * jcf-parse.c (yyparse): variable len changed from a char to an
6531         int to prevent overflow.
6532
6533 Wed Jan  6 17:19:46 1999  Per Bothner  <bothner@cygnus.com>
6534
6535         * java-tree.h:  Declare read_class.
6536         * jcf-parse.c (read_class):  New function.
6537         (load_class):  Now just call read_class.
6538
6539         * java-tree.h (java_parse_abort_on_error):  Only return if new errors.
6540         * jcf-parse.c (parse_source_file):  Declare save_error_count,
6541         which is needed by java_parse_abort_on_error macro,
6542         * parse.y (java_layout_classes, java_expand_classes):  Likewise.
6543
6544         * parse.y (register_fields):  Set TREE_STATIC flag of NEW_ARRAY_INIT
6545         constructor, if initializing a static field.
6546         (patch_new_array_init):  Set TREE_CONSTANT if it is.
6547         * expr.c (java_lang_expand_expr):  For a static array constructor
6548         of primitive elements, allocate the array itself statically.
6549         Disabled until we can set the vtable field statically.
6550
6551         * check-init.c:  New file.  Checks for definite assignment.
6552         * Makefile.in (JAVA_OBJS):  Add check-init.o.
6553         * parse.y (java_complete_expand_method): Call check_for_initialization.
6554         * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY):  Moved to java-tree.h.
6555
6556 Wed Jan  6 14:53:10 1999  Graham <grahams@rcp.co.uk>
6557
6558         * parse.y : include system.h instead of including
6559         standard headers directly with the exception of <dirent.h>.
6560
6561 Wed Jan  6 16:20:06 1999  Per Bothner  <bothner@cygnus.com>
6562
6563         * lex.h:  Moved static function declarations to lex.c,
6564         to shut up some -Wall warnings.
6565         * lex.c:  Static function declarations moved here.
6566         * jcf-dump.c:  Small fixes to shut up -Wall warnings.
6567
6568 Tue Jan  5 22:15:40 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6569
6570         * Make-lang.in ($(GCJ).o): Depend on prefix.h.
6571
6572 Tue Dec 22 11:25:19 1998  Per Bothner  <bothner@cygnus.com>
6573
6574         * expr.c (process_jvm_instruction):  Do load_type_state after JSR.
6575         * verify.c (verify_jvm_instructions):  Fix off-by-one error.
6576
6577         * jcf-write.c (CHECK_PUT):  Add (void) cast to avoid -Wall warnings.
6578         (localvar_alloc):  Change return type to void,
6579         (emit_unop):  Remove unused variable size.
6580
6581         * jcf-write.c (struct jcf_block):  Add new union.
6582         (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC):  New macros.
6583         (call_cleanups):  New functions.
6584         (struct jcf_partial):  New fields num_finalizers and return_value_decl.
6585         (generate_bytecode_insns):  Support CLEANUP_POINT_EXPR and
6586         WITH_CLEANUP_EXPR.  Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
6587         * lang.c (lang_init):  Call using_eh_for_cleanups.
6588         * parse.y (java_complete_lhs):  For SYNCHRONIZED_EXPR, defer
6589         completing operands to patch_synchronized_statement.
6590         Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
6591         (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
6592         WITH_CLEANUP_EXPR instead of TRY_EXPR.
6593
6594 Sun Dec 20 16:15:44 1998  John F. Carr  <jfc@mit.edu>
6595
6596         * Make-lang.in: Comment out control-Ls; they upset some makes.
6597
6598 1998-12-18  Tom Tromey  <tromey@cygnus.com>
6599
6600         * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
6601         consistently.
6602
6603 1998-12-17  Tom Tromey  <tromey@cygnus.com>
6604
6605         * parse.y (DIR_SEPARATOR): New define.
6606         (check_class_interface_creation): Use it.
6607
6608         * parse-scan.y (report_main_declaration): Recognize
6609         `java.lang.String' in argument to main.
6610
6611 Wed Dec 16 16:18:59 1998  Per Bothner  <bothner@cygnus.com>
6612
6613         * parse.y (create_interface):  Remove bogus test.
6614
6615 Wed Dec 16 14:42:19 1998  Per Bothner  <bothner@cygnus.com>
6616
6617         * jcf-parse.c (get_constant):  Set TREE_TYPE for string constants.
6618         (HANDLE_CONSTANTVALUE):  If flag_emit_class_files, call get_constant.
6619
6620 1998-12-16  Tom Tromey  <tromey@cygnus.com>
6621
6622         * parse-scan.y (qualified_name): Use correct sprintf format.
6623
6624 1998-12-15  Tom Tromey  <tromey@cygnus.com>
6625
6626         * gjavah.c (print_field_info): Changed how most negative number is
6627         printed.
6628
6629 Mon Dec 14 18:49:29 1998  Per Bothner  <bothner@cygnus.com>
6630
6631         * parse.y (fold_constant_for_init):  New function.
6632         (resolve_expression_name):  Don't replace static final
6633         constant-initialized fields by its value.
6634         (java_complete_lhs):  New.  Same as java_complete_tree, except does
6635         not replace static final constant-initialized fields by their values.
6636         (register_fields):  If there is an initializer, set DECL_INITIAL and
6637         MODIFY_EXPR_FROM_INITIALIZATION_P.
6638         (java_complete_tree):  For MODIFY_EXPR, use java_complete_lhs for lhs.
6639         Only call patch_initialized_static_field if
6640         MODIFY_EXPR_FROM_INITIALIZATION_P.
6641         (patch_initialized_static_field):  If not valid constant, clear
6642         DECL_INITIAL.
6643
6644         * parse.y (lookup_field_wrapper):  Fix thinko.
6645
6646         * parse.y (java_complete_tree):  In EXPR_WITH_FILE_LOCATION,
6647         set and restore global lineno.
6648
6649 1998-12-14  Tom Tromey  <tromey@cygnus.com>
6650
6651         * gjavah.c (print_field_info): If value to print is the smallest
6652         value of its size, then print as hex to avoid later warnings from
6653         C++ compiler.
6654
6655 1998-12-14  Tom Tromey  <tromey@cygnus.com>
6656
6657         * gjavah.c (decompile_method): Decompile `return null'.
6658         (process_file): Generate `#pragma interface'.
6659         (method_declared): New global.
6660         (print_method_info): Set it.
6661         (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
6662         (print_method_info): Handle abstract methods.
6663
6664 Sun Dec 13 17:31:40 1998  Per Bothner  <bothner@cygnus.com>
6665
6666         * parse.y (patch_method_invocation):  If class_decl is null
6667         (e.g. an array type), use original type.
6668
6669         * parse.y (check_thrown_exceptions):  Temporary hack to suppress
6670         errors about uncaught exception from clone (of array, specifically).
6671
6672 1998-12-13  Tom Tromey  <tromey@cygnus.com>
6673
6674         * gjavah.c (decompile_method): Handle all types of `return'
6675         opcode.  Decompile `return this' and `return'.
6676         (method_access): New global.
6677         (print_method_info): Set it.
6678         (decompile_method): Don't decompile a synchronized method.
6679
6680 1998-12-13  Tom Tromey  <tromey@cygnus.com>
6681
6682         * jcf-reader.c (jcf_parse_one_method): Recognize
6683         HANDLE_END_METHOD.
6684         * gjavah.c (HANDLE_END_METHOD): New macro.
6685         (HANDLE_CODE_ATTRIBUTE): New macro.
6686         (decompile_method): New function.
6687         (print_method_info): Don't print `;\n' at end of function decl.
6688         Include java-opcodes.h.
6689         (decompiled): New global.
6690
6691 Sat Dec 12 20:13:19 1998  Per Bothner  <bothner@cygnus.com>
6692
6693         * class.c (build_class_ref):  Handle PRIMTYPE.class if
6694         flag_emit_class_files.
6695         * expr.c (expand_java_field_op):  Don't optimize java.lang.XXX.TYPE
6696         if flag_emit_class_files.
6697         * parse.y (java_complete_tree):  Pre-liminary support for
6698         COMPONENT_REF - only to handle PRIMCLASS.TYPE.
6699
6700         * parse.y (patch_synchronized_statement):   Don't call monitorexit
6701         unless block CAN_COMPLETE_NORMALLY.  Propagate that flag properly.
6702
6703         * java-tree.h (DECL_LOCAL_STATIC_VALUE):  Removed - no longer used.
6704
6705         * zipfile.h (opendir_in_zip):  New declaration.
6706         * jcf-io.c (saw_java_source):  Moved to jcf-parse.c.
6707         (opendir_in_zip):  New function, using code from open_in_zip.
6708         (open_in_zip):  Call opendir_in_zip.
6709         (find_class):  Remove no-longer-used do_class_file parameter,
6710         but add source_ok parameter.  Change logic so if we find a .java file,
6711         we don't look for .class in later classpath emtries.
6712         * jcf-parse.c (load_class):  Pass saw_java_source to find_class.
6713         (jcf_figure_file_type):  Only call open_in_zip if correct magic number.
6714         * gjavah.c: Update call to find_class.
6715         * jcf-dump.c:  Likewise.
6716
6717         * jcf-write.c (put_linenumber):  Handle duplicate line numbers.
6718         (generate_bytecode_insns):  For EXPR_WITH_FILE_LOCATION, do
6719         nothing if body is empty_stmt_node.
6720         Various little fixes so SP gets correctly adjusted.
6721         For NEW_ARRAY_INIT, handle IGNORE_TARGET.
6722         For CALL_EXPR, test if static first.
6723         (generate_classfile):  Ignore fields that are DECL_ARTIFICIAL,
6724         such as the ones we create for Object and Class.
6725         Set and restore current_function_decl.
6726         * parse.y:  Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
6727         (note_possible_classname):  New function.
6728         (read_import_entry):  Removed.  Merged with read_import_dir.
6729         (read_import_dir):  Don't call find_class - that only gives us
6730         the first classpath entry having the needed package.
6731         Use the struct buffer data structure from buffer.h.
6732         (read_import_dir, find_in_imports_on_demand):  The remembered
6733         class names now use '.' (not '/') as package separator.
6734
6735         * parse.y (java_complete_expand_methods):  Call write_classfile
6736         here, and not in java_expand_classes (which only gets first class).
6737
6738 Sat Dec 12 19:46:04 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6739
6740         * parse.y (<type_declaration>):  Do maybe_generate_clinit last.
6741         (register_fields):  If a static fields has an initializer, just
6742         chain it on ctxp->static_initialized, and handle later.
6743         (java_complete_expand_methods):  Force <clinit> first.
6744         (resolve_expression_name, resolve_field_access):  Just get DECL_INITIAL
6745         - it's already been completed.
6746         (patch_initialized_static_field):  New function.
6747         (java_complete_field):  Call it.
6748
6749 Sat Dec 12 19:21:11 1998  Per Bothner  <bothner@cygnus.com>
6750
6751         * expr.c (encode_newarray_type, build_new_array):  New functions.
6752         * java-tree.h:  Declare build_new_array.
6753         * jcf-write.c (patch_newarray):  Use build_new_array.
6754
6755         * expr.c (java_lang_expand_exp):  Support NEW_ARRAY_INIT.
6756         * jcf-write.c (generate_bytecode_insns):  Support NEW_ARRAY_INIT.
6757
6758         * parse.y (patch_new_array_init):  Re-organize.
6759         Now is passed the actual array (pointer) type of the value.
6760         Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
6761         (patch_array_constructor):  Removed - merged into patch_new_array_init.
6762         (java_complete_tree):  Update patch_new_array_init.
6763
6764         * jcf-write.c (find_constant_index):  New function.
6765         (generate_bytecode_insns):  Use find_constant_index.
6766         (generate_classfile):  Use find_constant_index for ConstantValue.
6767
6768 1998-12-11  Tom Tromey  <tromey@cygnus.com>
6769
6770         * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
6771         * decl.c (init_decl_processing): Renamed dtable -> vtable.
6772         * class.c (make_class_data): Renamed dtable -> vtable, and
6773         dtable_method_count -> vtable_method_count.
6774
6775 Thu Dec 10 20:00:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6776
6777         * decl.c (long_zero_node, float_zero_node, double_zero_node): New
6778         global variables, initialized.
6779         * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
6780         Declared new global variables.
6781         * lex.c (java_lex): Return long_zero_node, float_zero_node,
6782         double_zero_node, integer_zero_node upon direct matching.
6783         * parse.y (purify_type_name): Added function prototype.
6784         (duplicate_declaration_error_p): Consider new_type as potentially
6785         being a incomplete type. Use purify_type_name on type string.
6786         (method_header): saved_type: unused variable removed. Don't figure
6787         return type if method name is invalid.
6788         (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
6789         processed by patch_unaryop.
6790         (patch_unaryop): Fixed typo in comment. Re-convert pre/post
6791         increment/decrement node into its original type after binary
6792         numeric promotion on its operands.
6793
6794 Thu Dec 10 11:02:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6795
6796         * parse.y (array_initializer:): Array init operand is NULL_TREE
6797         instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
6798         now an error. Fixed indentation problems.
6799         (patch_string): Handle error_mark_node as an argument.
6800         (patch_new_array_init): Fixed indentation problems.
6801         (array_constructor_check_entry): Removed check on null wfl_value.
6802         Return an error if wfl_value's walk returns an error.
6803
6804 Wed Dec  9 15:37:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6805
6806         * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
6807         * lex.c (java_lex): Remember column position before advancing one
6808         token. Retain location information on OCB_TK.
6809         * lex.h (typedef struct java_lc): Added new field.
6810         * parse.h (GET_SKIP_TYPE): New macro.
6811         (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
6812         * parse.y (build_new_array_init, patch_new_array_init,
6813         patch_array_constructor, maybe_build_array_element_wfl,
6814         array_constructor_check_entry): New function prototypes.
6815         (switch_block:): Tagged <node>.
6816         (OCB_TK): Tagged <operator>.
6817         (array_initializer:): Installed actions.
6818         (variable_initializer): Build location information on element if
6819         necessary.
6820         (switch_statement:): Fixed indentation typo.
6821         (switch_block:): Redefined default action.
6822         (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
6823         (patch_assignment): Removed duplicate code.
6824         (maybe_build_array_element_wfl, build_new_array_init,
6825         patch_new_array_init, patch_array_constructor,
6826         array_constructor_check_entry): New functions.
6827
6828 Mon Dec  7 15:13:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6829
6830         * parse.y (array_initializer): Tagged <node>.
6831         (variable_initializer:): Use default rule.
6832         (array_initializer:): Defined actions.
6833         (variable_initializers:): Likewise.
6834         (resolve_qualified_expression_name): Use DECL_CONTEXT to build
6835         non-static field accesses.
6836         (patch_invoke): Fixed indentation typo.
6837         (java_complete_tree): Likewise.
6838         (build_labeled_block): Changed leading comment. Generate an error
6839         in case of duplicate loop labels.
6840         (patch_conditional_expr): Patch results of string concatenation
6841         operations.
6842
6843 Sun Dec  6 13:45:00 1998  Per Bothner  <bothner@cygnus.com>
6844
6845         * constants.c (find_methodref_index):  When the class is an interface,
6846         generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
6847
6848         * decl.c (finit_identifier_node):  Use "$finit$", rather than
6849         "<finit>" (which Sun's verifier rejects).
6850         * parse.y (maybe_generate_finit):  Leave out meaningless final flag.
6851         (generate_field_initialization_code):  Removed.
6852         (fix_constructors)  Don't add call to $finit$ here (wrong order).
6853         (patch_method_invocation):  Add $finit$ call here.
6854
6855         * java-tree.h (CALL_USING_SUPER):  New macro.
6856         * parse.y (patch_invoke):  Remove im local variable.
6857         (patch_method_invocation, patch_invoke):  Don't pass super parameter.
6858         (patch_invoke):  Use CALL_USING_SUPER instead of from_super parameter.
6859         (resolve_qualified_expression_name):  Maybe set CALL_USING_SUPER.
6860
6861         * jcf-write.c (get_access_flags):  Fix typo ACC_PUBLIC -> ACC_FINAL.
6862
6863         * parse.y (java_complete_tree):  Don't complain about unreachable
6864         statement if it is empty_stmt_node.
6865
6866         * jcf-write.c (find_constant_wide):  New function.
6867         (push_long_const):  Use find_constant_wide.
6868
6869         * jcf-write.c (generate_bytecode_insn):  Fix bug in switch handling.
6870         (generate_bytecode_insn):  Use correct dup variant for MODIFY_EXPR.
6871         Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
6872         Emit invokeinterface when calling an interface method.
6873         Emit invokespecial also when calling super or private methods.
6874
6875         * jcf-write.c (generate_classfile):  Emit ConstantValue attributes.
6876
6877 Sun Dec  6 13:21:18 1998  Per Bothner  <bothner@cygnus.com>
6878
6879         * jcf-dump.c (INVOKE):  If invokeinterface, print number of args.
6880
6881 Thu Dec  3 17:11:12 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6882
6883         * java-tree.h (java_layout_seen_class_methods): New function
6884         prototype.
6885         (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
6886         * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
6887         * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
6888         * parse.y (method_declarator:): Defined action.
6889         (issue_warning_error_from_context): input_filename saved, set to
6890         the appropriate value and restored after java_error is called.
6891         (build_unresolved_array_type): Fixed comment.
6892         (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
6893         (method_header): Deal with return type the same way type are
6894         handled for fields and method's parameters and local variables
6895         types are handled.
6896         (check_method_redefinition): Removed extra CR.
6897         (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
6898         (java_layout_seen_class_methods): New function.
6899         (java_layout_classes): Call java_layout_seen_class_methods.
6900
6901 Thu Dec  3 15:56:50 1998  Per Bothner  <bothner@cygnus.com>
6902
6903         * parse,y (patch_synchronized_statement):  Set CAN_COMPLETE_NORMALLY.
6904
6905 Thu Dec  3 15:08:30 1998  Per Bothner  <bothner@cygnus.com>
6906
6907         * jcf-dump.c (main):  Fix error message.
6908         * jcf-path.c (add_entry):  Style fix.
6909
6910 Wed Dec  2 15:52:25 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6911
6912         * class.c (layout_class_method): Call build_java_argument_signature
6913         on constructors too.
6914         * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
6915         (patch_method_invocation): Define a primary when resolving an
6916         expression name. Augmented comment on code checking illegal `this'
6917         usage. Loosened it test by accepting NEW_CLASS_EXPR.
6918
6919 Tue Dec  1 13:53:24 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
6920
6921         * class.c (layout_class_method): Don't report error on non-static
6922         overriding static if the method is private.
6923         * java-tree.h (finish_class): Prototype added.
6924         * lex.c (java_get_line_col): Handle col argument -2 value.
6925         * parse.h: All static method declarations moved to parse.y.
6926         * parse.y: Now contains all static method declarations previously
6927         found in parse.h.
6928         (find_expr_with_wfl, missing_return_error,
6929         unreachable_stmt_error): New functions.
6930         (java_get_real_method_name): Identify constructors bearing class
6931         names in source code compiled classes only.
6932         (java_complete_expand_methods): Call missing_return_error.
6933         (invocation_mode): Private methods invoked as static methods.
6934         (java_complete_tree): Call unreachable_stmt_error.
6935
6936 1998-12-01  Tom Tromey  <tromey@cygnus.com>
6937
6938         * Makefile.in (+target): Removed.
6939         (+xmake_file): Likewise.
6940         (+tmake_file): Likewise.
6941         (.NOEXPORT): Removed duplicate.
6942
6943 Fri Nov 27 13:20:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6944
6945         * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
6946
6947         * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
6948
6949         * jvgenmain.c: Remove the xmalloc prototype, we get it from
6950         libiberty.h.  Provide an xmalloc definition.
6951
6952         * jvspec.c: Remove the xmalloc prototype.
6953
6954         * parse-scan.y: Include config.h and system.h.  Don't include
6955         OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
6956         Provide an xstrdup definition.
6957
6958 Thu Nov 26 22:03:58 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
6959
6960         * jcf-path.c (add_entry): Recognize ".jar" too.
6961         * lang-specs.h: Likewise.
6962
6963 Thu Nov 26 12:44:07 1998  Per Bothner  <bothner@cygnus.com>
6964
6965         * jcf-write.c (generate_bytecode_insns):  In Call_EXPR, handle
6966         soft_monitorenter_node, soft_monitorexit_node, throw_node.
6967
6968         * jcf-write.c (generate_bytecode_insns):
6969         Handle pre/post-increment/decrement of long.
6970
6971         * jcf-write.c (generate_bytecode_insns):
6972         Handle missing exception handler (finally for synchronized).
6973
6974 Wed Nov 25 09:47:15 1998  Per Bothner  <bothner@cygnus.com>
6975
6976         * java-tree.h (end_params_node):  Declare global.
6977         * decl.c (end_params_node):  New global.
6978         (init_decl_processing, start_java_method):  Use end_params_node for
6979         end of list of parameter types.  Follows correct gcc conventions.
6980         * expr.c (pop_argument_types, pop_arguments):  Likewise.
6981         * lang.c (put_decl_node):  Likewise.
6982         * typeck.c (various places):  Likewise.
6983         * class.y (various places):  Likewise.
6984         * parse.y (various places):  Likewise.
6985
6986         * parse.y (java_complete_tree):  Move CAN_COMPLETE_NORMALLY.
6987         (build_jump_to_finally):  Add missing CAN_COMPLETE_NORMALLY.
6988
6989         * class.c:  Add #include flags.h, remove no-longer needed declaration.
6990
6991         * class.c (layout_class_method):  Remove commented-out code, re-format.
6992         Don't add vtable entry (or index) for private methods.
6993         * expr.c (expand_invoke):  A private method is implicitly final.
6994         * class.c (make_class_data):  If inlining or optimizing,
6995         skip private methods.
6996
6997         * class.c (finish_class):  New function.  Calls existing methods,
6998         but alls emits deferred inline functions.
6999         * jcf-parse.c (parse_class_file):  Call finish_class.
7000         * parse.y (java_complete_expand_methods):  Likewise.
7001
7002         * expr.c (build_java_binop):  Explicit default, to silence -Wall.
7003
7004         * expr.c (CHECK_PC_IN_RANGE):  Add void cast to kill warnings.
7005
7006 Wed Nov 25 00:50:58 1998  Marc Espie <espie@quatramaran.ens.fr>
7007
7008         * jcf-write.c (generate_bytecode_conditional): Fix typo.
7009
7010 Tue Nov 24 17:06:38 1998  Per Bothner  <bothner@cygnus.com>
7011
7012         * (generate_classfile): Always write class access flag with
7013         ACC_SUPER set.
7014
7015 Tue Nov 24 16:34:33 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7016
7017         * class.c (maybe_layout_super_class): New function.
7018         (layout_class): Reorganized. Loop on class methods dispatched into
7019         a new function. Call maybe_layout_super_class.
7020         (layout_class_methods, layout_class_method): New functions.
7021         * expr.c (expand_java_NEW): Call layout_class_methods on loaded
7022         class.
7023         (expand_invoke): Likewise.
7024         * java-tree.h (all_class_list): New global variable declared.
7025         (layout_class_methods, layout_class_method): New function
7026         prototypes.
7027         (LAYOUT_SEEN_CLASS_METHODS): New macro.
7028         * jcf-parse.c (all_class_list): New global variable.
7029         (load_class): Extended what class_or_name can be. Use parser
7030         context mechanism to save globals before calling jcf_parse.
7031         (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
7032         is set on the file name.
7033         (jcf_parse): Layout class methods when Object is loaded, otherwise
7034         record class in all_class_list for delayed method layout.
7035         (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
7036         * lang.c (put_decl_node): Decode <init> into the decl context
7037         class name.
7038         * lex.c (java_allocate_new_line): Use xmalloc.
7039         * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
7040         pointers, not TREE_LIST elements.
7041         (struct parser_ctxt): Fixed comment indentations, added comments
7042         and reordered some fields.
7043         (java_check_methods): Function prototype removed.
7044         * parse.y (java_push_parser_context): Use xmalloc.
7045         (java_parser_context_restore_global): Pop extra pushed ctxp only
7046         when there's nothing next.
7047         (maybe_create_class_interface_decl): Fixed comment, add new
7048         created class decl to all_class_list.
7049         (method_header): Use GET_REAL_TYPE on argument's types.
7050         (method_declarator): Use GET_REAL_TYPE, change type to the real
7051         type in TREE_LIST dependency node. Build argument list with the
7052         real type.
7053         (create_jdep_list): Use xmalloc. Removed allocation error message.
7054         (obtain_incomplete_type): Fixed leading comment. Broadened
7055         incoming argument meaning.
7056         (register_incomplete_type): Use xmalloc. Removed allocation error
7057         message.
7058         (safe_layout_class): Fixed leading comment.
7059         (jdep_resolve_class): Reversed if statement condition and switch
7060         if and else bodies.
7061         (resolve_and_layout): Fixed leading comment. Broadened incoming
7062         argument meaning.
7063         (complete_class_report_errors): New local variable name, for
7064         clarity. purify_type_name used for all error cases.
7065         (java_get_real_method_name): Stricter check on constructors.
7066         (java_check_regular_methods): Reverse methods list only if not
7067         already laid out. Layout artificial constructor.
7068         (java_check_methods): Deleted.
7069         (source_start_java_method): Obtain incomplete type for patchable
7070         method arguments.
7071         (java_layout_classes): Fixed leading comment. Use
7072         LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
7073         statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
7074         before returning. Fixed comments.
7075         (java_expand_classes): Check for errors up front.
7076         (patch_method_invocation): Class to search is resolved and laid
7077         out.
7078
7079 Tue Nov 24 12:57:13 1998  Per Bothner  <bothner@cygnus.com>
7080
7081         * expr.c (java_lang_expand_expr):  Add missing emit_queue.
7082
7083         * javaop.h (int8):  Removed - not used.
7084         (jbyte):  Redefine portably with correct signedness.
7085
7086         * jcf-write.c (generate_bytecode_insns):  Don't free sw_state.cases.
7087
7088         * jcf-write.c (generate_bytecode_insns):  Fix typo
7089         OPCODE_getstatic to OPCODE_getfield.
7090
7091         * java-tree.def (CASE_EXPR, DEFAULT_EXPR):  Kind is 'x', not '1'.
7092         * parse.y (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR,
7093         set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
7094
7095 Thu Nov 19 11:16:55 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7096
7097         * jcf-parse.c (jcf_parse_source): Function returned type is
7098         void. Added prototype.
7099         (jcf_parse): Function returned type is void.
7100         (yyparse): Remove call to fclose on the last parsed file.
7101
7102         * java-tree.h (jcf_parse): Changed jcf_parse prototype.
7103
7104 Wed Nov 18 23:54:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7105
7106         * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
7107         (layout_class): Cope with methods featuring WFL in decl names.
7108         * decl.c (unqualified_object_id_node): New global variable,
7109         initialized.
7110         (build_decl_no_layout): Removed.
7111         * expr.c (build_primtype_type_ref): Handle Double.
7112         (java_lang_expand_expr): Fixed indentations.
7113         * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
7114         (flag_wall, flag_redundant, flag_not_overriding,
7115         flag_static_local_jdk1_1, unqualified_object_id_node): Global
7116         variable declarations.
7117         (build_decl_no_layout): Removed prototype.
7118         (java_get_real_method_name): Added prototype.
7119         (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
7120         (java_parse_abort_on_error): Macro now just returns.
7121         * jcf-parse.c (jcf_parse_source): Check fclose returned
7122         value. Call emit_register_classes if java_report_errors returns
7123         zero.
7124         * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
7125         flag_static_local_jdk1_1): New integer flags.
7126         (lang_decode_option): New flags set here.
7127         * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
7128         (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
7129         the flag_redundant variable.
7130         (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
7131         when parsing java.lang.Object class.
7132         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
7133         NULL_TREE to build.
7134         (resolve_qualified_expression_name): Fixed indentation.
7135         (patch_array_ref): Changed prototype.
7136         (not_initialized_as_it_should_p): Prototype removed.
7137         (java_report_errors): Added function prototype.
7138         * parse.y (formal_parameter:): Changed error message for not yet
7139         supported final parameters.
7140         (class_type_list:): Set both PURPOSE and VALUE of created
7141         TREE_LIST to be class_type.
7142         (primary_no_new_array:): Handle class literals on primitive types.
7143         (parse_warning_context): Reinstalled correct force_error and
7144         do_warning flags setups.
7145         (java_report_errors): Changed prototype. Return java_error_count
7146         value.
7147         (variable_redefinition_error): Consider treating variable type as
7148         a fake pointer.
7149         (create_interface): Warn about redundant abstract modifier if
7150         flag_redundant is set. Changed error message.
7151         (lookup_field_wrapper): Save/restore globals before/after looking
7152         up field.
7153         (duplicate_declaration_error_p): Consider treating declaration
7154         type as a fake pointer.
7155         (register_fields): Extract real type from dependency node. Check
7156         for duplicate field declaration after type adjustment. Use
7157         DECL_INITIAL to store static final initialized values.
7158         (method_header): Extract real function type from dependency node.
7159         (check_abstract_method_header): Use GET_METHOD_NAME.
7160         (obtain_incomplete_type): Layout fake pointer type.
7161         (safe_layout_class): Don't try to check for methods before layout.
7162         (java_complete_class): Don't check for correct throws clause
7163         elements inheritance here.
7164         (resolve_and_layout): Broadened name parameter meaning.
7165         (reset_method_name): Use GET_METHOD_NAME.
7166         (java_get_real_method_name): New function.
7167         (java_check_regular_methods): Don't check methods in
7168         java.lang.Object.  Verify lineage of throws clause elements. Use
7169         flag_no_overriding in warning report.
7170         (check_throws_clauses): Don't check if class was from
7171         bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
7172         (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
7173         (declare_local_variables): Use flag_static_local_jdk1_1 to report
7174         warning on unsupported final local variables. Use build_decl
7175         instead of build_decl_no_layout. Get real local variable type from
7176         dependency node.
7177         (source_start_java_method): Get real parameter type from
7178         dependency node. Call build_decl instead of build_decl_no_layout.
7179         (java_layout_classes): Reverse tree and layout type and class as
7180         required. Mark class as loaded when done.
7181         (resolve_field_access): Fixed indentation. Restricted condition
7182         leading to static field access code generation. Set field_type
7183         decl's TREE_TYPE if QUAL_DECL_TYPE not available.
7184         (resolve_qualified_expression_name): Initialize type_found to
7185         null. Handle static field resolved during qualification. Fixed
7186         layout on non primitive field decl types.
7187         (not_accessible_p): Fixed typo in comment.
7188         (patch_method_invocation): Resolve and layout class to search from
7189         type.
7190         (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
7191         layout non primitive type, if necessary. Make method node only to
7192         report errors.
7193         (find_applicable_accessible_methods_list): Consider WFL'ed method
7194         decl names. Fixed indentation.
7195         (argument_types_convertible): Resolve and layout target type if
7196         necessary.
7197         (java_complete_tree): Fixed indentation problems. Rewrote
7198         CALL_EXPR thrown exceptions check. Re-installed further processing
7199         of the assignment in certain cases.
7200         (patch_assignment): Call maybe_build_primttype_type_ref to perform
7201         inlining on class literals.
7202         (valid_builtin_assignconv_identity_widening_p): Cope with constant
7203         0 literal.
7204         (valid_method_invocation_conversion_p): Likewise.
7205         (patch_string): Temporary disable forbidden use of `this' in
7206         explicit constructor invocations when doing string concatenation
7207         within their scope.
7208         (patch_unaryop): Added comment. Reinstalled code to disable
7209         further check on assignment operation with cast expression RHS.
7210         (patch_switch_statement): Fixed indentation.
7211         (build_try_statement): Call build_decl instead of
7212         build_decl_no_layout.
7213         (patch_synchronized_statement): Likewise.
7214         (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
7215         IS_UNCHECKED_EXPRESSION_P.
7216         (check_thrown_exceptions_do): Changed leading comment. Resolve and
7217         layout argument exception type.
7218         (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
7219         of IS_UNCHECKED_EXPRESSION_P.
7220
7221 Wed Nov 18 14:21:48 1998  Anthony Green  <green@cygnus.com>
7222
7223         * jcf-parse.c (yyparse): Open class file in binary mode.
7224
7225 Sun Nov 15 17:14:17 1998  Per Bothner  <bothner@cygnus.com>
7226
7227         * jvgenmain.c:  Need to #include "gansidecl.h" (to get PROTO).
7228
7229         * jcf-write.c (perform_relocations):  Move check out one loop.
7230
7231 Sun Nov 15 15:09:56 1998  Anthony Green  <green@hoser.cygnus.com>
7232
7233         * Make-lang.in: Fix reference to srcdir.
7234         * jv-scan.c: Add missing xmalloc prototype.
7235         * jvgenmain.c: Ditto.
7236
7237 Sun Nov 15 14:36:29 1998  Per Bothner  <bothner@cygnus.com>
7238
7239         * decl.c (error_mark_node), java-tree.h:  New global.
7240         * parse.y:  Use empty_stmt_node instead of size_zero_node.
7241         (build_if_else_statement):  If missing else, use empty_stmt_node.
7242
7243         * parse.y (not_initialized_as_it_should_p):  Removed, with its callers.
7244         (java_complete_expand_method):  Complain if return is missing.
7245         (java_check_regular_methods):  Comment out incorrect error check.
7246         (not_accessible_p):  Fix incorrect handling of protected methods.
7247         (patch_method_invocation):  Pass correct context to not_accessible_p.
7248         (find_applicable_accessible_methods_list):  Likewise.
7249         (qualify_ambiguous_name):  If ARRAY_REF, it's an expression name.
7250         (java_complete_tree):  For CASE_EXPR and DEFAULT_EXPR, set
7251         TREE_TYPE (to void_type_node);  otherwise expand_expr crashes.
7252         (patch_if_else_statement):  Fix setting of CAN_COMPLETE_NORMALLY.
7253
7254         * jcf-write.c (CHECK_OP, CHECK_PUT):  Add some error checking.
7255         (push_int_const):  Remove reundant NOTE_PUSH.
7256         (generate_bytecode_insns - case STRING_CST):  Do NOTE_PUSH.
7257         (- case SWITCH_EXPR):  Fix code generation bug.
7258         (- case PREDECREMENT_EXPR etc):  Remove redundant NOTE_PUSH.
7259         (generate_classfile):  More robust for abstract methods.
7260
7261 Sun Nov 15 13:52:39 1998  Anthony Green  <green@cygnus.com>
7262
7263         * Makefile.in: jv-scan and jvgenmain all require libiberty.
7264         * Make-lang.in: Ditto.
7265
7266         * jv-scan.c: Remove xmalloc and xstrdup definitions.
7267         * jvgenmain: Ditto.
7268
7269 Sun Nov 15 14:10:56 1998  Per Bothner  <bothner@cygnus.com>
7270
7271         * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE):  New macro.
7272
7273         * jcf-io.c (find_class):  Simpler/cleaner structure fixes a bug.
7274
7275 Sat Nov 14 17:19:18 1998  Per Bothner  <bothner@cygnus.com>
7276
7277         Allow uses of interface types to verify.  This is not really
7278         type-safe, but it matches what Sun does, and is OK as long as
7279         there are appropriate run-time checks.
7280         * verify.c (merge_types):  If merging two interface types,
7281         just set the result to java.lang.Object.
7282         * expr.c (pop_type):  Any interface is matches by java.lang.Object.
7283
7284 1998-11-13  Tom Tromey  <tromey@cygnus.com>
7285
7286         * gjavah.c (main): Handle --output-class-directory argument.
7287         * jvspec.c (lang_specific_driver): Translate `-d' into
7288         -foutput-class-dir.
7289         * jcf.h (jcf_write_base_directory): Declare.
7290         * lang.c (lang_decode_option): Recognize -foutput-class-dir.
7291         * lang-options.h: Mention -foutput-class-dir.
7292         * jcf-write.c (jcf_write_base_directory): New global.
7293         (make_class_file_name): Put generated .class file into `-d'
7294         directory, or into source directory if -d not given.  Function now
7295         static.
7296         (write_classfile): Free class file name.  Handle case where class
7297         file name is NULL.
7298         (DIR_SEPARATOR): New macro.
7299         Include <sys/stat.h>
7300
7301         * Makefile.in (prefix): New macro.
7302
7303 Thu Nov 12 14:15:07 1998  Per Bothner  <bothner@cygnus.com>
7304
7305         * parse.y (patch_invoke):  Do less if flag_emit_class_files.
7306         * expr.c (build_known_method_ref):  Don't check flag_emit_class_files
7307         here (done in patch_invoke instead).
7308         (case_identity):  Moved here from parse.y.
7309
7310         * java-tree.h (CAN_COMPLETE_NORMALLY):  New macro.
7311         * parse.y (java_complete_tree etc):  Maybe set CAN_COMPLETE_NORMALLY.
7312         * parse.y (java_complete_tree):  Re-order COMPOUND_EXPR in BLOCK
7313         so they can be efficiently scanned without recursion.
7314         Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
7315         * expr.c (java_lang_expand_expr):  Expand statements of COMPOUND_EXPR
7316         in BLOCK iteratively, rather than recursively.
7317
7318         * parse.y (do_unary_numeric_promotion):  New function.
7319         (patch_unaryop, patch_binop, patch_array_ref):  Use it.
7320
7321         * parse.y (patch_newarray):  Various fixes.
7322
7323         Re-do handling of switch statements (for proper block scoping).
7324         * parse.y:  Add just a single block for the enture switch block,
7325         but don't create any "case blocks".
7326         (group_of_labels):  Rmeoved unneeded non-terminal.
7327         CASE_EXPR and DEFAULT_EXPR are added to current block.
7328         * expr.c (java_lang_expand_expr):  Inline SWITCH_EXPR here.
7329         Now also need to handle CASE_EXPR and DEFAULT_EXPR.
7330         * java-tree.h (SWITCH_HAS_DEFAULT):  New macro.
7331         * parse.y (wfl_operator, print_int_node): Make non-static.
7332         (java_complete_tree):  CASE_EXPR and DEFAULT_EXPR are now processed
7333         as part of recursive scan of block.
7334         (java_expand_switch ):  Removed - inlined into java_lang_expand_expr.
7335         (patch_switch_statement):  Most tests move dinto java_complete_tree.
7336
7337         * parse.y:  Make various production be non-typed (void).
7338         * parse.y (parse_error):  Merged into issue_warning_error_from_context.
7339         * parse.y (add_stmt_to_compound):  Don't create/change extra node.
7340         (patch_method_invocation_stmt):  Renamed to patch_method_invocation.
7341
7342         * jcf-write.c (struct jcf_handler):  New type.
7343         (struct jcf_switch_state):  New type.
7344         (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC):  New relocation kinds.
7345         (alloc_handler, emit_unop, emit_reloc):  New functions.
7346         (adjust_typed_op):  Add extra parameter ("max type" offset).
7347         (emit_switch_reloc, emit_case-reloc):  New function.
7348         (generate_bytecode_conditional):  Handle REAL_TYPE comparisons.
7349         (generate_bytecode_insns):  Support REAL_CST, switch statements,
7350         exception handling, method calls, object/array creation, and more.
7351
7352         * class.c:  Remove some unused variables.
7353         * constants.c (find_string_constant):  New function.
7354         (count_constant_pool_bytes):  Fix to correctly handle wide constants.
7355         * decl.c (complete_start_java_method):  Don't _Jv_InitClass
7356         if flag_emit_class_files.
7357
7358 1998-11-12  Tom Tromey  <tromey@cygnus.com>
7359
7360         * jcf-io.c (find_class): Added explanatory comment.
7361
7362         * jcf-path.c (add_entry): Look for `.zip' at end of filename.  Add
7363         trailing slash to `.zip' entries.
7364
7365         * jvspec.c (lang_specific_driver): Correctly handle case where
7366         GC_NAME not defined.
7367
7368 1998-11-11  Tom Tromey  <tromey@cygnus.com>
7369
7370         * jvspec.c (GC_NAME): New define.
7371         (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
7372         if required.
7373         * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
7374
7375 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
7376
7377         * jcf-dump.c (TABLE_SWITCH):  Fix typos.
7378
7379 1998-11-11  Tom Tromey  <tromey@cygnus.com>
7380
7381         * jcf-dump.c (main): Correctly recognize `--'-style long options.
7382
7383 Tue Nov 10 12:34:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7384
7385         * class.c (is_compiled_class): Call safe_layout_class for class
7386         compiled from source.
7387         * conver.h (convert_to_integer, convert_to_real,
7388         convert_to_pointer): Added prototypes.
7389         * decl.c (init_decl_processing): Non longer push the decls of
7390         `methodtable', `constants', `Class', `Field', `dispatchTable'
7391         `jexception' and `Method'.
7392         * expr.c (build_invokeinterface): New function.
7393         (expand_invoke): static variable CLASS_IDENT now in
7394         build_invokeinterface. Use build_invokeinterface.
7395         (expand_java_field_op): Moved code to inline
7396         java.lang.PRIMTYPE.TYPE into a function.
7397         (build_primtype_type_ref): New function.
7398         * java-tree.def (INSTANCEOF_EXPR): New tree code.
7399         * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
7400         FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
7401         (DECL_CONSTRUCTOR_P): Fixed typo in comment.
7402         (DECL_LOCAL_STATIC_VALUE): New macro.
7403         (build_invokeinterface, build_primtype_type_ref): New function
7404         prototypes.
7405         (java_parse_abort_on_error): Macro rewritten.
7406         * jcf-parse.c (current_method): Add comment to declaration.
7407         (parse_zip_file_entries, process_zip_dir, void parse_source_file):
7408         Function prototypes fixed.
7409         (jcf_parse_source): push/pop parser context. save/restore global.
7410         (parse_source_file): Fixed leading comment. Now take a
7411         IDENTIFIER_NODE as an argument. Doesn't check methods, layout
7412         classes and pop the parser context anymore.
7413         (yyparse): Push parser context, save globals, parse the source
7414         file, restore globals and pop the parser context when processing a
7415         source file.
7416         * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
7417         * lex.c (java_parse_doc_section): New function.
7418         (java_lex): Call java_parse_doc_section when appropriate. Build an
7419         operator around INSTANCEOF_TK.
7420         * lex.h (java_lineterminator, java_sprint_unicode,
7421         java_unicode_2_utf8, java_lex_error, java_store_unicode):
7422         Prototypes rewritten.
7423         (java_parse_escape_sequence, java_letter_or_digit_p,
7424         java_parse_doc_section, java_parse_end_comment, java_get_unicode,
7425         java_read_unicode, java_store_unicode, java_read_char,
7426         java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
7427         Added function prototypes.
7428         * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
7429         define.
7430         (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
7431         New macros
7432         (struct parser_ctxt): New fields: deprecated,
7433         current_parsed_class_un, gclass_list.
7434         (fix_method_argument_names, issue_warning_error_from_context,
7435         resolve_package, lookup_package_type): New function prototypes.
7436         (resolve_expression_name): Fixed function prototype.
7437         (find_applicable_accessible_methods_list): Fixed indentation, added
7438         extra argument in prototype.
7439         (check_final_assignment, build_null_of_type, check_deprecation,
7440         check_method_redefinition, reset_method_name,
7441         java_check_regular_methods, java_check_abstract_methods,
7442         maybe_build_primttype_type_ref): New function prototype.
7443         * parse.y (conver.h): Include.
7444         (INSTANCEOF_TK): Tagged <operator>.
7445         (single_type_import_declaration): Use REGISTER_IMPORT macro.
7446         (relational_expression:): Build binop for instanceof.
7447         (java_push_parser_context): Remember ctxp->gclass_list across
7448         contexts.
7449         (java_pop_parser_context): Simply return if no context
7450         exists. Remember gclass_list across contexts.
7451         (issue_warning_error_from_context): New function.
7452         (parse_error_context): Don't setup ctxp->elc here. Call
7453         issue_warning_error_from_context instead.
7454         (parse_warning_context): Likewise.
7455         (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
7456         setup. Link new class/interface to ctxp->gclass_list.
7457         (add_superinterfaces): Register interface as incomplete if not
7458         loaded.
7459         (create_class): Remember class unqualified name in
7460         ctxp->current_parsed_class_un. Check class deprecation.
7461         (register_fields): Check field deprecation. Remember static final
7462         field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
7463         processing INIT.
7464         (method_header): New local variable ORIG_ARG. Use unqualified
7465         current class name for check on constructor errors. Promote return
7466         type if of record type. Argument list fix moved in
7467         fix_method_argument_names, called here. Check method deprecation.
7468         (fix_method_argument_names): New function.
7469         (method_declarator): Promote record typed arguments.
7470         (safe_layout_class): Check class methods before layout.
7471         (java_complete_class): Compute field layout when patched.
7472         (do_resolve_class): Try to load class after having it renamed
7473         after the package name.
7474         (get_printable_method_name): Use DECL_CONTEXT.
7475         (reset_method_name): New function.
7476         (check_method_redefinition): Use reset_method_name.
7477         (java_check_regular_methods): New local variable
7478         SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
7479         names for error report. Check for compile-time error when method
7480         found has default (package) access.
7481         (java_check_abstract_methods): Now takes an interface DECL node as
7482         an argument. Also reinstall real name on unchecked
7483         overriding/hiding methods for error report.
7484         (java_check_methods): Fixed leading comment. Get classes to verify
7485         from ctxp->gclass_list. Use CHECK_METHODS macro and set
7486         CLASS_METHOD_CHECKED_P on class verification.
7487         (lookup_java_method2): Get real method name if necessary.
7488         (find_in_imports): Don't check package class access here.
7489         (resolve_package, lookup_package_type): New functions.
7490         (java_layout_classes): Fixed leading comment. Take classes to be
7491         laid out from ctxp->gclass_list.
7492         (java_complete_expand_methods): Don't expand native and abstract
7493         methods.
7494         (java_expand_classes): New function.
7495         (resolve_expression_name): Use additional argument ORIG.  Retrieve
7496         values of static final field of primitive types.
7497         (resolve_field_access): Handles static final field of promotive
7498         type.
7499         (resolve_qualified_expression_name): Handle STRING_CST as
7500         primaries and package name resolution. Check deprecation on found
7501         decls. Set where_found and type_found on non static field resolved
7502         during qualification. Layout non primitive field decl types.
7503         (check_deprecation): New function.
7504         (maybe_access_field): Simplified.
7505         (patch_method_invocation_stmt): Local variable CLASS_TYPE
7506         removed. Reverse method's argument when primary is a type. Don't
7507         use CLASS_TYPE to report problems, use IDENTIFIER_WFL
7508         instead. Include abstract class in the list of class searchable
7509         for constructors. Use DECL_CONTEXT of found method for access
7510         checks. Check method deprecation.
7511         (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
7512         converting arguments. Handle INVOKE_INTERFACE.
7513         (lookup_method_invoke): Search constructor using existing
7514         infrastructure (don't rely on lookup_java_constructor anymore).
7515         (find_applicable_accessible_methods_list): Extra argument flag
7516         LC. Now include constructor in the search.
7517         (qualify_ambiguous_name): Conditional expression are primaries.
7518         (not_initialized_as_it_should_p): static final are always
7519         initialized.
7520         (java_complete_tree): Pass extra NULL argument to
7521         resolve_expression_name. Stricter test to carry on patching
7522         assignments. New case for INSTANCEOF_EXPR.
7523         (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
7524         (check_final_assignment, maybe_build_primttype_type_ref): New
7525         functions.
7526         (patch_assignment): Detect resolved static finals and carry normal
7527         assignment error check on them. Inline PRIMTYPE.TYPE read access.
7528         (try_builtin_assignconv): Access constant 0 on all primitive
7529         types.
7530         (valid_builtin_assignconv_identity_widening_p): Accept identical
7531         types. Accept all promoted type on int type.
7532         (valid_ref_assignconv_cast_p): Accept a null pointer to be
7533         assigned to a reference.
7534         (valid_method_invocation_conversion_p): Accept to check null
7535         pointers.
7536         (build_binop): Merge declaration and initialization of local
7537         variable BINOP.
7538         (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
7539         numeric types. Improved validity test for qualify operators on
7540         references.
7541         (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
7542         and PREINCREMENT_EXPR. Also detect resolved static finals of a
7543         primitive type and issue the appropriate error message.
7544         (resolve_type_during_patch): Mark class loaded when resolved.
7545         (patch_cast): Allow null to be cased to reference types.
7546         (build_null_of_type): New function.
7547         (patch_array_ref): Handle array on references correctly.
7548         (patch_return): Removed unused local variable MODIFY. Force
7549         boolean to be returned as integers. Allows null to be returned by
7550         a function returning a reference.
7551         * typeck.c (convert_to_integer, convert_to_real,
7552         convert_to_pointer): Prototypes moved to convert.h
7553         (lookup_argument_method): Use method real name, if necessary.
7554
7555 1998-10-30  Tom Tromey  <tromey@cygnus.com>
7556
7557         * class.c (build_class_ref): Changed name of primitive classes to
7558         start with `_Jv_'.
7559
7560         * class.c (make_class_data): Renamed fields: nmethods to
7561         method_count, method_count to dtable_method_count.  Always set
7562         `state' field to 0.
7563         * decl.c (init_decl_processing): Likewise.
7564
7565 Wed Oct 28 08:03:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7566
7567         * class.c (layout_class): Don't mangle <finit>, produce
7568         __finit<class> instead. Don't verify artificial methods.
7569         * decl.c (finit_identifier_node): New declared global.
7570         (init_decl_processing): finit_identifier_node initialized.
7571         * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
7572         * java-tree.h (finit_identifier_node): Declared as extern.
7573         (struct lang_decl): New field called_constructor.
7574         (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
7575         (CLASS_HAS_FINIT_P): New macro.
7576         (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
7577         explicit constructor invocation.
7578         (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
7579         CALL_SUPER_CONSTRUCTOR_P): New macros.
7580         (write_classfile): Added prototype.
7581         * jcf-parse.c (jcf_parse_source): Parse and remember for
7582         generation if the file was seen on the command line.
7583         (parse_source_file): Don't write the class file here.
7584         (yyparse): Loop on files rewritten. Set current_jcf.
7585         (parse_zip_file_entries): Parse class file only if it was found.
7586         * lang.c (init_parse): Don't open command line provided filename
7587         here.
7588         (lang_parse): Don't set main_jcf anymore.
7589         * parse.h (ABSTRAC_CHECK): Capitalized arguments.
7590         (JCONSTRUCTOR_CHECK): New macro.
7591         (JBSC_TYPE_P): New macro.
7592         (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
7593         (COMPLETE_CHECK_OP_2): New macro.
7594         (struct parse_ctxt): New field explicit_constructor_p.
7595         (check_class_interface_creation): Fixed prototype indentation.
7596         (patch_method_invocation_stmt): Prototype reflects added argument.
7597         (patch_invoke): Likewise.
7598         (complete_method_declaration, build_super_invocation,
7599         verify_constructor_circularity,
7600         build_this_super_qualified_invocation, get_printable_method_name,
7601         patch_conditional_expr, maybe_generate_finit, fix_constructors,
7602         verify_constructor_super, create_artificial_method,
7603         start_artificial_method_body, end_artificial_method_body,
7604         generate_field_initialization_code): New function prototypes.
7605         * parse.y: Fixed leading comment
7606         (constructor_header:, constructor_body:, block_end:): Rules tagged
7607         <node>.
7608         (type_declaration:): Call maybe_generate_finit.
7609         (method_declaration:): Action for method_body: placed in new
7610         function complete_method_declaration, called here.
7611         (constructor_declaration:): Defined actions. Removed leading
7612         FIXME.
7613         (constructor_header:): New rule with action.
7614         (constructor_body:): Rule rewritten using block_begin: and
7615         block_end:. Defined actions.
7616         (constructor_declarator:, explicit_constructor_invocation:):
7617         Defined actions.
7618         (block:): Use new rules block_begin: block_end:.
7619         (block_begin:, block_end:): New rules and actions.
7620         (block_statements:): Fixed error message for explicit
7621         constructors.
7622         (method_invocation:): Call build_this_super_qualified_invocation
7623         if primary is `this' or `super' was seen.
7624         (conditional_expression:): Action defined.
7625         (extra_ctxp_pushed_p): New static global flag.
7626         (java_parser_context_save_global): Create parser context if
7627         necessary. Use extra_ctxp_pushed_p to remember it.
7628         (java_parser_context_restore_global): Pop extra parser context if
7629         one exists.
7630         (build_array_from_name): Array on primitive types are marked
7631         loaded.
7632         (register_fields): Restore new name in field initializer
7633         expression if type was altered. Non static fields initialized upon
7634         declaration marked initialized.
7635         (maybe_generate_finit): New function.
7636         (maybe_generate_clinit): Use create_artificial_method,
7637         start_artificial_method_body, end_artificial_method_body. Generate
7638         debug info for enclosed initialization statements.
7639         (method_header): Fixed leading comment. Check constructor
7640         flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
7641         accordingly.
7642         (complete_method_declaration, constructor_circularity_msg,
7643         verify_constructor_circularity): New functions.
7644         (get_printable_method_name): New function.
7645         (check_method_redefinition): Don't rename <finit> methods. Fix
7646         declared constructor names. Error message for
7647         constructors modified.
7648         (java_check_regular_methods): Local variable seen_constructor
7649         renamed saw_constructor. Skip verification on constructors. Create
7650         default constructor with create_artificial_method.
7651         (java_check_methods): Removed unnecessary empty line.
7652         (create_artificial_method, start_artificial_method_body,
7653         end_artificial_method_body): New functions.
7654         (java_layout_classes): Changed leading comment. Reverse fields
7655         list if necessary. Always layout java.lang.Object if being
7656         defined.
7657         (java_complete_expand_methods): Verify constructor circularity.
7658         (java_complete_expand_method): Call fix_constructor on
7659         constructors.  Local variable no_ac_found removed. Restore
7660         bindings if method body expansion failed.
7661         (fix_constructors, verify_constructor_super,
7662         generate_field_initialization_code): New function.
7663         (java_expand_classes): Fixed leading comment. Write class file
7664         here.
7665         (resolve_expression_name): Check for illegal instance variable
7666         usage within the argument scope of an explicit constructor
7667         invocation.
7668         (resolve_qualified_expression_name): Pass extra from_super flag
7669         when invoking patch_method_invocation_stmt. New case for
7670         conditional expression when used as a primary. Check for error
7671         when acquiring super.
7672         (patch_method_invocation_stmt): Added extra argument super. New
7673         local variable is_static_flag. Set class_to_search according to
7674         the nature of the constructor invocation. Don't add `this'
7675         argument when expanding NEW_CLASS_EXPR. Check for illegal method
7676         invocation within the argument scope of explicit constructor
7677         invocation. Set is_static according to is_static_flag. Provide
7678         extra `super' argument to patch_invoke invocation.
7679         (patch_invoke): New argument from_super. Loop on arguments
7680         indentation fixed. Pass from_super to invocation_mode. New switch
7681         case INVOKE_SUPER. Fixed error message in switch default case.
7682         Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
7683         value.
7684         (invocation_mode): Return INVOKE_SUPER mode when appropriate.
7685         (lookup_method_invoke): Fixed prototypes in candidates list. Error
7686         message takes constructors into account.
7687         (find_applicable_accessible_methods_list): Fixed indentation.
7688         (qualify_ambiguous_name): Take explicit constructor invocation
7689         into account. Deal with a conditional expression as a primary to
7690         a method call.
7691         (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
7692         case. Added extra argument to patch_method_invocation_stmt.
7693         Register calls made to explicit constructor `this'. Don't call
7694         save_expr in ARRAY_REF case when emitting class files. Check for
7695         illegal use of this when expanding explicit constructor invocation
7696         arguments.
7697         (complete_function_arguments): Set and reset parser context
7698         explicit_constructor_p field value when appropriate.
7699         (build_super_invocation, build_this_super_qualified_invocation):
7700         New functions.
7701         (patch_assignment): Fixed typo.
7702         (patch_unaryop): Check on final fields occurs only when a decl
7703         exits.
7704         (patch_return): Take constructors into account.
7705         (patch_conditional_expr): New function.
7706         * typeck.c (build_java_signature): Removed unnecessary empty line.
7707
7708 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
7709
7710         * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
7711
7712 1998-10-28  Tom Tromey  <tromey@cygnus.com>
7713
7714         * decl.c (init_decl_processing): Renamed fields.
7715         * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
7716         interface_len, msize fields.
7717
7718         * class.c (make_class_data): Removed subclass_head and
7719         subclass_next fields.
7720         * decl.c (init_decl_processing): Removed subclass_head and
7721         subclass_next fields.
7722
7723 Wed Oct 28 00:46:15 1998  Jeffrey A Law  (law@cygnus.com)
7724
7725         * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
7726         * mangle.c (emit_unicode_mangled_name): Similarly.
7727
7728 Mon Oct 26 12:17:23 1998  Nick Clifton  <nickc@cygnus.com>
7729
7730         * jcf-parse.c (get_constant): Place braces around code to compute
7731         'd' when REAL_ARITHMETIC is not defined.
7732
7733 Sun Oct 25 14:58:05 1998  H.J. Lu  (hjl@gnu.org)
7734
7735         * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
7736         dependency.
7737
7738 1998-10-23  Tom Tromey  <tromey@cygnus.com>
7739
7740         * lang-specs.h: `.zip' files are input to jc1.
7741
7742 Thu Oct 22 23:01:54 1998  Per Bothner  <bothner@cygnus.com>
7743
7744         * jvspecs.c:  Add (but don't enable) support for combining multiple
7745         .class and .java input filenames to a single jc1 invocation.
7746         Add support for -C flag (copile to .class files).
7747         Translate -classpath and -CLASSPATH arguments.
7748         * lang-specs.h:  Don't set %2 spec.
7749
7750 1998-10-22  Tom Tromey  <tromey@cygnus.com>
7751
7752         * jcf-path.c (add_entry): Don't add trailing separator if entry is
7753         a .zip file.
7754         (add_path): Don't add trailing separator to non-empty path
7755         elements.
7756
7757         * lang.c (lang_decode_option): Check for -fclasspath and
7758         -fCLASSPATH before examining other `-f' options.
7759
7760         * java-tree.h (finalize_identifier_node): Don't declare.
7761         * class.c (make_class_data): Don't push "final" field.
7762         * decl.c (init_decl_processing): Don't push "final" field.
7763         (finalize_identifier_node): Removed.
7764         (init_decl_processing): Don't set finalize_identifier_node.
7765
7766         * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
7767
7768 Sun Oct 11 10:31:52 1998  Anthony Green  <green@cygnus.com>
7769
7770         * Make-lang.in (java): Depend on jcf-dump and jv-scan.
7771         (JV_SCAN_SOURCES): New macro.
7772         (JCF_DUMP_SOURCES): Likewise.
7773         (jcf-dump$(exeext)): New target.
7774         (jv-scan$(exeext)): New target.
7775
7776 1998-10-22  Tom Tromey  <tromey@cygnus.com>
7777
7778         * Makefile.in (LEX): Removed.
7779         (LEXFLAGS): Likewise.
7780         (SET_BISON): New macro.
7781         (BISON): Removed.
7782         ($(PARSE_C)): Use SET_BISON.  Run bison from srcdir to avoid
7783         spurious diffs in parse.c.
7784         ($(PARSE_SCAN_C)): Likewise.
7785         (PARSE_DIR): New macro.
7786         (PARSE_C): Use it.
7787         (PARSE_SCAN_C): Likewise.
7788         (PARSE_RELDIR): New macro.
7789
7790         * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
7791
7792         * jcf-io.c (find_class): Use saw_java_source to determine when to
7793         look for `.java' file.
7794         * jcf-parse.c (saw_java_source): New global.
7795         (yyparse): Set it if `.java' file seen.
7796
7797         * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
7798         (GCJH_SOURCES): Likewise.
7799         * Makefile.in (datadir): New macro.
7800         (libjava_zip): Likewise.
7801         (JAVA_OBJS): Added jcf-path.o.
7802         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
7803         (../gcjh$(exeext)): Likewise.
7804         (jcf-path.o): New target.
7805         * java-tree.h (fix_classpath): Removed decl.
7806         * jcf-parse.c (fix_classpath): Removed.
7807         (load_class): Don't call fix_classpath.
7808         * parse.y (read_import_dir): Don't call fix_classpath.
7809         * lex.h: Don't mention classpath.
7810         * lex.c (java_init_lex): Don't initialize classpath.
7811         * jcf-io.c (classpath): Removed global.
7812         (find_class): Use jcf_path iteration functions.  Correctly search
7813         class path for .java file.
7814         (open_in_zip): New argument `is_system'.
7815         * jcf-dump.c (main): Call jcf_path_init.  Recognize all new
7816         classpath-related options.
7817         * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
7818         and -I.
7819         (lang_init): Call jcf_path_init.
7820         * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
7821         * lang-specs.h: Handle -I.  Minor cleanup to -M options.
7822         Correctly put braces around second string in each entry.
7823         * gjavah.c (main): Call jcf_path_init.  Recognize all the new
7824         classpath-related options.
7825         (help): Updated for new options.
7826         * jcf.h: Declare functions from jcf-path.c.  Don't mention
7827         `classpath' global.
7828         * jcf-path.c: New file.
7829
7830         * jcf-depend.c: Include jcf.h.
7831
7832         * jcf-write.c (localvar_alloc): Returns `void'.
7833         (localvar_free): Removed unused variable.
7834
7835         * lang.c (OBJECT_SUFFIX): Define if not already defined.
7836         (init_parse): Use OBJECT_SUFFIX, not ".o".
7837
7838 Wed Oct 21 07:54:11 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7839
7840         * class.c (emit_register_classes): Renamed from
7841         emit_register_class.
7842         * java-tree.h (emit_register_classes): Prototype renamed from
7843         emit_register_class.
7844         * jcf-parse.c (yyparse): Call emit_register_classes once before
7845         returning.
7846         * parse.y (java_expand_classes): No longer register classes.
7847
7848 Tue Oct 20 09:15:38 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7849
7850         * class.c (is_compiled_class): New local variable
7851         seen_in_zip. Identify classes found in currently compiled source
7852         file(s).
7853         * decl.c (complete_start_java_method): Fixed typo.
7854         * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
7855         HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
7856         (CLASS_P): Moved around.
7857         (java_parse_abort_on_error): Macro moved from jcf-parse.c
7858         * jcf-parse.c (java_parse_abort_on_error): Macro moved to
7859         java-parse.h
7860         (jcf_parse_source): Changed leading comment. Removed unnecessary
7861         fclose and CLASS_FROM_SOURCE_P marking.
7862         (parse_source_file): New local variables remember_for_generation
7863         and filename. Mark parsed file name identifier node. Removed block
7864         executed when parse_only was null. Set remember_for_generation.
7865         Use it as an argument to java_pop_parser_context.
7866         (yyparse): New local variables several_files, list, next node and
7867         current_file_list. Split ampersand separated file names into
7868         current_file_list. Iterate through the list and parse accordingly.
7869         * parse.h (java_pop_parser_context): New function prototype.
7870         * parse.y (ctxp_for_generation): New static global variable.
7871         (java_pop_parser_context): New argument generate. Link popped ctxp
7872         to ctxp_for_generation list accordingly.
7873         (java_complete_expand_methods): Fixed indentation.
7874         (java_expand_classes): New function.
7875
7876 Sat Oct 17 11:25:21 1998  Per Bothner  <bothner@cygnus.com>
7877
7878         * Makefile.in:  Link with libiberty.a instead of memmove.o.
7879
7880 Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7881
7882         * lex.c (setjmp.h): No longer included.
7883         * lex.h (setjmp.h): Included.
7884         * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
7885         (duplicate_declaration_error_p): Renamed from
7886         duplicate_declaration_error.
7887         (build_array_from_name): New function prototype.
7888         * parse.y (setjmp.h): No longer included.
7889         (variable_declarator_id): Define action.
7890         (build_array_from_name): New function.
7891         (duplicate_declaration_error_p): Renamed from
7892         duplicate_declaration_error.  Fixed leading comment.
7893         (register_fields): Main `for' loop reorganized. Uses
7894         SET_TYPE_FOR_RESOLUTION and build_array_from_name.
7895         (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
7896         build_array_from_name.
7897         (resolve_class): Set CLASS_LOADED_P on newly build array dimension
7898         types.
7899         (read_import_dir): Don't try to skip `.' and `..'.
7900         (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
7901         build_array_from_name. Main `for' loop reorganized.
7902         (resolve_qualified_expression_name): When building access to a
7903         field, use the type where the field was found, not its own type.
7904         (maybe_access_field): Use field DECL_CONTEXT if the type where the
7905         field was found is null.
7906         (qualify_ambiguous_name): Sweep through all successive array
7907         dimensions.
7908
7909 Wed Oct 14 18:21:29 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
7910
7911         * java-tree.h (pop_labeled_block, lang_printable_name,
7912         maybe_add_interface, set_super_info, get_access_flags_from_decl,
7913         interface_of_p, inherits_from_p, fix_classpath,
7914         complete_start_java_method, emit_handlers, init_outgoing_cpool,
7915         make_class_data, register_class, alloc_name_constant): New
7916         function prototypes.
7917         * lang.c (lang_decode_option): Set argc argument unused. Fixed
7918         indentation. Added cast to remove warning.
7919         (lang_printable_name): Set v argument unused.
7920         (lang_print_error): Added argument to lang_printable_name call.
7921         (java_dummy_print, print_lang_decl, print_lang_type,
7922         print_lang_identifier, lang_print_xnode): All argument marked
7923         unused.
7924         * lex.c (java_unget_unicode): Removed unnecessary argument.
7925         (java_allocate_new_line): Unused local variable is gone.
7926         (java_read_char): Added parenthesis in expressions to remove
7927         warnings.  Added final return statement.
7928         (java_read_unicode): Added parenthesis in expression to remove
7929         warning.
7930         (java_parse_end_comment): Fixed java_unget_unicode invocation.
7931         (java_parse_escape_sequence): Likewise.
7932         (java_lex): Unused local variables are gone. Fixed
7933         java_unget_unicode invocation.
7934         * lex.h (set_float_handler): Prototype added when JC1_LITE not
7935         defined.
7936         * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
7937         lang_printable_name invocation in macro.
7938         (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
7939         Likewise.
7940         (duplicate_declaration_error): Suppressed unused argument in
7941         prototype.
7942         (identical_subpath_p): Function declaration is gone.
7943         (patch_invoke): Suppressed unused argument in prototype.
7944         (patch_cast, build_labeled_block, check_thrown_exceptions):
7945         Likewise.
7946         * parse.y (setjmp.h): Included
7947         (toplev.h): Likewise.
7948         (field_declaration:): Suppressed unused local
7949         (label_decl:): Fixed build_labeled_block invocation.
7950         (java_pop_parser_context): Put extra parenthesis around assignment
7951         in if.
7952         (yyerror): Suppressed unused local variables.
7953         (variable_redefinition_error): Fixed lang_printable_name
7954         invocation.
7955         (create_interface): Suppressed unused local variables.
7956         (create_class): Likewise.
7957         (duplicate_declaration_error): Suppressed unused argument. Fixed
7958         lang_printable_name invocation.
7959         (register_fields): Suppressed unused local variable. Fixed
7960         duplicate_declaration_error invocation.
7961         (method_header): Suppressed unused local variable.
7962         (method_declarator, parser_check_super): Likewise.
7963         (java_complete_class): Suppressed unused local variable. Fixed
7964         fatal error message.
7965         (complete_class_report_errors): Added default: in switch.
7966         (java_check_regular_methods): Fixed lang_printable_name
7967         invocations.
7968         (check_throws_clauses): Likewise.
7969         (java_check_abstract_methods): Suppressed unused local
7970         variable. Fixed lang_printable_name invocation.
7971         (read_import_entry): Added supplemental return statement.
7972         (read_import_dir): Suppressed unused local variables.
7973         (check_pkg_class_access, declare_local_variables): Likewise.
7974         (source_start_java_method): Suppressed unused extern variable
7975         declarations
7976         (expand_start_java_method): Suppressed unused extern and local
7977         variable declarations.
7978         (java_complete_expand_methods): Likewise.
7979         (java_complete_expand_method): Suppressed unused local variables.
7980         (make_qualified_name): Likewise.
7981         (resolve_qualified_expression_name): Added default: in
7982         switch. Fixed lang_printable_name invocation.
7983         (class_instance_creation_expression): Added parenthesis around
7984         expressions.
7985         (patch_method_invocation_stmt): Fixed lang_printable_name and
7986         patch_invoke invocations.
7987         (check_for_static_method_reference): Fixed lang_printable_name
7988         invocation.
7989         (patch_invoke): Suppressed unused arguments and local variables.
7990         (lookup_method_invoke): Suppressed unused local variables.
7991         (qualify_ambiguous_name): Added default: in switch.
7992         (identical_subpath_p): Function removed.
7993         (patch_assignment): Suppressed unused local variables. Suppressed
7994         unnecessary if statement. Fixed lang_printable_name invocations.
7995         (try_builtin_assignconv): Fixed lang_printable_name invocations.
7996         (valid_ref_assignconv_cast_p): Parenthesis around
7997         expression. Suppressed unused local variables.
7998         (build_binop): Suppressed unused local variables. fixed
7999         lang_printable_name invocations.
8000         (string_constant_concatenation): Suppressed unused local
8001         variables.
8002         (patch_unaryop): Fixed lang_printable_name invocation.
8003         (patch_cast): Suppressed unnecessary argument. Fixed
8004         lang_printable_name invocation.
8005         (patch_array_ref): Fixed lang_printable_name invocation.
8006         (patch_newarray, patch_return, patch_if_else_statement): Likewise.
8007         (build_labeled_block): Suppressed unused argument.
8008         (generate_labeled_block): Fixed build_labeled_block invocation.
8009         (build_loop_body): Suppressed unused local variables.
8010         (patch_loop_statement): Likewise.
8011         (patch_exit): Fixed lang_printable_name invocation.
8012         (patch_switch_statement): Likewise.
8013         (case_identity): First argument marked unused.
8014         (patch_try_statement): Fixed lang_printable_name invocations.
8015         (patch_synchronized_statement, patch_throw_statement): Likewise.
8016         (check_thrown_exceptions): Fixed check_thrown_exceptions and
8017         lang_printable_name invocations.
8018         (check_thrown_exceptions_do): Suppressed unused argument.
8019
8020 1998-10-14  Tom Tromey  <tromey@cygnus.com>
8021
8022         * jcf-write.c (write_classfile): Add output class file as target.
8023         * lang-options.h: Added -MD, -MMD, -M, and -MM.
8024         * jcf.h: Added declarations for dependency-tracking functions.
8025         * lang-specs.h: Handle -M, -MM, MD, and -MMD.
8026         * lang.c (lang_decode_option): Recognize -MD and -MMD.
8027         (finish_parse): Call jcf_dependency_write.
8028         (dependency_tracking): New global.
8029         (DEPEND_SET_FILE): New define.
8030         (DEPEND_ENABLE): New define.
8031         (init_parse): Enable dependency tracking if required.
8032         Include "flags.h".
8033         * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
8034         (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
8035         (../gcjh$(exeext)): Likewise.
8036         (jcf-depend.o): New target.
8037         * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
8038         (GCJH_SOURCES): Likewise.
8039         * jcf-io.c (open_class): Call jcf_dependency_add_file.  Added
8040         dep_name argument.
8041         (find_classfile): Added dep_name argument.
8042         (find_class): Compute name of dependency.
8043         (open_in_zip): Call jcf_dependency_add_file.
8044         * gjavah.c (output_file): No longer global.
8045         (usage): Don't mention "gjavah".
8046         (help): Likewise.
8047         (java_no_argument): Likewise.
8048         (version): Likewise.
8049         (main): Recognize and handle -M family of options.
8050         (print_mangled_classname): Return is void.
8051         (process_file): Handle case where output is suppressed.
8052         (HANDLE_END_FIELD): Likewise.
8053         (HANDLE_METHOD): Likewise.
8054         * jcf-depend.c: New file.
8055
8056 Tue Oct 13 23:34:12 1998  Jeffrey A Law  (law@cygnus.com)
8057
8058         * java-tree.def: Add missing newline at EOF.
8059
8060 1998-10-13  Tom Tromey  <tromey@cygnus.com>
8061
8062         * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
8063         (main): Likewise.  Exit with SUCCESS_EXIT_CODE at end of
8064         function.
8065         Include <config.h> and "system.h".
8066         (disassemble_method): Undefine RET to avoid clash with
8067         config/i386/i386.h.
8068
8069 Tue Oct 13 03:50:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8070
8071         * decl.c (runtime_exception_type_node, error_exception_type_node):
8072         New global variables.
8073         (init_decl_processing): Initialized.
8074         * expr.c (java_lang_expand_expr): Set caught exception type to
8075         null if catch handler argument doesn't exit.
8076         * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
8077         tree codes.
8078         * java-tree.h (runtime_exception_type_node,
8079         error_exception_type_node): Global variables declared.
8080         (DECL_FUNCTION_THROWS): New macro.
8081         (DECL_FUNCTION_BODY): Modified comment.
8082         (DECL_SPECIFIC_COUNT): Likewise.
8083         (struct lang_decl): New field throws_list.
8084         (IS_UNCHECKED_EXPRESSION_P): New macro.
8085         * lex.c (java_lex): Generate location information for THROW_TK.
8086         * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
8087         EXCEPTIONS_P): New macros.
8088         (enum jdep_code): New value JDEP_EXCEPTION.
8089         (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
8090         BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
8091         PATCH_METHOD_RETURN_ERROR): New macros.
8092         (patch_method_invocation_stmt): Added new argument to prototype.
8093         (patch_synchronized_statement, patch_throw_statement,
8094         check_thrown_exceptions, check_thrown_exceptions_do,
8095         purge_unchecked_exceptions, check_throws_clauses): New function
8096         prototypes.
8097         * parse.y Fixed typo in keyword section.
8098         (throw:): Rule tagged <node>.
8099         (THROW_TK): Keyword tagged <operator>.
8100         (method_header:): Last argument to call to method_header passed
8101         from throws: rule.
8102         (throws:, class_type_list:, throw_statement:,
8103         synchronized_statement:, synchronized:): Defined actions.
8104         (method_header): New local variable current. Register exceptions
8105         from throws clause.
8106         (java_complete_tree): Complete and verify exceptions from throws
8107         clause.
8108         (complete_class_report_errors): Error message on exceptions not
8109         found
8110         (java_check_regular_methods): Fixed typo. Shortcut on private
8111         overriding methods. Changed error message on method
8112         redefinition. Check for throws clause compatibility.
8113         (check_throws_clauses): New function.
8114         (java_check_abstract_methods): Use DECL_NAME for wfl or current
8115         method. Changed error message on method redefinition.
8116         (currently_caught_type_list): New static variable.
8117         (java_complete_expand_methods): Purge unchecked exceptions from
8118         throws clause list. Call PUSH_EXCEPTIONS before walk and
8119         POP_EXCEPTIONS after.
8120         (resolve_qualified_expression_name): Pass new argument as NULL to
8121         patch_method_invocation_stmt.
8122         (patch_method_invocation_stmt): New argument ref_decl. Invoke
8123         PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
8124         argument list when appropriate. Use new argument if non null to
8125         store selected method decl.
8126         (patch_invoke): Convert if necessary args of builtin types before
8127         forming CALL_EXPR. Argument list no longer reversed here.
8128         (invocation_mode): Treat final methods as static methods.
8129         (java_complete_tree): New cases for THROW_EXPR: and
8130         SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
8131         function call.
8132         (complete_function_arguments): No more RECORD_TYPE
8133         conversion. Function parameter nodes no longer saved.
8134         (valid_ref_assignconv_cast_p): Avoid handling null type.
8135         (patch_binop): Fixed null constant reference handling.
8136         (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
8137         BUILD_THROW macros.
8138         (patch_try_statement): Fixed comments. Record caught types in
8139         list, push the list, expand try block and pop the list.
8140         (patch_synchronized_statement, patch_throw_statement,
8141         check_thrown_exceptions, check_thrown_exceptions_do,
8142         purge_unchecked_exceptions): New functions.
8143         * typeck.c (lookup_argument_method): Allow WFL in place of method
8144         DECL_NAME during method definition check
8145
8146 1998-10-09  Tom Tromey  <tromey@cygnus.com>
8147
8148         * gjavah.c (decode_signature_piece): New function.
8149         (print_c_decl): Use it.  Added `name_override' argument.
8150         (print_method_info): Use name_override argument to print_c_decl.
8151         (seen_fields): Removed.
8152         (print_field_info): Don't update seen_fields.
8153         (struct method_name): New structure.
8154         (method_name_list): New global.
8155         (print_method_info): Add new method to list of methods.
8156         (name_is_method_p): New function.
8157         (print_field_info): If field name has same name as method, then
8158         change field name.
8159         (process_file): Parse methods before fields.
8160         (field_pass): New global.
8161         (HANDLE_END_FIELD): Take field_pass into account.
8162
8163 Wed Oct  7 12:10:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8164
8165         * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
8166         (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
8167
8168 Sat Oct  3 13:29:46 1998  Anthony Green  <green@cygnus.com>
8169
8170         * jvspec.c: Fix bug in jvgenmain_spec patch.
8171
8172 Fri Oct  2 17:22:52 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8173
8174         * Makefile.in (lang.o:): Install dependency on java-tree.def.
8175         * decl.c (soft_exceptioninfo_call_node): New global variable.
8176         (init_decl_processing): Fixed indentation. soft_badarrayindex_node
8177         takes extra integer argument. soft_exceptioninfo_call_node
8178         initialized.
8179         * except.c (java_set_exception_lang_code): New function
8180         (method_init_exceptions): Called here.
8181         (prepare_eh_table_type): New function.
8182         (expand_end_java_handler): Called here.
8183         * expr.c (build_java_throw_out_of_bounds_exception): Now features
8184         one argument. Modified generation of call to
8185         soft_badarrayindex_node to use new argument.
8186         (build_java_arrayaccess): Pass faulty index value to
8187         build_java_throw_out_of_bounds_exception.
8188         (generate_name): New function.
8189         (java_lang_expand_expr): New local variables node, current,
8190         has_finally_p. Expand TRY_EXPR node.
8191         (process_jvm_instruction): Replace top of the stack with thrown
8192         object reference when entering exception handler.
8193         * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
8194         specific tree codes.
8195         * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
8196         global.
8197         (DECL_SPECIFIC_COUNT): New macro.
8198         (prepare_eh_table_type, java_set_exception_lang_code,
8199         generate_name): New function declarations.
8200         (match_java_method): Declaration deleted.
8201         (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
8202         macros.
8203         * lex.c (TRY_TK, CATCH_TK): Generate location information.
8204         * parse.h (redefinition_error, refine_accessible_methods_list,
8205         can_cast_to_p): Function declaration removed.
8206         (classitf_redefinition_error, variable_redefinition_error,
8207         parse_jdk1_1_error, find_applicable_accessible_methods_list,
8208         find_most_specific_methods_list, argument_types_convertible,
8209         enter_a_block, valid_builtin_assignconv_identity_widening_p,
8210         valid_cast_to_p, valid_method_invocation_conversion_p,
8211         try_reference_assignconv, add_stmt_to_compound,
8212         build_jump_to_finally, build_tree_list, patch_try_statement,
8213         java_get_catch_block): New function declarations.
8214         * parse.y (string_buffer_type): Global variable deleted.
8215         (group_of_labels, catches, catch_clause, catch_clause_parameter,
8216         finally): Rules tagged <node>.
8217         (TRY_TK, CATCH_TK): Token tagged <operator>.
8218         (class_body_declaration:, class_member_declaration:,
8219         formal_parameter:, explicit_constructor_invocation:,
8220         interface_member_declaration:, constant_declaration:,
8221         primary_no_new_array:, class_instance_creation_expression:,
8222         array_creation_expression:): Issue error on unsuported JDK1.1
8223         features.
8224         (try_statement:, catches:, finally:): Define actions.
8225         (catch_clause_parameter): New rule.
8226         (catch_clause:): Use new rule catch_clause_parameter.
8227         (parse_jdk1_1_error): New function.
8228         (redefinition_error): Renamed classitf_redefinition_error.
8229         (variable_redefinition_error): New function.
8230         (check_class_interface_creation): Call
8231         classitf_redefinition_error.
8232         (java_complete_tree): Added error message on JDEP_TYPE: case.
8233         (complete_class_report_errors): Fixed indentation.
8234         (declare_local_variables): Call variable_redefinition_error.
8235         (source_end_java_method): Call java_set_exception_lang_code and
8236         emit_handlers where appropriate.
8237         (java_method_add_stmt): Call add_stmt_to_block.
8238         (add_stmt_to_block): New function.
8239         (lookup_method_invoke): Fixed outside comment. new local variable
8240         candicates.  Call find_applicable_accessible_methods_list and
8241         find_most_specific_methods_list when searching for a
8242         method. Modified error report to list possible candidates when
8243         applicable.
8244         (find_applicable_accessible_methods_list,
8245         find_most_specific_methods_list, argument_types_convertible): New
8246         function.
8247         (refine_accessible_methods_list): Function deleted.
8248         (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
8249         expr (if applicable) before calling patch_array_ref.
8250         (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
8251         (enter_block): Fixed comment.
8252         (enter_a_block): New function.
8253         (patch_assignment): Reorganized. Call try_reference_assignconv for
8254         references. Call valid_cast_to_p instead of can_cast_to_p.
8255         (try_reference_assignconv,
8256         valid_builtin_assignconv_identity_widening_p): New functions.
8257         (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
8258         (valid_cast_to_p, valid_method_invocation_conversion_p): New
8259         functions.
8260         (build_string_concatenation): Don't resolve StringBuffer.
8261         (patch_cast): Fixed inverted arguments.
8262         (patch_array_ref): Code to save array expr deleted. Call
8263         valid_cast_to_p instead of can_cast_to_p.
8264         (generate_labeled_block): Call generate_name.
8265         (build_jump_to_finally, build_try_statement, java_get_catch_block,
8266         patch_try_statement): New functions.
8267         * typeck.c (match_java_method): Function deleted.
8268
8269 Fri Oct  2 13:48:36 1998  Anthony Green  <green@cygnus.com>
8270
8271         * jvspec.c: jvgenmain_spec uses different temporary file names.
8272
8273 Fri Oct  2 12:50:19 1998  Anthony Green  <green@cygnus.com>
8274
8275         * jvspec.c (lang_specific_driver): Fail if user specifies
8276         --main= when not linking.
8277
8278 Mon Sep 28 13:48:33 1998  Tom Tromey  <tromey@cygnus.com>
8279
8280         * class.c (make_class_data): Push value for `thread' field.
8281         * decl.c (init_decl_processing): Added `thread' field to class.
8282
8283         * class.c (add_field): Always make static fields externally
8284         visible.
8285
8286 Sat Sep 26 08:22:47 1998  Anthony Green  <green@cygnus.com>
8287
8288         * expr.c (build_java_athrow,
8289         build_java_throw_out_of_bounds_exception, expand_invoke,
8290         build_newarray, expand_java_multianewarray, build_java_monitor):
8291         Update comments to reflect _Jv_* function names.
8292
8293 Fri Sep 25 16:03:02 1998  Per Bothner  <bothner@cygnus.com>
8294
8295         * decl.c (complete_start_java_method):  DECL_RESULT is always promoted.
8296         * decl.c (start_java_method):  Handle PROMOTE_PROTOTYPES target macro.
8297         * parse.y (expand_start_java_method):  Likewise.
8298
8299 Thu Sep 24 12:20:35 1998  Per Bothner  <bothner@cygnus.com>
8300
8301         * expr.c (pop_arguments):  Handle PROMOTE_PROTOTYPES target macro.
8302
8303         * class.c (push_class):  IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
8304         (add_field):  No longer need to convert from RECORD_TYPE to pointer,
8305         * expr.c:  Remove no-longer-needed calls to promote_type.
8306         * decl.c (give_name_to_locals):  Liekwise.
8307         * jcf-parse.c (get_class_constant):  Compensate for new signatures.
8308         * parse.y:  Add/remove promote_type calls as appropriate.
8309         * typeck.c (parse_signature_type):  Returns POINTER_TYPE for objects.
8310         (parse_signature_string):  Likewise.
8311         (build_java_array_type):  Fix for now signature convenions.
8312
8313         * lex.c (java_lex):  Fix (from Alex) for JC1_LITE problem.
8314
8315 Wed Sep 23 14:49:35 1998  Tom Tromey  <tromey@cygnus.com>
8316
8317         * class.c (init_class_processing): libjava function renamed to
8318         _Jv_RegisterClass.
8319
8320 Tue Sep 22 12:00:02 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8321
8322         * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
8323         * java-tree.def: Fixed DEFTREECODE third argument.
8324         (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
8325         CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
8326         * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
8327         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8328         JAVA_THIS_EXPR): Now replaced by tree code definitions.
8329         (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
8330         * lang.c (java_tree_code_type, java_tree_code_length,
8331         java_tree_code_name): New arrays.
8332         (lang_init): Append Java tree node definitions to Gcc ones.
8333         * lex.c (expression_obstack): Declared as extern when JC1_LITE
8334         defined.
8335         (java_init_lex): Initialize wfl_append, wfl_string_buffer,
8336         wfl_to_string.
8337         (java_lex): Allow declaration of empty string constants. Retain
8338         location information on CASE_TK and DEFAULT_TK.
8339         * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
8340         JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
8341         Modified to be more robust.
8342         (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
8343         (build_new_invocation, try_builtin_assignconv,
8344         patch_switch_statement, string_constant_concatenation,
8345         build_string_concatenation, patch_string_cst, patch_string,
8346         java_expand_switch): New function declarations.
8347         * parse.y: Rules related to switch and EH tagged <node>.
8348         (label_id): Set to NULL_TREE
8349         (wfl_string_buffer, wfl_append, wfl_to_string): New static global
8350         tree nodes.
8351         (this_or_super:): Fixed indentation.
8352         (statement:, statement_nsi:, statement_without_trailing_substatement:,
8353         statement_expression:): Removed call to RULE on all sub-rules.
8354         (switch_expression:, switch_labels:): New rules.
8355         (switch_statement:, switch_block:, switch_block_statement_groups:,
8356         switch_block_statement_group:, switch_labels:, switch_label:):
8357         Defined actions.
8358         (throw_statement:, synchronized_statement:, try_statement:):
8359         Defined temporary actions.
8360         (class_instance_creation_expression:): Call
8361         build_new_invocation. Fixed indentation.
8362         (field_access): Fixed indentation.
8363         (method_invocation): Likewise.
8364         (make_qualified_primary): Use THIS_EXPR.
8365         (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
8366         resolving from SUPER, set *type_found.
8367         (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
8368         (java_complete_tree): Removed unused local variable `location'. Case
8369         for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
8370         NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
8371         on MODIFY_EXPR: and all binary operator tree code cases. Removed
8372         STRING_CST: case. default: checks for patchable strings.
8373         (complete_function_arguments): Transform string constant or
8374         crafted StringBuffer if necessary.
8375         (build_method_invocation): Fixed comments.
8376         (build_new_invocation): New function.
8377         (patch_assignment): Call try_builtin_assignconv to figure a valid
8378         assignment conversion between builtin types.
8379         (try_builtin_assignconv): New function.
8380         (build_binop): Use URSHIFT_EXPR directly to call build.
8381         (operator_string): Use UNARY_PLUS_EXPR.
8382         (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
8383         operator.
8384         (do_merge_string_cste, merge_string_cste,
8385         string_constant_concatenation, build_string_concatenation,
8386         patch_string, patch_string_cst): New function.
8387         (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
8388         (patch_unaryop): Likewise. New test of valid ++/-- operands.
8389         (build_newarray_node): Use NEW_ARRAY_EXPR.
8390         (build_this): Use THIS_EXPR.
8391         (build_return): Enable debug information on return statement.
8392         (build_if_else_statement): Likewise.
8393         (complete_labeled_statement): Fixed related comment.
8394         (build_loop_body): Fixed comment.
8395         (build_bc_statement): Enable debug information on break/continue
8396         statements.
8397         (patch_bc_statement): Fixed typos. Handle SWITCH statement
8398         context.
8399         (patch_switch_statement, case_identity, java_expand_switch): New
8400         functions.
8401
8402 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
8403
8404         * buffer.h (BUFFER_INIT):  New macro.
8405         * jcf-write.c (struct jcf_partial):  New type.  Put global stuff here.
8406         Pass (struct jcf_partial *state) to most functions.
8407         (jcf_block, jcf_relocation):  New types.
8408         Support labels, branches, conditionals, loops.
8409
8410 Mon Sep 21 15:08:48 1998  Tom Tromey  <tromey@cygnus.com>
8411
8412         * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
8413
8414 Mon Sep 21 13:21:35 1998  Per Bothner  <bothner@cygnus.com>
8415
8416         * decl.c (integer_type_node):  Make it have INT_TYPE_SIZE.
8417         * verify.c (verify_jvm_instructions):  Use int_type_not (32 bits),
8418         not integer_type_node (INT_TYPE_SIZ bits).
8419
8420         * parse.y (patch_if_else_statement):  Accept promoted_boolean_type_node.
8421
8422         * jcf-reader.c (get_attribute):  New HANDLE_EXCEPTION_TABLE hook.
8423         * jcf-dump.c (print_exception_table):  New function.
8424         (disassemble_method):  Better handling of wide instructions.
8425         Make more robust for bad input.
8426
8427 Wed Sep 30 20:53:51 1998  Jeffrey A Law  (law@cygnus.com)
8428
8429         * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
8430         FreeBSD.
8431
8432 Thu Sep 17 19:45:01 1998  Jeffrey A Law  (law@cygnus.com)
8433
8434         * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
8435
8436 Thu Sep 17 16:21:52 1998  Tom Tromey  <tromey@cygnus.com>
8437
8438         * Makefile.in ($(PARSE_H)): Removed target.
8439
8440 Thu Sep 17 01:57:07 1998  Jeffrey A Law  (law@cygnus.com)
8441
8442         * Makefile.in (JAVA_OBJS): Add memmove.o
8443         (memmove.o): New target & rules.
8444
8445 Tue Sep 15 23:21:55 1998  Tom Tromey  <tromey@cygnus.com>
8446
8447         * expr.c (expand_invoke): Don't generate a call to the class init
8448         code.
8449
8450 Mon Sep 14 10:14:47 1998  Jeffrey A Law  (law@cygnus.com)
8451
8452         * Makefile.in: Add many missing dependencies.
8453         * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
8454         as appropriate.
8455         * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
8456         * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
8457
8458 Fri Sep 11 14:05:21 1998  Per Bothner  <bothner@cygnus.com>
8459
8460         * decl.c (complete_start_java_method):  If method is static (and
8461         not private) call _Jv_InitClass.
8462         * expr.c (expand_invoke):  Don't call build_class_init.
8463
8464         * jvspec.c (jvgenmain_spec):  Fix spec for generated .o file.
8465
8466 Thu Sep 10 10:33:31 1998  Jeffrey A Law  (law@cygnus.com)
8467
8468         * Make-lang.in (GCJ): Define before using.
8469
8470 Wed Sep  9 21:23:10 1998  Jeffrey A Law  (law@cygnus.com)
8471
8472         * gjavah.c (java_no_argument): Renamed from no_argument to avoid
8473         losing due to namespace pollution in GNU getopt.h
8474
8475 Wed Sep  9 13:33:39 1998  Tom Tromey  <tromey@cygnus.com>
8476
8477         * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
8478         (java.all.cross): Likewise.
8479         (java.rest.encap): Likewise.
8480
8481 Tue Sep  8 10:34:05 1998  Jeffrey A Law  (law@cygnus.com)
8482
8483         * gjavah.c (print_class_decls): Fix thinko in arglist
8484         * jcv-io.c (find_classfile): Similarly.
8485
8486 Mon Sep  7 13:59:49 1998  Jeffrey A Law  (law@cygnus.com)
8487
8488         * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
8489
8490 Sat Sep  5 16:08:01 1998  Tom Tromey  <tromey@cygnus.com>
8491
8492         * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
8493         (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
8494         * Makefile.in (PARSE_C): New macro.
8495         (PARSE_H): Likewise.
8496         (PARSE_SCAN_C): Likewise.
8497         ($(PARSE_C)): Target renamed from parse.c.
8498         ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
8499         (clean): Remove parse-scan.c as well.
8500         (parse.o): Depend on $(PARSE_C).
8501
8502 Sat Sep  5 08:48:40 1998  Anthony Green  <green@cygnus.com>
8503
8504         * README, license.terms: Removed.
8505
8506         * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
8507         decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
8508         javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
8509         jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
8510         keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
8511         lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
8512         verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
8513         and Java trademark attribution.
8514
8515 Fri Sep  4 10:42:05 1998  Tom Tromey  <tromey@cygnus.com>
8516
8517         * Makefile.in: Use gcjh, not gjavah.
8518         * config-lang.in (stagestuff): Use gcjh, not gjavah.
8519         * Make-lang.in: Changed gjavah to gcjh everywhere.
8520
8521 Thu Sep  3 18:04:09 1998  Per Bothner  <bothner@cygnus.com>
8522
8523         * gjavah.c:  Support new -prepend -add -append flags.
8524         (print_method_info):  Method is not virtual if class is final.
8525
8526 Thu Sep  3 12:03:53 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8527
8528         * jv-scan.c: Fixed copyright assignment.
8529         * keyword.gperf: Likewise.
8530         * keyword.h: Likewise.
8531         * lex.c: Fixed copyright assignment.
8532         (java_lex): Push unicode back when parsing '<'.
8533         * lex.h: Fixed copyright assignment.
8534         * parse-scan.y: Likewise.
8535         * parse.h: Fixed copyright assignment.
8536         (build_debugable_stmt, complete_for_loop): New function prototypes.
8537         * parse.y: Fixed copyright assignment.
8538         (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
8539         size_zero_node when completing a loop with no exit condition.
8540         (for_statement_nsi:): Define action.
8541         (for_init:, for_update:): Return size_zero_node when empty.
8542         (declare_local_variables): Call build_debugable_stmt.
8543         (build_debugable_stmt): New function.
8544         (build_loop_body): Build debugable statement around loop
8545         condition part.
8546         (complete_loop_body): Take into account the debugable statement
8547         around the EXIT_EXPR.
8548         (complete_loop_body): New function.
8549         (patch_exit_expr): Fixed condition inversion.
8550
8551 Wed Sep  2 11:53:58 1998  Tom Tromey  <tromey@cygnus.com>
8552
8553         * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
8554         name of thread define.
8555         * jvspec.c (THREAD_NAME): New macro.
8556         (GCLIB): Likewise.
8557         (THREADLIB): Likewise.
8558         (lang_specific_driver): Recognize attempt to link with thread
8559         library or gc library.  Recognize -ljava on command line so it
8560         isn't linked against more than once.
8561
8562 Wed Sep  2 11:28:35 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8563
8564         * parse-scan.y (report_main_declaration): Name of the class
8565         containing `main' can be a qualified name.
8566
8567 Mon Aug 31 13:25:58 1998  Tom Tromey  <tromey@cygnus.com>
8568
8569         * config-lang.in: Changed gjavac to gjc everywhere.
8570         * Make-lang.in: Changed gjavac to gjc everywhere.
8571
8572 Thu Aug 27 02:28:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8573
8574         * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
8575         (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
8576         and install the files.
8577         * Makefile.in (JAVA_OBJS_LITE): New variable.
8578         (compiler:): Now include jv-scan as a dependency.
8579         (../jv-scan$(exeext), parse-scan.c): New targets.
8580         (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
8581         * config-lang.in (compilers): Removed gcj, gjavah from the list.
8582         * jcf-parse.c (parse_source_file): Call java_layout_classes and
8583         check for errors even if parse_only.
8584         * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
8585         defined.
8586         (yylex): New function. Uses java_lex body.
8587         (java_lex): Removed commented out statement. Remove local variable
8588         literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
8589         appropriate.  Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
8590         DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
8591         SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
8592         if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
8593         SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
8594         where appropriate.
8595         (java_lex_error): Empty if JC1_LITE is defined.
8596         (java_get_line_col): Return 0 if JC1_LITE is defined.
8597         * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
8598         SET_MODIFIER_CTX): Moved into the section containing the macros
8599         conditionally defined by JC1_LITE.
8600         (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
8601         argument if JC1_LITE is defined.
8602         (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
8603         REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
8604         is defined.
8605         (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
8606         FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
8607         SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
8608         to different values according to JC1_LITE.
8609         * parse.h (int_fits_type_p, stabilize_reference): Prototype not
8610         declared if JC1_LITE set.
8611         (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
8612         defined if JC1_LITE not set.
8613         (struct parser_ctx): Reorganized and skip the jc1 front end part
8614         if JC1_LITE set.
8615         (java_layout_classes): New function definition.
8616         (java_push_parser_context, java_init_lex, yyparse, yylex,
8617         yyerror): Prototype always declared. All other static function
8618         prototypes declared only if JC1_LITE is not set.
8619         * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
8620         declared in parse.h.
8621         (java_layout_classes): New function.
8622         (java_complete_expand_methods): No longer layout the class here.
8623         * parse-scan.y: New file.
8624         * jv-scan.c: New file.
8625
8626 Tue Aug 25 10:17:54 1998  Tom Tromey  <tromey@cygnus.com>
8627
8628         * gjavah.c (main): Handle -friend option.
8629         (friend_specs): New global.
8630         (generate_access): Handle friend_specs.
8631         (process_file): Likewise.
8632         (MAX_FRIENDS): New macro.
8633         (friend_count): New global.
8634         (print_cxx_classname): Added `prefix' argument.  Ignore arrays.
8635         Changed all callers.
8636
8637 Mon Aug 24 20:19:27 1998  Per Bothner  <bothner@cygnus.com>
8638
8639         * jcf-dump.c (process_class):  Move JCF_FINISH use to main,
8640         (main):  Handle processing all the entries of a named .zip archive.
8641         * jcf-io.c (jcf_trim_old_input):  New function.
8642         * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le):  New macros.
8643
8644 Mon Aug 24 07:35:13 1998  Per Bothner  <bothner@cygnus.com>
8645
8646         * lang.c (flag_assume_compiled):  Make default be on.
8647
8648 Fri Aug 21 17:29:04 1998  Per Bothner  <bothner@cygnus.com>
8649
8650         * jcf-dump.c:  Add bunches of flags to control output more.
8651         (process_class):  New function;  support printing more than one class.
8652         (main): Support new --print-main and --javap flags.
8653         * jcf-reader.c (IGNORE_ATTRIBUTE):  New hook.
8654         * jcf.h (CPOOL_INDEX_IN_RANGE):  New macro.
8655
8656 Thu Aug 20 14:24:47 1998  Per Bothner  <bothner@cygnus.com>
8657
8658         Change mangling of dispatch table to match C++ vtable (w/thunks).
8659         * class.c (build_dtable_decl), java-tree.h:  New function.
8660         (make_class_data):  Call it.
8661         * decl.c (init_decl_processing):  Likewise.
8662
8663 Wed Aug 19 17:57:07 1998  Warren Levy  <warrenl@cygnus.com>
8664
8665         * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
8666         soft_anewarray; adjust args passed.
8667         * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
8668         match _Jv_NewObjectArray.
8669
8670 Wed Aug 19 09:33:23 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8671
8672         * decl.c (push_labeled_block, pop_labeled_block): New functions.
8673         * expr.c (loopup_label): Call create_label_decl.
8674         (create_label_decl): New function.
8675         (java_lang_expand_expr): Call expand_start_bindings with argument
8676         set to zero.
8677         * java-tree.h Added space after PROTO in function declarations
8678         when necessary.
8679         (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
8680         (create_label_decl, push_labeled_block): New function
8681         declarations.
8682         * lex.c (label_id): Initialize.
8683         (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
8684         switch.
8685         * parse.h Added space after PROTO in function declarations when
8686         necessary.
8687         (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
8688         LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
8689         LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
8690         PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
8691         macros.
8692         (struct parser_ctxt): New fields current_loop,
8693         current_labeled_block.
8694         (build_if_else_statement, patch_if_else_statement,
8695         add_stmt_to_compound, patch_exit_expr, build_labeled_block,
8696         generate_labeled_block, complete_labeled_statement,
8697         build_bc_statement, patch_bc_statement, patch_loop_statement,
8698         build_new_loop, build_loop_body, complete_loop_body): New function
8699         declarations.
8700         * parse.y (java_warning_count): New global variable.
8701         (label_id): New static variable.
8702         (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
8703         (block:): Return size_zero_node when block is empty.
8704         (empty_statement:): Return size_zero_node.
8705         (statement:): Implement supplemental action when for_statement: is
8706         reduced.
8707         (label_decl:): New rule.
8708         (labeled_statement:): Rewritten using label_decl. Actions
8709         implemented.
8710         (labeled_statement_nsi:): Likewise.
8711         (if_then_statement): Actions implemented.
8712         (while_expression): New rule.
8713         (while_statement:): Rewritten using while_expression. Actions
8714         implemented.
8715         (while_statement_nsi:): Likewise.
8716         (do_statement_begin:): New rule.
8717         (do_statement:): Rewritten using do_statement_begin. Actions
8718         implemented.
8719         (for_statement:): Rewritten using for_begin. Actions implemented.
8720         (for_statement_nsi:): Likewise.
8721         (for_header:, for_begin:): New rules.
8722         (for_init:): Actions implemented.
8723         (statement_expression_list:, break_statement:,
8724         continue_statement:): Likewise.
8725         (yyerror): Count number of issued warning(s).
8726         (java_report_errors): Report error(s) and/or warning(s).
8727         (java_complete_class): Use build_java_argument_signature to
8728         recompute completed method signature.
8729         (java_check_regular_methods): New locals method_wfl and aflags.
8730         Use method_wfl instead of lookup_cl during error reports. Fixed
8731         indentation and modified some error messages. Use
8732         lang_printable_name in method instead of the DECL_NAME. New code
8733         to issue warnings on methods not overriding corresponding methods
8734         private to a different package.
8735         (java_method_add_stmt): Call add_stmt_to_compound.
8736         (add_stmt_to_compound): New function.
8737         (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
8738         LOOP_EXPR, EXIT_EXPR and COND_EXPR.
8739         (build_if_else_statement, patch_if_else_statement,
8740         build_labeled_block, generate_labeled_block,
8741         complete_labeled_statement, build_new_loop, build_loop_body,
8742         complete_loop_body, patch_loop_statement, build_bc_statement,
8743         patch_bc_statement, patch_exit_expr): New functions.
8744         * typeck.c (build_java_signature): Build argument signature before
8745         enclosing it in between parenthesis.
8746
8747 Mon Aug 17 17:44:24 1998  Warren Levy  <warrenl@cygnus.com>
8748
8749         * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
8750         (JAVA_OBJS): Added reminder comment
8751
8752 Thu Aug 13 10:01:45 1998  Nick Clifton  <nickc@cygnus.com>
8753
8754         * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
8755         be interpreted as a long long.
8756
8757 Thu Aug 13 14:34:07 1998  Warren Levy  <warrenl@cygnus.com>
8758
8759         * decl.c (init_decl_processing): Use _Jv_InitClass, not
8760         soft_initialise_class.  Use _Jv_NewMultiArray, not
8761         soft_multianewarray.  Use _Jv_ThrowBadArrayIndex, not
8762         soft_badarrayindex.  Use _Jv_CheckCast, not soft_checkcast.  Use
8763         _Jv_CheckArrayStore, not soft_checkarraystore.  Use
8764         _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
8765
8766 Wed Aug 12 14:23:13 1998  Per Bothner  <bothner@cygnus.com>
8767
8768         * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
8769         length_identifier_node):  New global tree node constants.
8770         * parse.y (kw_super, kw_this, kw_length):  Removed globals.
8771         Replace uses by super_identifier_node etc.
8772         * lex.c (kw_super, kw_this, kw_length):  Don't initialize.
8773
8774         * parse.y (resolve_field_access):  Don't special-case ".length" if
8775         flag_emit_class_files.
8776         (patch_array_ref):  Leave as ARRAY_REF if flag_emit_class_files.
8777         * jcf-write.c (generate_bytecode_insns):  Handle ARRAY_REF opcode
8778         and ARRAY.length.
8779
8780 Tue Aug 11 11:31:55 1998  Per Bothner  <bothner@cygnus.com>
8781
8782         * decl.c (init_decl_processing): Remove unused method_type_node fields.
8783         * class.c (make_method_value):  Remove init for removed fields.
8784
8785         * class.c (layout_class):  Use build_java_argument_signature.
8786         * java-tree.h (TYPE_ARGUMENT_SIGNATURE):  New macro.
8787
8788         * typeck.c (push_java_argument_signature):  Removed.  Merged into ...
8789         (build_java_argument_signature):  Use TYPE_ARGUMENT_SIGNATURE cache.
8790         (build_java_signature):  Don't use push_java_argument_signature.
8791
8792         * typeck.c (lookup_argument_method):  New function.
8793         * parse.y (java_check_regular_methods):  Use lookup_argument_method
8794         instead of lookup_java_method2 followed by lookup_java_method.
8795
8796         * parse.y (check_method_redefinition):  Minor optimization.
8797
8798         * jcf-write.c (generate_bytecode_insns):  Handle RETURN_EXPR,
8799         MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
8800
8801 Mon Aug 10 09:57:15 1998  Tom Tromey  <tromey@cygnus.com>
8802
8803         * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
8804         c-pragma.o.
8805
8806         * gjavah.c (java_float_finite): Use K&R-style definition.
8807         (java_double_finite): Likewise.
8808         (generate_access): Now returns void.  Changed all callers.
8809         (last_access_generated): Removed.
8810         (process_file): Only make a single pass over the .class file.
8811
8812 Wed Jul 29 17:50:23 1998  Per Bothner  <bothner@cygnus.com>
8813
8814         * class.c (get_dispatch_table):  Add extra dummy vtable entry,
8815         for compatibility for G++ (with -fvtable-thunks).
8816         * expr.c (build_invokevirtual):  Add one for extra dummy vtable entry.
8817
8818         * gjavah.c (process_file):  Use public inheritance for super-class.
8819
8820 Wed Jul 29 13:19:03 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8821
8822         * lex.c (java_init_lex): Initialize ctxp->package.
8823         * parse.h (struct parser_ctxt): package and package_len replaced
8824         by tree package, an identifier node. Field method_decl_list is
8825         gone. Fixed comments.
8826         (lookup_field_wrapper, merge_qualified_name, not_accessible,
8827         class_in_current_package): New function prototypes.
8828         * parse.y (array_type:): Set class loaded flag on primitive type
8829         arrays.
8830         (package_declaration:): Assign ctxp->package to the
8831         identifier node.
8832         (method_invocation:): Handle invocation of method qualified by
8833         `super'.
8834         (single_type_import_declaration:): Removed ambiguity check.
8835         (java_pop_parser_context): New local variable `next'. Reset and
8836         set IMPORT_CLASSFILE_NAME flags on current and previous import
8837         list.
8838         (java_accstring_lookup): Use new local macro COPY_RETURN.
8839         (lookup_field_wrapper): New function.
8840         (parser_qualified_classname): Use merge_qualified_name.
8841         (parser_check_super_interface): Broaden error message.
8842         (do_resolve_class): Check for qualified class name in the current
8843         compilation unit if appropriate.
8844         (process_imports): Check for already defined classes.
8845         (check_pkg_class_access): Got rid of call to
8846         get_access_flags_from_decl.
8847         (java_complete_expand_methods): Call safe_layout_class based on
8848         the current class size.
8849         (make_qualified_primary): Build a WFL qualification on primary if
8850         none exists.
8851         (merge_qualified_name): New function.
8852         (make_qualified_name): Use merge_qualified_name.
8853         (resolve_expression_name): Use safe_lookup_field.
8854         (resolve_field_access): Got rid of call to get_access_flags_from_decl.
8855         (resolve_qualified_expression_name): Likewise. Check on resolved
8856         element accessibility.
8857         (not_accessible_p, class_in_current_package): New functions.
8858         (maybe_access_field): Got rid of call to get_access_flags_from_decl.
8859         (patch_method_invocation_stmt): Merged common pieces. Check
8860         accessibility of invoked method.
8861         (check_for_static_method_reference): Add returned type in error
8862         message.
8863         (invocation_mode): Get rid of bogus check on PRIVATE methods.
8864         (refine_accessible_methods_list): Merged two conditions in test.
8865         (java_complete_class): Sanity check on stabilize_ref gone.
8866         * zextract.c (read_zip_archive): Cast lseek second argument to long.
8867
8868 Tue Jul 28 21:39:22 1998  Per Bothner  <bothner@cygnus.com>
8869
8870         * class.c (hashUtf8String):  Fix - use new JavaSoft specification.
8871
8872 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8873
8874         * gjavah.c (F_NAN): Removed.
8875         (F_NAN_MASK): New macro.
8876         (F_POSITIVE_INFINITY): Removed.
8877         (F_NEGATIVE_INFINITY): Likewise.
8878         (java_float_finite): Rewrote.
8879         (D_NAN_MASK): Renamed.
8880         (java_double_finite): Rewrote.
8881         (D_POSITIVE_INFINITY): Removed.
8882         (D_NEGATIVE_INFINITY): Likewise.
8883
8884         * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
8885         If verbose, print underlying representation of value in hex.
8886
8887 Fri Jul 24 14:14:32 1998  Per Bothner  <bothner@cygnus.com>
8888
8889         * buffer.h, buffer.c:  New files.
8890         * Makefile.in (JAVA_OBJS):  Add buffer.o.
8891
8892         Support locals variables and writing their debug entries to .class.
8893         * jcf-write.c:  Simplify some by user new buffer type.
8894         (vode_buffer_grow):  Removed.
8895         (struct localvar_info):  New type.
8896         (localsvars, localvartable):  New buffers.
8897         (localvar_alloc, localvar_free):  New functions.
8898         (generate_bytecode_insns):  Handle local variables.
8899         (generate_classfile):  Write LocalVariableTable attribute.
8900
8901 Fri Jul 24 13:46:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8902
8903         * jcf-io.c (open_in_zip): Check the zipfile magic number.
8904         * zipfile.h (ZIPMAGIC): New macro.
8905
8906 Fri Jul 24 10:43:25 1998  Tom Tromey  <tromey@cygnus.com>
8907
8908         * Makefile.in (gjavah.o): Updated dependencies.
8909         (jcf-dump.o): Likewise.
8910         (all.indirect): Use ../gjavah.
8911         (../gjavah$(exeext)): Likewise.
8912         (clean): Don't remove gjavah.
8913         (clean): Remove parse.c, not java/parse.c.
8914         * Make-lang.in (java): Added gjavah.
8915         (gjavah$(exeext)): New target.
8916         (GJAVAH_SOURCES): New macro.
8917         (java.all.build): Added gjavah.
8918         (java.all.cross): Likewise.
8919         (java.rest.encap): Likewise.
8920         * config-lang.in (compilers, stagestuff): Added gjavah.
8921
8922 Thu Jul 23 18:33:56 1998  Tom Tromey  <tromey@cygnus.com>
8923
8924         * gjavah.c (java_float_finite): New function.
8925         (java_double_finite): Likewise.
8926         (F_POSITIVE_INFINITY): New macro.
8927         (F_NEGATIVE_INFINITY): Likewise.
8928         (F_NAN): Likewise.
8929         (D_POSITIVE_INFINITY): Likewise.
8930         (D_NEGATIVE_INFINITY): Likewise.
8931         (D_NAN): Likewise.
8932         (print_field_info): Use java_float_finite and java_double_finite.
8933
8934 Thu Jul 23 15:28:24 1998  Per Bothner  <bothner@cygnus.com>
8935
8936         * parse.y (method_header):  Name "this" implicit argument.
8937
8938 Wed Jul 22 15:47:30 1998  Per Bothner  <bothner@cygnus.com>
8939
8940         * jcf-write.c:  Write out LineNumberTable attribute in .class file.
8941         (linenumber_buffer, linenumber_ptr, linenumber_limit):  New statics.
8942         (put_linenumber):  New function.
8943         (generate_bytecode_insns, generate_classfile):  Write line numbers.
8944
8945 Wed Jul 22 14:39:00 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
8946
8947         * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
8948         (lookup_name, build_known_method_ref, build_class_init,
8949         build_invokevirtual, invoke_build_dtable, match_java_method,
8950         build_field_ref, pushdecl_force_head, build_java_binop,
8951         binary_numeric_promotion, build_decl_no_layout,
8952         build_java_arrayaccess, build_newarray, build_anewarray,
8953         build_java_array_length_access, build_java_arraynull_check): New
8954         extern function prototypes.
8955         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8956         JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
8957         java-tree.h.
8958         * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
8959         to NULL
8960         * jcf.h (jcf_out_of_synch): New extern function prototype.
8961         * parse.h: Static/global function implemented in parse.y
8962         prototyped and declarations moved at the end of the file.
8963         (DECL_P): Check that the argument isn't null.
8964         (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
8965         JAVA_THIS_EXPR): No longer defined here. See java-tree.h
8966         (QUAL_DECL_TYPE): New macro.
8967         (PARAMS): Macro definition removed.
8968         * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
8969         (return_statement:): Call build_return.
8970         (field_access:): Call make_qualified_primary in sub rule.
8971         (method_invocation:): Build method invocation and call
8972         make_qualified_primary when processing primaries.
8973         (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
8974         get_type_from_signature.
8975         (java_check_regular_method): Extra integer 0 argument when calling
8976         lookup_java_method2.
8977         (lookup_java_interface_method2): Extra method DECL argument when
8978         calling lookup_java_interface_method2.
8979         (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
8980         COMPOUND_EXPR node.
8981         (java_complete_expand_method): Layout current class iff not
8982         already done. Don't process interface's methods.
8983         (java_complete_expand_method): Use super class only if it
8984         exists. Use current class otherwise.
8985         (make_qualified_primary): New function.
8986         (resolve_expression_name): Process qualified expression or
8987         expression from primary the same way.
8988         (resolve_expression_name): Two last arguments to
8989         resolve_field_access are now NULL_TREEs.
8990         (resolve_field_access): New variable is_static. Local field must
8991         be DECLs. is_static computed on field DECLs only. Append code in
8992         where_found to the field access if necessary. Use QUAL_DECL_TYPE
8993         to initialize field_type.
8994         (resolve_qualified_expression_name): New local variable,
8995         previous_call_static and is_static. Handle primaries with function
8996         calls, casts, array references and `this'. `super' now handled as
8997         `(super_class)this'. Use is_static to clarify boolean expressions.
8998         Added code to handle case where a proper handle is required to
8999         access a field. Use QUAL_DECL_TYPE where applicable.
9000         (maybe_access_field): New function.
9001         (patch_method_invocation_stmt): New arguments primary, where,
9002         is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
9003         deleted. Use `where' as a type to search from if specified. Check
9004         for static method reference where forbidden. Append primary or
9005         current_this to the argument list if not calling constructor nor
9006         static methods.
9007         (check_for_static_method_reference): New function.
9008         (patch_invoke): Layout the class on which new is done if
9009         necessary.
9010         (lookup_method_invoke): Changed format to report errors on
9011         methods.
9012         (qualify_ambiguous_name): New local variable this_found. Now
9013         handle things from primaries. Method call are considered
9014         expression names.
9015         (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
9016         changed into NULLs.
9017         (not_initialized_as_it_should_p): Comply with the new DECL_P.
9018         (java_complete_tree): New case fo RETURN_EXPR. Process function
9019         call arguments in separate function.
9020         (complete_function_arguments): New function.
9021         (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
9022         anymore.
9023         (patch_assignment): Take the return function slot into account as
9024         a RHS. Distinguish assignment from a return.
9025         (valid_ref_assignconv_cast_p): Use build_java_argument_signature
9026         when checking methods in interfaces.
9027         (resolve_type_during_patch): NULL argument to unresolve_type_p
9028         instead of NULL_TREE.
9029         (patch_newarray): Fixed typo in comment.
9030         (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
9031         (build_return, patch_return): New functions.
9032         * typeck.c (lookup_java_constructor): Fixed typo in comment.
9033
9034 Tue Jul 21 12:10:04 1998  Per Bothner  <bothner@cygnus.com>
9035
9036         * constants.c (find_name_and_type_constant, find_fieldref_index,
9037         find_methodref_index):  New methods.
9038         * expr.c (build_invoke_non_interface):  If flag_emit_class_files,
9039         just return given method.  Also, rename to build_known_method_ref.
9040         (expand_invoke):  Rename call to build_invoke_non_interface.
9041         * java-tree.h, parse.h:  Update prototype.
9042         * parse.y, decl.c, jcf-parse.c:  Suppress calls to back-end functions
9043         (such as expand_expr_stmt) if flag_emit_class_files.
9044         * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
9045         STACK_TARGET, IGNORE_TARGET):  New macros.
9046         (code_buffer, code_ptr, code_limit, code_S, code_SP_max):  New globals.
9047         (generate_bytecode_insn):  New function to generate method's bytecode.
9048         (generate_classfile):  Node generate Code attribute for a method.
9049         (code_buffer_grow, push_constant1, push_constant2, push_int_const,
9050         push_long_const, field_op, adjust_typed_op, maybe_wide):
9051         New functions used by generate_bytecode_insn.
9052
9053         * typeck.c (signature_include_return):  Remove variable.
9054         (push_java_argument_signature, build_java_argument_signature):  New.
9055         (build_java_signature):  Use push_java_argument_signature.
9056         * parse.y:  Use build_java_argument_signature instead of fiddling
9057         with signature_include_return.
9058
9059 Fri Jul 17 09:48:51 1998  Tom Tromey  <tromey@cygnus.com>
9060
9061         * gjavah.c (print_c_decl): Always generate JArray<>* for array
9062         types.
9063
9064         * Makefile.in (all.indirect): Added gjavah$(exeext).
9065         (gjavah$(exeext)): Added $(exeext).
9066         (clean): Likewise.
9067
9068 Thu Jul 16 15:29:20 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9069
9070         * class.c (layout_class): Call to java_layout_parsed_class replace
9071         by safe_layout_class.
9072         * expr.c (build_java_array_length_access): Removed static storage
9073         class in the function definition.
9074         (build_java_arraynull_check): Likewise.
9075         Also fixed typos in two comments.
9076         * lex.c (java_init_lex): Initialize static global kw_length.
9077         (java_lex): Use BUILD_OPERATOR on RETURN_TK.
9078         * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
9079         java_lex_error.
9080         (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
9081         * parse.h (resolve_no_layout): New static function declaration.
9082         (get_identifier_in_static): Declaration removed.
9083         (java_layout_parsed_class): Function name declaration changed to
9084         safe_layout_class.
9085         (build_newarray_node, patch_newarray, resolve_type_during_patch,
9086         not_initialized_as_it_should_p, build_this): New static function
9087         declarations.
9088         (pushdecl_force_head, build_java_binop, int_fits_type_p,
9089         binary_numeric_promotion, stabilize_reference,
9090         build_decl_no_layout, build_java_arrayaccess): Extern function
9091         declarations moved into their own section.
9092         (build_newarray, build_anewarray, build_java_array_length_access,
9093         build_java_arraynull_check): New extern function declarations.
9094         (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
9095         (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
9096         fake tree codes.
9097         (CALL_CONSTRUCTOR_P): New macro.
9098         * parse.y (kw_length): New static global tree node.
9099         (return_statement): Tagged <node>.
9100         (RETURN_TK): Tagged <operator>.
9101         (variable_declarator_id:): Build variable declaration with an
9102         empty initialization value if a syntax error was found in the
9103         initialization part of the variable declaration.
9104         (statement_without_trailing_substatement:): return_statement: now
9105         uses the default rule.
9106         (return_statement:): Temporarily fixed to return NULL_TREE.
9107         (primary_no_new_array:): Call build_this when THIS_TK was parsed.
9108         (class_instance_creation_expression:): Class creation rules now
9109         call build_method_invocation upon reduction.
9110         (array_creation_expression:): Rules call build_newarray_node upon
9111         reduction.
9112         (dim_exprs:): Build a list of dimension expressions.
9113         (dim_expr:): Store location of the OSB_TK in the dimension
9114         expression node.
9115         (method_invocation:): Added a new error rule.
9116         (build_unresolved_array_type): WFL argument may also be an array
9117         on a primitive type. Name of the argument changed to reflect this.
9118         (method_declarator): Insert argument type at the beginning of the
9119         argument type list and later reverse the list.
9120         (unresolved_type_p): Argument 'returned' may be optionally
9121         NULL_TREE.
9122         (java_layout_class_from_source): Function renamed
9123         safe_layout_class.
9124         (resolve_and_layout): Now call resolve_no_layout and
9125         safe_layout_class.
9126         (resolve_no_layout): New function.
9127         (purify_type_name): New function.
9128         (complete_class_report_errors): Call purify_type_name during error
9129         report on a type not found.
9130         (process_imports): error_found local variable doesn't need to be
9131         initialized to zero.
9132         (declare_local_variables): New local type_wfl. Fixed typo in error
9133         message. type_wfl assigned to unresolved type and used to register
9134         incomplete type. Build a WFL around the variable initialization
9135         statement so that debug info can be generated on it.
9136         (source_start_java_method): Reverse argument list after they've
9137         been processed.
9138         (current_this): New static global variable.
9139         (java_complete_expand_methods): Set current_this when appropriate.
9140         (resolve_expression_name): Build correct static and non static
9141         field access bearing a simple name.
9142         (resolve_field_access): Resolve the length field of arrays. Handle
9143         f.m() cases.
9144         (patch_method_invocation_stmt): Set the type of the method
9145         invocation to error_mark_node. This value is later overridden by a
9146         valid type, if any. Don't handle qualified constructor invocation
9147         as qualified method invocation. Call lookup_method_invoke with its
9148         new flag. It's no longer necessary to access the selected method
9149         as the value of a tree list. Handle constructor invocation.
9150         (patch_invoke): Reverse argument list when invoking non interface
9151         methods. Insert call to new as the first argument of the
9152         constructor.
9153         (invocation_mode): Return a INVOKE_STATIC is the invoked method is
9154         defined within a final class. Return INVOKE_STATIC if the invoked
9155         method is a constructor.
9156         (lookup_method_invoke): New lc argument is a flag to indicate a
9157         constructor lookup. Now handle constructor lookup. Choose the most
9158         specific method in case several were matching the invocation
9159         requirements. Return a method decl instead of a tree list featuring
9160         one single method decl element.
9161         (refine_accessible_methods_list): New lc flag argument to
9162         indicate that a constructor is being looked up.
9163         (not_initialized_as_it_should_p): New function.
9164         (java_complete_tree): Now process fake tree codes
9165         JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
9166         save_expr on resolved function call arguments. Case on
9167         UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
9168         (patch_assignment): LHS can be a field access expression. When
9169         dealing with reference, lhs_type is the promoted type of the
9170         rhs_type, not the RHS. Use not_initialized_as_it_should_p where
9171         applicable.
9172         (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
9173         (patch_binop): Use not_initialized_as_it_should_p where
9174         applicable.
9175         (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
9176         (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
9177         where applicable.
9178         (resolve_type_during_patch): New function.
9179         (patch_cast): Call resolve_type_during_patch to resolve type and
9180         report error accordingly.
9181         (patch_array_ref): Use not_initialized_as_it_should_p where
9182         applicable. Array base expression is saved before being
9183         used. Promote the type of an array elements if it contains non
9184         builtin types.
9185         (build_newarray_node, patch_newarray, build_this): New functions.
9186
9187 Thu Jul 16 10:46:47 1998  Tom Tromey  <tromey@cygnus.com>
9188
9189         * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
9190         increment it in `for' statement.
9191         (print_field_info): If number is inf or nan, don't print it.
9192         (print_method_info): If method name is `delete', just ignore it.
9193         (print_c_decl): Special-case jstringArray.
9194
9195         * gjavah.c (help): New function.
9196         (no_argument): New function.
9197         (usage): Changed text.
9198         (main): Rewrote argument handling.  Now handles -v, --help,
9199         --version.
9200         (version): New function.
9201         (found_error): New global.
9202         (main): Return found_error.
9203         (generate_access): Set found_error.
9204         (print_c_decl): Likewise.
9205
9206 Wed Jul 15 10:36:27 1998  Tom Tromey  <tromey@cygnus.com>
9207
9208         * gjavah.c (print_c_decl): Don't print "," when examining field.
9209         Skip type name when looking at "[L" types.
9210         (process_file): Now static.
9211         (generate_access): Now returns int.
9212         (last_access_generated): New global.
9213         (process_file): Clear last_access_generated; make multiple passes
9214         over the class.
9215         (print_field_info): Just return if generate_access returns true.
9216         (print_method_info): Likewise.  Also, allow <init> functions to
9217         pass through.
9218         (print_c_decl): Added is_init argument.  Print constructors
9219         properly.
9220         (print_cxx_classname): Use UTF8_GET to extract characters from
9221         string.
9222         (print_base_classname): New function.
9223         (print_class_decls): New function.
9224         (process_file): Use it.
9225         (utf8_cmp): New function.
9226
9227 Mon Jul 13 14:21:47 1998  Nick Clifton  <nickc@cygnus.com>
9228
9229         * lang-options.h: Format changed to match changes in gcc/toplev.c
9230         to implement a --help option.
9231
9232 1998-07-10  Brendan Kehoe  <brendan@cygnus.com>
9233
9234         * decl.c (init_decl_processing): Revert change to dtable_type.
9235
9236 Thu Jul  9 18:22:12 1998  Per Bothner  <bothner@cygnus.com>
9237
9238         * java-tree.h (CLASS_P):  Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
9239
9240 1998-07-08  Brendan Kehoe  <brendan@cygnus.com>
9241
9242         * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
9243
9244         * lang.c (lang_init): Default flag_exceptions to 1, without
9245         checking to see if it's 2 first.
9246
9247 Wed Jul  8 03:01:32 1998  Jeffrey A Law  (law@cygnus.com)
9248
9249         * constants.c: Include "system.h".
9250         * decl.c: Likewise.
9251         * lang.c (flag_new_exceptions): Get via extern now.
9252         (lang_init_options): New functions.  Turn on flag_new_exceptions.
9253
9254 Tue Jul  7 12:56:48 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9255
9256         * lex.c (java_lex): Return 0 when we see an invalid character in
9257         the input.
9258
9259         * lex.c (java_read_char): Specify extra argument when calling
9260         java_lex_error.
9261         (java_read_unicode, java_parse_end_comment,
9262         java_parse_escape_sequence): Likewise,
9263         (java_lex): Specify extra argument when calling
9264         java_lex_error. Test that IDs are beginning with a legal character
9265         for IDs. Handle invalid characters with an error message and a
9266         call to java_lex_error.
9267         (java_lex_error): Adjust column position by new argument
9268         `forward'. Issue an error even if in the middle of reporting an
9269         other error.
9270
9271 1998-07-07  Brendan Kehoe  <brendan@cygnus.com>
9272
9273         * jcf-io.c (find_class): Zero out BUFFER before we use it, since
9274         we don't explicitly put a null pointer when we're copying it.
9275
9276 Tue Jul  7 09:38:38 1998  Tom Tromey  <tromey@cygnus.com>
9277
9278         * gjavah.c (print_cxx_classname): New function.
9279         (super_class_name): Likewise.
9280         (print_super_fields): Removed.
9281         (in_super): Removed.
9282         (print_field_info): Never generate #defines.
9283         (print_c_decl): Changed generated types to match JNI.  No longer
9284         print class name before method name.
9285         (print_method_info): Print "static" before static methods.
9286         Print "virtual" before non-final methods.
9287         (usage): Use exit(1), not exit(-1).
9288         (main): Likewise.
9289         (print_field_info): Use %.17g to print a double.
9290         (last_access): New globals.
9291         (process_file): Initialize last_access.
9292         (usage): Now static.
9293         (ACC_VISIBILITY): New define.
9294         (generate_access): New function.
9295         (print_field_info): Call it.
9296         (print_method_info): Likewise.  Also, generate information for all
9297         methods, not just native methods.  Return void.
9298         (print_c_decl): Return void.
9299         (print_field_info): Return void.
9300
9301 Thu Jul  2 16:53:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9302
9303         * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
9304         processing the jc1 grammar file. Prefix bison functions and
9305         variables with java_.
9306         (parse.c): Dependencies on parse.h and lex.h
9307         * expr.c (build_java_arrayaccess): Function now global.
9308         * java-tree.h: Comment reorganized to carry on previous
9309         classification effort.
9310         (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
9311         RESOLVE_TYPE_NAME_P): New flags on WFLs.
9312         * jcf-parse.c (parse_source_file): java_parse_source_file renamed
9313         java_parse (new prefix java_ generated by bison).
9314         (java_layout_parsed_class, java_register_parsed_class): Function
9315         call removed.
9316         (yyparse): Removed unnecessary call to init_outgoing_cpool.
9317         * lex.c (static tree wfl_op): Variable deleted.
9318         (java_init_lex): Initialize kw_super and kw_this. Initialize more
9319         ctxp fields to NULL_TREE.
9320         (java_lex): No longer create WFL for operators. Filename caching
9321         mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
9322         created as STRING_CST and later expanded. Removed extra argument
9323         to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
9324         and SUPER.
9325         (build_wfl_node): Removed code in comments.
9326         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
9327         store token and location data in the current bison token.
9328         * parse.h: Removed pre-processor based symbol prefixes hack. Moved
9329         static/extern function declaration at the beginning of the file.
9330         (struct qualification): Data structure definition deleted.
9331         (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
9332         (qualify_ambiguous_name): Function declaration modified. Function
9333         now returns nothing.
9334         (build_array_ref, patch_array_ref, make_qualified_name,
9335         resolve_qualified_expression_name, maybe_generate_clinit,
9336         resolve_field_access): New static function declarations.
9337         (build_java_arrayaccess): New extern function declaration.
9338         (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
9339         (CALL_EXPR_PRIMARY): Macro deleted.
9340         (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
9341         (struct parser_ctxt): Field initialized_final
9342         removed. non_static_initialized, static_initialized: New fields.
9343         * parse.y (static tree kw_super, static tree kw_this): New global
9344         static.
9345         (%union): tree wfl field of operator member replaced by int
9346         location. WFLs are non longer created for operators.
9347         (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
9348         (qualified_name:): Now calls make_qualified_name to build the
9349         identifier.
9350         (type_declaration:): Consider generating <clinit> when class
9351         parsing completed.
9352         (variable_declarator:): Directly build an assignment node when the
9353         variable is initialized when declared.
9354         (this_or_super:): Build a WFL and set current location when THIS
9355         or SUPER are parsed.
9356         (expression_statement:): Wrap statement around a WFL.
9357         (primary_no_new_array:): Fixed typo. Changed value returned by
9358         THIS_TK because of its new type (temporary).
9359         (dim_exprs:): Temporary fix because of OSB_TK's new type.
9360         (field_access:): Build qualified name with SUPER.
9361         (method_invocation:): Fixed returned value because of SUPER's new
9362         type.
9363         (array_access:): Use OSB_TK location information.
9364         (post_increment_expression:, post_decrement_expression:,
9365         unary_expression:, pre_increment_expression:,
9366         pre_decrement_expression:, unary_expression_not_plus_minus:,
9367         cast_expression:, multiplicative_expression:,
9368         additive_expression:, shift_expression:, relational_expression:,
9369         equality_expression:, and_expression:, exclusive_or_expression:,
9370         inclusive_or_expression:, conditional_and_expression:,
9371         conditional_or_expression:, assignment:): Use new location/token
9372         information available on operators.
9373         (create_class): Set super_decl_type to NULL_TREE when processing
9374         java.lang.Object.
9375         (register_fields): Field initialization is now a MODIFY_EXPR
9376         node. Chain initialization code to the matching lists (according
9377         the the field declaration modifiers).
9378         (maybe_generate_clinit): New function.
9379         (method_header): Don't set method's DECL_NAME to a WFL when adding
9380         methods to java.lang.Object.
9381         (resolve_and_layout): Now can return NULL_TREE if the type
9382         resolution fails. Otherwise, return the class DECL instead of its
9383         TYPE.
9384         (check_method_redefinition): Don't patch method DECL_NAME if it
9385         belongs to java.lang.Object.
9386         (process_imports): Simply assign error_found to the value returned
9387         by check_pkg_class_access.
9388         (declare_local_variables): Don't use their init statements (if
9389         any) when parsing error were previously found. Reuse MODIFY_EXPR
9390         build during parsing as an init statement.
9391         (java_method_add_stmt): Now return the current method body.
9392         (java_layout_parsed_class, java_register_parsed_class): Functions
9393         removed.
9394         (java_complete_expand_methods): Initialize the constant pool on a
9395         per class basis. Layout the classes before expanding their method
9396         bodies. Don't try expand artificial constructor code if error were
9397         found. Make the classes data and register them if no error were
9398         found.
9399         (java_complete_expand_method): Retrieve an artificial constructor
9400         argument list before entering its body. Assign the top block to
9401         the artificial constructor function body and set types of declared
9402         blocks and compound statements to void. Walk method body if not an
9403         artificial constructor.
9404         (make_qualified_name, cut_identifier_in_qualified): New functions.
9405         (resolve_expression_name): Fixed comments. Save/restore the
9406         current class CLASS_LOADED_P flag value. Build non qualified
9407         static field access and handle qualified expression names.
9408         (resolve_field_access, resolve_qualified_expression_name): New
9409         functions.
9410         (patch_method_invocation_stmt): Use the new expression resolution
9411         scheme, calling resolve_field_access when the function call is
9412         resolved as an expression.
9413         (qualify_ambiguous_name): Function rewritten to work on qualified
9414         expression produced by make_qualified_name.
9415         (java_complete_tree): Promote type when function's argument are
9416         RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
9417         the assignment to discover further errors if RHS is a expression
9418         name that fails to evaluate. Declare LHS initialized even though
9419         the assignment failed. Don't use the location variable and removed
9420         extra argument in patch function calls. Now handle the ARRAY_REF
9421         case and build internal string representation when STRING_CSTs are
9422         walked.
9423         (build_method_invocation): Don't wrap function call around a WFL.
9424         (build_assignment): Likewise. Use the operator location
9425         information.
9426         (patch_assignment): Handle array access LHSs. Handle error
9427         provenance, resulting in a better error report.
9428         (build_binop): Use op_location from operator as binop location
9429         information.
9430         (build_unaryop, build_incdec, build_cast): Likewise.
9431         (patch_binop): Extract location information from the node. Fixed
9432         typo in error message.
9433         (patch_unary_op): Extract location information from the node.
9434         (build_array_ref, patch_array_ref): New functions.
9435
9436 Wed Jul  1 13:11:36 1998  Tom Tromey  <tromey@cygnus.com>
9437
9438         * expr.c (expand_java_INSTANCEOF): Changed calling convention to
9439         match _Jv_IsInstanceOf.
9440         * decl.c (init_decl_processing): Use _Jv_NewArray, not
9441         soft_newarray.  Use _Jv_IsInstanceOf, not soft_instanceof.
9442
9443 Tue Jun 30 14:12:54 1998  Tom Tromey  <tromey@cygnus.com>
9444
9445         * decl.c (init_decl_processing): Functions are now named
9446         _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
9447
9448 Mon Jun 29 14:47:10 1998  Per Bothner  <bothner@cygnus.com>
9449
9450         * java-tree.h (load_class):  Add prototype.
9451         * class.c (is_compiled_class):  Add missing arg to load_class.
9452         * expr.c (expand_java_NEW):  Call load_class.
9453         * parse.y (process_import):  Removed bogus use of void return value.
9454
9455 Thu Jun 25 11:50:48 1998  Per Bothner  <bothner@cygnus.com>
9456
9457         * decl.c, java-tree.h (soft_athrow_node):  Renamed to soft_node.
9458         Function name is "_Jv_Throw" instead of "soft_athrow".
9459         * decl.c, java-tree.h (soft_new_node):  Renamed to alloc_object_node.
9460         Function name is "_Jv_AllocObject" instead of "soft_new".
9461         Takes an extra parameter (object size).
9462         * expr.c:  Update calls.
9463
9464 Wed Jun 24 13:59:02 1998  Per Bothner  <bothner@cygnus.com>
9465
9466         * lex.c (java_get_line_col):  Handle end-of-file.
9467         * except.c (expand_end_java_handler):  Handle null type (i.e. finally).
9468
9469 Wed Jun 24 09:22:34 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
9470
9471         * lang.c (lang_init): Make -fexceptions the default.
9472         * except.c (maybe_start_try, maybe_end_try): Don't do anything if
9473         exception handling is not turned on.
9474
9475 Tue Jun 23 10:17:09 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
9476
9477         * lang.c (flag_new_exceptions): Make this this default.
9478         * decl.c (end_java_method): Call emit_handlers.
9479         * except.c (method_init_exceptions): Set language code and version.
9480         (expand_start_java_handler): Enable exception, and call
9481         expand_eh_region_start.
9482         (expand_end_java_handler): Enable exception, and set up catch blocks.
9483         (emit_handlers): New routine to generate the saved handlers.
9484         * java-except.h (emit_handlers): Add prototype.
9485
9486 Fri Jun 12 11:31:24 1998  Per Bothner  <bothner@cygnus.com>
9487
9488         We used to have three different representations of the constant pool:
9489         the CPool structure, the tree_constant_pool, and the constructures
9490         used to build the Class object (which may need class and string
9491         constants) in compiled code.  None were appropriate for compiling
9492         to .class files, so I did a major overhaul.
9493
9494         First, the tree_constant_pool array was removed.  Things were
9495         modified to the CPool structure in the JCF could be used.
9496         Second, a "capacity" field was added to the CPool, and functions
9497         written to search for a matching constant, adding one if not found.
9498         The code that generated the Class object was changed to use a CPool.
9499         The actual TREE_LISTs used to build the CONSTRUCTORs used for
9500         the static Class object are now only in build_constants_constructor.
9501         Finally, I wrote code which can generate a .class file (including its
9502         constant pool) from the RECORD_TYPE of a class.  This is a big step
9503         on the way to compiling Java source into .class files.
9504
9505         * jcf-write.c:  New file. Writes out a RECORD_TYPE as a .class file.
9506         * Makefile.in (JAVA_OBJS):  Added jcf-write.o.
9507
9508         * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
9509         CONSTANT_ResolvedString, CONSTANT_ResolvedClass):  New macros.
9510         (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
9511         COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
9512         (COMPONENT_REF_CLASS):  Replaced by COMPONENT_REF_CLASS_INDEX.
9513         (lang_type):  Removed constant_pool field.
9514         * jcf.h (CPool):  Renamed size to count.  Added field capacity.
9515         (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
9516         CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT):  New macros.
9517         Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
9518
9519         * constants.c (current_constant_pool_tags, current_constant_pool_data,
9520         current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
9521         * constants.c (build_constants_constructor):  Use new outgoing_cpool.
9522         (set_constant_entry, find_constant1, find_constant2,
9523         find_class_constant, count_constant_pool_bytes, write_constant_pool,
9524         find_utf8_constant, find_class_or_string_constant):  New functions.
9525
9526         * jcf-parse.c (load_class):  Don't save/restore tree-constant_pool.
9527         (get_constant):  Use current_jcf.cpool instead of tree_constant_pool.
9528         (give_name_to_class, get_class_constant):  Likewise.
9529         * jcf-parse.c, java-tree.h (tree_constant_pool):  Removed.
9530         (get_name_and_type_constant, get_ref_constant):  Removed.
9531         * parse.h (parser_ctxt):  Remove field tree_constant_pool.
9532         * parse.y:  Don't save/restore tree_constant_pool.
9533         * verify.c (verify_jvm_instructions):  Update for new approach.
9534         * expr.c (expand_invoke, expand_java_field_op): Likewise.
9535
9536         * lang-options.h:  Added -femit-class-file, -femit-class-files.
9537         * lang.c (flag_emit_class_files), java-tree.h:  New flag.
9538         (lang_f_options):  Added "emit-class-file(s)".
9539
9540         * expr.c (build_java_arrayaccess):  Generate more efficient array
9541         bounds checking, by using unsigned compare.
9542
9543         * expr.c (expand_invoke):  Re-arrange error checks to make more robust.
9544
9545 Wed Jun 10 17:34:42 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9546
9547         * parse.h: New comment on the handling of unresolved type
9548         identifiers. JDEPs are now part of the jdep_code enum.
9549         (typedef struct jdep): Now use enum jdep_code or int, depending on
9550         availability. Both are narrowed down to an 8 bits bitfield.
9551         (CALL_EXPR_PRIMARY): Fixed comment.
9552
9553 Wed Jun 10 10:54:39 1998  Tom Tromey  <tromey@cygnus.com>
9554
9555         * Make-lang.in (java): Added gjavac and jvgenmain.
9556         (java.start.encap): Depend on gjavac.
9557         (java.rest.encap): Depend on jvgenmain.
9558
9559         * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
9560         (JAVA_CROSS_NAME): Likewise.
9561         (java.all.build): Depend on jvgenmain and gjavac.
9562         (java.all.cross): Depend on jvgenmain and gjavac-cross.
9563         (jvgenmain$(exeext)): New target.
9564         (java.install-common): Wrote.
9565         * config-lang.in (compilers, stagestuff): Added gjavac and
9566         jvgenmain.
9567
9568 Wed Jun 10 12:19:04 1998  Dave Brolley  <brolley@cygnus.com>
9569
9570         * lang.c (lang_decode_option): New argc/argv interface.
9571
9572 Tue Jun  9 18:12:46 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9573
9574         * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
9575         * decl.c (build_decl_no_layout): New function.
9576         * expr.c (java_lang_expand_expr): Layout declarations found in
9577         blocks before they're pushed.
9578         * jcf-parse.c (load_class): Save current line when parsing class
9579         file.
9580         (parse_source_file): Register class before expanding their
9581         methods.
9582         * lang.c (put_decl_node): Produce `null' when `void *' is
9583         processed.
9584         * lex.c (static tree wfl_op): New static global, for error report
9585         on casts.
9586         (java_init_lex): wfl_operator and wfl_op initialized
9587         here. Filename caching added for wfl_op. Return wfl_op when `(' is
9588         parsed.
9589         * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
9590         patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
9591         build_unresolved_array_type): New static function definitions.
9592         (build_decl_no_layout): New extern function declared.
9593         (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
9594         faulty modifier exists.
9595         (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
9596         (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
9597         (UNARY_PLUS_EXPR): New fake operator.
9598         (struct parser_ctxt): New field osb_number.
9599         * parse.y (static tree wfl_operator): New static WFL for operator
9600         bound error messages.
9601         (DECR_TK, INCR_TK): Moved.
9602         (OP_TK): Tagged <operator>.
9603         (array_type:): Now call build_unresolved_array_type.
9604         (dim_expr:): Count the number of '[' seen.
9605         (post_increment_expression, post_decrement_expression,
9606         pre_increment_expression, pre_decrement_expression,
9607         unary_expression_not_plus_minus, unary_expression:): Actions are
9608         now building the corresponding unary expressions.
9609         (cast_expression:): Actions are now building cast expressions.
9610         (build_unresolved_array_type): New function.
9611         (create_interface): Reset the number of declared interfaces.
9612         (create_class): Likewise.
9613         (method_header): Methods declared within the scope of an interface
9614         are now implicitly set public and abstract.
9615         (java_complete_class): Variable's and parameter's type are patched
9616         with a promoted type.
9617         (declare_local_variables): Resolved non builtin types are promoted
9618         before being used to build a variable decl. Removed type patch
9619         posted on variable initialization statement.
9620         (source_start_java_method): Use build_decl_no_layout to build the
9621         decl of a parameter of incomplete type.
9622         (java_register_parsed_class): Process interfaces too. Call
9623         rest_of_decl_compilation on each processed class declarations.
9624         (java_complete_expand_methods): Don't attempt to expand things in
9625         interfaces.
9626         (java_complete_tree): Process CONVERT_EXPR, even though it always
9627         has a type. Propagate error_mark_node to node's type too. Promote
9628         method's call argument type and return error_mark_node if
9629         argument's completion didn't work. MODIFY_EXPR can have a WFL as a
9630         RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
9631         handle unary operator nodes.
9632         (build_assignment): Added comment.
9633         (print_int_node): New function.
9634         (patch_assignment): New second argument. New error handling. Use
9635         print_int_node. Handle references. Use can_cast_to_p to issue
9636         different error message according to the context and check upon
9637         the initialization of the RHS.
9638         (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
9639         (operator_string): Handle more operators.
9640         (patch_binop): No longer use a function static
9641         wfl_operator. Improved error message on shift distance.
9642         (build_unaryop, build_incdec, build_cast, patch_unaryop,
9643         patch_cast): New functions.
9644
9645 Fri Jun  5 18:03:07 1998  Per Bothner  <bothner@cygnus.com>
9646
9647         * jvspec.c:  New file.
9648         * Make-lang.in:  New rules to build gjavac from jvspec.c and ../gcc.c.
9649
9650         * java-tree.h (identifier_subst):  Add declaration.
9651
9652 Thu Jun  4 13:44:23 1998  Tom Tromey  <tromey@cygnus.com>
9653
9654         * jvgenmain.c (main): Generate call to JvRunMain.
9655
9656         * class.c (make_class_data): Push value for "sync_info" field.
9657         * decl.c (init_decl_processing): Push "sync_info" field.
9658
9659 Wed Jun  3 20:39:14 1998  Per Bothner  <bothner@cygnus.com>
9660
9661         * typeck.c (build_java_array_type):  Set TYPE_NAME to actual
9662         Java (source) name, not signature.
9663         Set TYPE_ALIGN to (at least) that of element_type.
9664
9665 Tue Jun  2 15:19:19 1998  Per Bothner  <bothner@cygnus.com>
9666
9667         * class.c:  Moved classname-mangling-rekated code to ...
9668         * mangle.c:  ... this new file.
9669         * jvgenmain.c:  New program (needs mangle.c) to generate main program.
9670         * Makefile.in:  Update for above changes.
9671
9672 Mon Jun  1 09:58:36 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9673
9674         * expr.c (truthvalue_conversion): Convert integer and floating
9675         point value to their truth value.
9676         * lex.c (java_lex): Handle the `null' literal.
9677         * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
9678         (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
9679         ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
9680         New macros.
9681
9682         * parse.y: Reorganization/documentation on token declaration.
9683         (binop_lookup[]): New added new tree codes.
9684         (relational_expression): Build corresponding binary operators.
9685         (equality_expression, conditional_and_expression,
9686         conditional_or_expression): Likewise.
9687         (java_complete_class): Fix crash in debug message.
9688         (java_complete_tree): Check initialization of method call
9689         arguments. Further bogus node evaluation to detect more error
9690         during assignments. Handles more binary operators.
9691         (patch_assignment): Use DECL_P.
9692         (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
9693         code.
9694         (operator_string): Handle more case. Compacted source.
9695         (patch_binop): Changed function comment. Checking for
9696         uninitialized first operand takes the compound assignment into
9697         account and uses DECL_P. Checking for uninitialized second operand
9698         delayed to routine's end. Use macros to issue type bound error
9699         messages and issue messages on both operands if their types are
9700         different. Force fixed type into node. Handle all binary
9701         operators.
9702
9703 Wed May 27 10:30:31 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9704
9705         * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
9706         * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
9707         build operator node and return tokens.
9708         * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
9709         * parse.h (java_complete_tree): Changed returned type in prototype.
9710         (build_method_invocation, build_assignment, patch_assignment,
9711         patch_binop): New static function declarations.
9712         (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
9713         BUILD_EXPR_WFL): New macros.
9714         * parse.y (enum tree_code binop_lookup[]): New static for token to
9715         TREE_CODE lookup.
9716         (%union): Parser union has new sub-structure `operator'.
9717         (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
9718         PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
9719         ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
9720         ASSIGN_ANY_TK): Tokens tagged `operator'.
9721         (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
9722         AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
9723         MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
9724         REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
9725         (assignment_operator:): Rule tagged `operator'.
9726         (expression_statement:): Re-installed default rule.
9727         (method_invocation:): Sub rules call build_method_invocation.
9728         (postfix_expression:): Don't attempt to resolve name here. Just
9729         return an ID.
9730         (multiplicative_expression:): Sub-rules build corresponding binop
9731         expression node.
9732         (additive_expression:, shift_expression:, and_expression:,
9733         exclusive_or_expression:, inclusive_or_expression:): Likewise.
9734         (assignment:): Sub rule invoke build_assignment.
9735         (assignment_operator:): Default rules on sub rules.
9736         (force_error): Added documentation on this variable.
9737         (declare_local_variables): Build initialization calling
9738         build_assignment.
9739         (expand_start_java_method): Removed unused rtx declaration. Mark
9740         arguments as already initialized.
9741         (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
9742         (java_complete_expand_methods): Don't process next method if
9743         completion of the previous one triggered errors.
9744         (java_complete_expand_method): Call source_end_java_method if no
9745         error were found during completion.
9746         (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
9747         locals declaratilon. Handle names found within a class. Return
9748         error_mark_node when things aren't found.
9749         (patch_method_invocation_stmt): Return error_mark_node on failures.
9750         (patch_invoke): Removed unused local. Return the correct node.
9751         (java_complete_tree): Now returns a value. The BLOCK section binds
9752         local identifiers and the type of a BLOCK is now void. Assign the
9753         result of operand completion on COMPOUND_EXPR. Assign the
9754         encapsulated node of a WFL to the result of its completion, except
9755         when the node is an identifier. Now handle MODIFY_EXPR and several
9756         binary operators. Return error_mark_node on errors.
9757         (build_method_invocation, build_assignment, patch_assignment,
9758         build_binop, operator_string, patch_binop): New functions.
9759         * typeck.c (binary_numeric_promotion): New function.
9760
9761 Thu May 21 12:01:04 1998  Per Bothner  <bothner@cygnus.com>
9762
9763         * class.c (identifier_subst):  New convenience wrapper for ident_subst.
9764         Replace most uses of ident_subst by identifier_subst.
9765
9766         * class.c (push_class_static_dummy_field):  Removed function.
9767         (build_class_ref):  Find Class object decl by looking up "CNAME.class",
9768         instead of looking got "class" static field.  Create that decl here.
9769         (class_identifier_node):  Removed;  no longer needed.
9770         (init_class_processing):  Don't init class_identifier_node.
9771         * jcf-parse.c (jcf_parse):  Don't call push_class_static_dummy_field.
9772         Do nreverse 0 times (instead of twice) for Object and Class.
9773         * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
9774
9775 Wed May 20 16:35:04 1998  Per Bothner  <bothner@cygnus.com>
9776
9777         * jcf-parse.c (parse_class-file):  Set lino to smallest line number,
9778         while initializing linenumber_count and linenumber_table.
9779         Do it before init_function_start (which calls emit_line_note).
9780         * expr.c (expand_byte_code):  Don't need to clear lineno here.
9781
9782 Mon May 18 16:23:32 1998  Tom Tromey  <tromey@cygnus.com>
9783
9784         * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
9785         then mangle number as _N_.
9786
9787         * class.c (mangle_class_field): New function.
9788         (build_class_ref): Set assembler name of class reference using
9789         mangle_class_field.
9790         (push_class_static_dummy_field): Likewise.
9791
9792 Sun May 17 12:52:35 1998  Michael Tiemann <tiemann@cygnus.com>
9793
9794         * parse.y (source_start_java_method): Use TREE_SET_CODE instead
9795         of assigning to TREE_CODE.  The latter method exploits a feature
9796         of GCC that is not ANSI compliant.
9797
9798 Thu May 12 13:44:27 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9799
9800         * decl.c (pushdecl_force_head): New function.
9801         (pushlevel): Removed conditional printf.
9802         (complete_start_java_method): Don't enter local variable scope if
9803         function is compiled from source code.
9804         * expr.c: parse.h now included
9805         (java_lang_expand_expr): New function.
9806         * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
9807         printf. Terminate buffer when doing directories.
9808         * jcf-parse.c (parse_source_file): Call lang_init_source before
9809         parsing and before code generation.
9810         * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
9811         use printf if the macro is defined.
9812         * lang.c (lang_init): Install lang_expand_expr hook on
9813         java_lang_expand_expr.
9814         (java_dummy_print): New function.
9815         (lang_init_source): New function.
9816         * lex.c (java_lex): Remember location of an opening brace at the
9817         second nesting level.
9818         (java_is_eol): Unget character seen after a CR if it is EOF.
9819         * parse.h: Now includes lex.h
9820         (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
9821         printf if the macro is defined.
9822         (expand_start_java_method, build_expr_block, enter_block,
9823         exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
9824         New static function declarations.
9825         (pushdecl_force_head): New extern function declaration.
9826         (INCOMPLETE_TYPE_P): New macro.
9827         (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
9828         (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
9829         BLOCK_EXPR_ORIGIN): New macros.
9830         (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
9831         DECL_SOURCE_LINE_LAST): New macros.
9832         (struct parser_ctxt): Removed field current_method_decl, redundant
9833         with the field current_function_decl. Added fields
9834         first_ccb_indent1 and pending_block.
9835         * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
9836         BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
9837         tagged <node>
9838         (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
9839         (compilation_unit:): Cosmetic on sub rule.
9840         (type_declaration:): Cosmetic on sub rules. Added an error rule.
9841         (variable_initializer:): Installed default rule on expression:.
9842         (method_declaration:): method_header: starts a new
9843         method. method_body: installs the function body, absorbs blocks
9844         emitted for temporary variable scopings, pops function's body block
9845         and merges function's last statement lineno in DECL_SOURCE_LINE.
9846         (method_body:): Installed default rules.
9847         (block:): Call enter_block when an opening brace is seen.  Absorb
9848         scoping blocks and call exit_block when a closing brace is seen.
9849         (block_statement:): Cosmetic changes.
9850         (method_invocation:): Create WFL around CALL_EXPR node.
9851         (patch_stage): Added comment around definition.
9852         (method_header): Try to use first_ccb_indent1 as the first line of
9853         the method, so BP debug info are emitted at the first opening
9854         brace of the function. If the function has no body, use the
9855         location of the function's name. Override currently defined method
9856         name with the matching WFL so we can point redefinition errors
9857         using the location where the function's name was declared.
9858         (check_abstract_method_header): Interprets DECL_NAME as an
9859         identifier or as a WFL, accordingly.
9860         (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
9861         (check_method_redefinition): Use DECL_NAME as a WFL. Extract
9862         location and name information out of it and reinstall DECL_NAME to
9863         its original identifier node value.
9864         (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
9865         function's source code).
9866         (read_import_dir): Test the value returned by find_class and issue
9867         a fatal accordingly.
9868         (declare_local_variables): Push a new block for the scope of the
9869         new variable(s) if code has been already generated at that nesting
9870         level. Pinpoint redefinition errors using the variable id
9871         WFLs. Generate initialization code if necessary. If the variable
9872         type is incomplete, register a patch on its decl.
9873         (source_start_java_method): Rewritten. Define a new block for the
9874         function's parameters. Build parameter decl out of function's
9875         arguments and register them for a patch if their types are
9876         incomplete.
9877         (expand_start_java_method): Includes the part of
9878         source_start_java_method that was pushing the parameter decls and
9879         completing the method start code.
9880         (source_end_java_method): Removed call the expand_end_bindings and
9881         poplevel (already taken care of). Reinstall function's arguments
9882         and get function's last line of code before calling
9883         expand_function_end.
9884         (java_method_add_stmt): New comment before the function's
9885         code. Complement the second operand of the current COMPOUND_EXPR
9886         if necessary.
9887         (java_complete_expand_methods): Don't generate debug info on line
9888         zero when expanding a generated constructor.
9889         (java_complete_expand_method): Set start and end line numbers for
9890         a artificially generated constructor to one and manually call
9891         enter_block and exit_block when defining it. For all methods:
9892         expand function's start calling the new expand_start_java_method
9893         and invoke java_complete_tree on the effective method's body, if
9894         any.
9895         (resolve_expression_name): Now use lookup_name_in_blocks to search
9896         local variable decls and print out an error when variables are
9897         undefined.
9898         (patch_method_invocation_stmt): Inserted comment before the
9899         function's code.
9900         (lookup_method_invoke): Chain method's arguments using chainon
9901         with the current arg list as a second argument. Inserted missing
9902         IDENTIFIER_POINTER when reporting an error on methods not found.
9903         (refine_accessible_methods_list): Don't retain constructors.
9904         (patch_arguments): Function removed.
9905         (java_complete_tree): Inserted comment before the function's
9906         code. New case for BLOCKs. Moved the WFL case a bit
9907         further. Complete function's arguments.
9908         (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
9909         maybe_absorb_scoping_blocks): New functions.
9910
9911 Mon Apr 27 10:50:05 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
9912
9913         * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
9914         previously set.
9915         * jcf-parse.c (parse_source_file, java_error_count): New forward
9916         and extern declarations.
9917         (java_parse_abort_on_error): Macro moved.
9918         (jcf_parse_source): fatal called if fopen fails. Now calls
9919         parse_source_file.
9920         (parse_source_file): New parse_only parameter. Reflects the
9921         elimination of the second pass.
9922         (yyparse): parse_source_file called with argument set to 0.
9923         * jcf.h (JCF_ZERO): Sets java_source to zero.
9924         * lex.c (java_init_lex): pass argument is gone. Function modified
9925         to be called once during the analysis of a file.
9926         (java_unget_unicode): Fixed typo in fatal message.
9927         (java_get_line_col): Likewise.
9928         (java_lval): Likewise. String literals no longer built during
9929         second pass.
9930         * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
9931         account.
9932         * parse.h (MODIFIER_WFL): New macro.
9933         (parse_check_super, parser_check_super_interface): Now return int.
9934         (parser_chain_incomplete_item, not_builtin_p,
9935         complete_method_decl): Declarations removed.
9936         (build_method_invocation_stmt, build_invoke): Renamed using the
9937         `patch' instead of `build'
9938         (register-incomplete_type, obtain_incomplete_type,
9939         java_complete_tree, java_complete_expand_method,
9940         unresolved_type_p, create_jdep_list): New function declarations.
9941         (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
9942         END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
9943         (jdep): New typedef on new struct _jdep.
9944         (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
9945         JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
9946         JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
9947         JDEP_RESOLVED_P): New macros.
9948         (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
9949         JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
9950         JDEP_VARIABLE): New enum values and jdep kinds.
9951         (jdeplist): New typedef on struct _jdeplist.
9952         (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
9953         macros.
9954         (CALL_EXPR_PRIMARY): New macro.
9955         (struct parser_ctxt): Fields java_pass, current_method_decl,
9956         method_decl_list deleted. New field jdeplist.
9957         (INCOMPLETE_P): Macro deleted.
9958         * parse.y (single_type_import_declaration:): Removed pass switch.
9959         (type_import_on_demand_declaration): Likewise.
9960         (field_declaration:): Removed pass switch on all sub rules.
9961         (class_declaration:): Call the complete_class_decl removed on
9962         class_body rules.
9963         (method_declaration:): Removed second pass switch. No longer chain
9964         methods decl when method_header reduced.
9965         (method_header:): Sub rules no longer depend on pass switch.
9966         (method_declarator:): Likewise.
9967         (method_body:): Likewise.
9968         (abstract_method_declaration:): Likewise.
9969         (block_statement:): Likewise.
9970         (local_variable_declaration:): Likewise.
9971         (argument_list:): Likewise.
9972         (method_invocation:): Likewise. Call to build_method_invocation_stmt
9973         removed. Partial CLASS_EXPR tree node built instead.
9974         (postfix_expression:): Removed pass switch on all sub rules.
9975         (java_pop_parser_context): Free classd_list content.
9976         (yyerror): Call obstrack_grow0 to finalize error message.
9977         (check_class_interface_creation): Comment modified to reflect new
9978         returned value meaning. Removed second pass switch. Return 1 if an
9979         error was found, 0 otherwise. Adjust pointer on filename if a
9980         leading path separator was found.
9981         (maybe_create_class_interface_decl): Removed first pass switch
9982         when linking the class decl to the class_list. Install a new
9983         jdep_list for the class.
9984         (add_superinterfaces): List of unresolved interfaces is
9985         gone. Unresolved interfaces are directly added to the current
9986         dependencies list.
9987         (create_interface): Second pass shortcut removed.
9988         ctpx->modifier_ctx access through MODIFIER_WFL.
9989         (create_class): Second pass shortcut removed. Call to
9990         register_incomplete_type replaces the call to
9991         parser_chain_incomplete_item.
9992         (complete_class_decl): Function removed.
9993         (duplicate_declaration_error): New way of retrieving redeclared
9994         item type.
9995         (register_fields): Call to lookup_modifier_cl replaced by
9996         MODIFIER_WFL. New way of handling unresolved type, using
9997         unresolved_type_p and obtain_incomplete_type.
9998         register_incomplete_type replaces call to parser_chain_incomplete_item.
9999         (patch_stage): New static global variable.
10000         (method_header): New way of handling unresolved type, using
10001         unresolved_type_p and obtain_incomplete_type. patch_stage used to
10002         indicates that the method decl needs to be patched.
10003         (check_abstract_method_header): Call to lookup_modifier_cl
10004         replaced by MODIFIER_WFL.
10005         (method_declarator): Incomplete argument type are registered
10006         calling register_incomplete_type. Patch on the declared method is
10007         issued in that case.
10008         (unresolved_type_p): New function.
10009         (parser_check_super_interface): New comment to reflect function's
10010         modified returned type (int). Function and has a new argument
10011         this_wfl. Call to parse_error_context uses this_wfl instead of
10012         relying on lookup_cl.
10013         (parser_check_super): Comment reflects function's new returned
10014         type (int). Function returns non zero value on error.
10015         (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
10016         register_incomplete_type, jdep_resolve_class): New functions to
10017         handle incomplete types in declarations.
10018         (java_complete_class): Rewritten to work with the new incomplete
10019         type handling scheme.
10020         (complete_class_report_errors): Likewise.
10021         (complete_method_decl): Removed: it jobs is now handled by
10022         java_complete_class.
10023         (do_resolve_class): Class loaded in not already loaded and not
10024         found in Java source code.
10025         (java_check_regular_methods, java_check_abstract_methods): Don't
10026         call complete_method_decl anymore.
10027         (lookup_modifier_cl, not_builtin_p): Functions deleted.
10028         (read_import_dir): Got rid of the pass number dependency.
10029         (declare_local_variables): New handling of unresolved types (patch
10030         issued).
10031         (source_start_java_method): New parameter level. Function called
10032         with level set to 1 when argument types are potentially
10033         unresolved.  Called to complete the job with level set to 2 once
10034         types are complete.
10035         (source_end_java_method): Call to permanent_allocation
10036         removed. Waiting to be replaced by a more suitable obstack
10037         management.
10038         (java_complete_expand_methods, java_complete_expand_method,
10039         java_expand_finals): New functions.
10040         (build_method_invocation_stmt): Renamed
10041         patch_method_invocation_stmt. Extracts function call expression
10042         (wfl) and arguments (args) from CALL_EXPR tree operands.
10043         (build_invoke): Renamed patch_invoke. Fixed typo in fatal
10044         call. Patch the function and argument operand of the CALL_EXPR
10045         tree argument.
10046         (patch_argument, java_complete_tree): New functions.
10047
10048 Mon Apr 20 18:26:57 1998  Per Bothner  <bothner@cygnus.com>
10049
10050         Recover from missing fields and methods (i.e. error instead of fatal).
10051         * decl.c, java-tree.h (TYPE_identifier_node):  New global constant.
10052         * expr.c (expand_invoke):  Recover from missing method.
10053         (expand_java_field_op):  Recover from missing field.
10054         Inline references to java.lang.{Integer,Char,...}.TYPE.
10055         * typeck.c (get_type_from_signature), java-tree.h:  New function.
10056         * class.c (add_method):  Use get_type_from_signature.
10057         (build_class_ref):  Handle a class that was not found.
10058         * typeck.c (convert):  Handle conversion to pointers (for convenience).
10059         * verify.c (verify_jvm_instructions):  Use get_type_from_signature
10060         instead of lookup_field to handle missing fields.
10061
10062         * jcf-parse.c (process_zip_dir):  Set java_source.
10063
10064 1998-04-20  Brendan Kehoe  <brendan@cygnus.com>
10065
10066         * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
10067
10068 Tue Apr 14 15:59:54 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10069
10070         * jcf-parse.c (load_class): Don't change input_filename before
10071         calling jcf_parse_source (but still do it before calling
10072         jcf_parse).
10073         (jcf_parse_source): Assign input_filename after having saved the
10074         parser context.
10075         * lex.c (java_init_lex): Chain a WFL node to the import on demand
10076         list. ctxp->modifier_ctx zeroed according to its new
10077         definition. ctxp->filename initialized. Removed
10078         JAVA_MODIFIER_CTX_UNMARK.
10079         (java_unget_unicode): Update the character based column position.
10080         (java_allocate_new_line): ref_count not used anymore. Always free
10081         ctxp->p_line. Initialize c_line->char_col to 0.
10082         (java_get_unicode): Update the character based column position.
10083         (java_lex): Use ctxp->elc to store current position in source
10084         file, at the beginning of the parsed token. Set modifier_ctx entry
10085         corresponding to the parse modifier to a WFL node. Return a WFL
10086         node when an identifier is parsed.
10087         (java_lex_error): Now uses ctxp->elc to store current position in
10088         source.
10089         (build_wfl_node, java_is_eol, java_get_line_col): New functions.
10090         * lex.h (build_wfl_node): New function definitions.
10091         (struct java_line): ref_count and next fields are gone. New field
10092         char_col.
10093         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
10094         JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
10095         (JAVA_COLUMN_DELTA): New macro.
10096         (java_lc): New typedef on new struct _java_lc.
10097         * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
10098         (parse_error_context, parse_warning_context): Changed prototypes.
10099         (java_get_line_col): Added as an available global function.
10100         (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
10101         (IC_DECL): Replaced by macro IC_TYPE
10102         (DEPEND_WFL): New macro.
10103         (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
10104         wrong modifier.
10105         (exit_java_complete_class): Removed a commented out statement.
10106         (struct parser_ctxt): Added comments on fields. modifier_ctx is
10107         now an array of tree nodes. Deleted fields line_list and
10108         e_line. New field elc, to replace e_line.
10109         * parse.y (array_type:): Build WFL node.
10110         (qualified_name:): Build a single WFL node out of two. Retain
10111         the location information of the first node in the resulting node.
10112         (package_declaration:): Use package name as a WFL node
10113         (single_type_import_declaration:): Use imported name as a WFL node.
10114         (type_import_on_demand_declaration:): Use root of the imported
10115         packages as a WFL node.
10116         (field_declaration:): Removed unused local variable cl.
10117         (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
10118         (yyerror): New static elc. Removed static error_line, error_pos.
10119         New local code_from_source. Save ctxp->elc into elc at the first
10120         pass. Call java_get_line_col to get a string of the line where
10121         the error occured.
10122         (debug_line): Removed static function.
10123         (parse_error_context, parse_warning_context): Parameter cl is now
10124         a WFL node. Use its value to initialize ctxp->elc.
10125         (redefinition_error): Parameter cl is now a WFL node.
10126         (parse_add_interface): New parameter wfl. No longer call
10127         lookup_cl, use wfl instead.
10128         (check_class_interface_creation): Parameter cl is now a WFL node.
10129         (maybe_create_class_interface_decl): Likewise.
10130         (add_superinterfaces): New function.
10131         (create_interface): Removed local cl, node, super_decl,
10132         super_decl_type.  Function now uses id as a WFL node. Better
10133         warning/error report on obsolete or forbidden mix of
10134         modifiers. Now calls add_superinterfaces to register interfaces.
10135         (create_class): Removed local cl, node. Local variable id is used
10136         as a WFL node. Better error report on forbidden modifier
10137         mix. Uses add_superinterfaces to register interfaces.
10138         (find_field): Argument cl is now a WFL node. Now store the WFL
10139         node of a fields that needs to be checked for their
10140         initialization.
10141         (method_header): Local variable node non longer used. Local
10142         variable id replaces cl.
10143         (check_modifiers_consistency): Local variable cl is now a WFL
10144         node.
10145         (method_declarator): Local variable cl replaced by parameter id.
10146         (parser_qualified_name): Now uses parameter name as a WFL node.
10147         (parser_check_super_interface): New parameter wfl, for achieve
10148         greater accuracy during error reports.
10149         (parser_chain_incomplete_item): New parameter named location. Used,
10150         along the decl, to construct the incomplete item node.
10151         (java_complete_class): resolve_class now uses WFL node extracted
10152         from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
10153         where appropriate.
10154         (complete_method_decl): Unresolved function's argument types are WFL.
10155         (resolve_class): Parameter cl is now a WFL node.
10156         (resolve_and_layout): Likewise.
10157         (do_resolve_class): Likewise. Try first to use cl and then do the
10158         lookup on the decl when calling check_pkg_class_access.
10159         (complete_class_report_errors): Use IC_TYPE in place of
10160         TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
10161         instead of doing a lookup over the decl.
10162         (java_check_final): Use WFL info from field tree list.
10163         (lookup_cl): Rewritten and returns a statically defined WFL node.
10164         (lookup_modifier_cl): Now uses information from WFL nodes.
10165         (process_imports): Likewise.
10166         (read_import_dir): name and cl arguments replaced by a single WFL
10167         node. Function modified accordingly.
10168         (find_in_imports_on_demand): Now uses WFL node.
10169         (check_pkg_class_access): cl argument is now a WFL node.
10170         (declare_local_variables): Fixed to use WFL nodes.
10171         (resolve_expression_name): Likewise.
10172         (build_method_invocation_stmt): name_combo argument renamed
10173         wfl. Function modified to use WFL nodes.
10174         (build_invoke): cl used as a WFL node when calling build_expr_wfl.
10175         (lookup_method_invoke): cl is now a WFL node. Added missing
10176         IDENTIFIER_POINTER to class type decl name.
10177
10178 Tue Apr 14 15:23:29 1998  Dave Brolley  <brolley@cygnus.com>
10179
10180         * lang.c (init_parse): Now returns char* containing the filename.
10181
10182 Fri Apr 10 11:36:04 1998  Per Bothner  <bothner@cygnus.com>
10183
10184         * class.c (layout_class):  Mangle repeated arg types to match cc1plus.
10185
10186         * decl.c, java-tree.h (integer_four_node):  New INTEGER_CST node.
10187         * class.c (make_class_data):  If flag_assume_compiled, initial class
10188         state is CSTATE_PREPARED; make superclass and interfaces direct
10189         references, rather than constant pool indexes.
10190
10191 Thu Apr  9 16:10:56 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10192
10193         * parser.y: Include flags.h. Removed debug variable pl.
10194         (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
10195         (block:): Likewise.
10196         (labeled_statement_nsi:): Generate debug info when reducing
10197         expression_statement:.
10198         (check_pkg_class_access): get_access_flags_from_decl invokation
10199         fixed for new CLASS_* flags location.
10200         (source_end_java_method): Save/restore parser context when
10201         entering/leaving this routine. Restore lineno to its right value
10202         before calling expand_end_bindings.
10203         (build_method_invocation_stmt): build_invoke called with the
10204         current line information.
10205         (build_invoke): New argument cl. Wrap the function call around a
10206         wfl node.
10207         (refine_accessible_methods_list): Changed comment, removed
10208         unnecessary code.
10209         * parse.h: Fixed typo in comments.
10210         (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
10211         (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
10212         (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
10213         parser_ccb_indent.
10214         * lex.c (java_lex): Record the last closing curly bracket of a
10215         function.
10216         * jcf-parse.c (jcf_parse_source): Now calls
10217         java_check_methods. Clarified comment, fixed typo.
10218
10219 1998-04-09  Dave Brolley  <brolley@cygnus.com>
10220
10221         * lang.c (init_parse): Expose for non USE_CPPLIB builds.
10222         (finish_parse): Expose for non USE_CPPLIB builds.
10223
10224 Wed Apr  8 13:06:23 1998  Jeffrey A Law  (law@cygnus.com)
10225
10226         * lang.c (lang_print_xnode): New function.
10227
10228 Fri Apr  3 13:22:41 1998  Per Bothner  <bothner@cygnus.com>
10229
10230         * decl.c (class_dtable_decl), java-tree.h:  New tree node.
10231         * class.c (get_dispatch_vector, get_dispatch_table):  New functions
10232         used to build a class's dispatch table.
10233         (make_class_data):  Generate dispatch table if flag_assume_compiled.
10234         Set dtable of class object to address of class_dtable_decl.
10235
10236         * decl.c (int_decl_processing):  Make soft_badarrayindex_node
10237         be volatile and have side effects - generates better code.
10238
10239         * class.c, expr.c, parse.y:  CLASS_INTERFACE, CLASS_FINAL, etc:
10240         These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
10241
10242         * expr.c (expand_invoke):  If class is final, method is
10243         effectively final, so can call it directly.
10244
10245         * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE):  New macros.
10246
10247         * Makefile.in, Make-lang.in:  Add missing $(exeext)s.
10248
10249 Thu Mar 19 16:59:16 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10250
10251         * parse.y (build_method_invocation_stmt): Removed extra argument
10252         to build_invoke.
10253
10254 Mon Mar 16 17:25:19 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10255
10256         * expr.c (dtable_indent): Now static global.
10257         (expand_invoke): Now call invoke_build_dtable and
10258         build_invokevirtual.
10259         (invoke_build_dtable, build_invokevirtual): New functions.
10260         * jcf-io.c (find_class): Defer issuing a warning by setting
10261         jcf->outofsynch to 1.
10262         * jcf-parse.c (jcf_out_of_synch): New function.
10263         (load_class): Test this_jcf.outofsynch flag and call
10264         jcf_out_of_synch accordingly.
10265         * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
10266         comment indentation.
10267         * lex.c (java_get_unicode): Fixed code indentation.
10268         (java_lex): Create string literal. Fixed typo. Removed several
10269         premature obstack_free.
10270         * parse.h: New enums for name resolution and invocation mode.
10271         (struct qualification): New data structure.
10272         (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
10273         (do_resolve_class, build_method_invocation_stmt,
10274         breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
10275         debug_line, identical_subpath_p, invocation_mode,
10276         refine_accessible_methods_list, build_invoke,
10277         lookup_method_invoke): New functions declared.
10278         (build_invokevirtual, invoke_build_dtable, match_java_method,
10279         build_field_ref, jcf_out_of_synch): New references to external
10280         functions.
10281         (struct parse_ctxt): Removed artificial_constructor field.
10282         * parse.y: (array_type:): Type defined for this rule.
10283         (class_type:): Installed default rule for interface_type:.
10284         (array_type:): Now build Java array type.
10285         (qualified_name:): Now use obstack_grow0.
10286         (method_declaration:): Skip the artificial constructor added to
10287         the list, if any.
10288         (abstract_method_declaration:): Execute the code only during pass 1.
10289         (block:): Installed default rule in block_statements:.
10290         (block_statement:): Add the statement to the method during pass 2.
10291         (statement_expression): Installed default rule for
10292         method_invocation:.
10293         (argument_list:): Added code to build the argument list.
10294         (method_invocation:): Added call to create the method invocation
10295         node.
10296         (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
10297         (debug_line): New function for debug.
10298         (complete_class_decl): No longer do something during pass 1.
10299         (method_header): Use BUILD_PTR_FROM_NAME.
10300         (parser_qualified_classname): Use obstack_grow0. Removed bogus
10301         obstack_free.
10302         (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
10303         function's main comment.
10304         (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
10305         classes.
10306         (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
10307         (resolve_class): Now works with arrays.
10308         (do_resolve_class, resolve_and_layout): New functions.
10309         (java_check_regular_methods): Reverse method list before and after
10310         having processed it. No longer set ctxp->artificial_constructor.
10311         (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
10312         accordingly. Fixed typo in issued error message. Now use
10313         obstack_grow0.
10314         (find_in_imports_on_demand): Now use obstack_grow0.
10315         (declare_local_variables): Use BUILD_PTR_FROM_NAME.
10316         (source_end_java_method): Call expand_expr_stmt instead of
10317         expand_expr. Calls it before calling expand_function_end.
10318         (java_method_add_stmt): Do nothing if errors were found during
10319         parsing.
10320         (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
10321         (build_method_invocation_stmt, build_invoke, invocation_mode,
10322         lookup_method_invoke, refine_accessible_methods_list,
10323         qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
10324         New functions.
10325         * typeck.c (build_java_signature): Properly end method signature
10326         if return type skipped.
10327         (match_java_method): New function.
10328
10329 Mon Mar 16 10:40:47 1998  Per Bothner  <bothner@cygnus.com>
10330
10331         * jcf-io.c (find_classfile):  If USE_JCF_STDIO, fopen in binary mode.
10332
10333 Wed Feb 25 08:55:49 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10334
10335         * expr.c (build_invoke_non_interface): New function.
10336         (methods_ident, ncode_ident): Now static globals.
10337         (expand_invoke): Use build_invoke_non_interface.
10338         * java-tree.h (struct lang_decl): New field function_decl_body.
10339         (DECL_FUNCTION_BODY): New macro.
10340         * jcf-parse.c (jcf_parse_source): Deeper check before setting
10341         CLASS_FROM_SOURCE_P.
10342         (parse_source_file): Fixed typos. Call java_layout_parsed_class
10343         before starting pass 2. Call to java_generate_parsed_class replaced
10344         by java_register_parsed_class.
10345         * lex.c: Fixed typo in header. Some line width related formating.
10346         * lex.h: Some line width related formating.
10347         * parse.h (source_end_java_method, resolve_expression_name,
10348         complete_class_decl, maybe_create_class_interface_decl,
10349         check_class_interface_creation): New static function declarations.
10350         (java_layout_parsed_class, java_method_add_stmt): New function
10351         declarations.
10352         (struct parser_ctxt): Field mark_class_generate removed. New
10353         fields class_list and artificial_constructor.
10354         * parse.y: Fixed typo in header.
10355         (class_declaration:): Call complete_class_decl when class body
10356         parsed.
10357         (method_declaration:): Call source_end_java_method in pass 2 when
10358         the method body is defined.
10359         (postfix_expression:): Do expression name resolution on sub-rule
10360         name during pass 2.
10361         (create_class, create_interface): Merged common pieces.
10362         (check_class_interface_creation, maybe_create_class_interface_decl):
10363         New functions.
10364         (complete_class_decl): New function.
10365         (register_fields): Fixed line width related typo.
10366         (method_header): Correctly skip first argument when fixing
10367         argument line. Changed the loop.
10368         (java_check_circular_reference): Now use ctxp->class_list.
10369         (java_complete_class): Removed start/stop marking.
10370         (java_check_regular_methods): Now takes a class decl as an
10371         argument.  Add default constructor if none were encountered.
10372         (java_check_methods): Now use ctxp->class_list. Changed call to
10373         java_check_regular_methods.
10374         (source_start_java_method): Set DECL_ARG_TYPE for each function
10375         arguments.
10376         (source_end_java_method, java_method_add_stmt): New functions.
10377         (java_generate_parsed_class): No longer exists.
10378         (java_layout_parsed_class, java_register_parsed_class): New functions.
10379         (resolve_expression_name): New function.
10380
10381 Thu Feb 12 11:54:28 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10382
10383         * jcf-parse.c: (parse_source_file): Check on errors after init lex.
10384         * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
10385         until pass initializations are done. Call read_import_dir with
10386         pass set to 0.
10387         * parse.h: (lookup_modifier_cl): New function declared.
10388         (INTERFACE_FIELD_MODIFIERS): New macro.
10389         (OBSOLETE_MODIFIER_WARNING): New macro.
10390         * parse.y: (register_fields): Class type and current field name in
10391         local variables. Check modifier(s) if adding field(s) to an interface.
10392         (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
10393         and report errors using the faulty modifier line context.
10394         (lookup_modifier_cl): New function.
10395         (read_import_dir): Detect and report default import processing
10396         failure.
10397
10398 1998-02-11  Brendan Kehoe  <brendan@cygnus.com>
10399
10400         Add a pair of -fassume-compiled/-fno-assume-compiled options.
10401         * class.c (is_compiled_class): Return 1 after making sure it
10402         qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
10403         * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
10404         * java-tree.h (flag_assume_compiled): Add decl.
10405         * lang.c (lang_f_options): Add the flag.
10406         (flag_assume_compiled): Add decl, default to 0.
10407
10408 Wed Feb 11 11:27:59 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10409
10410         * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
10411         (is_compiled_class): Likewise.
10412         (layout_class): Likewise.
10413         (layout_class): Detect and lay out classes defined in source code.
10414         (interface_of_p, add_interface_do, may_add_interface): New
10415         function.
10416         (add_interface): Now use add_interface_do.
10417         (add_method_1): New function.
10418         (add_method): Now use add_method_1.
10419         (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
10420         (complete_start_java_method): New function.
10421         (start_java_mehod): Now call complete_start_java_method.
10422         * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
10423         (expand_invoke): Likewise and fixed typo.
10424         *gjava.c: (print_super_field): Use new argument to find_class
10425         DO_CLASS_FILE.
10426         (main): Likewise.
10427         *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
10428         (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
10429         QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
10430         IDENTIFIER_NODE.
10431         (CLASS_COMPLETE_P): New flag on TYPE_DECL.
10432         (add_method_1, push_class): New prototypes.
10433         *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
10434         *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
10435         directory where the class was found.
10436         (find_class): New argument DO_CLASS_FILE. Function find_class
10437         modified accordingly.
10438         *jcf-parse.c: (fix_class_path): New function.
10439         (load_class): Use new VERBOSE argument. load_class now finds and
10440         loads/parses .class/.java files. Save read_state of current_jcf
10441         if necessary.
10442         (java_parser_abort_on_error): New macro.
10443         (jcf_parse_source, parse_source_file): New function.
10444         (jcf_parse): Fixed typo.
10445         (yyparse): Call parse_source_file () only.
10446         (process_zip_dir): Fixed typo, fix zdir->filename_length when
10447         writing the real class name back in the zip directory entry.
10448         (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
10449         (jcf_figure_file_type): Fixed bogus alloc and bcopy.
10450         *jcf.h: (typedef struct JCF): New fields java_source and zipd.
10451         (find_class): Prototype fixed.
10452         *lex.c: Added 1998 time stamp.
10453         Removed all static global variables, moved into the parser
10454         context data structure.. Now include unistd.h if SEEK_SET not
10455         defined.
10456         (java_init_lex): Rewritten.
10457         (java_sneak_unicode): Modified current unicode access in current line.
10458         (java_unget_unicode): Likewise.
10459         (java_allocate_new_line): New allocation management.
10460         (java_read_char): Modified access and storage of unget_utf8_value.
10461         New way of processing current unicode.
10462         (java_store_unicode, java_read_unicode): Fixed typo in declaration.
10463         (java_get_unicode): Now use the parser context.
10464         (java_lineterminator): Likewise.
10465         (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
10466         of the reentrant parser implementation. Function now use the
10467         parser context data structure and java_lval. Fixed production of
10468         the float and double constant "out of range" error message. Fixed
10469         obstack use. Return integer value when hitting a modifier. Now
10470         return type for TRUE, FALSE and other predefined types. Return
10471         identifier as a TREE_LIST list containing the current line context
10472         as the TREE_VALUE sub-node.
10473         (java_unicode_2_utf8): Fixed typo in declaration.
10474         (java_lex_error): Now use the parser context data structure.
10475         *lex.h: Added 1998 time stamp.
10476         (struct java_line): New fields ref_count and next.
10477         (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
10478         JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
10479         (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
10480         *parse.h: Added 1998 time stamp.
10481         (java_parse_source_file): Renamed from parse_source_file.
10482         (YYERROR_NOW, YYNOT_TWICE): Fixed.
10483         (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
10484         INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
10485         JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
10486         THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
10487         END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
10488         CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
10489         (struct parser_ctxt): New data structure to keep the parser context.
10490         *parse.y: Added 1998 time stamp, got rid of static global variables.
10491         (java_error_count, ctxp): New global variables.
10492         (%union): New value field.
10493         (numeric_type, integral_type): Rules removed.
10494         (primitive_type): Rule defined to handle integral, float, double and
10495         boolean types.
10496         (qualified_name, package_declaration,
10497         single_type_import_declaration, type_import_on_demand_declaration,
10498         modifiers, class_declaration, super, interfaces,
10499         interface_type_list, class_body, field_declaration,
10500         field_declaration, variable_declarators, variable_declarator,
10501         variable_declarator_id, method_declaration, method_header,
10502         formal_parameter_list, formal_parameter, method_body, block,
10503         static, interface_declaration, extends_interfaces,
10504         abstract_method_declaration, local_variable_declarators): Rules now
10505         define actions.
10506         (force_error, do_warning): New global statics.
10507         (push_parser_context, parser_context_save_global,
10508         parser_context_restore_global, pop_parser_context): New functions.
10509         (yyerror): Now uses the global parser context. Fixed use of obstack.
10510         (parse_error, parse_error_context, parse_warning_context,
10511         java_accstring_lookup, redefinition_error, check_modifiers,
10512         parser_add_interface, create_interface, create_class, find_field,
10513         duplicate_declaration_error, register_fields, method_header,
10514         check_modifiers_consistency, check_abstract_method_header,
10515         method_declarator, parser_qualified_classname,
10516         parser_check_super_interface, parser_check_super,
10517         parser_chain_incomplete_item, java_check_circular_reference,
10518         layout_class_from_source, java_complete_class,
10519         complete_method_decl, resolve_class, complete_class_report_errors,
10520         java_check_final, check_method_redefinition,
10521         java_check_regular_methods, java_check_abstract_methods,
10522         java_check_methods, lookup_java_interface_method2,
10523         lookup_java_method2, lookup_cl, find_name_in_single_imports,
10524         process_imports, find_in_imports, read_import_entry,
10525         read_import_dir, find_in_imports_on_demand,
10526         check_pkg_class_access, not_builtin_p, declare_local_variables,
10527         source_start_java_method, java_generate_parsed_class): New
10528         functions.
10529         *typeck.c: (signature_include_return): New global variable.
10530         (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
10531         to add the function returned type in the signature.
10532
10533 1998-02-09  Brendan Kehoe  <brendan@cygnus.com>
10534
10535         * jcf-io.c (open_in_zip): Use strncmp and LEN.
10536
10537 Thu Jan 29 16:12:13 1998  Dave Brolley  <brolley@cygnus.com>
10538
10539         * Make-lang.in (java.info): Added.
10540         (java.install-info): Added
10541
10542 1998-01-27  Brendan Kehoe  <brendan@cygnus.com>
10543
10544         * Makefile.in (clean): Also remove java/parse.c.
10545
10546 1998-01-26  Brendan Kehoe  <brendan@cygnus.com>
10547
10548         Add a pair of -fbounds-check/-fno-bounds-check options.
10549         * lang.c (lang_decode_option): Add code to grok arguments.
10550         (flag_bounds_check): Add decl.
10551         (lang_f_options): New array w/ the option in it.
10552         * java-tree.h (flag_bounds_check): Add decl.
10553         * lang-options.h: New file.
10554         * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
10555         of a static macro value.
10556         (JAVA_ARRAY_EXCEPTION): Delete macro.
10557
10558 Fri Jan 23 14:19:47 1998  Per Bothner  <bothner@cygnus.com>
10559
10560         * typeck.c (build_java_array_type):  Fix two bugs in previous change.
10561         * expr.c (build_anewarray):  Add missing promote_type.
10562
10563 Thu Jan 22 17:43:45 1998  Per Bothner  <bothner@cygnus.com>
10564
10565         Add array types with known length to optimize bounds checking.
10566         * typeck.c (build_java_array_type):  Take length parameter.
10567         (java_array_type_length, build_prim_array_type):  New functions.
10568         * java-tree.h:  Update for new functions.
10569         * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
10570         * class.c:  Use build_prim_array_type.
10571         * expr.c (can_widen_reference_to):  Handle known-length array types.
10572         (verify_jvm_instructions):  Keep track of integer push instructions
10573         followed by newarray/anewarray, so we can build known-length arrays.
10574         (JAVA_ARRAY_DATA_OFFSET):  Replace by ...
10575         (java_array_data_offset):  New function.
10576         (build_java_array_length_access):  New function.  Optimize if constant.
10577         (build_java_arrayaccess):  Constant fold bounds check.
10578         (expand_java_newarray, expand_java_anewarray):  Replaced by ...
10579         (build_newarray, build_anewarray):  New functions.
10580         (ARRAY_NEW_NUM, ARRAY_NEW_PTR):  Use build_{a,}newarray.
10581         * verify.c (merge_types):  Handle known-lengh array types.
10582
10583 Mon Jan 19 13:09:25 1998  Per Bothner  <bothner@cygnus.com>
10584
10585         * expr.c (expand_byte_code):  Fix performace bug, which caused
10586         searching linenumber_table to be linear rather than constant.
10587
10588 Fri Dec 12 19:18:42 1997  Per Bothner  <bothner@cygnus.com>
10589
10590         * Makefile.in (BISON, BISONFLAGS):  Add missing macros.
10591
10592         * decl.c, java-tree.h (soft_fmod_node):  New global.
10593         * decl.c (init_decl_processing):  Define __builtin_fmod.
10594         * expr.c (build_java_binop):  Implement TRUNC_MOD_EXPR for REAL_TYPE
10595         using __builtin_fmod.
10596
10597 Thu Dec  4 13:22:59 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10598
10599         * keyword.h: New file, output of keyword.gperf as processed by
10600         gperf.
10601         * lex.c (java_lex_init): Initialize java_error_flag.
10602         * parse.c (YYERROR_NOW): Uses java_error_flag.
10603         * parse.y: New static java_error_flag. Useless definition of
10604         buffer_error gone.
10605         * parse.y (java_error): Portable error recovery using
10606         java_error_flag (not yet completely tuned).
10607
10608 1997-12-04  Brendan Kehoe  <brendan@lisa.cygnus.com>
10609
10610         * Makefile.in (parse.c): Use $(srcdir) for parse.y.
10611
10612 Wed Dec  3 18:37:42 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10613
10614         * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
10615         (parse.c, lex.c, keyword.h): New rules for Java source code
10616         front-end.
10617         * parse.c: Renamed into jcf-parse.c.
10618         * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
10619         * keyword.gperf: New file, Java keywords.
10620         * parse.y: New file, Java language grammar.
10621         * parse.h: New file, Java language grammar definitions.
10622         * lex.c: New file, Java language lexer.
10623         * lex.h: New file, Java language lexer definitions.
10624
10625 Wed Dec  3 17:00:17 1997  Per Bothner  <bothner@cygnus.com>
10626
10627         * decl.c (clinit_identifier_node), java-tree.h:  New global.
10628         * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P):  Removed.
10629         * verify.c (verify_jvm_instructions):  Inline use of removed macros.
10630         * expr.c (expand_java_field_op):  Check for invalid assignment
10631         to final field.
10632
10633         * jcf-reader.c (get_attribute):  Test for wrong attribute length.
10634
10635 Mon Oct 27 17:46:36 1997  Per Bothner  <bothner@cygnus.com>
10636
10637         * verify.c (verify_jvm_instructions):  When processing a handler,
10638         attempt to set the current_subr to the right value.
10639         (More complicated code combines Sep 17 and Oct 22 versions.)
10640
10641 Fri Oct 24 11:36:54 1997  Per Bothner  <bothner@cygnus.com>
10642
10643         * class.c (push_class):  Figure out (guess) name of source file.
10644         * parse.c  (set_source_filename):  Set DECL_SOURCE_FILE of class decl.
10645         (give_name_to_class):  Don't guess source name;  use DECL_SOURCE_FILE.
10646         (parse_class_file):  Change return type from int to void.
10647         Call debug_start_source_file/debug_end_source_file.
10648
10649         * expr.c (build_java_binop):  Fix masking 2nd operand.
10650         * decl.c (init_decl_processing):  Set sizetype first.
10651
10652 Wed Oct 22 19:39:05 1997  Per Bothner  <bothner@cygnus.com>
10653
10654         * verify.c (verify_jvm_instructions):  Don't set current_subr to NULL.
10655         (Revert Sep 17 change.)
10656
10657 Tue Oct 21 15:09:02 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10658
10659         * parse.c (process_zip_dir): Skip ZIP entries not bearing the
10660         .class extension in their name and fix thing so we don't process
10661         them parse_zip_file_entries().
10662         (parse_zip_file_entries): Cleaned unused local variables.
10663
10664 Mon Oct 20 14:52:42 1997  Per Bothner  <bothner@cygnus.com>
10665
10666         * expr.c (can_widen_reference_to):  Allows equal array element types.
10667         (expand_byte_code):  PRE_RET must expand OPERAND_VALUE (to get index).
10668         * jcf-dump.c (RET):  Get (and print) index.
10669
10670         * verify.c (verify_jvm_instructions case OPCODE_anewarray):
10671         Promote element type to POINTER_TYPE.
10672
10673 Mon Oct 20 13:40:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10674
10675         * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
10676         find_in_current_zip, jcf_figure_file_type): Moved from
10677         jcf-reader.c to parse.c.
10678         * zextract.c: (read_zip_archive): takes file_comment_length possible
10679         field into account.
10680
10681 Mon Oct 20 11:45:06 1997  Per Bothner  <bothner@cygnus.com>
10682
10683         * verify.c (verify_jvm_instructions):  Var can also be promoted to int.
10684
10685         * verify.c (merge_types):  Handle array types even better ...
10686
10687 Fri Oct 17 15:56:37 1997  Per Bothner  <bothner@cygnus.com>
10688
10689         * expr.c (java_stack_pop):  Fix use of NULL_TREE for TYPE_SECOND.
10690
10691         * java-tree.h (PUSH_FIELD):  Set DECL_ARTIFICIAL.
10692         * class.c (make_class_data):  Don't build fields_decl if no fields.
10693         When building fields_decl, skip if DECL_ARTIFICAL.
10694
10695         * expr.c (java_stack_swap):  Update stack_type_map.
10696         * verify.c (merge_types):  Handle array types better.
10697
10698 Wed Oct 15 18:09:45 1997  Per Bothner  <bothner@cygnus.com>
10699
10700         * class.c (add_field):  Don't promote short integral fields to
10701         int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
10702         * expr.c (push_value):  Promote and convert short integral values.
10703
10704         * decl.c, java-tree.h (integer_two_node):  New constant node.
10705         * verify.c (merge_types):  Check for TYPE_RETURN_ADDR.
10706
10707 Wed Oct 15 17:04:50 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10708
10709         * class.c (append_gpp_mangled_type): Use function argument
10710         unpromoted type to generate mangled name.
10711
10712 Mon Oct 13 16:52:55 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10713
10714         * constants.c (build_constant_data_ref): Now uses current_class
10715         instead of main_class.
10716         (build_constants_constructor): Now uses current_class instead of
10717         main_class.
10718         * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
10719         of the global variable SeepZipFiles done here.
10720         * zextract.c (read_zip_archive): extra_field optional field taken
10721         into account while computing the position of the class file in the
10722         archive.
10723         * verify.c (verify_jvm_instructions): Use current_jcf to search
10724         the constant pool.
10725         * parse.c (load_class): First search for the class to load in the
10726         current zip file. Saves current_jcf (restored before returning
10727         from that function). Don't call JCF_FINISH in the class was found
10728         in the current ZIP file.
10729         (jcf_parse): If the class was found in the current ZIP file, save
10730         its tree_constant_pool (for later reuse).
10731         (parse_class_file): New function. Process each method defined in
10732         the current class and record the class as to be later registered.
10733         (yyparse): Rewritten. Figure the type of the current file and switch
10734         accordingly.
10735         * lang.c: New global variable current_jcf.
10736         (lang_init): Removed compiling_from_source test (done later, in
10737         yyparse). Removed call the jcf_parse ().
10738         * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
10739         (typedef struct JCF): New fields seen_in_zip (to mark a class found
10740         in the current ZIP file) and zip_offset (offset to the class data in
10741         the current zip file).
10742         * jcf-reader.c: zipfile.h included.
10743         localToFile: New ZipFileCache static global variable
10744         (parse_zip_file_entries): New function. Browse the current ZIP
10745         file directory and process each class found.
10746         (process_zip_dir): New function. Register each class found in the
10747         ZIP file directory. The class aren't parsed but a valid JCF is
10748         link to each of them.
10749         (find_in_current_zip): New function. Search for a class in the
10750         current ZIP file directory. If found, prepare the class so that it
10751         can be loaded.
10752         (jcf_figure_file_type): New function. Examine the file structure
10753         to figure a class file, a ZIP file. If none of these categories are
10754         matched, a source file is assumed.
10755         * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
10756         SeenZipFile: New global variable.
10757         (open_in_zip): Use zipmember's length to accelerate the search for
10758         a member. If zipmember was NULL and zip file successfully read,
10759         return 0.
10760         * java-tree.h: New global variable current_jcf declared.  Added
10761         declaration for current_constant_pool_tags, current_constant_pool_data,
10762         current_constant_pool_length, current_constant_pool_data_ref.
10763         (struct lang_type): Augmented with two fields. struct JCF *jcf (to
10764         store the JCF of classes seen in a zip file) and tree *constant_pool
10765         (to save a loaded class constant pool). current_class declared here.
10766         * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
10767         retrieve method_ref_constant.
10768         (PUSHC): java_push_constant_from_pool now uses current_jcf.
10769         (OBJECT): get_class_constant now uses current_jcf.
10770         (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
10771         (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
10772         (expand_invoke): Now uses current_class instead of main_class
10773         (build_class_init): Now uses current_class instead of main_class
10774         * class.c: New static global variable registered_class.
10775         (register_class): New function.
10776         (emit_register_class): Modified to use registered_class instead of
10777         main_class
10778         (is_compiled_class): Now take into account class seen in the archive.
10779
10780 Mon Oct  6 12:03:23 1997  Per Bothner  <bothner@cygnus.com>
10781
10782         * except.h:  Renamed to: java-except.h.
10783         * parse.c, except.c, expr.c, verify.c:  Update #include accordingly.
10784         * except.c:  Add semi-working (commented out) implementation.
10785
10786         * expr.c (expand_iinc):  Add needed flush_quick_stack.
10787         * parse.c (set_source_filename):  New function.
10788         (give_name_to_class):  Set input_filename from package.classname.java.
10789
10790         * jcf-io.c (find_class):  Don't look first in ".".
10791
10792 Wed Oct  1 11:26:10 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10793
10794         * zextract.c (read_zip_archive): Now takes into account the
10795         extra_field field.
10796         * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
10797
10798 Sat Sep 20 12:44:28 1997  Per Bothner  <bothner@cygnus.com>
10799
10800         * constants.c, java-tree.h (build_internal_class_name):  New function.
10801         (alloc_class_constant):  Re-implement using build_internal_class_name.
10802         * class.c (make_class_data):  Likewise.
10803         * class.c (hashUtf8String):  Make hash algorithm match String.hashCode.
10804
10805 Wed Sep 17 13:15:23 1997  Per Bothner  <bothner@cygnus.com>
10806
10807         * verify.c (verify_jvm_instructions):  Temporarily set current_subr
10808         to NULL before pushing an exception handler target.
10809
10810         * expr.c (flush_quick_stack):  Save from low stack indexes to high.
10811         (java_stack_swap, java_stack_dup):  Re-write to be safe from
10812         clobbering registers.
10813         (build_class_init):  New function.
10814
10815 Wed Sep 17 11:02:41 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10816
10817         * typeck.c (build_java_array_type): Temporary use
10818         permanent_obstack to create the array 'length' field.
10819         * expr.c (lookup_label): Temporay use permanent_obstack to create
10820         label if not found.
10821         * class.c (push_super_field): Tempory use permanent_obstack.
10822
10823 Mon Sep 15 11:33:31 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10824
10825         * typeck.c (type_for_mode): Now handles double_type_node and
10826         float_type_node.
10827         * verify.c (verify_jvm_instructions): The instruction following
10828         the wide bytecode is checked. OPCODE_ret added to the list of
10829         wide.
10830
10831 Thu Sep 11 19:45:18 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10832
10833         * class.c (make_class): Temporary use permanent_obstack. Set the
10834         class CLASS_P field to 1.
10835         (push_class): Temporary use permanent_obstack.
10836         (set_super_info): Temporary use permanent_obstack.
10837         (add_method): Temporary use permanent_obstack, set
10838         METHOD_TRANSIENT().
10839         (add_field): Temporary use permanent_obstack. Sets
10840         FIELD_VOLATILE() and FIELD_TRANSIENT().
10841         (build_class_ref): Temporary use permanent_obstack if the class
10842         isn't compiled.
10843         (build_static_field_ref): Temporary use permanent_obstack when
10844         creating field's rtl.
10845         (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
10846         ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
10847         and fields. Function finalized, as far as flag handling.
10848         (push_class_static_dummy_field): Temporary use permanent_obstack.
10849         (emit_register_class): Force generation of class registration at
10850         -O3 or deeper.
10851         * decl.c (end_java_method): Call permanent_allocation() before
10852         returning.
10853         * expr.c (can_widen_reference_to): Added comment to interface
10854         handling, fixed typo.
10855         (lookup_field): Now uses CLASS_P() to correct FIXME
10856         (expand_invoke): Verification on public && !static &&
10857         !abstract moved into soft_lookupinterfacemethod (kaffe).
10858         Use Object class dtable if objectref is an array when expanding
10859         invokeinterface.
10860         (java_push_constant_from_pool): Temporary use permanent_obstack
10861         for CONSTANT_string
10862         * parse.c (get_ref_constant): Temporary use permanent_obstack to
10863         create constant references.
10864         (get_constant): Temporary use permanent_obstack to create constant.
10865         (load_class): Temporary use permanent_obstack to load class.
10866         (jcf_parse): Temporary use permanent_obstack to perform class
10867         layout.
10868         * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
10869         (build_java_signature): Temporary use permanent_obstack.
10870         * verify.c: (verify_jvm_instruction): removed unecessary verification
10871         on ACC_SUPER flag.
10872         * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
10873         (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
10874         (CLASS_P): Defined
10875
10876 Thu Sep 11 11:57:32 1997  Per Bothner  <bothner@cygnus.com>
10877
10878         * class.c (append_gpp_mangled_type):  Fix typo.
10879         (emit_register_class):  Use main_class to get class object, rather
10880         than looking for no-longer-existing static decl starting with _CL.
10881         * typeck.c (parse_signature_type):  Promote array element type
10882         if it is a RECORD_TYPE.
10883
10884 Wed Sep 10 16:09:23 1997  Per Bothner  <bothner@cygnus.com>
10885
10886         * class.c (push_class_static_dummy_field):  New function.
10887         (mangle_static_field):  New. Do G++-style mangling of static fields.
10888         (layout_class):  Mandle static fields here, not in add_field.
10889         (build_class_ref):  The class object is now a dummy static field.
10890         * decl.c (find_local_variable):  Look for best, instead of first match.
10891         * expr.c (push_type):  Always promote_type, not just for RECORD_TYPE.
10892         (build_java_athrow):  Don't check here if exception is Throwable.
10893         * java-tree.h (TYPE_UNSET):  Renamed to TYPE_UNKNOWN.
10894         (TYPE_USED):  Removed.  No longer used ...
10895         * parse.c (jcf_parse):  Call push_class_static_dummy_field.
10896         * verify.c (push_pending_label):  New function.
10897         (push_pending_block):  Renamed to check_pending_block.
10898         (merge_types):  Remove unneeded suuport for TYPE_UNUSED.
10899         (verify_jvm_instructions):  Only reset prev_eh_ranges (to force
10900         re-checking possible handlers) after a store (less wasted work).
10901         Check for null handler (finally) before calling add_handler.
10902         Various changes to (finally?) correctly handle try/finally.
10903
10904 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
10905
10906         * class.c: Include stdio.h.
10907
10908 Thu Sep  4 21:30:55 1997  Per Bothner  <bothner@cygnus.com>
10909
10910         * expr.c (expand_invoke):  Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
10911         to make sure class is initialized before static/special invoke.
10912
10913         * verify.c (verify_jvm_instructions):  On a store instruction,
10914         call find_local_variable to force pre-allocation of decl and rtx.
10915         * decl.c (push_jvm_slot):  Set DECL_REGISTER on stack slots.
10916
10917 Wed Sep  3 16:13:23 1997  Per Bothner  <bothner@cygnus.com>
10918
10919         * class.c (build_class_ref):   Strip off "promoted_" if need be.
10920         (make_field_value): Call build_java_signature when needed.
10921         (layout_class):  Don't make_function_rtl if METHOD_ABSTRACT.
10922         * expr.c (build_java_athrow):  Don't push_value of exception.
10923         (build_java_binop):  Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
10924         match specification of [fd]cmp[lg] for NaNs.
10925         (expand_byte_code):  Add support for exception handler ranges.
10926         * except.c:  Add skeleton for EH code-generation.
10927         * verify.c (merge_types):  Treat all promoted integral types as equal.
10928         * constants.c (build_constants_constructor):  To force creation of
10929         current_constant_pool_data_ref, call build_constant_data_ref.
10930
10931         * javaop.def (lload):  Fix typo.
10932         * jcf-dump.c (main):  Clear filename to prevent possibly-bad free.
10933
10934 Tue Sep  2 17:37:25 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
10935
10936         * parse.c: Don't include function.h.
10937
10938 Wed Aug 27 18:33:04 1997  Per Bothner  <bothner@cygnus.com>
10939
10940         * except.[ch]:  New files.
10941         * Makefile.in (JAVA_OBJS):  Add except.o
10942         * expr.c:  Temporary warning about unimplemented exceptions.
10943         * verify.c:  Verify exception handlers.
10944
10945         * jcf-dump.c (disassemble_method):  Print exception table.
10946
10947 Wed Aug 27 13:26:58 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10948
10949         * expr.c (verify_jvm_instructions): Started a thorough
10950         verification of invoke* bytecodes.
10951         (expand_byte_code): flush quick stack if PC is the target of a
10952         branch.  and undef RET (conflicting with config/i386/i386.h).
10953         (expand_java_arrayload): Fixed bogus cast, when Boolean type is
10954         used.
10955         (expand_invoke): Now handles invokeinterface and do more
10956         verification according to the bytecode.
10957         (lookup_field): Don't try to load the class if processing
10958         dtable_type.
10959         (can_widen_reference_to): Now handles interfaces.
10960         * decl.c (init_decl_processing): New global variable
10961         soft_lookupinterfacemethod_node, declared in java-tree.h.
10962         Call set_super_info on string_type_node.
10963         * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
10964         defined.
10965         * class.c (set_super_info): Fills the CLASS_* flags according to
10966         access_flags.
10967         (get_access_flags_from_decl): Handles all class flags.
10968
10969 Tue Aug 26 18:54:34 1997  Per Bothner  <bothner@cygnus.com>
10970
10971         * class.c (add_method):  Zero out newly-allocated DECL_LANG_SPECIFIC.
10972         * parse.c (yyparse):  Check for abstract method, and missing code.
10973         * expr.c (expand_byte_code):  Change interface.
10974         * lang.c (put_decl_node):  Print promoted types prettier.
10975         * verify.c (verify_jvm_instruction):  Change interface.
10976         Partial support for scanning exception table.
10977         For load instructions, handle promoted integral types.
10978
10979 Thu Aug 21 13:48:01 1997  Per Bothner  <bothner@cygnus.com>
10980
10981         * verify.c:  New file, with contents moved from expr.c.
10982         * expr.c:  Bunch of stuff (mostly verification) moved to verify.c.
10983         * typeck.c (is_array_type_p):  Moved here from expr.c.
10984         * java-tree.h:  Add some now-needed function declarations.
10985         * Makefile.in (JAVA_OBJS): Added verify.o.
10986
10987 Wed Aug 20 14:34:34 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
10988
10989         * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
10990         METHOD_ABSTRACT flag.
10991
10992         * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
10993         (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
10994         (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
10995
10996         * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
10997         variables.
10998         (start_java_method): Hook for SYNCHRONIZED methods.
10999
11000         * expr.c (build_java_jsr, build_java_ret): New functions
11001         (JSR,PRE): New macros
11002         (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
11003         (verify_jvm_instructions): tableswitch, lookupswitch,
11004         monitorenter, monitorexit, goto_w: verified.
11005         (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
11006         (build_java_monitor): New function.
11007         (MONITOR_OPERATION): Modified to call build_java_monitor()
11008         (verify_jvm_instructions): Started a thorough verification of
11009         invoke* bytecodes.
11010
11011 Tue Aug 19 13:35:49 1997  Per Bothner  <bothner@cygnus.com>
11012
11013         Support verification of jsr/ret subroutines (used for try/finally).
11014         * decl.c (return_address_type_node):  New type node.
11015         * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
11016         RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
11017         LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED):  New macros.
11018         (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
11019         TYPE_USED):  New macros for special types in type_map.
11020
11021         * java-tree.h (BCODE_JUMP_TARGET):  Renamed to BCODE_TARGET.
11022         (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET):  Replaced by
11023         BCODE_JUMP_TARGET.
11024         * expr.c (expand_byte_code):  Fix logic to warn of unused instructions.
11025
11026         * expr.c (can_widen_reference_to):  New function.
11027         (pop_type):  Use it.
11028         (merge_type_state):  Support handling start of subroutine.
11029         (push_pending_block):  Return char* error message, instead of calling
11030         fatal on an error.  Also handle subroutines.
11031         (verify_jvm_instructions):  Handle errors from push_poending_block.
11032         Support jsr and ret instructions.
11033
11034 Tue Aug 19 13:33:36 1997  Per Bothner  <bothner@cygnus.com>
11035
11036         * jcf-io.c (find_classfile):  Fix thinko.
11037         * jcf-dump.c:  Add CONVERT2 (to match changed javaop.def).
11038
11039 Tue Aug 12 20:14:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
11040
11041         * Makefile.in (BISON): Remove.
11042
11043 Thu Aug  7 23:08:24 1997  Per Bothner  <bothner@cygnus.com>
11044
11045         * Makefile.in:  Convert to autoconf.
11046         * config-lang.in (outputs):  Added java/Makefile.
11047
11048         * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
11049         Rename cc1java to jc1.
11050
11051         * lang.c (init_parse, finihs_parse):  New functions #ifdef USE_CPPLIB.
11052         * Makefile.in (INTERNAL_CFLAGS):  Add @extra_c_flags.
11053
11054         * class.c (class_depth):  Do load_class if needed.
11055
11056         Mostly better verification.
11057         * decl.c (pushdecl):  Set TYPE_STUB_DECL for a type.
11058         (init_decl_processing):  Change return type of soft_checkcast.
11059         * expr.c (expand_java_CHECKCAST):  Do push_value of the "casted" value.
11060         * lang.c (put_decl_string, put_decl_node, lang_printable_name,
11061         lang_print_error):  New functions.
11062         (lang_init):  Set global hook print_error_function to lang_print_error.
11063         * expr.c:  In the type_map ptr_type_node is only used for null now.
11064         (pop_type, merge_types):  Hence ptr_type_node matches any reference.
11065         (merge_types):  Dererence pointer to record types before comparing.
11066         (decode_newarray_type, merge_types):  On error just return NULL.
11067         (build_java_binop):  Add preliminary implementation (with warning)
11068         for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
11069         (lookup_label):  Set DECL_IGNORED_P (for dwarf2out).
11070         (expand_compare, expand_java_goto, expand_java_call):  Don't
11071         push_pending_block, since that only makes sense when verifying.
11072         (merge_type_state):  Different return codes.
11073         (push_pending_block):  A block may need to be verified more than once.
11074         (expand_byte_code):  Warn about unused code at code generation time.
11075         (verify_jvm_instruction):  Changed logic, since code may need to be
11076         re-verified if type-state has changed.  Also, better error handling.
11077         Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
11078         Improve newarray, anewarray, ?aload, athrow,
11079         * java-tree.h (LABEL_CHANGED):  New macro.
11080
11081 Tue Aug  5 12:21:27 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11082
11083         * decl.c (soft_athrow_node): New global variable initialized.
11084         * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
11085         * typeck.c (convert): Added support for REAL_TYPE.
11086         (convert_to_char): New function.
11087         (convert): Handle CHAR_TYPE.
11088         * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
11089         SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
11090         (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
11091         promoted type.
11092         (verify_jvm_instructions): Added break a the end of bogus unop: label.
11093         (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
11094         (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
11095         (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
11096         (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
11097         to Use The Right Things.
11098         (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
11099         compatible with INT. BOOLEAN is made equivalent to BYTE.
11100         (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
11101         OPCODE_ifnonnull): Now supported.
11102         (build_java_athrow): New function.
11103
11104 Mon Aug  4 15:46:45 1997  Per Bothner  <bothner@cygnus.com>
11105
11106         Rename method name <init> to match G++ (and fix mangling).
11107         * class.c (layout_class):  Replace method name of <init> by class name.
11108         (make_method_value):  Do inverse renaming of constructor from <init>.
11109         * java-tree.h (DECL_CONSTRUCTOR_P):  New macro.
11110         * typeck.c (lookup_java_constructor):  New function.
11111         * expr.c (expand_invoke):  If method_name is <init>, call
11112         lookup_java_constructor to find constructor.
11113
11114         * parse.c (get_constant):  Handle CONSTANT_Float and CONSTANT_Double.
11115
11116 Fri Aug  1 11:37:09 1997  Alexandre Petit-Bianco  <apbianco@cygnus.com>
11117
11118         * parse.c (get_class_constant): Modified to handle array "classes"
11119         * typeck.c (set_local_type): Bug fixed when filling type_map[] with
11120         wide type.
11121         (convert): Modified to handle real type.
11122         * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
11123         soft_multianewarray, soft_newarray_node, soft_throw_node): New global
11124         variables declared.
11125         * decl.c (soft_badarrayindex_node, soft_anewarray_node,
11126         soft_multianewarray, soft_newarray_node, soft_throw_node): New
11127         global variables initialized.
11128         (find_local_variable): Handles the case of a pointer
11129         (end_java_method): Restore the use of one more scope
11130         * expr.c (build_java_arraynull_check, build_java_arrayaccess,
11131         build_java_array_length_access, expand_java_arrayload,
11132         expand_java_arraystore, expand_java_array_length,
11133         expand_java_multianewarray, expand_java_anewarray,
11134         build_java_check_indexed_type, is_array_type_p,
11135         build_java_throw_out_of_bound_exception): New functions.
11136         (STORE_INTERNAL): Now forces type of the decl to be type of the value.
11137         (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
11138         OPCODE_<t>aload): Implemented code for verification.
11139         (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
11140         ARRAY_NEW_MULTI): Macro defined.
11141         (CONVERT): Modified to invoke convert().
11142         (case OPCODE_aload2): Fixed index typo from 2 to 1.
11143
11144 Thu Jul 31 12:48:18 1997  Per Bothner  <bothner@cygnus.com>
11145
11146         * class.c (push_class):  Set DECL_ARTIFICIAL (for dbxout.c).
11147         (build_class_ref, is_compiled_class):  Handle pointer-to-record types.
11148         (make_class_data):  Field name needs '/' as package prefix.
11149         * expr.c (type_stack_dup, java_stack_dup):  Fix fencepost errors.
11150
11151 Fri Jul 25 11:44:21 1997  Per Bothner  <bothner@cygnus.com>
11152
11153         Implement debug information for local variables.
11154         * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
11155         DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
11156         DECL_LOCAL_SLOT_CHAIN):  New macros.
11157         (struct lang_decl_var):  New type.
11158         * parse.c (give_name_to_locals):  Move to decl.c.
11159         * decl.c (give_name_to_locals):  Re-written to Do The Right Thing.
11160         (start_java_method):  Re-write parameter handling.
11161         (pending_local_decls):  New global variable.
11162         (push_jvm_slot, maybe_pushlevels, maybe_poplevels):  New functions.
11163         (find_local_variable):  Accept pc so we can skips decls not in range.
11164         (struct binding_level):  Add end_pc field.
11165         * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
11166         (various):  Change so current pc gets passed to find_local_variable.
11167
11168         * decl.c (init_decl_processing):  Re-arrange fields in
11169         class_type_node and and method_type_node to match kaffe 0.9.1.
11170         * class.c (make_method_value, make_class_data):  Update
11171         initializations to match.
11172
11173 Wed Jul 16 17:17:50 1997  Per Bothner  <bothner@cygnus.com>
11174
11175         * class.c (unicode_mangling_length, emit_unicode_mangled_name,
11176         append_gpp_mangled_name, append_gpp_mangled_type):  New functions.
11177         (push_super_field):  New function.
11178         (make_class_data):  Handle inheritance of class static initializer.
11179         (layout_class):  New name mangling.
11180         * constants.c (build_constant_data_ref):  Init type of data array
11181         to a one-element array.
11182         (build_constants_constructor):  Set DECL_SIZE from complete array type.
11183         * decl.c:  Rename class_type, object_type etc to class_type_node,
11184         object_type_node etc.  Make former inherit from latter.
11185         * expr.c (expand_invoke):  Add cast of function address.
11186         * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE):  New.
11187         * parse.c (yyparse):  Don't call layout_class here.
11188         * typeck.c (build_java_array_type):  Set TYPE_ARRAY_ELEMENT.
11189
11190 Sat Jun 14 12:06:57 1997  Per Bothner  <bothner@cygnus.com>
11191
11192         * decl.c, class.c:  Update method type to match latest Kaffe snapshot.
11193         * constants.c (lookup_name_constant):  Renamed to alloc_name_constant.
11194         (alloc_class_constant):  New.
11195         * expr.c (expand_invoke):  Make sure method's class is initialized.
11196         * class.c (interits_from_p, emit_register_class):  New functions.
11197         * parse.c (yyparse):  Call emit_register_class.
11198
11199 Mon Jun  9 18:08:06 1997  Per Bothner  <bothner@cygnus.com>
11200
11201         * constants.c:  New file, to handle constant pool.
11202         * Makefile.in (JAVA_OBJS):  Add constants.o.
11203         * decl.c (init_decl_processing):  Update, fix, finish various structs.
11204         (pushdecl_top_level):  New.
11205         * parse.c (layout_class):  Moved to class.c.
11206         * expr.c (java_push_constant_from_pool):  New function.
11207         * class.c (build_class_ref):  Make work fully
11208         (make_class_data):  Emit super-class, constant pool, interface vector.
11209
11210 Tue Jun  3 10:14:31 1997  Per Bothner  <bothner@cygnus.com>
11211
11212         java-tree.h (DECL_SIGNATURE, BCODE_EMITTED):  Remove.
11213         (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P):  New.
11214         * class.c (class_depth):  New function.
11215         (lookup_named_class):  Replaced by new function lookup_class.
11216         * decl.c (object_type_node, string_type_node):  New.
11217         Remove various types that we no longer need.
11218         * expr.c (verify_jvm_instructions):  New separate verifier pass.
11219         (push_type, pop_type):  New functions for verifier.
11220         (type_stack_dup, pop_argument_types, merge_types):  Likewise.
11221         (expand_byte_code):  Simplify, since we assume already verified.
11222         (expand_invoke):  Now mostly works.
11223         * javaop.def:  Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
11224         * lang.c (main_class):  Move to parse.c.  Don't make_class yet.
11225         * parse.c:  Wait to allocate class object until we know its name.
11226         (layout_class):  Calculate DECL_VINDEX for each virtual method.
11227         * typeck.c (get_array_type):  Rename to ...
11228         (build_java_array_type):  ... and provide working implementation.
11229         (build_java_signature):  New function - build Java signature of type.
11230         (set_java_signature):  New function - cache signature with type.
11231         (lookup_java_method):  New function.
11232
11233 Tue May  6 22:08:24 1997  Per Bothner  <bothner@deneb.cygnus.com>
11234
11235         * class.c (ident_subst):  Take extra SUFFIX parameter.
11236         (add_field):  Set DECL_ASSEMBLER_NAME of static fields;  more.
11237         (set_constant_value, build_static_field_ref, is_compiled_class):  New.
11238         (build_class_ref):  Actually implement.
11239         * decl.c, java-tree.h:  Renamed some xx_type to xx_type_node.
11240         * decl.c (builtin_function):  New.
11241         (init_decl_processing):  Update for current Kaffe.  Declare some
11242         builtin Kaffe functions.
11243         * expr.c (build_address_of):  New.
11244         (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
11245         Renamed (from expand_java_new etc), and added working implementations.
11246         (build_field_ref):  Now also handle static fields.
11247         (expand_invoke):  Implement invokestatic, and start implement rest.
11248         * java-opcodes.h:  Use javaop.def to avoid duplicated list.
11249         * javaop.def:  Rename invokevirt -> invokevirtual.
11250         * lang.c (use_handles):  Removed.
11251         * parse.c:  Add support for ConstantValue atribute.
11252         Handle nested loading of a class.  (JPOOL_UTF):  New.
11253
11254 Tue Mar 11 20:11:05 1997  Per Bothner  <bothner@deneb.cygnus.com>
11255
11256         * expr.c (expand_java_pushc):  Support #ifndef REAL_ARITHMETIC case.
11257
11258 Thu Feb 27 14:24:29 1997  Per Bothner  <bothner@deneb.cygnus.com>
11259
11260         * Make-lang.in (java.install-man):  New empty rule.
11261         * typeck.c (set_local_type):  New function.
11262         * expr.c (STORE_INTERNAL):  Call find_local_variable,
11263         not find_stack_slot.  Call set_local_type.
11264
11265 Wed Feb 12 16:11:05 1997  Per Bothner  <bothner@kalessin.cygnus.com>
11266
11267         * java-tree.h:  Various new macros for constructing RECORD_TYPEs,
11268         and building RECORD_TYPE CONSTRUCTORs.
11269         Also support for creating Utf8Const objects from an INDETIFIER_NODE.
11270
11271         * lang.c (use_handles):  Change the default to 0.
11272         * decl.c:  Define and build class_type, field_type, utf8const_type.
11273         * class.c (make_class_data, make_field_value,
11274         get_access_flags_from_decl, build_class_ref, build_utf8_ref,
11275         hashUtf8String, strLengthUtf8, mangled_classname:
11276         Functions to build reflective data structures.
11277         * parse.c (yyparse):  Call make_class_data.
11278
11279         * jcf-io.c (open_class, find_classfile):  New functions.
11280         * jcf-dump.c:  Support reading classfile from explicitly-named
11281         class file (without CLASSPATH searching).
11282
11283 Thu Oct 24 14:10:16 1996  Per Bothner  <bothner@deneb.cygnus.com>
11284
11285         * jcf-reader.c:  Add parameter list to HANDLE_CONSTANT_Utf8.
11286         * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
11287         Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
11288         (get_constant):  Now trivial for CONSTANT_Utf8.
11289
11290         * jcf.h:  Make NEW_CPOOL the default.
11291         * jcf.h, jcf-reader.c, parse.c:  Remove support for !NEW_CPOOL.
11292
11293 Thu Oct 24 13:52:45 1996  Per Bothner  <bothner@deneb.cygnus.com>
11294
11295         New directory.