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